text
stringlengths 28
935k
| meta
stringlengths 137
139
| red_pajama_subset
stringclasses 1
value |
---|---|---|
\section{Introduction}
In our daily routine we interact with dozens of sensors: from motion detection
in home security systems and tire pressure monitors in cars, to
accelerometers in smartphones and heart rate monitors in smartwatches.
The integrity of these sensor outputs is crucial, as
many security-critical decisions are taken in response
to the sensor values. However,
specially-crafted adversarial signals can be used to remotely
induce waveforms into the outputs of sensors, thereby attacking
pacemakers~\cite{ghost}, temperature sensors~\cite{trusting_sensors},
smartphone microphones~\cite{smartphone_iemi}, and
car-braking mechanisms~\cite{abs}. These attacks cause a system to
report values which do not match the true sensor measurements, and trick it
into performing dangerous actions such as raising false alarms, or even
delivering defibrillation shocks.
The root cause of these vulnerabilities lies in the unintentional side-effects
of the physical components of a system. For example,
the wires connecting sensors to microcontrollers behave like low-power, low-gain
antennas, and can thus pick up high-frequency electromagnetic radiations.
Although these radiations are considered ``noise'' from an electrical point of view,
hardware imperfections in the subsequent parts of the circuit can transform
attacker injections into meaningful waveforms. Specifically, these
radiations are digitized along with the true sensor outputs, which represent
a physical property as an analog electrical quantity. This digitization process
is conducted by Analog-to-Digital Converters (ADCs), which, when used outside
of their intended range, can cause high-frequency signals to be
interpreted as meaningful low-frequency signals.
Despite the potential that signal injection attacks have to break security
guarantees, there is no unifying framework for evaluating
the effect of such adversarial transmissions. Our work fills this gap
through the following contributions:
\begin{enumerate}
\item We propose a system model which abstracts away from
engineering concerns associated with remote transmissions,
such as antenna design (Section~\ref{sec:model}).
\item We define security against adversarial signal injection attacks.
Our definitions address effects ranging from mere disruptions of
the sensor readings, to precise waveform injections of attacker-chosen values
(Section~\ref{sec:definitions}).
\item We introduce an algorithm to calculate the security
level of a system under our definitions and demonstrate it in practice
by injecting ``OK Google'' commands into a smartphone (Section~\ref{sec:case_study}).
\item We investigate how vulnerable commercial ADCs are to malicious signal
injection attacks by testing their demodulation properties (Section~\ref{sec:adcs}).
\item We discuss how our model can be used to inform circuit design choices,
and how to interpret defense mechanisms and other types
of signal injection attacks in its context (Section~\ref{sec:discussion}).
\end{enumerate}
Overall, our work highlights the importance of testing systems against
signal injection attacks, and proposes a methodology to test the security of real devices.
\section{System and Adversary Model}
\label{sec:model}
Remote signal injection attacks pose new challenges
from a threat-modeling perspective, since the electrical properties of systems
suggest that adversaries cannot arbitrarily and precisely
change any sensor reading. To create a threat
model and define security in its context, we need to first abstract away from
specific circuit designs and engineering concerns related to remote
transmissions. To do so, we separate the behavior of a system
into two different transfer functions. The first function describes
circuit-specific behavior, including how adversarial signals
enter the circuit (e.g., through PCB wires acting as antennas), while the second one
is ADC-specific, and dictates how the signals
which have made it into the circuit are digitized.
We describe this model in greater detail in Section~\ref{sec:adc_model}, taking
a necessary detour into electrical engineering to show why our proposal
makes for a good system model. We then explain
some sources of measurement errors even in the absence of an
adversary in Section~\ref{sec:samp_errors} and finish by detailing the
capabilities and limitations of the adversary in Section~\ref{sec:adv_model}.
Both sub-sections are crucial in motivating the security definitions of
Section~\ref{sec:definitions}.
\subsection{Circuit Model}
\label{sec:adc_model}
\begin{figure*}[t]
\centering
\includegraphics[width=\textwidth]{adc_adc_model.pdf}
\caption{System model: an adversarial signal $v(t)$ enters the circuit
and is transformed via the transfer function $H_C$.
It is digitized along with the sensor signal
$s(t)$ and the noise $n(t)$ through an ADC-specific transfer function $H_A$.
In successful attacks, the digitized signal will contain the demodulated
version $w(t)$ of the attacker signal $v(t)=M(w(t))$, where $M$
is the modulation function (e.g., amplitude modulation over
a high-frequency carrier).}
\label{fig:adc_model}
\vspace{-2em}
\end{figure*}
Analog-to-Digital Converters (ADCs) are central in the
digitization process of converting signals from the analog to the digital realm,
and our circuit block diagram (Figure~\ref{fig:adc_model}) reflects that.
In the absence of an adversary, the ADC digitizes the sensor signal $s(t)$
as well as the environmental noise $n(t)$, and transfers the digital bits
to a microcontroller. We model the ADC in two parts: an ``ideal'' ADC which simply
digitizes the signal, and a transfer function $H_A$. This transfer function
describes the internal behavior of the ADC, which includes effects such as
filtering and amplification.
The digitized version of the signal $\tilde{s}_f(t)$ depends both on this
transfer function, and the sampling frequency $f$ of the ADC.
An adversarial signal can enter the system (e.g., through the wires
connecting the sensor to the ADC) and add to the sensor signal and the noise.
This process can be described by a second, circuit-specific transfer function $H_C$,
which transforms the adversarial signal $v(t)$ into $\tilde{v}(t)$.
Note that components such as external filters and amplifiers in the signal path between
the point of injection and the ADC can be included in either $H_A$ or $H_C$.
We include them in $H_A$ when they also affect the sensor signal $s(t)$,
but in $H_C$ when they are specific to the coupling effect.
$H_C$ and $H_A$ are discussed in detail below.
\secpar{Circuit Transfer Function $H_C$}
To capture the response of the circuit to external signal injections,
we introduce a transfer function $H_C$. This transfer function explains
why the adversarial waveforms must be modulated, and why it is helpful
to try and reduce the number of remote experiments to perform.
For electromagnetic interference (EMI) attacks,
the wires connecting the sensor to the ADC pick up signals by
acting as (unintentional) low-power and low-gain antennas,
which are resonant at specific
frequencies related to the inverse of the wire length~\cite{pcb_emi}.
Non-resonant frequencies are attenuated more, so for a successful attack
the adversary must transmit signals at frequencies with relatively low attenuation.
For short wires, these frequencies are in the $\si{\giga\hertz}$ range~\cite{pcb_emi},
so the low-frequency waveform $w(t)$ that the adversary wants
to inject into the output of the ADC $\tilde{s}_f(t)$ may need to be modulated
over a high-frequency carrier using a function $M$. We denote this
modulated version of the signal by $v(t)=M(w(t))$.
$H_C$ is also affected by passive and active components on the path to the ADC,
and can also be influenced by inductive and capacitive coupling for small
transmission distances, as it closely depends on the circuit components and
their placement. Specifically, it is possible for 2 circuits with
``the same components, circuit topology and placement area''
to have different EMI behavior depending on the component placement
on the board~\cite{emi_predict}.
Despite the fact that it is hard to mathematically
model and predict the behavior of circuits in response to different
signal transmissions, $H_C$ can still be determined
empirically using frequency sweeps. It presents a useful abstraction,
allowing us to separate the behavior of the ADC (which need only be determined
once, for instance by the manufacturer) from circuit layout and
transmission details.
Note, finally, that $H_C$
can also account for distance factors between the adversary
and the circuit under test: due to the Friis transmission formula~\cite{friis},
as distance doubles, EMI transmission power needs to
quadruple. This effect can be captured by increasing
the attenuation of $H_C$ by $\SI{6}{\decibel}$, while defense mechanisms such
as shielding can be addressed similarly. This approach allows us to
side-step engineering issues of
remote transmissions and reduce the number
of parameters used in the security definitions we
propose in Section~\ref{sec:definitions}.
\begin{figure}[t]
\centering
\includegraphics[width=0.45\linewidth]{adc_sah_model.pdf}
\caption{The sample-and-hold mechanism of an ADC is an $RC$ low-pass filter.
Electrostatic Discharge (ESD) protection diodes can also introduce
non-linearities.}
\label{fig:sah_model}
\vspace{-2em}
\end{figure}
\secpar{ADC Transfer Function $H_A$}
Every system with sensors contains one or more ADCs, which may even be integrated
into the sensor chip itself. ADCs are not perfect, but contain components
which may cause a mismatch between the ``true'' value at the ADC
input and the digitized output. In this section, we describe how these components
affect the digitization process.
Although there are many types of ADCs, every ADC contains
three basic components: a ``sample- or track-and-hold circuit where the
sampling takes place, the digital-to-analog
converter and a level-comparison mechanism''~\cite{adc_book}. The
sample-and-hold component acts as a low-pass filter, and makes it harder
for an adversary to inject signals modulated at high frequencies.
However, the level-comparison mechanism is essentially an amplifier with
non-linearities which induces DC offsets, and
allows low-frequency intermodulation products to pass through.
These ADC-specific transformations, modeled through $H_A$,
unintentionally demodulate high-frequency signals which are not attenuated by $H_C$.
They are explored in more detail in Section~\ref{sec:adcs} and Appendix~\ref{app:exp}.
\secpar{Sample-And-Hold Filter Characteristics}
A sample-and-hold (S/H) mechanism is an
$RC$ circuit connected to the analog input, with the resistor and
the capacitor connected in series (Figure~\ref{fig:sah_model}). The transfer
function of the voltage across the capacitor is
$H_{S/H}(j\omega)=\frac{1}{1+j\omega RC}$, and the magnitude of the gain
is $G_{S/H}=\frac{1}{\sqrt{1+\left(\omega R C\right)^2}}$. As the
angular frequency $\omega=2\pi f$ increases, the gain is reduced: the
S/H mechanism acts as a low-pass filter. The $\SI{-3}{\deci\bel}$ cutoff frequency
is thus $f_{cut}=\frac{1}{2\pi RC}$, which is often higher than the
ADC sampling rate (Section~\ref{sec:adcs}).
Hence, ``aliasing'' occurs when signals beyond the Nyquist frequency are
digitized by the ADC: high-frequency signals become indistinguishable
from low-frequency signals which the ADC can sample accurately.
\secpar{Amplifier Non-Linearities}
Every ADC contains amplifiers: a comparator, and possibly buffer and
differential amplifiers. Many circuits also contain additional external amplifiers
to make weak signals measurable. All these amplifiers have
harmonic and intermodulation non-linear distortions~\cite{emc_analog_book},
which an adversary can exploit.
Harmonics are produced when an amplifier transforms an input $v_{in}$ to an output $
v_{out}=\sum_{n=1}^\infty a_nv_{in}^n$. In particular, if $v_{in}=\hat{v}\cdot \sin(\omega t)$,
then:
\[
v_{out} = \left(\frac{a_2\hat{v}^2}{2}+\frac{3a_4\hat{v}^4}{8}+\cdots\right)
+\left(a_1\hat{v}+\cdots\right)\sin(\omega t)
- \left(\frac{a_2\hat{v}^2}{2}+\cdots\right)\cos(2\omega t) + \cdots
\]
This equation shows that ``the frequency
spectrum of the output contains a spectral component at the original (fundamental)
frequency, [and] at multiples of the fundamental
frequency (harmonic frequencies)''~\cite{emc_analog_book}.
Moreover, the output includes a DC component,
which depends only on the even-order non-linearities of the system.
Besides harmonics, intermodulation products arise when the input signal
is a sum of two sinusoids (for instance when the injected signal sums with
the sensor signal): $v_{in}=\hat{v}_1\cdot \sin(\omega_1 t)+\hat{v}_2\cdot \sin(\omega_2 t)$.
In that case, the output signal contains frequencies of the form
$n\omega_1 \pm m\omega_2$ for integers $n,m\neq 0$.
These non-linearities demodulate attacker waveforms,
even when they are modulated on high-frequency carriers.
\secpar{Diode Rectification} Figure~\ref{fig:sah_model} shows that the input
to an ADC can contain reverse-biased diodes to ground and $V_{cc}$ to protect
the input from Electrostatic Discharge (ESD). When
the input to the ADC is negative, or when it exceeds $V_{cc}$, the diodes
clamp it, causing non-linear behavior. When the sensor signal $s(t)$
is positive, this behavior is also asymmetric, causing a DC shift~\cite{emc_analog_book},
which compounds with the amplifier non-linearities.
\secpar{Conclusion} All ADCs contain the same basic building blocks,
modeled through $H_A$. Although the sample-and-hold mechanism should
attenuate high-frequency signals beyond the maximum sampling rate of the ADC,
non-linearities due to ESD diodes and amplifiers in the ADC cause
DC offsets and the demodulation of signals through harmonics and intermodulation
products. Section~\ref{sec:adcs} and Appendix~\ref{app:exp} exemplify these
effects through experiments on different ADCs.
\subsection{Sampling Errors in the Absence of an Adversary}
\label{sec:samp_errors}
\begin{figure}[t]
\centering
\includegraphics[width=0.45\linewidth]{adc_normal_distribution.pdf}
\caption{Noise probability distribution $p(x)$. The shaded area represents
the probability $\epsilon=N(x)=\textrm{Pr}[|n(t)|\le x]$.}
\label{fig:noise}
\vspace{-2em}
\end{figure}
The digitization process through ADCs entails errors due to quantization
and environmental noise.
Quantization errors exist due to the inherent loss of accuracy
in the sampling process. An ADC can only
represent values within a range, say between $V_{min}$ and $V_{max}$ volts,
with a finite binary representation of $N$ bits, called
the {\em resolution} of the ADC. In other words, every value between $V_{min}$ and $V_{max}$
is mapped to one of the $2^N$ values that can be represented using $N$ bits.
As a result, there is a {\em quantization error} between the true sensor
analog value $s$ and the digitized value $\tilde{s}$. The maximum value
of this error is
\begin{equation}
\label{eq:quantization}
Q=\frac{V_{max}-V_{min}}{2^{N+1}}\ge|s-\tilde{s}|
\end{equation}
The second source of error comes from environmental noise, which may affect
measurements. We assume that this noise, denoted by $n(t)$, is
independent of the signal being measured, and that it comes from a zero-mean
distribution, i.e., that the noise is {\em white}. The security definitions
we introduce in Section~\ref{sec:definitions} require an estimate of the
level of noise in the system, so we introduce some relevant notation
here. We assume that $n(t)$ follows a probability distribution function (PDF)
$p(x)$, and define $N(x)$ as the probability that the noise is between $-x$ and $x$,
as shown in Figure~\ref{fig:noise}, i.e.,
\[
N(x)=\textrm{Pr}\left[|n(t)|\le x\right]=\int_{-x}^x p(u) du
\]
Note that typically the noise is assumed to come from a normal distribution, but
this assumption is not necessary in our models and definitions.
We are also interested in the inverse of this function, where given a
probability $0\le \epsilon < 1$, we want to find $x\ge 0$ such that $N(x)=\epsilon$.
For this $x$, the probability that the noise magnitude falls within $[-x,x]$
is $\epsilon$, as also shown in Figure~\ref{fig:noise}.
Because for some distributions there might be multiple $x$ for which $N(x)=\epsilon$,
we use the smallest such value:
\begin{equation}\label{eq:noise}
N^{-1}(\epsilon) =\inf\{x\ge 0:N(x)=\epsilon\}
\end{equation}
Since $N(x)$ is an increasing function, so is $N^{-1}(\epsilon)$.
To account for repeated measurements, we introduce a short-hand for
sampling errors, which we denote by $E_s(t)$.
The sampling errors depend on the sensor input into the
ADC $s(t)$, the sampling rate $f$, the discrete output of the ADC
$\tilde{s}_f(t)$ as well as the conversion delay $\tau$, representing the
time the ADC takes for complete a conversion:
\begin{equation}\label{eq:samp_error}
E_s(t)=
\begin{cases}
\left|\tilde{s}_f(t+\tau) - s(t)\right| & \text{if a conversion starts at $t$} \\
0 & \text{otherwise} \\
\end{cases}
\end{equation}
\subsection{Adversary Model}
\label{sec:adv_model}
Our threat model and definitions can capture a range of attacker goals, from
attackers who merely want to disrupt sensor outputs, to those who wish
to inject precise waveforms into a system. We define these notions
precisely in Section~\ref{sec:definitions},
but here we describe the attacker capabilities based on our model of
Figure~\ref{fig:adc_model}. Specifically, in our model, the adversary can only
alter the transmitted adversarial signal $v(t)$. He/she cannot directly influence the sensor
signal $s(t)$, the (residual) noise $n(t)$, or the transfer functions
$H_A$ and $H_C$. The adversary knows $H_A$, $H_C$, and the distribution
of the noise $n(t)$, although the true sensor signal $s(t)$
might be hidden from the adversary (see Section~\ref{sec:select_sec}).
The only constraint placed on the
adversarial signal is that the attacker is only allowed to transmit signals $v(t)$
whose peak voltage level is bounded by some constant $V_{PK}^{Adv}$, i.e.,
$|v(t)|\le V_{PK}^{Adv}$ for all $t$. We call this adversary a {\em $V_{PK}^{Adv}$-bound adversary},
and all security definitions are against such bounded adversaries.
We choose to restrict voltage rather than restricting power or distance, as
it makes for a more powerful adversarial model. Our model gives the adversary
access to any physical equipment necessary (such as powerful amplifiers and
highly-directional antennas), while reducing the number of parameters
needed for our security definitions of Section~\ref{sec:definitions}.
Distance and power effects can be compensated directly through altering $V_{PK}^{Adv}$,
or indirectly by integrating them into $H_C$, as discussed in Section~\ref{sec:adc_model}.
\section{Security Definitions}
\label{sec:definitions}
Using the model of Figure~\ref{fig:adc_model}, we can
define security in the presence of signal injection attacks. The
$V_{PK}^{Adv}$-bound adversary is allowed to transmit any
waveform $v(t)$, provided that $|v(t)|\le V_{PK}^{Adv}$ for all $t$: the adversary is only
constrained by the voltage budget. Whether or not the adversary succeeds
in injecting the target waveform $w(t)$ into the output of the system depends on
the transfer functions $H_C$ and $H_A$. For a given system described by $H_A$
and $H_C$, there are three outcomes against an adversary whose only restriction is
voltage:
\begin{enumerate}
\itemsep0em
\item The adversary can disturb the sensor readings, but cannot precisely control
the measurement outputs, an attack we call {\em existential injection}.
The lack of existential injections can be considered {\em universal security}.
\item The adversary can inject a target waveform $w(t)$ into
the ADC outputs with high fidelity, performing a {\em selective injection}.
If the adversary is unable to succeed, the system is {\em selectively secure}
against $w(t)$.
\item The adversary can {\em universally inject} any waveform $w(t)$. If there
is any non-trivial waveform for which he/she fails, the system is
{\em existentially secure}.
\end{enumerate}
This section sets out to precisely define the above security notions by
accounting for noise and quantization error (Equation~\eqref{eq:quantization}).
Our definitions capture the intuition that
systems are secure when there are no adversarial transmissions, and are
``monotonic'' in voltage, i.e., systems are more vulnerable
against adversaries with access to higher-powered transmitters. Our definitions
are also monotonic in noise: in other words, in
environments with low noise, even a small disturbance of the output is sufficient
to break the security of a system. Section~\ref{sec:exist_sec}
evaluates whether an adversary can disturb the ADC
output away from its correct value sufficiently. Section~\ref{sec:select_sec} then
formalizes the notion of selective security against target waveforms $w(t)$.
Finally, Section~\ref{sec:univ_sec} introduces universal injections by defining
what a non-trivial waveform is. The three types of signal injection attacks,
the corresponding security properties, and the ensuing ADC errors (injected
waveforms) are summarized in Table~\ref{table:sec_defs}.\footnote{
The terminology chosen was inspired by attacks against signature
schemes, where how broken a system is depends on what types of messages an attacker
can forge~\cite{sig_scheme}.
}
\begin{table}[t]
\centering
\caption{Correspondence between security properties of a sensor system,
adversarial injection attacks, and the resulting ADC waveform errors (signals).}
\begin{tabular}{llr}
\toprule
\textbf{Security} & \textbf{Injection} & \textbf{ADC Error $E_s(t)$} \\
\midrule
Universal & Existential & Bounded away from $0$ \\
Selective & Selective & Target waveform $w(t)$ \\
Existential & Universal & Non-trivial waveforms $w(t)$ \\
\bottomrule
\end{tabular}
\label{table:sec_defs}
\end{table}
\subsection{Existential Injection, Universal Security}
\label{sec:exist_sec}
The most primitive type of signal injection attack is a simple disruption of
the sensor readings. There are two axes in which this notion can be evaluated:
adversarial voltage and probability of success (success is probabilistic,
as noise is a random variable). For a fixed probability of success,
we want to determine the smallest voltage level for which an attack is successful.
For a fixed voltage level, we want to find the probability of a successful attack.
Alternatively, if we fix both the voltage and the probability of success, we want to
determine if a system is secure against disruptive signal injection attacks.
The definition for universal security is a formalization of the
above intuition, calling a system secure when, even in the presence of
injections (bounded by adversarial voltage), the true analog sensor value and the ADC digital output
do not deviate by more than the quantization error and the noise, with sufficiently
high probability. Mathematically:
\begin{definition}[Universal Security, Existential Injection]
For $0\le\epsilon< 1$, and $V_{PK}^{Adv} \ge 0$,
we call a system \textbf{universally $(\epsilon, V_{PK}^{Adv})$-secure} if
\begin{equation}
Pr\left[E_s(t) \ge Q+\nin{}\right]\le \eh{} \label{eq:ex_sec}
\end{equation}
for every adversarial waveform $v(t)$, with $|v(t)|\leV_{PK}^{Adv}$ for all $t$.
$Q$ is the quantization error of the system, $N^{-1}$ is the noise distribution inverse
defined in Equation~\eqref{eq:noise}, and $E_s$ is the sampling error as defined
by Equation~\eqref{eq:samp_error}.
The probability is taken over the duration of the attack, i.e.,
at each sampling point within the interval $t_{start}\le t \le t_{end}$.
We call a successful attack an \textbf{existential injection}, and simply call
a system universally $\epsilon$-secure, when $V_{PK}^{Adv}$ is implied.
\end{definition}
We first show that in the absence of injections,
the system is universally $\epsilon$-secure for all $0\le \epsilon < 1$.
Indeed, let $x=\nin{}$, so that $Pr\left[|n(t)|\le x\right]=\eh{}$.
Then, in the absence of injections,
\begin{align*}
&Pr\left[E_s(t) \ge Q+\nin{}\right]=Pr\left[|n(t)|\ge x\right]=\\
&=1-\eh{}=\frac{1-\epsilon}{2}\le\eh{}
\end{align*}
which holds for all $0\le \epsilon<1$, as desired. This proof is precisely the
reason for requiring a noise level and probability of at least 50\% in the definition:
the proof no longer works if $(1+\epsilon)/2$ is replaced by just $\epsilon$.
In other words, mere noise would be classified as an attack by the modified
definition.
\secpar{Voltage} We now show
that a higher adversarial voltage budget can only make a system more vulnerable.
Indeed, if a system is universally $(\epsilon, V_1)$-secure, then
it is universally $(\epsilon, V_2)$-secure for $V_2\le V_1$. For this,
it suffices to prove the contrapositive, i.e., that if a system is
not universally $(\epsilon, V_2)$-secure,
then it is not universally $(\epsilon, V_1)$-secure. For the proof,
let $v(t)$ be an adversarial waveform with $|v(t)| \le V_2$ such that
Equation~\eqref{eq:ex_sec} does not hold, which exists by the assumption that
the system is not universally $(\epsilon, V_2)$-secure. Then, by the transitive property,
$|v(t)| \le V_1$, making $v(t)$ a valid counterexample for universal
$(\epsilon, V_1)$ security.
\secpar{Probability} The third property we show is probability monotonicity,
allowing us to define a ``critical threshold'' for $\epsilon$, above which
a system is universally secure (for a fixed $V_{PK}^{Adv}$), and below which
a system is not universally secure. Indeed, for fixed $V_{PK}^{Adv}$,
if a system is universally $(\epsilon,V_{PK}^{Adv})$-secure, then it is
universally $(\epsilon+\delta, V_{PK}^{Adv})$-secure for $0\le \delta < 1-\epsilon$, as
\begin{align*}
&Pr\left[E_s(t) \ge Q+\nin[\epsilon+\delta]\right]\le \\
&Pr\left[E_s(t) \ge Q+\nin{}\right]\le \eh{} \le \eh[\epsilon+\delta]
\end{align*}
because $N^{-1}$ is increasing. The contrapositive is, of course, also true:
if a system is not universally secure for a given $\epsilon$, it is also not
universally secure for $\epsilon-\delta$ with $0\le \delta \le \epsilon$.
\secpar{Thresholds} For a given security level $\epsilon$,
then, we can talk about the maximum (if any) $V_{PK}^{Adv}$
such that a system is universally $(\epsilon,V_{PK}^{Adv})$-secure, or conversely
the minimum (if any) $V_{PK}^{Adv}$ such that a system is not
universally $(\epsilon,V_{PK}^{Adv})$-secure. This is the \textbf{critical universal
voltage level $V_c$} for the given $\epsilon$.
Moreover, for any $V_{PK}^{Adv}$, there is a unique \textbf{critical universal
security threshold $\epsilon_c$} such that the system is universally
$(\epsilon,V_{PK}^{Adv})$-secure for $\epsilon_c<\epsilon<1$ and not universally
$(\epsilon,V_{PK}^{Adv})$-secure for $0\le\epsilon<\epsilon_c$. By convention we take
$\epsilon_c = 0$ if the system is secure for all $\epsilon$, and
$\epsilon_c=1$ if there is no $\epsilon$ for which the system is secure.
This critical threshold indicates the security level of a system: the
lower $\epsilon_c$ is, the better a system is protected against signal injection attacks.
\subsection{Selective Injection and Security}
\label{sec:select_sec}
The second definition captures the notion of security against specific
target waveforms $w(t)$:
we wish to find the probability that a $V_{PK}^{Adv}$-bounded adversary can make
$w(t)$ appear in the output of the ADC. Conversely, to define security
in this context, we must make sure that
the digitized signal $\tilde{s}_f(t)$ differs from the waveform $s(t)+w(t)$ with high
probability, even if plenty of noise is allowed. There are two crucial points to
notice about the waveform $w(t)$. First, $w(t)$ is not the raw signal $v(t)$
the adversary is transmitting, as this signal undergoes two transformations
via $H_C$ and $H_A$. Instead, $w(t)$ is the signal
that the adversary wants the ADC to think that it is seeing, and is usually
a demodulated version of $v(t)$ (see Figure~\ref{fig:adc_model}).
Second, $w(t)$ does not necessarily cancel out or overpower $s(t)$,
because that would require predictive modeling of the sensor signal $s(t)$.
However, if the adversary
can predict $s(t)$ (e.g., by monitoring the output of the ADC, or by
using identical sensors), we can then ask about security against the
waveform $w'(t)=w(t)-s(t)$ instead. Given this intuition, we can define
selective security as follows:
\begin{definition}[Selective Security, Selective Injection]
For $0\le\epsilon< 1$, and $V_{PK}^{Adv} \ge 0$, a system is called
\textbf{selectively $(\epsilon, w(t), V_{PK}^{Adv})$-secure} if
\begin{equation}
Pr\left[E_{s+w}(t)\ge Q+\nin[(1-\epsilon)]\right]> \meh{}\label{eq:sel_sec}
\end{equation}
for every adversarial waveform $v(t)$, with $|v(t)|\leV_{PK}^{Adv}$ for all $t$,
where the probability is taken over the duration of the attack.
$Q$ is the quantization error of the system, $N^{-1}$ is the noise distribution inverse
defined in Equation~\eqref{eq:noise}, and
$E_{s+w}(t)=\left|\tilde{s}_f(t+\tau) - s(t) - w(t)\right|$ during
sampling periods, and $0$ otherwise.
We call a successful attack a \textbf{selective injection}, and simply call
a system selectively $\epsilon$-secure, when $V_{PK}^{Adv}$ and $w(t)$ are clear from context.
\end{definition}
This definition is monotonic in voltage and
the probability of success, allowing us to talk about ``the'' probability of success
for a given waveform:
\secpar{Voltage} A similar argument
shows that increasing $V_{PK}^{Adv}$ can only make a secure
system insecure, but not vice versa, i.e., that if
a system is selectively $(\epsilon, w(t), V_1)$-secure, then
it is selectively $(\epsilon, w(t), V_2)$-secure for $V_2\le V_1$. We can
thus define the \textbf{critical selective voltage level $V_c^w$} for a given
$\epsilon$ and $w(t)$.
\secpar{Probability} If a system is selectively $\epsilon$-secure (against a target waveform and
voltage budget), then it is selectively $(\epsilon+\delta)$-secure for $0\le\delta<1-\epsilon$, because
\begin{align*}
P&=Pr\left[E_{s+w}(t)\ge Q+\nin[1-(\epsilon+\delta)]\right]\\
&\ge Pr\left[E_{s+w}(t)\ge Q+\nin[1-\epsilon]\right] > \meh{}\ge \meh[(\epsilon+\delta)]
\end{align*}
If the system is not selectively $\epsilon$-secure,
then it is not selectively $(\epsilon-\delta)$-secure.
Given the above, for a given waveform $w(t)$ and fixed $V_{PK}^{Adv}$,
we can define a waveform-specific \textbf{critical selective security threshold} $\epsilon_c^w$
such that the system is vulnerable for all $\epsilon^w$ with
$0\le\epsilon^w<\epsilon_c^w$ and secure for all $\epsilon^w$ with $\epsilon_c^w<\epsilon^w<1$.
By convention we take $\epsilon_c^w = 0$ if there is no $\epsilon$ for which
the system is vulnerable, and $\epsilon_c^w=1$ if there is no $\epsilon$ for which
the system is secure.
\secpar{Threshold Relationship} The critical universal threshold of a system
$\epsilon_c$ is related to the critical selective threshold $\epsilon_c^0$ against the zero waveform $w(t)=0$
through the equation $\epsilon_c^0=1-\epsilon_c$. Indeed, if a system is not universally
$\epsilon$-secure, then
$P=Pr\left[E_s(t) \ge Q+\nin{}\right]> \eh{}$, so
$\meh[(1-\epsilon)]=\eh{}<P=Pr\left[E_{s+0}(t) \ge Q+\nin[(1-(1-\epsilon))]\right]$,
making the system selectively $(1-\epsilon)$-secure for the zero waveform. Conversely, if a system
is selectively $(1-\epsilon)$-secure for the zero waveform,
then it is not universally $\epsilon$-secure.
The fact that a low critical universal threshold results in a high critical selective
threshold for the zero threshold is not surprising: it is
easy for an adversary to inject a zero signal by simply not transmitting anything.
\subsection{Universal Injection, Existential Security}
\label{sec:univ_sec}
The final notion of security is a weak one, which requires that the adversary
cannot inject at least one ``representable'' waveform into the system, i.e.,
one which is within the ADC limits. We can express this more precisely as follows:
\begin{definition}[Representable Waveform]
A waveform $w(t)$ is called \textbf{representable}
if it is within the ADC voltage levels, and has a maximum frequency component
bounded by the Nyquist frequency of the ADC. Mathematically,
$V_{min} \le w(t) \le V_{max}$ and $f_{max} \le f_s/2$.
\end{definition}
\noindent Using this, we can define security against at least one
representable waveform:
\begin{definition}[Existential Security, Universal Injection]
For $0\le\epsilon< 1$, and $V_{PK}^{Adv} \ge 0$, a system is called
\textbf{existentially $(\epsilon, V_{PK}^{Adv})$-secure} if there exists
a representable waveform $w(t)$ for which the system is
selectively $(\epsilon, w(t), V_{PK}^{Adv})$-secure.
We call a system existentially $\epsilon$-secure
when $V_{PK}^{Adv}$ is clear. If there is no such $w(t)$,
we say that the adversary can perform any \textbf{universal injection}.
\end{definition}
\noindent As above, voltage and probability are monotonic in
the opposite direction.
\secpar{Voltage} If a system is existentially $(\epsilon, V_1)$-secure,
then it is $(\epsilon, V_2)$-secure for $V_2\le V_1$. By assumption, there is a representable
$w(t)$ such that the system is selectively $(\epsilon, w(t), V_1)$-secure.
By the previous section, this system is $(\epsilon, w(t), V_2)$-secure,
concluding the proof.
\secpar{Probability} If a system is existentially $(\epsilon_1, V)$-secure,
then it is $(\epsilon_2, V)$-secure for $\epsilon_1\le \epsilon_2$.
By assumption, there is a representable
$w(t)$ such that the system is selectively $(\epsilon_1, w(t), V)$-secure.
By the previous section, the system is also $(\epsilon_2, w(t), V)$-secure, as desired.
\secpar{Thresholds} Extending the definitions of the previous sections, for fixed
$\epsilon$ we can define a \textbf{critical existential voltage level $V_c^{exist}$} below which
a system is existentially $\epsilon$-secure, and above which the system
is existentially $\epsilon$-insecure. Similarly, for a fixed adversarial voltage
we can define the
\textbf{critical existential security threshold $\epsilon_c^{exist}$}, above
which the system is existentially secure, and below which the system is insecure.
In some cases,
security designers may wish to adjust the definitions to restrict target waveforms (and
existential security counterexamples) even further.
For instance, we might wish to check whether an adversary can inject all
waveforms which are sufficiently bounded away from 0, periodic waveforms, or
waveforms of a specific frequency. The proofs for voltage and probability monotonicity
still hold, allowing us to talk about universal security against $\mathcal{S}$-representable
waveforms: waveforms which are representable and also in a set $\mathcal{S}$.
\section{Security Evaluation of a Smartphone Microphone}
\label{sec:case_study}
\begin{table}[t]
\centering
\caption{The adversary can
easily disturb the smartphone output (existential injection), and inject
human speech (universal injection). Selective injections of sines are less
precise than exponentials of the same frequency.}
\begin{tabular}{llr}
\toprule
\textbf{Injection} & \textbf{Resulting Signal} & \textbf{Crit. Thres.}\\
\midrule
Existential & $w(t) \ne 0$ & $0.892$ \\
Selective & $w(t)=e^{\sin(2\pi f_m t)}$ & $0.747$ \\
Selective & $w(t)=\sin(2\pi f_m t)$ & $0.562$ \\
Universal & ``OK Google'' commands & $\le0.562$\\
\bottomrule
\end{tabular}
\vspace{-1em}
\label{table:results}
\end{table}
In this section, we illustrate how our security definitions can be used to
determine the security level of a commercial, off-the-shelf smartphone microphone.
We first introduce an algorithm to calculate the critical selective security
threshold $\epsilon_c^w$ against a target waveform $w(t)$ in Section~\ref{sec:algorithm}.
We then use the algorithm to calculate the critical thresholds
of a smartphone in Section~\ref{sec:phone_security}.
Finally, we comment on universal security in Section~\ref{sec:phone_sine},
where we show that we are able to inject complex ``OK Google'' commands.
We summarize our results in Table~\ref{table:results}, while
Appendix~\ref{app:exp} contains additional experiments for further
characterization of the smartphone's ADC.
\subsection{Algorithm for Selective Security Thresholds}
\label{sec:algorithm}
In this section, we introduce an algorithm to calculate the critical
selective security threshold $\epsilon_c^w$ of a system against a target waveform $w(t)$,
using a transmitted signal $v(t)$.
The first step in the algorithm (summarized in
pseudocode as Algorithm~\ref{alg:adc:sec_calc}) is to determine the noise
distribution. To that end, we collect $N$ measurements of
the system output $\tilde{s}_f(t)$ during the injection and pick one as the
{\em reference} signal. We then pick $1\le k\le N-2$ of them to calculate
the noise ({\em estimation} signals), while the remaining are used to verify
our calculations ({\em validation} signals).
\begin{algorithm}[t]
\small
\begin{algorithmic}[1]
\Procedure{FindCriticalEpsilon}{$measured$, $ideal$, $sigma$}
\State $errors \gets |measured - ideal|/sigma$ \Comment{Calculate normalized absolute errors}
\State $lo \gets 0.5$ \Comment{Probabilities need to be between $0.5$ and $1$}
\State $hi \gets 1$
\While {$lo < hi$}
\State $mid \gets (lo + hi)/2$ \Comment{$mid$ represents $(2-\epsilon)/2$}
\State $n_{inv} \gets \text{ppf}((1+mid)/2) $ \Comment{Percentile point function}
\State $p_{error} \gets \text{length}([x\ge n_{inv}:x\in errors])/\text{length}(errors)$
\If{$|p_{error} - mid| < \delta \And p_{error} \le mid$} \Comment{Threshold $\delta=10^{-4}$}
\State \Return $2-2*mid$ \Comment{Break out if sufficiently close}
\ElsIf{$p_{error} < mid$}
\State $hi \gets mid$
\Else
\State $lo \gets mid$
\EndIf
\EndWhile
\EndProcedure
\Procedure{Compare}{$\boldsymbol{measurements}$, $ideal$} \Comment{Repeated $\boldsymbol{measurements}$}
\State $ref \gets \text{detrend}(\boldsymbol{measurements}[0])$ \Comment{Pick first as reference, remove DC}
\State $\boldsymbol{estimating} \gets \text{align}(\text{scale}(\text{detrend}(\boldsymbol{measurements}[1:]), ref), ref)$
\State $\boldsymbol{errors} \gets (measured - ref)\ \forall measured \in \boldsymbol{estimating}$
\State $\sigma_{noise} \gets \text{std\_deviation}(\boldsymbol{errors})$ \Comment{Calculate noise from estimations}
\State $ideal \gets \text{align}(\text{scale}(\text{detrend}(ideal), ref), ref)$
\State \Return FindCriticalEpsilon($ref$, $ideal$, $\sigma_{noise}$)
\EndProcedure
\end{algorithmic}
\caption{Determining the Critical Selective Security Threshold}
\label{alg:adc:sec_calc}
\end{algorithm}
Our algorithm first removes any DC offset and re-scales the measurements
so that the root-mean-square (RMS) voltages of the signals are the same. The
repeated measurements are then phase-aligned, and we calculate the distance
between the reference signal and the estimation signals. The average of this
distance should be very close to 0, as the signals are generated in the same
way. However, the standard deviation $\sigma$ is non-zero, so we can model
noise as following a zero-mean normal distribution $n(t)\sim N(0, \sigma^2)$.
We can then find the critical threshold between the reference signal
and any target {\em ideal} waveform $w(t)$ as follows: we first detrend, scale, and align
the ideal signal to the reference waveform, as with the estimation signals.
Then, we calculate the errors (distance)
between the ideal and the reference signal. Finally, we perform a binary search
for different values of $\epsilon$, in order to find the largest $\epsilon$
for which Equation~\eqref{eq:sel_sec} does not hold: this is the critical
threshold $\epsilon_c^w$. To calculate the inverse of the noise, we use the percentile point
function $ppf(\epsilon)$, which is the inverse of the cumulative distribution
function, and satisfies $N^{-1}(\epsilon)=ppf((1+\epsilon)/2)$.
Note that since the critical universal threshold $\epsilon_c$ is related to the
selective critical threshold of the zero waveform $\epsilon_c^0$ through $\epsilon_c=1-\epsilon_c^0$
(Section~\ref{sec:select_sec}), the same algorithm can be used to calculate the
critical universal security threshold $\epsilon_c$.
\subsection{Existential and Selective Injections into a Smartphone}
\label{sec:phone_security}
\begin{figure*}[t]
\centering
\begin{subfigure}[b]{0.49\textwidth}
\centering
\includegraphics[width=\textwidth]{adc_clean_injection.pdf}
\caption{$\vrms^{Adv}=\SI{0.2}{\volt}$, $f_c=\SI{200}{\mega\hertz}$}
\label{fig:clean_waveform}
\end{subfigure}\hfill
\begin{subfigure}[b]{0.49\textwidth}
\centering
\includegraphics[width=\textwidth]{adc_distorted_injection.pdf}
\caption{$\vrms^{Adv}=\SI{0.9}{\volt}$, $f_c=\SI{25}{\mega\hertz}$}
\label{fig:distorted_waveform}
\end{subfigure}\hfill
\caption{Clean (\subref{fig:clean_waveform}) and Distorted (\subref{fig:distorted_waveform}) waveforms injected into the smartphone, with ideal sine and exponential sine functions for comparison.}
\label{fig:phone_waveform}
\vspace{-1em}
\end{figure*}
We demonstrate how our algorithm can be used in a realistic setup
using a Motorola XT1541 Moto G3 smartphone. We inject amplitude-modulated
$f_m=\SI{1}{\kilo\hertz}$ signals using a Rohde \& Schwarz SMC100A/B103
generator into the headphone jack of the phone, following direct
power injection (DPI) methodology~\cite{sok}. We collect $N=10$ measurements of
$2^{15}$ sample points per run using an ``Audio Recorder'' app,
and record the data
at a frequency of $f_s=\SI{44.1}{\kilo\hertz}$ in a $\left[-1,1\right]$
dimensionless range (AAC encoding). We first amplitude-modulate $f_m$ over
$f_c=\SI{200}{\mega\hertz}$ using an output level of $\vrms^{Adv}=V_{PK}^{Adv}/\sqrt2=\SI{0.2}{\volt}$.
This injection is demodulated well by the smartphone and has a ``similarity''
(see Appendix~\ref{app:exp})
of over $0.98$ compared to a pure $\SI{1}{\kilo\hertz}$ tone. We call
this example the ``clean'' waveform.
The second injection, which we call the ``distorted'' waveform,
uses $f_c=\SI{25}{\mega\hertz}$, $\vrms^{Adv}=\SI{0.9}{\volt}$, and has a similarity
of less than $0.55$ to the ideal tone.
Example measurements of these signals and ``ideal'' signals (see below) are
shown in Figure~\ref{fig:phone_waveform}.
The algorithm first calculates the noise level using the reference signals.
As expected, the error average is very close to 0 (usually less than $10^{-6}$),
while the standard deviation $\sigma$ is noticeable at around $0.0015$.
Taking the reference signals as the target signal $w(t)$, the critical selective thresholds
are close to $1$. In other words, even if the injected waveforms do not
correspond to ``pure'' signals, the adversary can inject them
with high fidelity: the system is not selectively secure against them with
high probability.
We also tried two signals as the signal $w(t)$ that the adversary is trying
to inject: a pure $\SI{1}{\kilo\hertz}$ sine wave,
and an exponential of the same sine wave. The averages and standard deviations for
the calculated thresholds over all combinations of $k$
and reference signals are shown in
Table~\ref{table:selective_thresholds}. As we would expect, the thresholds
for the distorted waveform are much lower than the values for the clean waveform:
the signal is distorted, so it is hard to inject an ideal signal. We also find
that the exponential function is a better fit for the signal we are seeing,
and can better explain the harmonics. Table~\ref{table:selective_thresholds}
also includes the critical universal injection threshold based on the two
waveform injections. This
threshold is much higher for both waveforms, as injections disturb the ADC output
sufficiently, even when the demodulated signal is not ideal.
\begin{table}[t]
\centering
\caption{Mean and std. deviation $(\mu, \sigma)$ of critical selective
thresholds $\epsilon_c^w$ for different target signals $w(t)$.
Injections using the clean waveform are always more successful than
with the distorted waveform. Validation signals are injected
with high fidelity, and are better modeled by an exponential
rather than a pure sine.}
\begin{tabular}{lrrrr}
\toprule
\textbf{Waveform} & \textbf{Validation} & \textbf{Ideal Sine} & \textbf{$e^{\text{Ideal Sine}}$} & \textbf{$w(t) \ne 0$}\\
\midrule
Clean & $(0.98, 0.03)$ & $(0.56, 0.04)$ & $(0.75, 0.06)$ & $(0.89, 0.01)$\\
Distorted & $(0.95, 0.09)$ & $(0.31, 0.05)$ & $(0.34, 0.05)$ & $(0.71, 0.04)$ \\
\bottomrule
\end{tabular}
\vspace{-1em}
\label{table:selective_thresholds}
\end{table}
\subsection{Universal Injections on a Smartphone}
\label{sec:phone_sine}
In this section, we demonstrate that the smartphone is vulnerable to the
injection of arbitrary
commands, which cause the smartphone to behave as if the user initiated an action.
Using the same setup of direct power injection (Section~\ref{sec:phone_security}),
we first inject a modulated recording of ``OK Google, turn on the flashlight''
into the microphone port,
checking both whether the voice command service was activated in response to
``OK Google'', and whether the desired action
was executed. We repeat measurements 10 times, each time amplitude-modulating
the command at
a depth of $\mu=1.0$ with $\vrms^{Adv}=\SI{0.6}{\volt}$ on 26 carrier frequencies
$f_c$: $\SI{25}{\mega\hertz}$, $\SI{50}{\mega\hertz}$, and $\SIrange{100}{2400}{\mega\hertz}$
at a step of $\SI{100}{\mega\hertz}$.
The voice-activation feature (``OK Google'') worked with 100\% success
rate (10/10 repetitions) for all frequencies, while the full command was successfully executed
for 23 of the 26 frequencies we tested (all frequencies
except $f_c\in\{1.3, 2.0, 2.4\si{\giga\hertz}\}$). Increasing the output level
to $\vrms^{Adv}=\SI{0.9}{\volt}$, increased success rate to 25/26 frequencies.
Only $f_c=\SI{2.4}{\giga\hertz}$ did not
result in a full command injection, possibly because the Wi-Fi disconnected in
the process.
We repeated the above injections, testing 5 further commands to (1) call
a contact; (2) text a contact; (3) set a timer; (4) mute the volume; and
(5) turn on airplane mode. The results remained identical, regardless of
the actual command to be executed. As a result, all carrier frequencies which are not severely
attenuated by $H_C$ (e.g., when coupling to the user's headphones) are vulnerable
to injections of complex waveforms such as human speech.
\section{Commercial ADC Response $H_A$ to Malicious Signals}
\label{sec:adcs}
\begin{table}[t]
\centering
\caption{The ADCs used in our experiments cover a range of different properties.}
\begin{tabular}{llllrrHHHr}
\toprule
\textbf{ADC} & \textbf{Manufacturer} & \textbf{Package} & \textbf{Type} & \textbf{Bits}& \textbf{Max $f_s$} & \textbf{Eff. $f_s$} & \textbf{$R$} & \textbf{$C$} & \textbf{$f_{cut}$}\\
\midrule
TLC549 & Texas Instruments & DIP & SAR & 8 & \SI{40}{\kilo\hertz} & \SI{29}{\kilo\hertz} & \SI{1}{\kilo\ohm} & \SI{60}{\pico\farad} & \SI{2.7}{\mega\hertz}\\
ATmega328P & Atmel & Integrated & SAR & 10 & \SI{76.9}{\kilo \hertz} & \SI{8.3}{\kilo\hertz}
& \SIrange{1}{100}{\kilo\ohm} & \SI{14}{\pico\farad} & \SIrange{0.1}{11.4}{\mega\hertz} \\
Artix7 & Xilinx & Integrated & SAR & 12& \SI{1}{\mega \hertz} & \SI{198}{\kilo\hertz} & \SI{10}{\kilo\ohm} & \SI{3}{\pico\farad} & \SI{5.3}{\mega\hertz} \\
AD7276 & Analog Devices & TSOT & SAR & 12& \SI{3}{\mega \hertz} & \SI{35}{\kilo\hertz} & \SI{75}{\ohm} & \SI{32}{\pico\farad} & \SI{66.3}{\mega\hertz}\\
AD7783 & Analog Devices & TSSOP & $\Delta\Sigma$ & 24 & \SI{19.79}{\hertz} & \SI{19.71}{\hertz} & N/A & N/A & [$50$,\SI{60}{\hertz}] \\
AD7822 & Analog Devices & DIP & Flash & 8 & \SI{2}{\mega \hertz} & \SI{84}{\kilo\hertz} & \SI{310}{\ohm} & \SI{4}{\pico\farad} & \SI{128.4}{\mega\hertz}\\
\bottomrule
\end{tabular}
\label{table:adcs}
\vspace{-.5em}
\end{table}
\vspace{-0.5em}
As explained in Section~\ref{sec:model}, an adversary trying to inject signals
remotely into a system typically needs to transmit modulated signals over
high-frequency carriers. As $H_C$ is unique to each circuit and needs to be re-calculated even
for minor changes to its components and layout~\cite{emi_susceptibility},
the first step to determine the
system vulnerability is to understand the behavior $H_A$ of the ADC used.
\begin{figure}[t]
\centering
\includegraphics[width=0.5\textwidth]{adc_setup}
\caption{Amplitude-modulated signals are directly injected into ADCs using a
signal generator controlled over the VISA interface. Measurements are
transferred to a computer for analysis via a microcontroller's
UART interface.}
\label{fig:setup}
\vspace{-.5em}
\end{figure}
To do so, we inject signals into the ADCs to determine their
demodulation characteristics. As shown in Figure~\ref{fig:setup},
the output of the Rohde \& Schwarz signal generator is directly connected to the
ADC under test,
while additional experiments with an amplifier or with remote transmissions are
performed in Appendix~\ref{app:exp}. An Arduino Uno (ATmega328P microcontroller)
interfaces with the ADC over the appropriate protocol, while a computer
collects the measurements from the microcontroller over the UART,
and controls the signal generator over the VISA interface.
Experiments are conducted with six ADCs from four manufacturers (Texas
Instruments, Analog Devices, Atmel, and Xilinx) in different packages: some are part
of the silicon in other ICs, while others are standalone surface-mount
or through-hole chips. Delta-Sigma ($\Delta\Sigma$), half-flash, and successive
approximation (SAR) ADCs
are tested, with sampling rates $f_s$ ranging from a few $\si{\hertz}$
to several $\si{\mega\hertz}$, and resolutions between $8$ and $24$ bits.
Table~\ref{table:adcs} shows these properties
along with the $\SI{-3}{\decibel}$ cutoff frequency $f_{cut}$, calculated using
the $R,C$ parameters in the ADCs' datasheets.
We use sinusoidals of frequencies $f_m$
that have been amplitude-modulated on carrier frequencies
$f_c$. In other words, we consider the intended
signal to be $w(t)=\sin(2\pi f_m t)$, the sensor signal to be absent ($s(t)=0$),
and evaluate how ``close'' $w(t)$ is to the ADC output $\tilde{s}_f(t)$.
We summarize typical results for each ADC here, and present more details
in Appendix~\ref{app:exp}.
\begin{figure*}[t]
\centering
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{adc_atmega328p_0_50_1_10000000.pdf}
\caption{$f_c=\SI{10}{\mega\hertz}$}
\end{subfigure}\hfill
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{adc_atmega328p_0_50_1_80000000.pdf}
\caption{$f_c=\SI{80}{\mega\hertz}$}
\end{subfigure}\hfill
\caption{Example ATmega328P output for power $P=\SI{0}{\decibel m}$, signal frequency $f_m=\SI{1}{\hertz}$,
and modulation depth $\mu=0.5$. The signal exhibits the correct fundamental frequency, but also
contains strong harmonics and a high-frequency component, which is attenuated as the carrier frequency $f_c$ increases.}
\label{fig:atmega_raw}
\vspace{-1em}
\end{figure*}
\secpar{ATmega328P} Figure~\ref{fig:atmega_raw} presents two example measurements
of outputs of the ATmega328P, both in the time domain and in the frequency
domain. The input to the ADC is a $f_m=\SI{1}{\hertz}$ signal modulated over
different high-frequency carriers. As shown in the frequency
domain (bottom of Figure~\ref{fig:atmega_raw}), the fundamental frequency $f_m$
dominates all other frequencies, so the attacker is able to inject a signal
of the intended frequency into the output of the ADC.
However, the output at both carrier frequencies has strong harmonics
at $2f_m,3f_m,\ldots\si{\hertz}$,
which indicates that the resulting signal is not pure. Moreover, there is
a residual high-frequency component, which is attenuated as the carrier
frequency $f_c$ increases. Finally, there is a frequency-dependent
DC offset caused, in part, by the ESD diodes, while the peak-to-peak
amplitude of the measured signal decreases as the carrier frequency increases.
This is due to the low-pass filtering behavior of the sample-and-hold mechanism,
which also explains why we are only able to demodulate signals
for carrier frequencies until approximately $\SI{150}{\mega\hertz}$.
\begin{figure*}[!t]
\centering
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{adc_tlc549_5_50_1_20000000.pdf}
\caption{TLC549: $f_c=\SI{80}{\mega\hertz}$, $\mu=0.5$, $f_m=\SI{1}{\hertz}$}
\label{fig:tlc549_raw}
\end{subfigure}\hfill
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{adc_ad7783_5_100_10_40000000.pdf}
\caption{AD7783: $f_c=\SI{40}{\mega\hertz}$, $\mu=1.0$, $f_m=\SI{10}{\hertz}$}
\label{fig:ad7783_raw}
\end{subfigure}\hfill
\caption{Example TLC549 (\subref{fig:tlc549_raw}) and AD7783 (\subref{fig:ad7783_raw})
outputs for a transmission power of $P=\SI{5}{\decibel m}$.
Both ADCs demodulate the injected signal, but present harmonics
and some high-frequency components. The AD7783 signal is aliased.}
\vspace{-1em}
\end{figure*}
\secpar{TLC549} The TLC549 (Figure~\ref{fig:tlc549_raw}) also demodulates the
injected signal, but still
contains harmonics and a small high-frequency component.
\begin{figure*}[t]
\centering
\begin{subfigure}[b]{0.33\textwidth}
\centering
\includegraphics[width=\textwidth]{adc_ad7822_m5_50_5_79493300.pdf}
\caption{$f_c=\SI{79.4933}{\mega\hertz}$}
\end{subfigure}\hfill
\begin{subfigure}[b]{0.33\textwidth}
\centering
\includegraphics[width=\textwidth]{adc_ad7822_m5_50_5_79493600.pdf}
\caption{$f_c=\SI{79.4936}{\mega\hertz}$}
\end{subfigure}\hfill
\begin{subfigure}[b]{0.33\textwidth}
\centering
\includegraphics[width=\textwidth]{adc_ad7822_m5_50_5_79493700.pdf}
\caption{$f_c=\SI{79.4937}{\mega\hertz}$}
\end{subfigure}\hfill
\caption{Example AD7822 output for power $P=\SI{-5}{\decibel m}$, signal frequency $f_m=\SI{5}{\hertz}$,
and depth $\mu=0.5$. Signal demodulation requires a fine-tuned $f_c$.}
\label{fig:ad7822_tuning}
\vspace{-2em}
\end{figure*}
\secpar{AD7783} As the AD7783 (Figure~\ref{fig:ad7783_raw}) only has a sampling frequency of
$f_s=\SI{19.79}{\hertz}$, aliasing occurs when the baseband signal exceeds
the Nyquist frequency $f_s/2$. For example, when the baseband frequency is
$f_m=\SI{10}{\hertz}$,
the fundamental frequency dominating the measurements is of frequency
$2f_m-f_s=20-19.79=\SI{0.21}{\hertz}$, with a high-frequency component of
$f_s-f_m=\SI{9.79}{\hertz}$.
\secpar{AD7822, AD7276, Artix7}
The three remaining ADCs contain strong high-frequency components which dominate
the low-frequency signal. Their outputs appear to be AM-modulated,
but at a carrier frequency which is below the ADC's Nyquist frequency.
However, with manual tuning of the carrier frequency, it is possible to
remove this high frequency component, causing the ADC to demodulate
the input. This is shown for the Flash ADC AD7822 in
Figure~\ref{fig:ad7822_tuning}, where we change the carrier frequency $f_c$
in steps of $\SI{100}{\hertz}$.
\secpar{Conclusion} The results of our experiments lead to the following observations:
\begin{enumerate}
\vspace{-0.5em}
\item {\bf Generality} -- All 6 ADCs tested are
vulnerable to signal injections at multiple carrier frequencies, as they
demodulate signals, matching the theoretical expectations of
Section~\ref{sec:adc_model}. As the ADCs are of all
major types and with a range of different resolutions and sampling frequencies,
the conclusions drawn should also be valid for other ADC chips.
\item {\bf Low-Pass Filter} -- Although all ADCs exhibited low-pass
filtering characteristics,
the maximum vulnerable carrier frequency for a given power level was multiple
times the cut-off frequency of the $RC$ circuit at the input of the ADC.
This extended the frequency range that an attacker could use for
transmissions to attack the system.
\item {\bf Power} -- The adversary needs to select the power level of
transmissions carefully: too much power in the input of the ADC can cause
saturation and/or clipping of the measured signal. Too little power, on the
other hand, results in output that looks like noise or a zero signal.
\item {\bf Carrier Frequency} -- Some ADCs were vulnerable at any
carrier frequency that is not severely attenuated by the sample-and-hold
mechanism. For others, high-frequency components dominated the intended
baseband signal of frequency $f_m$ in the ADC output for most frequencies.
Even then, carefully-chosen carrier frequencies
resulted in a demodulated ADC output.
\vspace{-1.5em}
\end{enumerate}
\section{Discussion}
\label{sec:discussion}
We now discuss how our work can inform design choices.
To start, choosing the right ADC directly impacts
the susceptibility to signal injection attacks. As shown in Section~\ref{sec:adcs},
some ADCs distort the demodulated output and result in more sawtooth-like
output, making them more resilient to clean sinusoidal injections. Moreover,
other ADCs require fine-grained control over the carrier frequency of
injection. As the adversarial signal is transformed
through the circuit-specific transfer function $H_C$, the adversary may
not have such control, resulting in a more secure system.
Having chosen the appropriate ADC based on cost, performance, security, or
other considerations, a designer needs to assess the impact of $H_C$.
Prior work has shown that even small layout or component changes
affect the EMI behavior of a
circuit~\cite{emi_susceptibility,emi_predict,statistics_demodulation_rfi}.
Since the ADC behavior can be independently determined through direct power injections,
fewer experiments with remote transmissions are required to evaluate the
full circuit behavior and how changes in the circuit's topology
influence the system's security.
Our selective security definition and algorithm
address how to determine the vulnerability of a system against specific waveforms.
Universal security, on the other hand, allows us to directly compare
the security of two systems for a fixed adversarial voltage budget through their critical universal
security thresholds. Moreover, given a probability/threshold
$\epsilon$, we can calculate the critical universal voltage level, which is
the maximum output level for which a system is still universally $\epsilon$-secure.
Our smartphone case study showed that our framework can be used in practice
with real systems, while our ``OK Google'' experiments
demonstrated that less-than-perfect injections of
adversarial waveforms can have the same effect as perfect injections.
This is because there is a mismatch between the true noise level of a system
and the worst-case noise level that the system expects. In other
words, injections worked at all carrier frequencies, even when
the demodulated output was noisy or distorted.
This is a deliberate, permissive design decision, which allows the
adversary to succeed with a range of different and noisy waveforms $w(t)$,
despite small amplitudes and DC offsets.
Although not heavily discussed in this paper, our model and definitions are
general enough to capture alternative signal
injection techniques. For instance,
electro-mechanical sensors have resonant frequencies which allow acoustic
injection attacks~\cite{drones,injected_actuation}. $H_C$ can
account for such imperfections in the sensors themselves, attenuating
injection frequencies which are not close to the resonant frequencies.
Our system model also makes it easy to evaluate countermeasures and
defense mechanisms in its context. For example, shielding increases
the attenuation factor of $H_C$, thereby
increasing the power requirements for the adversary
(Section~\ref{sec:adc_model}).
Alternatively, a low-pass
filter (LPF) before the ADC and/or amplifier changes $H_A$, and attenuates the
high-frequency components which would induce non-linearities.
Note, however, that even
moving the pre-amplifier, LPF and ADC into the same IC package does not fully
eliminate the vulnerability to signal injection attacks
(Section~\ref{sec:related}) as the channel between
the analog sensor and the ADC cannot be fundamentally authenticated.
\section{Related Work}
\label{sec:related}
Ever since a 2013 paper by Kune et al. showed that
electromagnetic (EM) signals can be used to cause medical devices to
deliver defibrillation shocks~\cite{ghost},
there has been a rise in EM, acoustic, and
optical signal injection attacks against sensor and actuator
systems~\cite{sok}. Although some papers have focused on vulnerabilities caused by
the ADC sampling process itself~\cite{ics_adc_attack}, others have focused
on exploiting the control algorithms that make use of the digitized signal.
For example, Shoukry et al. showed how to force the Anti-Lock Braking
Systems (ABS) to model the real input signal as a disturbance~\cite{abs}.
Selvaraj et al. also used the magnetic field to perform attacks on actuators,
but further explored the relationship between frequency and the average injected voltage
into ADCs~\cite{induction_embedded}. By contrast, our paper primarily focused on
a formal mathematical framework to understand security in the context of
signal injection attacks, but also investigated the demodulation properties of
different ADCs.
Our work further highlighted how to use the introduced algorithm and definitions to
investigate the security of a smartphone, complementing earlier work which
had shown that AM-modulated electromagnetic transmissions can be picked up
by hands-free headsets to trigger voice commands in smartphones~\cite{smartphone_iemi}.
Voice injection attacks can also be achieved
by modulating signals on ultrasound frequencies~\cite{dolphin}, or by playing two tones at
different ultrasound frequencies and exploiting non-linearities in
components~\cite{backdoor_microphone}.
Acoustic transmissions at a device's resonant frequencies can also
incapacitate~\cite{drones} or precisely control~\cite{walnut} drones, with
attackers who account for sampling rate drifts being able to control the outputs
of accelerometers for longer periods of time~\cite{injected_actuation}.
Moreover, optical attacks can be used to spoof medical infusion pump
measurements~\cite{pump}, and cause autonomous cars and unmanned aerial
vehicles (UAVs) to drift or fail~\cite{uavs,lidar,autonomous_vehicles}.
It should be noted that although the literature has primarily focused on signal
injection attacks, some works have also proposed countermeasures. These defense
mechanisms revolve around better sampling techniques, for example by adding
unspoofable physical and computational delays~\cite{pycra}, or by oversampling
and selectively turning the sensors off using a secret
sequence~\cite{zhang_detection_2020}.
Overall, despite the extensive literature on signal injection attacks and defenses,
the setup and effectiveness of different works is often reported in an inconsistent way,
making their results hard to compare~\cite{sok}. Our work, recognizing this gap,
introduced a formal foundation to define and quantify security against signal injection attacks,
working towards unifying the reporting methodology for competing works.
\section{Conclusion}
\label{sec:conlusion}
Sensors guide many of our choices, and we often blindly
trust their values. However, it is possible to spoof
their outputs through electromagnetic or other signal injection attacks. To
address the lack of a unifying framework
describing the susceptibility of devices to such attacks, we defined a system and
adversary model for signal injections. Our model is the first to abstract away from
specific environments and circuit designs and presents a strong adversary
who is only limited by transmission power.
It also makes it easy to discuss and evaluate countermeasures in its
context and covers different types of signal injection attacks.
Within our model, we defined existential, selective, and universal security,
capturing effects ranging from mere
disruptions of the ADC outputs to precise injections of all waveforms.
We showed that our definitions can be used to evaluate the
security level of an off-the-shelf smartphone, and introduced an algorithm to
calculate ``critical'' thresholds, which express how close an
injected signal is to the ideal signal. Finally, we characterized
the demodulation characteristics of commercial ADCs to malicious injections.
In response to the emerging signal injection threat,
our work paves the way towards a future where security can be quantified
and compared through our methodology and security definitions.
\input{bibliography}
\input{appendix}
\end{document}
\section{Additional Experiments with ADCs}
\label{app:exp}
This appendix contains further measurements on the demodulation properties
of ADCs. Section~\ref{sec:app:metric} precisely defines the similarity metric
of Section~\ref{sec:case_study}, and validates the experimental setup.
Section~\ref{sec:app:mic} and~\ref{sec:app:atmega} then
conduct further characterization experiments of the smartphone microphone
and ATmega328P ADC respectively. Finally, Section~\ref{sec:app:others}
contains additional examples of the demodulation characteristics of the
remaining ADCs.
\subsection{Similarity Metric and Setup Validation}
\label{sec:app:metric}
The experiments of Section~\ref{sec:phone_security} required
an independent metric to evaluate how ``similar'' two signals are
as a way of independently validating the security definitions of Section~\ref{sec:definitions}.
The metric proposed for this task is based on the Pearson Correlation Coefficient (PCC),
which is commonly found in signal-alignment and optimization
applications~\cite{pearson_noise,pearson_alignment}. It is defined
as the covariance of two variables divided by the product of their
standard deviations:
\begin{equation}\label{eq:app:pcc}
\rho\left(X,Y\right) = \frac{\text{cov}\left(X,Y\right)}{\sigma_X\sigma_Y}=\frac{\sum_{i=1}^{n}\left(x_i-\mu_x\right)\left(y_i-\mu_y\right)}{\sqrt{\sum_{i=1}^{n}\left(x_i-\mu_x\right)^2}{\sqrt{\sum_{i=1}^{n}\left(y_i-\mu_y\right)^2}}}
\end{equation}
It is a suitable metric because it removes the mean value of the signals
(DC shift), as well as the effects of scaling (related to transmission power).
In other words, $\rho\left(X, aX+b\right)=1$ for a variable $X$ and scalars $a,b$.
However, the PCC is sensitive to signal alignment.
To overcome this issue, the phase (time) offset between two signals $s_a$, $s_b$
can be found using cross-correlation. Specifically, the signals are
aligned when the cross-correlation coefficient is maximized:
\begin{equation}\label{eq:app:lag}
\text{lag}\left(s_a, s_b\right) = \argmax\limits_{n} \left(\left(s_a \star s_b\right)\left(n\right)\right)
\end{equation}
Using Equations~\eqref{eq:app:pcc} and~\eqref{eq:app:lag}, the
similarity metric between the measured signal $\tilde{s}_f(t)$ and the ideal
signal $w(t)$ can be defined as follows:
\begin{equation}\label{eq:app:similarity}
\text{similarity}\left(\tilde{s}_f, w\right) = \rho\left(\tilde{s}_f, w^{lag}\right)
\end{equation}
To sanity-check this metric and the experimental setup, an unmodulated \SI{20}{\milli\volt}
$f_m=\SI{1}{\kilo\hertz}$ signal is generated. Figure~\ref{fig:app:ideal_ref} shows this waveform as
measured by the smartphone of Section~\ref{sec:phone_security} along
with an ideal $\SI{1}{\kilo\hertz}$ signal. Even though the amplitudes are different,
the frequency responses of the measured and the ideal signal are almost identical,
with the two signals having a similarity of $0.9991$ according to
Equation~\eqref{eq:app:similarity}.
\begin{figure}[!t]
\centering
\begin{subfigure}[b]{0.33\textwidth}
\centering
\includegraphics[width=\textwidth]{app_adc_microphone_10mV_1000_only}
\caption{$f_m$ (Ideal \& Microphone)}
\label{fig:app:ideal_ref}
\end{subfigure}\hfill
\begin{subfigure}[b]{0.33\textwidth}
\centering
\includegraphics[width=\textwidth]{app_adc_oscilloscope_20mv_100_1000_10000}
\caption{$f_m \times f_c$ (Oscilloscope)}
\label{fig:app:osc_ref}
\end{subfigure}\hfill
\begin{subfigure}[b]{0.33\textwidth}
\centering
\includegraphics[width=\textwidth]{app_adc_microphone_20mv_100_1000_10000}
\caption{$f_m \times f_c$ (Microphone)}
\label{fig:app:mic_ref}
\end{subfigure}\hfill
\caption{Unmodulated and modulated injections measured by
an oscilloscope and a smartphone microphone, with RMS voltage
$\vrms^{Adv}=\SI{20}{\milli\volt}$, signal frequency $f_m=\SI{1}{\kilo\hertz}$,
carrier frequency $f_c=\SI{10}{\kilo\hertz}$, and modulation depth $\mu=1.0$.}
\label{fig:app:ref}
\end{figure}
Figures~\ref{fig:app:osc_ref} and~\ref{fig:app:mic_ref} additionally show
the same $f_m=\SI{1}{\kilo\hertz}$ signal modulated on a carrier frequency of
$f_c=\SI{10}{\kilo\hertz}$ at a depth of $\mu=1.0$. This carrier frequency was
chosen as it is within the Nyquist range of the smartphone ADC (sampling frequency
$f_s=\SI{44.1}{\kilo\hertz}$). Figure~\ref{fig:app:osc_ref} contains
measurements taken by a Rigol DS2302A oscilloscope with a timescale
division of $\SI{500}{\micro\second}$, while Figure~\ref{fig:app:mic_ref} uses
the smartphone microphone.
Unlike the examples of Section~\ref{sec:case_study}, the measurements shown in
Figure~\ref{fig:app:ref} do not exhibit harmonics, but rather high-frequency
components at $f_c$ and $f_c\pm f_m$, as expected. Consequently, the demodulation
characteristics are due to non-linearities in amplifiers and ADCs when
used outside of their intended range, instead of the experimental setup.
\subsection{Smartphone Microphone Properties}
\label{sec:app:mic}
\begin{figure}[!t]
\centering
\begin{subfigure}[!t]{0.49\textwidth}
\centering
\includegraphics[width=\textwidth]{app_adc_phone_similarity}
\caption{Similarity to the ideal signal}
\label{fig:app:phone_similarity}
\end{subfigure}\hfill
\begin{subfigure}[!t]{0.49\textwidth}
\centering
\includegraphics[width=\textwidth]{app_adc_phone_depth}
\caption{$V_{RMS}$ for different $\mu$}
\label{fig:app:phone_depth}
\end{subfigure}\hfill
\begin{subfigure}[!t]{0.49\textwidth}
\centering
\includegraphics[width=\textwidth]{app_adc_phone_power_absolute}
\caption{$V_{RMS}$ for different $\vrms^{Adv}$}
\label{fig:app:phone_absolute}
\end{subfigure}\hfill
\begin{subfigure}[!t]{0.49\textwidth}
\centering
\includegraphics[width=\textwidth]{app_adc_phone_power_relative}
\caption{$V_{RMS}$ relative to $\vrms^{Adv}=\SI{0.2}{\volt}$}
\label{fig:app:phone_relative}
\end{subfigure}\hfill
\caption{Results of amplitude-modulated $f_m=\SI{1}{\kilo\hertz}$ injections
into the smartphone microphone for different carrier frequencies $f_c$,
depths $\mu$, and output voltage levels $\vrms^{Adv}$. (\subref{fig:app:phone_similarity})
shows the similarity of the measured output compared to the ideal signal.
(\subref{fig:app:phone_depth}) and~(\subref{fig:app:phone_absolute})
illustrate the received RMS voltages $V_{RMS}$ for different modulation
depths $\mu$ and $\vrms^{Adv}$ respectively. Finally, (\subref{fig:app:phone_relative})
shows $V_{RMS}$ relative to $\vrms^{Adv}=\SI{0.2}{\volt}$.}
\label{fig:app:phone}
\end{figure}
This section characterizes the smartphone microphone through
the direct injection methodology of Section~\ref{sec:adcs}.
An $f_m=\SI{1}{\kilo\hertz}$ tone is amplitude-modulated with a depth
of $\mu=1.0$ on the following carrier frequencies $f_c$:
$\SI{25}{\mega\hertz}$, $\SI{50}{\mega\hertz}$, and $\SIrange{0.1}{2.4}{\giga\hertz}$
at a step of $\SI{100}{\mega\hertz}$. The RMS output level
$\vrms^{Adv}=V_{PK}^{Adv}/\sqrt{2}$ of the signal generator is also varied
between $\SIrange{0.2}{0.9}{\volt}$ at a step of $\SI{100}{\milli\volt}$.
The similarity of the measured to the ideal signal for various
carrier frequencies $f_c$ and output levels $\vrms^{Adv}$ is shown in
Figure~\ref{fig:app:phone_similarity}. It is consistently high for all
frequencies when $\SI{0.2}{\volt}\le \vrms^{Adv}\le\SI{0.6}{\volt}$, while higher voltage
levels lead to more pronounced harmonics and clipping, reducing the similarity.
The results are consistent across measurements: the $99\%$ confidence interval
of the similarity is always below $\pm0.0005$, except for the $(f_c, \vrms^{Adv})$ pairs
$(\SI{300}{\mega\hertz},\SI{0.5}{\volt})$ and
$(\SI{2.4}{\giga\hertz},\SI{0.9}{\volt})$, where it reaches $0.035$.
According to work on amplifier properties~\cite{statistics_demodulation_rfi},
the measured RMS voltage level $V_{RMS}$,
the input voltage $\vrms^{Adv}$, the modulation depth $\mu$, the signal frequency $f_m$,
and the carrier frequency $f_c$ satisfy the following relationship:
\begin{equation}\label{eq:app:amp_demod}
V_{RMS} = \frac{\sqrt{2}}{2}\mu\left(\vrms^{Adv}\right)^2\left| H_2\left(f_c, -\left(f_c-f_m\right)\right)\right|
\end{equation}
where $H_2$ is a second-order transfer function. Figure~\ref{fig:app:phone}
mostly confirms this equation for the microphone and ADC subsystem
of the smartphone.
Specifically, fixing $\mu$ and $f_m$ in Equation~\eqref{eq:app:amp_demod}
suggests that $V_{RMS}^{V_1}/V_{RMS}^{V_2}=(V_1/V_2)^2$ across all carrier
frequencies $f_c$. Indeed, Figure~\ref{fig:app:phone_depth} verifies that the received
RMS voltage $V_{RMS}$ is linear in the modulation depth $\mu$ for fixed
$\vrms^{Adv}\in\{0.4,0.6\}\si{\volt}$ with $R^2>0.97$. For $\SI{0.2}{\volt}$,
the relationship becomes linear after $\mu\approx0.8$, as the measured $V_{RMS}$
is approximately $0$ below that.
Figure~\ref{fig:app:phone_absolute} illustrates that the transfer function for the
$V_{RMS}$ response is frequency-dependent. Finally, Figure~\ref{fig:app:phone_relative} shows
$V_{RMS}$ relative to $\vrms^{Adv}=\SI{0.2}{\volt}$. For $\SI{0.3}{\volt}\le V_{RMS} \le\SI{0.6}{\volt}$
and $f_c\ge\SI{100}{\mega\hertz}$, there is a linear relationship between
the carrier frequency and $V_{RMS}/V_{RMS}^{\SI{0.2}{\volt}}$, as
predicted by Equation~\eqref{eq:app:amp_demod}.
\begin{figure}[!t]
\centering
\begin{subfigure}[!t]{0.49\textwidth}
\centering
\includegraphics[width=\textwidth]{app_adc_microphone_600mv_100_1000_1500000000}
\caption{$\vrms^{Adv}=\SI{0.6}{\volt}$, $f_c=\SI{1.5}{\giga\hertz}$}
\label{fig:app:mic_06_15}
\end{subfigure}\hfill
\begin{subfigure}[!t]{0.49\textwidth}
\centering
\includegraphics[width=\textwidth]{app_adc_microphone_600mv_100_1000_2000000000}
\caption{$\vrms^{Adv}=\SI{0.6}{\volt}$, $f_c=\SI{2.0}{\giga\hertz}$}
\label{fig:app:mic_06_20}
\end{subfigure}\hfill
\begin{subfigure}[!t]{0.49\textwidth}
\centering
\includegraphics[width=\textwidth]{app_adc_microphone_900mv_100_1000_1500000000}
\caption{$\vrms^{Adv}=\SI{0.9}{\volt}$, $f_c=\SI{1.5}{\giga\hertz}$}
\label{fig:app:mic_09_15}
\end{subfigure}\hfill
\begin{subfigure}[!t]{0.49\textwidth}
\centering
\includegraphics[width=\textwidth]{app_adc_microphone_900mv_100_1000_2000000000}
\caption{$\vrms^{Adv}=\SI{0.9}{\volt}$, $f_c=\SI{2.0}{\giga\hertz}$}
\label{fig:app:mic_09_20}
\end{subfigure}\hfill
\caption{Microphone output for $f_m=\SI{1}{\kilo\hertz}$ and $\mu=1.0$.}
\label{fig:app:mic}
\end{figure}
Figure~\ref{fig:app:mic} shows example microphone outputs for different
carrier frequencies $f_c$ and output voltages $\vrms^{Adv}$. They all exhibit high harmonics,
but the similarity compared to the ideal signal for
Figures~\ref{fig:app:mic_06_15}--\ref{fig:app:mic_09_15}
is still over $0.9$. However, the injection
of Figure~\ref{fig:app:mic_09_20} contains more
pronounced distortions, and the similarity drops to less than $0.3$.
Overall, the results of this section show that
a higher-order transfer function may be needed to more accurately
predict the ADC output, both in terms of its RMS voltage,
and in terms of the harmonics it produces.
\subsection{ATmega328P Characterization}
\label{sec:app:atmega}
\begin{figure}[t]
\centering
\begin{subfigure}[!t]{0.7\linewidth}
\includegraphics[width=\textwidth]{app_adc_atmega328p_1hz_similarity}
\caption{ADC only}
\label{fig:app:atmega}
\end{subfigure}\hfill
\end{figure}
\begin{figure}[!t]\ContinuedFloat
\centering
\begin{subfigure}[!t]{0.49\textwidth}
\centering
\includegraphics[width=\textwidth]{app_adc_atmega328p_amplifier_similarity}
\caption{ADC + Amplifier}
\label{fig:app:amp}
\end{subfigure}\hfill
\begin{subfigure}[!t]{0.49\textwidth}
\centering
\includegraphics[width=\textwidth]{app_adc_atmega328p_antenna_similarity}
\caption{ADC + Amplifier + Antenna}
\label{fig:app:ant}
\end{subfigure}\hfill
\caption{Similarity metrics for injections into the ATmega328P
for different transmission powers $P$,
modulation depths $\mu$, and carrier frequencies
$f_c$. The amplifier increases the vulnerable frequencies to
the $\si{\giga\hertz}$ range, allowing remote attacks.}
\end{figure}
This section contains detailed results for injections into the ATmega328P
ADC in three different arrangements: (a) the ADC on its own;
(b) the ADC with an amplifier; and (c) the ADC with an
amplifier and an antenna. The experimental results
support the theoretical model of Section~\ref{sec:model} and show that,
despite its low-pass filtering behavior, the ADC demodulates
signals carried at frequencies multiple times the cut-off frequency of
the sample-and-hold mechanism. Moreover, external amplifier non-linearities
increase the vulnerable frequency band into the $\si{\giga\hertz}$ range.
\secpar{ATmega328P Only} The first experiment targets the ATmega328P
directly, without using any additional components. The similarity
of the demodulated signal to the ideal signal is calculated for injections
at different powers $P$, modulation depths $\mu$, carrier frequencies $f_c$,
and a signal frequency of $f_m=\SI{1}{\hertz}$. As Figure~\ref{fig:app:atmega}
illustrates, the similarity for $f_c=\SI{1}{\mega\hertz}$ is always low due to aliasing.
However, similarity is high for $f_c$ between $\SIrange{10}{150}{\mega\hertz}$,
but signals are severely attenuated for $f_c\ge\SI{300}{\mega\hertz}$.
Small modulation depths and powers do not
result in demodulated outputs, while too much power causes the ADC to
be saturated. This leads to partial clipping of the signal, or
induces a DC offset which is beyond the range of the ADC. Overall,
the adversary has a range of choices for $P$ and $\mu$, and can use
carrier frequencies which are multiple times the cutoff frequency of the ADC,
provided these are not attenuated by the circuit-specific transfer function $H_C$.
\secpar{ATmega328P + Amplifier} A low-cost, off-the-shelf wideband LNA
is added before the input to the ADC
to change the transfer function $H_A$. The amplifier works between
$\SIrange{1}{2000}{\mega\hertz}$ and can perform a maximum amplification of
$\SI{32}{\decibel}$. It can output at most $\SI{10}{\decibel m}$,
and has a noise figure of approximately $\SI{2}{\decibel}$. Sinusoidals
of $f_m=\SI{1}{\hertz}$ and $f_m=\SI{10}{\hertz}$ are modulated at depths
of $\mu\in\{0.5,1.0\}$ on carrier frequencies $f_c$ from $\SI{100}{\mega\hertz}$
to $\SI{2.4}{\giga\hertz}$ at transmission powers $P$ between $\SI{-20}{\decibel m}$
and $\SI{10}{\decibel m}$. As can be seen in Figure~\ref{fig:app:amp},
the similarity is high across all frequencies, provided
the transmission power is above a minimum threshold.
The amplifier thus both reduces the power requirements for the adversary, and
increases the vulnerable frequencies to the $\si{\giga\hertz}$ range. This allows
an attacker to target systems with short wires between the ADC and the
sensor with a lower power budget: short wires are not a sufficient defense
against electromagnetic out-of-band signal injection attacks. Moreover, it should
be noted that an adversary gains an advantage by not obeying the amplifier
constraints: abusing the amplifier by transmitting higher-powered signals or
by driving frequency signals outside of the intended range still results in
recognizable output. In other words, although the signal may be distorted,
non-linearities produce outputs within the range of the ADC.
\secpar{ATmega328P + Amplifier + Antenna} The final set of experiments
changes the circuit-specific transfer function $H_C$ by using a transmitting antenna
at the signal generator output and a receiving antenna at the amplifier input.
The antennas used are Ettus Research omnidirectional VERT400 antennas, which are
resonant at $\SI{144}{\mega\hertz}$, $\SI{400}{\mega\hertz}$, and $\SI{1.2}{\giga\hertz}$.
The antennas are placed in parallel at a distance of $\SI{5}{\centi\meter}$
to one another, and the results for sine signals of $f_m=\SI{1}{\hertz}$ and
$f_m=\SI{10}{\hertz}$ are presented in Figure~\ref{fig:app:ant}.
Although the minimum power required for successful injections
is higher due to transmission losses, the system remains vulnerable
for all three frequencies due to the amplifier and ADC non-linearities.
In other words, results are reproducible across multiple setups,
whether through remote transmissions, or through direct injections with an
identity transfer function
$H_C(\sigma+j\omega)=\mathcal{L}\{\tilde{v}(t)\}/\mathcal{L}\{v(t)\}=1$.
\begin{figure}[!t]
\centering
\begin{subfigure}[!t]{0.49\textwidth}
\centering
\includegraphics[width=\textwidth]{app_adc_atmega328p_0_50_1_20000000}
\caption{$f_c=\SI{20}{\mega\hertz}$}
\end{subfigure}\hfill
\begin{subfigure}[!t]{0.49\textwidth}
\centering
\includegraphics[width=\textwidth]{app_adc_atmega328p_0_50_1_40000000}
\caption{$f_c=\SI{40}{\mega\hertz}$}
\end{subfigure}\hfill
\caption{ATmega328P-only output for power $P=\SI{0}{\decibel m}$, signal frequency $f_m=\SI{1}{\hertz}$,
and modulation depth $\mu=0.5$.}
\label{fig:app:atmega_full}
\end{figure}
\begin{figure}[!t]
\centering
\begin{subfigure}[!t]{0.49\textwidth}
\centering
\includegraphics[width=\textwidth]{app_adc_atmega328p_-5_100_1_1500000000_amp}
\caption{$f_c=\SI{1.5}{\giga\hertz}$}
\end{subfigure}\hfill
\begin{subfigure}[!t]{0.49\textwidth}
\centering
\includegraphics[width=\textwidth]{app_adc_atmega328p_-5_100_1_2400000000_amp}
\caption{$f_c=\SI{2.4}{\giga\hertz}$}
\end{subfigure}\hfill
\caption{ATmega328P with amplifier output for power $P=\SI{-5}{\decibel m}$, signal frequency $f_m=\SI{1}{\hertz}$,
and modulation depth $\mu=1.0$.}
\label{fig:app:atmega_amp}
\end{figure}
\begin{figure}[!t]
\centering
\begin{subfigure}[!t]{0.33\textwidth}
\centering
\includegraphics[width=\textwidth]{app_adc_atmega328p_0_50_1_144000000_amp_ant}
\caption{$f_c=\SI{144}{\mega\hertz}$}
\end{subfigure}\hfill
\begin{subfigure}[!t]{0.33\textwidth}
\centering
\includegraphics[width=\textwidth]{app_adc_atmega328p_0_50_1_400000000_amp_ant}
\caption{$f_c=\SI{400}{\mega\hertz}$}
\end{subfigure}\hfill
\begin{subfigure}[!t]{0.33\textwidth}
\centering
\includegraphics[width=\textwidth]{app_adc_atmega328p_0_50_1_1200000000_amp_ant}
\caption{$f_c=\SI{1.2}{\giga\hertz}$}
\end{subfigure}\hfill
\caption{ATmega328P with amplifier and antenna output for power $P=\SI{0}{\decibel m}$, signal frequency $f_m=\SI{1}{\hertz}$,
and modulation depth $\mu=0.5$.}
\label{fig:app:atmega_ant}
\end{figure}
Figures~\ref{fig:app:atmega_full}--\ref{fig:app:atmega_ant} show
example outputs from the internal ATmega328P ADC for different carrier frequencies $f_c$,
powers $P$, and modulation depths $\mu$, with $f_m$ fixed at $\SI{1}{\hertz}$.
Figure~\ref{fig:app:atmega_full} first shows the results for the ADC
on its own, and complements Figure~\ref{fig:atmega_raw} of Section~\ref{sec:adcs}.
Although harmonics of the fundamental persist, the high-frequency component
becomes less pronounced as $f_c$ increases.
Figure~\ref{fig:app:atmega_amp} then shows output from the ATmega328P for two different
carrier frequencies $f_c$ when connected to an amplifier. The ADC no longer behaves
like a low-pass filter due to non-linearities, while harmonics of the fundamental
remain strong. Finally, Figure~\ref{fig:app:atmega_ant} shows output from the ATmega328P
for remote injections using the VERT400 antenna with the amplifier. As in the amplifier case,
carrier frequencies in the $\si{\giga\hertz}$ range are still demodulated, and
harmonics (and some high-frequency components) persist.
\subsection{Further ADC Demodulation Examples}
\label{sec:app:others}
This section contains additional examples of injections into the different ADCs.
\secpar{TLC549} Figure~\ref{fig:app:tlc549_full} shows example outputs from the
TLC549 ADC for two carrier frequencies $f_c$. Harmonics of the fundamental
are not pronounced, as the resolution is only 8 bits.
\secpar{Artix~7} Figure~\ref{fig:app:artix7_full} shows example outputs from
the Artix~7 ADC for two carrier
frequencies $f_c$. The output contains high-frequency components which dominate
the target signal, forcing injections to require more fine-grained control over the
carrier frequency.
\secpar{AD7783} Figure~\ref{fig:app:ad7783_full} shows the output from the (slow)
$\Delta\Sigma$ AD7783 ADC for
different carrier frequencies and modulation depths. As $f_m=\SI{10}{\hertz}$
is above the Nyquist frequency, aliasing occurs. The strongest frequency present is
$2f_m-f_s=\SI{0.21}{\hertz}$, while the high-frequency component is $f_s-f_m=\SI{9.79}{\hertz}$.
\secpar{AD7822 \& AD7276} Figure~\ref{fig:app:ad7822_full} and Figure~\ref{fig:app:ad7276_full}
show example measurements for the AD7822 and the AD7276 ADCs respectively. As for
the Artix~7, high-frequency components dominate the output, and hence require
manual tuning to get a demodulated, low-frequency output.
\begin{figure}[!t]
\centering
\begin{subfigure}[!t]{0.49\textwidth}
\centering
\includegraphics[width=\textwidth]{app_adc_tlc549_5_50_1_20000000}
\caption{$f_c=\SI{20}{\mega\hertz}$}
\end{subfigure}\hfill
\begin{subfigure}[!t]{0.49\textwidth}
\centering
\includegraphics[width=\textwidth]{app_adc_tlc549_5_50_1_120000000}
\caption{$f_c=\SI{120}{\mega\hertz}$}
\end{subfigure}\hfill
\caption{TLC549 output for power $P=\SI{5}{\decibel m}$, signal frequency $f_m=\SI{1}{\hertz}$,
and depth $\mu=0.5$.}
\label{fig:app:tlc549_full}
\end{figure}
\begin{figure}[!t]
\centering
\begin{subfigure}[!t]{0.49\textwidth}
\centering
\includegraphics[width=\textwidth]{app_adc_artix7_10_50_1_80000000}
\caption{$f_c=\SI{80}{\mega\hertz}$}
\end{subfigure}\hfill
\begin{subfigure}[!t]{0.49\textwidth}
\centering
\includegraphics[width=\textwidth]{app_adc_artix7_10_50_1_100000000}
\caption{$f_c=\SI{100}{\mega\hertz}$}
\end{subfigure}\hfill
\caption{Artix~7 output for power $P=\SI{10}{\decibel m}$, signal frequency $f_m=\SI{1}{\hertz}$,
and depth $\mu=0.5$.}
\label{fig:app:artix7_full}
\end{figure}
\begin{figure}[!t]
\centering
\begin{subfigure}[!t]{0.49\textwidth}
\centering
\includegraphics[width=\textwidth]{app_adc_ad7783_5_50_10_40000000}
\caption{$f_c=\SI{40}{\mega\hertz}$, $\mu=0.5$}
\end{subfigure}\hfill
\begin{subfigure}[!t]{0.49\textwidth}
\centering
\includegraphics[width=\textwidth]{app_adc_ad7783_5_100_10_80000000}
\caption{$f_c=\SI{80}{\mega\hertz}$, $\mu=1.0$}
\end{subfigure}\hfill
\caption{AD7783 output for power $P=\SI{5}{\decibel m}$ and signal frequency $f_m=\SI{10}{\hertz}$.}
\label{fig:app:ad7783_full}
\end{figure}
\begin{figure}[!t]
\centering
\begin{subfigure}[!t]{0.49\textwidth}
\centering
\includegraphics[width=\textwidth]{app_adc_ad7822_-1_50_10_10000000}
\caption{AD7822: $f_c=\SI{10}{\mega\hertz}$}
\label{fig:app:ad7822_full}
\end{subfigure}\hfill
\begin{subfigure}[!t]{0.49\textwidth}
\centering
\includegraphics[width=\textwidth]{app_adc_ad7276_-1_50_10_40000000}
\caption{AD7276: $f_c=\SI{40}{\mega\hertz}$}
\label{fig:app:ad7276_full}
\end{subfigure}\hfill
\caption{AD7822~(\subref{fig:app:ad7822_full}) and AD7276~(\subref{fig:app:ad7276_full})
output for $P=\SI{-1}{\decibel m}$, $\mu=0.5$, and $f_m=\SI{10}{\hertz}$.}
\end{figure}
| {'timestamp': '2019-11-12T02:15:33', 'yymm': '1901', 'arxiv_id': '1901.03675', 'language': 'en', 'url': 'https://arxiv.org/abs/1901.03675'} | arxiv |
\section{Introduction}
\label{sec:Introduction}
With the rise of the different sensors, background initialization and background subtraction are widely employed in different computer vision applications based on video taken by fixed cameras. These applications involve a big variety of environments with different challenges and different kinds of moving foreground objects of interest. The most well-known and oldest applications are surely intelligent visual surveillance systems of human activities such as traffic surveillance of road, airport and maritime surveillance \cite{P7C1-6010}. But, detection of moving objects are also required for intelligent visual observation systems of animals and insects in order to study the behavior of the observed animals in their environment. However, it requires visual observation in natural environments such as forest, river, ocean and submarine environments with specific challenges. Other miscellaneous applications like optical motion capture, human-machine interaction system, vision-based hand gesture recognition, content-based video coding and background substitution also need in their first step either background initialization and background subtraction. Even if detection of moving objects is widely employed in these real application cases, no full survey can be found in literature that identifies, reviews and groups in one paper the current models and the challenges met in videos taken with fixed cameras for these applications. Furthermore, most of the research are done on large-scale datasets that often consist of videos which are taken in the aim of evaluation by researchers, and thus several challenging situations that appear in real cases are not covered. In addition, research focus on future directions with background subtraction methods with mathematical models, machine learning models, signal processing models and classification models: 1) statistical models \cite{P1C2-MOG-760}\cite{P1C2-MOG-769}\cite{P1C2-MOG-777}\cite{P1C2-MOG-778}, fuzzy models \cite{P2C2-10}\cite{P2C2-11} and Dempster-schafer models \cite{P7C1-10} for mathematical concepts; 2) subspace learning models either reconstructive \cite{P1C4-1}\cite{P1C4-23}\cite{P1C4-25}, discriminative \cite{P2C3-2}\cite{P2C3-3} and mixed \cite{P2C3-100}, robust subspace learning via matrix decomposition \cite{P3C1-PCP-940}\cite{P3C1-PCP-941}\cite{P3C1-PCP-942}\cite{P3C1-SO-14} or tensor decomposition \cite{P3C5-TRPCA-IT-1}\cite{P3C5-TRPCA-IT-3}\cite{P3C5-TRPCA-IT-3}), robust subspace tracking \cite{P3C1-PCP-1030}, support vector machines \cite{P1C3-1}\cite{P1C3-9}\cite{P1C3-101}\cite{P1C3-200}\cite{P1C3-201}, neural networks \cite{P1C5-410}\cite{P1C5-410-1}\cite{P1C5-412}\cite{P1C5-413}\cite{P1C5-414}, and deep learning \cite{P1C5-2100}\cite{P1C5-2110}\cite{P1C5-2150}\cite{P1C5-2162}\cite{P1C5-2163}\cite{P1C5-2163-1}, for machine learning concepts; 3) Wiener filter \cite{P6C2-Dataset-1}, Kalman filter \cite{P1C7-106}, correntropy filter \cite{P1C7-200}, and Chebychev filter \cite{P1C7-300} for signal processing models; and 4) clustering algorithms \cite{P1C6-1}\cite{P1C6-100}\cite{P1C6-193}\cite{P1C6-194}\cite{P1C6-300} for classification models. Statistical, fuzzy and Dempster-Schafer models allow to handle imprecision, uncertainty and incompleteness in the data due the different challenges while machine learning concepts allow to learn the background pixel representation in an supervised or unsupervised manner. Signal processing models allow to estimate the background value and the classification models attempts to classify pixels as background or foreground. But, in practice, most of the authors in real applications employed basic techniques (temporal median \cite{P1C1-Median-21}\cite{P1C1-Median-40}\cite{P1C1-Median-60}, temporal histogram \cite{P1C1-Histogram-1}\cite{P1C1-Histogram-2}\cite{P1C1-Histogram-10}\cite{P1C1-Histogram-22-1}\cite{P1C1-Histogram-50} and filter \cite{P1C7-101}\cite{P1C7-102}\cite{P1C7-105}\cite{P1C7-106}\cite{P1C7-300}) and relative old techniques like MOG \cite{P1C2-MOG-10} published in 1999, codebook \cite{P1C6-100} in 2004 and ViBe \cite{P2C1-200} in 2009. This fact is due to two main reasons: 1) most of the time the recent advances can not be currently employed in real application cases due their time and memory requirements, and 2) there is also an ignorance in the communities of traffic surveillance and animals surveillance about the recent background subtraction methods with direct real-time ability with low computation and memory requirements.
To address the previous mentioned issues, we first attempt in this review to survey most of the real applications that used background initialization and subtraction in their process by classifying them in terms of aims, environments and objects of interests. We reviewed only the publications that specifically address the problem of background subtraction in real applications with experiments on corresponding videos. To have an overview about the fundamental research in this field, the reader can refer to numerous surveys on background initialization \cite{P0C0-Survey-30}\cite{P0C0-Survey-31}\cite{P0C0-Survey-32}\cite{P0C0-Survey-33} and background subtraction methods \cite{P0C0-Survey-10}\cite{P0C0-Survey-11}\cite{P0C0-Survey-12}\cite{P0C0-Survey-20}\cite{P0C0-Survey-21}\cite{P0C0-Survey-22}\cite{P0C0-Survey-23}\cite{P0C0-Survey-24}\cite{P0C0-Survey-25}. Furthermore, we also highlight recent background subtraction models that can be directly used in real applications. Finally, this paper is intended for researchers and engineers in the field of computer vision (i.e visual surveillance of human activities), and biologist/ethologist (i.e visual surveillance of animals and insects).
The rest of this paper is as follows. First, we provide in Section \ref{Overview} a short reminder on the different key points in background subtraction for novices. In Section \ref{P0C2-sec:Applications}, we provide a preliminary overview of the different real application cases in which background initialization and background subtraction are required. In Section \ref{P0C2:sec:IVS}, we review the background models and the challenges met in current intelligent visual surveillance systems of human activities such as road, airport and maritime surveillance. In Section \ref{P0C2:sec:AIB}, intelligent visual observation systems for animals and insects are reviewed in terms of the challenges related to the behavior of the observed animals and its environment. Then, in Section \ref{P0C2:sec:IVO}, we specifically investigate the challenges met in visual observation of natural environments such as forest, river, ocean and submarine environments. In Section \ref{P0C2:sec:OMA}, we survey other miscellaneous applications like optical motion capture, human-machine interaction system, vision-based hand gesture recognition, content-based video coding and background substitution. In Section \ref{Challenges}, we provide a discussion identifying the solved and unsolved challenges in these different application cases as well as proposing prospective solutions to address them. Finally, in Section \ref{Conclusion}, concluding remarks are given.
\section{Background Subtraction: A Short Overview}
\label{Overview}
In this section, we remain briefly the aim of background subtraction for segmentation of static and moving foreground objects from a video stream. This task is the fundamental step in many visual surveillance applications for which background subtraction offers a suitable solution which provide a good compromise in terms of quality of detection and computation time. The different steps of background subtraction methods as follows:
\begin{enumerate}
\item \textbf{Background initialization} (also called \textit{background generation}, \textit{background extraction} and \textit{background reconstruction}) consists in computing the first background image.
\item \textbf{Background Modeling} (also called \textit{Background Representation}) describes the model use to represent the background.
\item \textbf{Background Maintenance} concerns the mechanism of update for the model to adapt itself to the changes which appear over time.
\item \textbf{Classification of pixels in background/moving objects} (also called \textit{Foreground Detection}) consists in classifying pixels in the class "background" or the class "moving objects".
\end{enumerate}
These different steps employ methods which have different aims and constraints. Thus, they need algorithms with different features. Background initialization requires \textit{"off-line"} algorithms which are \textit{"batch"} by taking all the data at one time. On the other hand, background maintenance needs \textit{"on-line"} algorithms which are \textit{"incremental"} algorithms by taking the incoming data one by one. Background initialization, modeling and maintenance require reconstructive algorithms while foreground detection needs discriminative algorithms. \\
A background subtraction process includes the following stages: \textbf{(1)} the background initialization module provides the first background image from $N$ training frames, \textbf{(2)} Foreground detection that
consists in classifying pixels as foreground or background, is achieved by comparing the background image and the current image.
\textbf{(3)} Background maintenance module updates the background image by using the previous background, the current image and the foreground detection mask. The steps \textbf{(2)} and \textbf{(3)} are executed repeatedly as time progresses. It is important to see that two images are compared and that for it, the methods compare a sub-entity of the entity background image with its corresponding sub-entity in the current image. This sub-entity can be of the size of a pixel, a region or a cluster. Furthermore, this sub-entity is characterized by a \textit{"feature"} which can be a color feature, edge feature, texture feature, stereo feature or motion feature \cite{P0C0-Survey-26}. Developing a background subtraction method, researchers and engineers must design each step and choose the features in relation to the challenges they want to handle in the concerned applications.
\section{A Preliminary Overview}
\label{P0C2-sec:Applications}
In real application cases, either background initialization and background subtraction are required in video taken by a static camera to generate a clean background image of the filmed scene or to detect static or moving foreground objects.
\subsection{Background Initialization based Applications}
Background initialization provides a a clean background from video sequence, and thus it is required for several applications as developed in Bouwmans et al. \cite{P0C0-Survey-32}:
\begin{enumerate}
\item \textbf{Video inpainting:} Video inpainting (also called video completion) tries to fill-in user defined spatio-temporal holes in a video sequence using information extracted in the existent spatio-temporal volume, according to consistency criteria evaluated both in time and space as in Colombari et al. \cite{P4C1-9}.
\item \textbf{Privacy protection:} Privacy protection for videos aims to avoid the infringement on the privacy right of people taken in the many videos uploaded to video sharing services, that may contain privacy sensitive information of the people as in Nakashima et al. \cite{P0C0-A-950}.
\item \textbf{Computational photography:} It concerns the case where the user wants to obtain a clean background plate from a set of input images containing cluttering foreground objects.
\end{enumerate}
These real application cases only need a clean background without detection of moving object. As the reader can found surveys for these applications in literature, we do not review them in this paper.
\subsection{Background Subtraction based Applications}
Segmentation of static and moving foreground objects from a video stream is the fundamental step in many computer vision applications for which background subtraction offers a suitable solution which provide a good compromise in terms of quality of detection and computation time.
\begin{enumerate}
\item \textbf{Visual Surveillance of Human Activities:} The aim is to identify and track objects of interests in several environments. The most frequent environments are traffic scenes (also called road or highway scenes) for their analysis in order to detect incidents such as stopped vehicles on highways \cite{P0C0-A-9-31}\cite{P0C0-A-9-31-1}\cite{P0C0-A-9-32}\cite{P0C0-A-9-33} or to traffic density estimation on highways which can be then categorized as empty, fluid, heavy and jam. Thus, it is needed to detect and track vehicles \cite{P0C0-A-9-1}\cite{P0C0-A-9-30} or to count the number of vehicles \cite{P0C0-A-9-50}. Background subtraction can be also used for congestion detection \cite{P0C0-A-14}\cite{P0C0-A-7} in urban traffic surveillance, for illegal parking detection
\cite{P0C0-A-9-70}\cite{P0C0-A-9-71}\cite{P0C0-A-9-72}\cite{P0C0-A-9-73}\cite{P0C0-A-9-74} and for the detection of free parking places \cite{P0C0-A-9-75}\cite{P0C0-A-9-76}\cite{P0C0-A-9-77}. It is also important for security in train stations and airports, where unattended luggage can be a main goal. Human activities can be also monitored in maritime scenes to count the number of ships which circulated in a marina or in a harbor \cite{P7C1-3000}\cite{P7C1-3001}\cite{P7C1-3002}\cite{P7C1-3010}, and to detect and track ships in fluvial canals. Other environments are store scenes for the detection and tracking of consumers \cite{P0C0-A-30}\cite{P0C0-A-31}\cite{P0C0-A-32}\cite{P0C0-A-33}.
\item \textbf{Visual Observation of Animals and Insects Behaviors:} The system required for intelligent visual observation of animals and insects need to be simple and non-invasive. In this context, a video-based system is suitable to detect and track animals and insects in order to analyze their behavior which is needed \textbf{(1)} to evaluate their interaction inside their group such as in the case of honeybees which are social insects and interact extensively with their mates \cite{P0C0-A-70} and in the case of mice \cite{P3C1-RMC-91}\cite{P3C1-RMC-92}; \textbf{(2)} to have a fine-scale analysis of the interaction of the animals with their environment (plants,etc...) such as in the case of birds in order to have information about the impact of climate change on the ecosystem \cite{P0C0-A-50}\cite{P0C0-A-51}\cite{P0C0-A-56}\cite{P0C0-A-57}; \textbf{(3)} to study the behavior of animals in different weather conditions such as in the case of fish in presence of typhoons, storms or sea currents for the Fish4Knowledge (F4K\protect\footnotemark[1]) \cite{P0C0-A-60}\cite{P0C0-A-61}\cite{P0C0-A-62}\cite{P0C0-A-63}; \textbf{(4)} for census of either endangered or threatened species like various species of fox, jaguar, mountain beaver, and wolf \cite{P7C1-2000}\cite{P7C1-2001}. In this case, the location and movements of these animals must be acquired, recorded, and made available for review; \textbf{(5)} for livestock and pigs \cite{P0C0-A-77} surveillance in farms; and \textbf{(6)} to design robots that mimics an animal’s locomotion such as in Iwatani et al. \cite{P0C0-A-760}. Detection of animals and insects also allows researchers in biology, ethology and green development to evaluate the impact of the considered animals or insects in the ecosystem, and to protect them such as honeybees that have crucial role in pollination across the world.
\item \textbf{Visual Observation of Natural Environments:} The aim is to detect foreign objects in natural environments such as forest, ocean and river to protect the biodiversity in terms of fauna and flora. For example, foreign objects in river and ocean can be floating bottles \cite{P1C7-104}, floating wood \cite{P0C0-A-90} \cite{P0C0-A-91} or mines \cite{P0C0-A-29}.
\item \textbf{Visual Analysis of Human Activities:} Background subtraction is also used in sport \textbf{(1)} when important decisions need to be made quickly as in soccer and in tennis with "Hawk-Eye\protect\footnotemark[2]". It has become a key part of the game; \textbf{(2)} for precise analysis of athletic performance, since it has no physical effect on the athlete as in Tamas et al. \cite{P0C0-A-500} for rowing motion and in John et al. \cite{P0C0-A-502} for aerobic routines; and \textbf{(3)} for surveillance as in Bastos \cite{P0C0-A-501} for surfers activities.
\item \textbf{Visual Hull Computation:} Visual hull is used for image synthesis to obtain an approximated geometric model of an object which can be static or not. In the first case, it allows a realistic model by provided an image-based model of objects. In the second case, it allows an image-based model of human which can be used for optical motion capture. Practically, visual hull is a geometric entity obtained with shape-from-silhouette 3D reconstruction technique introduced by Laurentini \cite{P0C0-A-400}. First, it uses background subtraction to separate the foreground object from the background to obtain the foreground mask known as a silhouette which is then considered as the 2D projection of the corresponding 3D foreground object. Based on the camera viewing parameters, the silhouette extracted in each view defines a back-projected generalized cone that contains the actual object. This cone is called a silhouette cone. The intersection of all the cones is called a visual hull, which is a bounding geometry of the actual 3D object. In practice, visual hull computation is employed for the following tasks:
\begin{itemize}
\item \textbf{Image-based Modeling:} Traditional modeling in image synthesis is made by a modeler but traditional modeling present several disadvantages: \textbf{(1)} it is a complex task and it requires time, \textbf{(2)} real data of objects are often not known, \textbf{(3)} specifying a practical scene is tedious, and \textbf{(4)} it presents lack of realism. To address this problem, visual hull is used to extract the model of an object from different images.
\item \textbf{Optical Motion Capture:} Optical motion capture systems are used \textbf{(1)} to give a character life and personality, and \textbf{(2)} to allow interactions between the real world and virtual world as in games or virtual reality. In the first application, an actor is filmed on up to $200$ cameras which monitor his movements precisely. Then, by using background subtraction, these movements are extracted and translated onto the character. In the second application, the gamer is filmed by a conventional camera or a RGB-D camera such as Microsoft's Kinect. His movements are tracked to interact with virtual objects.
\end{itemize}
\item \textbf{Human-Machine Interaction (HMI):} In several applications, it requires human-machine interaction such as in arts \cite{P0C0-A-360}, games and ludo-applications \cite{P0C0-A-200}\cite{P0C0-A-201}\cite{P0C0-A-202}. In the case of games, the gamer can observe his own image or silhouette composed into a virtual scene as in PlayStation Eye-Toy. In the case of ludo-multimedia applications, several ones concern the detection of a selected moving object in a video by an user as in the project Aqu@theque \cite{P0C0-A-200}\cite{P0C0-A-201}\cite{P0C0-A-202} which requires to detect the selected fish in video and to recognize it in terms of species.
\item \textbf{Vision-based Hand Gesture Recognition:} This application requires to detect, track and recognize hand gesture for several applications such as human-computer interface, behavior studies, sign language interpretation and learning, teleconferencing, distance learning, robotics, games selection and object manipulation in virtual environments.
\item \textbf{Content-based Video Coding:} In video coding for transmission such as in teleconferencing, digital movies and video phones, only the key frames are transmitted with the moving objects. For example, the MPEG-4 multimedia communication standard enables the content-based functionality by using the video object plane (VOP) as the basic coding element. Each VOP includes the shape and texture information of a semantically meaningful object in the scene. New functionality like object manipulation and scene composition can be achieved because the video bit stream contains the object shape information. Thus, background subtraction can be used in content-based video coding.
\item \textbf{Background Substitution:} The aim of background substitution (also called background cut and video matting) is to extract the foreground from the input video and then combine it with a new background. Thus, background subtraction can be used in the first step as in Huang et al. \cite{P0C0-A-350}.
\item \textbf{Miscellaneous applications:} Other applications used background subtraction such as carried baggage detection as in Tzanidou \cite{P0C0-A-600}, fire detection as in Toreyin et al. \cite{P0C0-A-700}, and OLED defect detection as in Wang et al. \cite{P0C0-A-900}.
\end{enumerate}
All these applications require the detection of moving objects in their first step, and possess their own characteristics in terms of challenges due to the location of the camera, the environment and the type of the moving objects. Background subtraction can be applied with one view or a multi-view as in Diaz et al. \cite{P0C2-6003}. In addition, background subtraction can be also used in applications in which cameras are slowly moving \cite{P0C2-6000}\cite{P0C2-6001}\cite{P0C2-6005}. For example, Taneja et al. \cite{P0C2-6004} proposed to model dynamic scenes recorded with freely moving cameras. Extensions of background subtraction to moving cameras are presented in Yazdi and Bouwmans \cite{P0C3-700}. But, real applications with moving camera is out of the scope of this review as we limited this paper to applications with fixed camera. Table \ref{P0C2:Applications-1}, Table \ref{P0C2:Applications-2}, Table \ref{P0C2:Applications-3}, Table \ref{P0C2:Applications-4} and Table \ref{P0C2:Applications-5} show an overview of the different applications, the corresponding types of moving objects of interest, and specific characteristics.
\footnotetext[1]{http://groups.inf.ed.ac.uk/f4k/}
\footnotetext[2]{http://www.hawkeyeinnovations.co.uk/}
\begin{table}
\scalebox{0.79}{
\begin{tabular}{|l|l|l|}
\hline
\scriptsize{Sub-categories-Aims} &\scriptsize{Objects of interest-Scenes} &\scriptsize{Authors-Dates} \\
\hline
\hline
\scriptsize{\textbf{1) Road Surveillance}} &\scriptsize{\textbf{1-Cars}} & \scriptsize{} \\
\cline{2-3}
\scriptsize{\textbf{1.1) Vehicles Detection}} &\scriptsize{} & \scriptsize{} \\
\scriptsize{Vehicles Detection} &\scriptsize{Road Traffic} & \scriptsize{Zheng et al. (2006) \cite{P0C0-A-1}} \\
\scriptsize{Vehicles Detection} &\scriptsize{Urban Traffic (Korea)} & \scriptsize{Hwang et al. (2009) \cite{P0C0-A-9-48}} \\
\scriptsize{Vehicles Detection} &\scriptsize{Highways Traffic (ATON Project)} & \scriptsize{Wang and Song (2011) \cite{P0C0-A-9-46}} \\
\scriptsize{Vehicles Detection} &\scriptsize{Aerial Videos (USA)} & \scriptsize{Reilly et al. (2012) \cite{P0C0-A-9-79-13}} \\
\scriptsize{Vehicles Detection} &\scriptsize{Intersection (CPS) (China)} & \scriptsize{Ding et al. (2012) \cite{P0C0-A-9-44}} \\
\scriptsize{Vehicles Detection} &\scriptsize{Intersection (USA)} & \scriptsize{Hao et al. (2013) \cite{P0C0-A-9-45}} \\
\scriptsize{Vehicles Detection} &\scriptsize{Intersection (Spain)} & \scriptsize{Milla et al. (2013) \cite{P0C0-A-9-79-3}} \\
\scriptsize{Vehicles Detection} &\scriptsize{Aerial Videos (VIVID Dataset \cite{P0C0-A-4-1})} &\scriptsize{Teutsch et al. (2014) \cite{P0C0-A-4}} \\
\scriptsize{Vehicles Detection} &\scriptsize{Road Traffic (CCTV cameras)(Korea)} & \scriptsize{Lee et al. (2014) \cite{P0C0-A-9-42}} \\
\scriptsize{Vehicles Detection} &\scriptsize{CD.net Dataset 2012 \cite{P6C2-Dataset-1000}} &\scriptsize{Hadi et al. (2014) \cite{P0C0-A-9}} \\
\scriptsize{Vehicles Detection} &\scriptsize{Northern Jutland (Danemark)} &\scriptsize{Alldieck (2015) \cite{P0C0-A-9-79-12}} \\
\scriptsize{Vehicles Detection} &\scriptsize{Road Traffic (Weather) (Croatia)} &\scriptsize{Vujovic et al. (2014) \cite{P7C1-9001}} \\
\scriptsize{Vehicles Detection} &\scriptsize{Road Traffic (Night) (Hungary)} &\scriptsize{Lipovac et al. (2014) \cite{P7C1-9003}} \\
\scriptsize{Vehicles Detection} &\scriptsize{CD.net Dataset 2012 \cite{P6C2-Dataset-1000}} &\scriptsize{Aqel et al. (2015) \cite{P0C0-A-9-20}} \\
\scriptsize{Vehicles Detection} &\scriptsize{CD.net Dataset 2012 \cite{P6C2-Dataset-1000}} &\scriptsize{Aqel et al. (2016) \cite{P0C0-A-9-21}} \\
\scriptsize{Vehicles Detection} &\scriptsize{CD.net Dataset 2012 \cite{P6C2-Dataset-1000}} & \scriptsize{Wang et al. (2016) \cite{P0C0-A-6}} \\
\scriptsize{Vehicles Detection} &\scriptsize{Urban Traffic (China)} & \scriptsize{Zhang et al. (2016) \cite{P0C0-A-5}} \\
\scriptsize{Vehicles Detection} &\scriptsize{CCTV cameras (India)} & \scriptsize{Hargude and Idate (2016) \cite{P0C0-A-9-40}} \\
\scriptsize{Vehicles Detection} &\scriptsize{Intersection (USA)} & \scriptsize{Li et al. (2016) \cite{P0C0-A-9-47}} \\
\scriptsize{Vehicles Detection} &\scriptsize{Dhaka city (Bangladesh)} &\scriptsize{Hadiuzzaman et al. (2017) \cite{P0C0-A-9-79-20}} \\
\scriptsize{Vehicles Detection} &\scriptsize{Road Traffic (Weather) (Madrid/Tehran)} &\scriptsize{Ershadi et al. (2018) \cite{P7C1-9002}} \\
\cline{2-3}
\scriptsize{\textbf{1.2) Vehicles Detection/Tracking}} &\scriptsize{} & \scriptsize{} \\
\scriptsize{Vehicles Detection/Tracking} &\scriptsize{Urban Traffic/Highways Traffic (Portugal)} &\scriptsize{Batista et al. (2008) \cite{P0C0-A-9-30}} \\
\scriptsize{Vehicles Detection/Tracking} &\scriptsize{Intersection (China)} &\scriptsize{Qu et al. (2010) \cite{P1C2-MOG-514}} \\
\scriptsize{Vehicles Detection/Tracking} &\scriptsize{Downtown Traffic (Night) (China)} &\scriptsize{Tian et al. (2013) \cite{P7C1-9005}} \\
\scriptsize{Vehicles Detection/Tracking} &\scriptsize{Urban Traffic (China)} &\scriptsize{Ling et al. (2014) \cite{P0C0-A-3}} \\
\scriptsize{Vehicles Detection/Tracking} &\scriptsize{Highways Traffic (India)} &\scriptsize{Sawalakhe and Metkar (2015) \cite{P0C0-A-9-43}} \\
\scriptsize{Vehicles Detection/Tracking} &\scriptsize{Highways Traffic (India)} &\scriptsize{Dey and Praveen (2016) \cite{P0C0-A-9-41}} \\
\scriptsize{Multi-Vehicles Detection/Tracking} &\scriptsize{CD.net Dataset 2012 \cite{P6C2-Dataset-1000}} &\scriptsize{Hadi et al. (2016) \cite{P0C0-A-9-1}} \\
\scriptsize{Vehicles Tracking} &\scriptsize{NYCDOT video/NGSIM US-101 highway dataset(USA)} & \scriptsize{Li et al. (2016) \cite{P0C0-A-9-44-1}} \\
\cline{2-3}
\scriptsize{\textbf{1.3) Vehicles Counting}} &\scriptsize{} & \scriptsize{} \\
\scriptsize{Vehicles Counting/Classification} &\scriptsize{Donostia-San Sebastian (Spain)} & \scriptsize{Unzueta et al. (2012) \cite{P0C0-A-2}} \\
\scriptsize{Vehicles Detection/Counting} &\scriptsize{Road (Portugal)} &\scriptsize{Toropov et al. (2015) \cite{P0C0-A-9-79-1}} \\
\scriptsize{Vehicles Counting} &\scriptsize{Lankershim Boulevard dataset (USA)} &\scriptsize{Quesada and Rodriguez (2016) \cite{P3C1-PCP-1066}} \\
\cline{2-3}
\scriptsize{\textbf{1.4) Stopped Vehicles}} &\scriptsize{} & \scriptsize{} \\
\scriptsize{Stopped Vehicles} &\scriptsize{Portuguese Highways Traffic (24/7)} &\scriptsize{Monteiro et al. (2008) \cite{P0C0-A-9-31}} \\
\scriptsize{Stopped Vehicles} &\scriptsize{Portuguese Highways Traffic (24/7)} &\scriptsize{Monteiro et al. (2008) \cite{P0C0-A-9-31-1}} \\
\scriptsize{Stopped Vehicles} &\scriptsize{Portuguese Highways Traffic (24/7)} &\scriptsize{Monteiro et al. (2008) \cite{P0C0-A-9-32}} \\
\scriptsize{Stopped Vehicles} &\scriptsize{Portuguese Highways Traffic (24/7)} &\scriptsize{Monteiro (2009) \cite{P0C0-A-9-33}} \\
\cline{2-3}
\scriptsize{\textbf{1.5) Congestion Detection}} &\scriptsize{} & \scriptsize{} \\
\cline{2-3}
\scriptsize{} &\scriptsize{\textbf{1-Cars}} &\scriptsize{} \\
\scriptsize{Congestion Detection} &\scriptsize{Aerial Videos} & \scriptsize{Lin et al. (2009) \cite{P0C0-A-14}} \\
\scriptsize{Free-Flow/Congestion Detection} &\scriptsize{Urban Traffic (India)} &\scriptsize{Muniruzzaman et al. (2016) \cite{P0C0-A-7}} \\
\cline{2-3}
\scriptsize{} &\scriptsize{\textbf{2-Motorcycles (Motorbikes)}} &\scriptsize{} \\
\scriptsize{Helmet Detection} &\scriptsize{Public Roads (Brazil)} &\scriptsize{Silva et al. (2013) \cite{P0C0-A-9-49-1}} \\
\scriptsize{Helmet Detection} &\scriptsize{Naresuan University Campus (Thailand)} &\scriptsize{Waranusast et al. (2013) \cite{P0C0-A-9-49-1}} \\
\scriptsize{Helmet Detection} &\scriptsize{Indian Institute of Technology Hyderabad (India)} &\scriptsize{Dahiya et al. (2016) \cite{P0C0-A-9-49}} \\
\cline{2-3}
\scriptsize{} &\scriptsize{\textbf{3-Pedestrians}} &\scriptsize{} \\
\scriptsize{Pedestrian Abnormal Behavior} &\scriptsize{Public Roads (China)} &\scriptsize{Jiang et al. (2015) \cite{P0C0-A-9-79-5}} \\
\hline
\end{tabular}}
\caption{Intelligent Visual Surveillance of Human Activities: An Overview (Part I)} \centering
\label{P0C2:Applications-1}
\end{table}
\begin{table}
\scalebox{0.79}{
\begin{tabular}{|l|l|l|}
\hline
\scriptsize{Categories-Aims} &\scriptsize{Objects of interest-Scenes} &\scriptsize{Authors-Dates} \\
\hline
\hline
\scriptsize{\textbf{Airport Surveillance}} &\scriptsize{\textbf{1-Airplane}} & \scriptsize{} \\
\scriptsize{AVITRACK Project (European)} &\scriptsize{Airport’s Apron} & \scriptsize{Blauensteiner and Kampel (2004) \cite{P0C0-A-10}} \\
\scriptsize{AVITRACK Project (European)} &\scriptsize{Airport’s Apron} & \scriptsize{Aguilera (2005) \cite{P0C0-A-11}} \\
\scriptsize{AVITRACK Project (European)} &\scriptsize{Airport’s Apron} & \scriptsize{Thirde (2006) \cite{P0C0-A-12}} \\
\scriptsize{AVITRACK Project (European)} &\scriptsize{Airport’s Apron} & \scriptsize{Aguilera (2006) \cite{P0C0-A-13}} \\
\cline{2-3}
\scriptsize{} &\scriptsize{\textbf{2-Ground Vehicles (Fueling vehicles/Baggage cars)}} & \scriptsize{} \\
\scriptsize{AVITRACK Project (European)} &\scriptsize{Airport’s Apron} & \scriptsize{Blauensteiner and Kampel (2004) \cite{P0C0-A-10}} \\
\scriptsize{AVITRACK Project (European)} &\scriptsize{Airport’s Apron} & \scriptsize{Aguilera (2005) \cite{P0C0-A-11}} \\
\scriptsize{AVITRACK Project (European)} &\scriptsize{Airport’s Apron} & \scriptsize{Thirde (2006) \cite{P0C0-A-12}} \\
\scriptsize{AVITRACK Project (European)} &\scriptsize{Airport’s Apron} & \scriptsize{Aguilera (2006) \cite{P0C0-A-13}} \\
\cline{2-3}
\scriptsize{} &\scriptsize{\textbf{3-People (Workers)}}& \scriptsize{} \\
\scriptsize{AVITRACK Project (European)} &\scriptsize{Airport’s Apron} & \scriptsize{Blauensteiner and Kampel (2004) \cite{P0C0-A-10}} \\
\scriptsize{AVITRACK Project (European)} &\scriptsize{Airport’s Apron} & \scriptsize{Aguilera (2005) \cite{P0C0-A-11}} \\
\scriptsize{AVITRACK Project (European)} &\scriptsize{Airport’s Apron} & \scriptsize{Thirde (2006) \cite{P0C0-A-12}} \\
\scriptsize{AVITRACK Project (European)} &\scriptsize{Airport’s Apron} & \scriptsize{Aguilera (2006) \cite{P0C0-A-13}} \\
\cline{1-3}
\scriptsize{\textbf{Maritime Surveillance}} &\scriptsize{\textbf{1-Cargos}} & \scriptsize{} \\
\scriptsize{} &\scriptsize{Ocean at Miami (USA)} & \scriptsize{Culibrk et al. (2006) \cite{P1C5-70}} \\
\scriptsize{} &\scriptsize{Harbor Scenes (Ireland)} & \scriptsize{Zhang et al. (2012) \cite{P0C0-A-29-72}} \\
\cline{2-3}
\scriptsize{} &\scriptsize{\textbf{2-Boats}} & \scriptsize{} \\
\scriptsize{Stationary Camera} &\scriptsize{Miami Canals (USA)} & \scriptsize{Socek et al. (2005) \cite{P0C0-A-29-1}} \\
\scriptsize{Dock Inspecting Event} &\scriptsize{Harbor Scenes (China)} & \scriptsize{Ju et al. (2008) \cite{P1C2-MOG-313}} \\
\scriptsize{Different Kinds of Targets} &\scriptsize{Baichay Beach (Vietnam)} & \scriptsize{Tran and Le (2016) \cite{P0C0-A-26}} \\
\scriptsize{Salient Events (Coastal environments)} &\scriptsize{Nantucket Island (USA)} & \scriptsize{Cullen et al. (2012) \cite{P0C0-A-27}} \\
\scriptsize{Salient Events (Coastal environments)} &\scriptsize{Nantucket Island (USA)} & \scriptsize{Cullen (2012) \cite{P0C0-A-28}} \\
\scriptsize{Boat ramps surveillance} &\scriptsize{Boat ramps (New Zealand)} & \scriptsize{Pang et al. (2016) \cite{P7C1-9000}} \\
\cline{2-3}
\scriptsize{} &\scriptsize{\textbf{3-Sailboats}} &\scriptsize{} \\
\scriptsize{Sailboats Detection} &\scriptsize{UCSD Background Subtraction Dataset} & \scriptsize{Sobral et al. (2015) \cite{P3C1-PCP-917}} \\
\cline{2-3}
\scriptsize{} &\scriptsize{\textbf{4-Ships}} &\scriptsize{} \\
\scriptsize{} &\scriptsize{Italy} & \scriptsize{Bloisi et al. (2014) \cite{P0C0-A-20}} \\
\scriptsize{} &\scriptsize{Fixed ship-borne camera (China) (IR)} & \scriptsize{Liu et al. (2014) \cite{P0C0-A-21}} \\
\scriptsize{Different Kinds of Targets} &\scriptsize{Ocean (South Africa)} & \scriptsize{Szpak and Tapamo (2011) \cite{P0C0-A-29-4}}\\
\scriptsize{Cage Aquaculture} &\scriptsize{Ocean (Taiwan)} & \scriptsize{Hu et al. (2011) \cite{P0C0-A-29-5}} \\
\scriptsize{} &\scriptsize{Ocean (Korea)} & \scriptsize{Arshad et al. (2010) \cite{P0C0-A-29-6}} \\
\scriptsize{} &\scriptsize{Ocean (Korea)} & \scriptsize{Arshad et al. (2011) \cite{P0C0-A-29-61}} \\
\scriptsize{} &\scriptsize{Ocean (Korea)} & \scriptsize{Arshad et al. (2014) \cite{P0C0-A-29-62}} \\
\scriptsize{} &\scriptsize{Ocean (Korea)} & \scriptsize{Saghafi et al. (2012) \cite{P0C0-A-29-7}} \\
\scriptsize{Overloaded Ship Identification} &\scriptsize{Ocean (China)} & \scriptsize{Xie et al. (2012) \cite{P0C0-A-29-71}} \\
\scriptsize{Ship-Bridge Collision} &\scriptsize{Wuhan Yangtze River (China)} & \scriptsize{Zheng et al. (2013) \cite{P0C0-A-29-73}} \\
\scriptsize{} &\scriptsize{Wuhan Yangtze River (China)} & \scriptsize{Mei et al. (2017) \cite{P3C4-DGS-16}} \\
\cline{2-3}
\scriptsize{} & \scriptsize{\textbf{5-Motor Vehicles}} &\scriptsize{} \\
\scriptsize{Salient Events (Coastal environments)} &\scriptsize{Nantucket Island (USA)} & \scriptsize{Cullen et al. (2012) \cite{P0C0-A-27}} \\
\scriptsize{Salient Events (Coastal environments)} &\scriptsize{Nantucket Island (USA)} & \scriptsize{Cullen (2012) \cite{P0C0-A-28}} \\
\cline{2-3}
\scriptsize{} &\scriptsize{\textbf{6-People (Shoreline)}} & \scriptsize{} \\
\scriptsize{Salient Events (Coastal environments)} &\scriptsize{Nantucket Island (USA)} & \scriptsize{Cullen et al. (2012) \cite{P0C0-A-27}} \\
\scriptsize{Salient Events (Coastal environments)} &\scriptsize{Nantucket Island (USA)} & \scriptsize{Cullen (2012) \cite{P0C0-A-28}} \\
\cline{2-3}
\scriptsize{} &\scriptsize{\textbf{7-Floating Objects}} & \scriptsize{} \\
\scriptsize{Detection of Drifting Mines} &\scriptsize{Floating Test Targets (IR)} & \scriptsize{Borghgraef et al. (2010) \cite{P0C0-A-29}} \\
\cline{1-3}
\scriptsize{\textbf{Store Surveillance}} &\scriptsize{\textbf{People}} & \scriptsize{} \\
\scriptsize{Apparel Retail Store} &\scriptsize{Panoramic Camera} & \scriptsize{Leykin and Tuceryan (2005) \cite{P0C0-A-31}} \\
\scriptsize{Apparel Retail Store} &\scriptsize{Panoramic Camera} & \scriptsize{Leykin and Tuceryan (2005) \cite{P0C0-A-32}} \\
\scriptsize{Apparel Retail Store} &\scriptsize{Panoramic Camera} & \scriptsize{Leykin and Tuceryan (2007) \cite{P0C0-A-30}} \\
\scriptsize{Retail Store Statistics} &\scriptsize{Top View Camera} & \scriptsize{Avinash et al. (2012) \cite{P0C0-A-33}} \\
\hline
\end{tabular}}
\caption{Intelligent Visual Surveillance of Human Activities: An Overview (Part II)} \centering
\label{P0C2:Applications-2}
\end{table}
\begin{table}
\scalebox{0.70}{
\begin{tabular}{|l|l|l|}
\hline
\scriptsize{Categories-Aims} &\scriptsize{Objects of interest-Scenes} &\scriptsize{Authors-Dates} \\
\hline
\hline
\scriptsize{\textbf{Birds Surveillance}} &\scriptsize{\textbf{Birds}} & \scriptsize{} \\
\scriptsize{Feeder Stations in natural habitats} &\scriptsize{Feeder Station Webcam/Camcorder Datasets} & \scriptsize{Ko et al. (2008) \cite{P0C0-A-50}} \\
\scriptsize{Feeder Stations in natural habitats} &\scriptsize{Feeder Station Webcam/Camcorder Datasets} & \scriptsize{Ko et al. (2010) \cite{P0C0-A-51}} \\
\scriptsize{Seabirds} &\scriptsize{Cliff Face Nesting Sites} & \scriptsize{Dickinson et al. (2008) \cite{P0C0-A-56}} \\
\scriptsize{Seabirds} &\scriptsize{Cliff Face Nesting Sites} & \scriptsize{Dickinson et al. (2010) \cite{P0C0-A-57}} \\
\scriptsize{Observation in the air} &\scriptsize{Lakes in Northern Alberta (Canada)} & \scriptsize{Shakeri and Zhang (2012) \cite{P0C0-A-55}} \\
\scriptsize{Wildlife@Home} &\scriptsize{Natural Nesting Stations} & \scriptsize{Goehner et al. (2015) \cite{P0C0-A-79}} \\
\cline{1-3}
\scriptsize{\textbf{Fish Surveillance}} &\scriptsize{\textbf{Fish}} & \scriptsize{} \\
\scriptsize{\textbf{1-Tank}} &\scriptsize{} & \scriptsize{} \\
\scriptsize{\textbf{1.1-Ethology}} &\scriptsize{} & \scriptsize{} \\
\scriptsize{Aqu@theque Project} & \scriptsize{Aquarium of La Rochelle} & \scriptsize{Penciuc et al. (2006) \cite{P0C0-A-202}} \\
\scriptsize{Aqu@theque Project} & \scriptsize{Aquarium of La Rochelle} & \scriptsize{Baf et al. (2007) \cite{P0C0-A-201}} \\
\scriptsize{Aqu@theque Project} & \scriptsize{Aquarium of La Rochelle} & \scriptsize{Baf et al. (2007) \cite{P0C0-A-200}} \\
\scriptsize{\textbf{1.2-Fishing}} &\scriptsize{} & \scriptsize{} \\
\scriptsize{Fish Farming} & \scriptsize{Japanese rice fish} & \scriptsize{Abe et al. (2016) \cite{P0C0-A-69-3}} \\
\scriptsize{\textbf{2-Open Sea}} &\scriptsize{} & \scriptsize{} \\
\scriptsize{\textbf{2.1-Census/Ethology}} &\scriptsize{} & \scriptsize{} \\
\scriptsize{EcoGrid Project (Taiwan)} &\scriptsize{Ken-Ding sub-tropical coral reef} & \scriptsize{Spampinato et al. (2008) \cite{P0C0-A-60}} \\
\scriptsize{EcoGrid Project (Taiwan)} &\scriptsize{Ken-Ding sub-tropical coral reef} & \scriptsize{Spampinato et al. (2010) \cite{P0C0-A-61}} \\
\scriptsize{Fish4Knowledge (European)} &\scriptsize{Taiwan’s coral reefs} & \scriptsize{Kavasidis and Palazzo (2012) \cite{P0C0-A-68-1}} \\
\scriptsize{Fish4Knowledge (European)} &\scriptsize{Taiwan’s coral reefs} & \scriptsize{Spampinato et al. (2014) \cite{P0C0-A-62}} \\
\scriptsize{Fish4Knowledge (European)} &\scriptsize{Taiwan’s coral reefs} & \scriptsize{Spampinato et al. (2014) \cite{P0C0-A-63}} \\
\scriptsize{UnderwaterChangeDetection (European)} &\scriptsize{Underwater Scenes (Germany)} & \scriptsize{Radolko et al. (2016) \cite{P6C2-Dataset-2025}} \\
\scriptsize{-} &\scriptsize{Simulated Underwater Environment} & \scriptsize{Liu et al. (2016) \cite{P0C0-A-65}} \\
\scriptsize{Fish4Knowledge (European)} &\scriptsize{Taiwan’s coral reefs} & \scriptsize{Seese et al. (2016) \cite{P0C0-A-68}} \\
\scriptsize{Fish4Knowledge (European)} &\scriptsize{Taiwan’s coral reefs} & \scriptsize{Rout et al. (2017) \cite{P1C2-MOG-776}} \\
\scriptsize{\textbf{2.2-Fishing}} &\scriptsize{} & \scriptsize{} \\
\scriptsize{Rail-based fish catching} &\scriptsize{Open Sea Environment} & \scriptsize{Huang et al. (2016) \cite{P0C0-A-67}} \\
\scriptsize{Fish Length Measurement} &\scriptsize{Chute Multi-Spectral Dataset \cite{P0C0-A-69-2}} & \scriptsize{Huang et al. (2016) \cite{P0C0-A-69-2}} \\
\scriptsize{Fine-Grained Fish Recognition} &\scriptsize{Cam-Trawl Dataset \cite{P0C0-A-69-1}/Chute Multi-Spectral Dataset \cite{P0C0-A-69-2}} & \scriptsize{Wang et al. (2016) \cite{P0C0-A-69}} \\
\cline{1-3}
\scriptsize{\textbf{Dolphins Surveillance}} &\scriptsize{\textbf{Dolphins}} & \scriptsize{} \\
\scriptsize{Social marine mammals} &\scriptsize{Open sea environments} & \scriptsize{Karnowski et al. (2015) \cite{P0C0-A-66}} \\
\cline{1-3}
\scriptsize{\textbf{Lizards Surveillance}} &\scriptsize{\textbf{Lizards}} & \scriptsize{} \\
\scriptsize{Endangered lizard species} &\scriptsize{Natural environments} & \scriptsize{Nguwi et al. (2016) \cite{P0C0-A-750}} \\
\cline{1-3}
\scriptsize{\textbf{Mice Surveillance}} &\scriptsize{\textbf{Mice}} & \scriptsize{} \\
\scriptsize{Social behavior} &\scriptsize{Caltech mice dataset \cite{P6C2-Dataset-20000}} & \scriptsize{Rezaei and Ostadabbas (2017) \cite{P3C1-RMC-91}} \\
\scriptsize{Social behavior} &\scriptsize{Caltech mice dataset \cite{P6C2-Dataset-20000}} & \scriptsize{Rezaei and Ostadabbas (2018) \cite{P3C1-RMC-92}} \\
\cline{1-3}
\scriptsize{\textbf{Pigs Surveillance}} &\scriptsize{\textbf{Pigs}} & \scriptsize{} \\
\scriptsize{Farming} &\scriptsize{Farming box (piglets)} & \scriptsize{Mc Farlane and Schofield (1995) \cite{P1C1-Median-1}} \\
\scriptsize{Farming} &\scriptsize{Farming box} & \scriptsize{Guo et al. (2014) \cite{P0C0-A-76}} \\
\scriptsize{Farming} &\scriptsize{Farming box} & \scriptsize{Tu et al. (2014) \cite{P0C0-A-77}} \\
\scriptsize{Farming} &\scriptsize{Farming box} & \scriptsize{Tu et al. (2015) \cite{P0C0-A-77-1}} \\
\cline{1-3}
\scriptsize{\textbf{Hinds Surveillance}} &\scriptsize{\textbf{Hinds}} & \scriptsize{} \\
\scriptsize{Animal Species Detection} &\scriptsize{Forest Environment} & \scriptsize{Khorrami et al. (2012) \cite{P0C0-A-75}} \\
\cline{1-3}
\scriptsize{\textbf{Insects Surveillance}} &\scriptsize{\textbf{1) Honeybees}} & \scriptsize{} \\
\scriptsize{Hygienic Bees} &\scriptsize{Institute of Apiculture in Hohen-Neuendorf (Germany)} & \scriptsize{Knauer et al. (2005) \cite{P0C0-A-70}} \\
\scriptsize{Honeybee Colonies} &\scriptsize{Hive Entrance} & \scriptsize{Campbell et al. (2008) \cite{P0C0-A-71}} \\
\scriptsize{Honeybees Behaviors} &\scriptsize{Flat Surface - Karl-Franzens-Universität in Graz (Austria)} & \scriptsize{Kimura et al. (2012) \cite{P0C0-A-72}} \\
\scriptsize{Pollen Bearing Honeybees} &\scriptsize{Hive Entrance} & \scriptsize{Babic et al. (2016) \cite{P0C0-A-73}} \\
\scriptsize{Honeybees Detection} &\scriptsize{Hive Entrance} & \scriptsize{Pilipovic et al. (2016) \cite{P0C0-A-74}} \\
\cline{2-3}
\scriptsize{} &\scriptsize{\textbf{2) Spiders}} & \scriptsize{} \\
\scriptsize{Spiders Detection} &\scriptsize{Observation Box} & \scriptsize{Iwatani et al. (2016) \cite{P0C0-A-760}} \\
\hline
\end{tabular}}
\caption{Intelligent Visual Observation of Animal/Insect Behaviors: An Overview (Part III)} \centering
\label{P0C2:Applications-3}
\end{table}
\begin{table}
\scalebox{0.9}{
\begin{tabular}{|l|l|l|}
\hline
\scriptsize{Categories-Aims} &\scriptsize{Objects of interest-Scenes} &\scriptsize{Authors-Dates} \\
\hline
\hline
\scriptsize{\textbf{1-Forest Environments}} &\scriptsize{\textbf{Woods}} & \scriptsize{} \\
\scriptsize{Human Detection} &\scriptsize{Omnidirectional cameras} & \scriptsize{Boult et al. (2003) \cite{P0C0-Sensors-SC-2}} \\
\scriptsize{Animal Detection} &\scriptsize{Illumination change dataset \cite{P7C1-1}} & \scriptsize{Shakeri and Zhang (2017) \cite{P7C1-1}} \\
\scriptsize{Animal Detection} &\scriptsize{Camera-trap dataset \cite{P7C1-2} } & \scriptsize{Yousif et al. (2017) \cite{P7C1-2}} \\
\cline{1-3}
\scriptsize{\textbf{2-River Environments}} &\scriptsize{\textbf{Woods}} & \scriptsize{} \\
\scriptsize{Floating Bottles Detection} &\scriptsize{Dynamic Texture Videos} & \scriptsize{Zhong et al. (2003) \cite{P1C7-104}} \\
\scriptsize{Floating wood detection} &\scriptsize{River Videos} & \scriptsize{Ali et al. (2012) \cite{P0C0-A-90}} \\
\scriptsize{Floating wood detection} &\scriptsize{River Videos} & \scriptsize{Ali et al. (2013) \cite{P0C0-A-91}} \\
\cline{1-3}
\scriptsize{\textbf{3-Ocean Environments}} &\scriptsize{} & \scriptsize{} \\
\scriptsize{Mine Detection} &\scriptsize{Open Sea Environments} & \scriptsize{Borghgraef et al. (2010) \cite{P0C0-A-29}} \\
\scriptsize{Intruders Detection} &\scriptsize{Open Sea Environments} & \scriptsize{Szpak and Tapamo (2011) \cite{P0C0-A-29-4}} \\
\scriptsize{Boats Detection} &\scriptsize{Singapore Marine dataset} & \scriptsize{Prasad et al. (2016) \cite{P0C0-A-29-3}} \\
\scriptsize{Boats Detection} &\scriptsize{Singapore Marine dataset} & \scriptsize{Prasad et al. (2017) \cite{P0C0-A-29-2}} \\
\cline{1-3}
\scriptsize{\textbf{4-Submarine Environments}} &\scriptsize{} & \scriptsize{} \\
\scriptsize{\textbf{4.1- Swimming Pools Surveillance}} &\scriptsize{} & \scriptsize{} \\
\scriptsize{Human Detection} &\scriptsize{Public Swimming Pool} & \scriptsize{Eng et al. (2003) \cite{P0C0-A-40}} \\
\scriptsize{Human Detection} &\scriptsize{Public Swimming Pool} & \scriptsize{Eng et al. (2004) \cite{P0C0-A-40-1}} \\
\scriptsize{Human Detection} &\scriptsize{Public Swimming Pool} & \scriptsize{Lei and Zhao (2010) \cite{P1C7-118}} \\
\scriptsize{Human Detection} &\scriptsize{Public Swimming Pool} & \scriptsize{Fei et al. (2009) \cite{P0C0-A-41}} \\
\scriptsize{Human Detection} &\scriptsize{Public Swimming Pool} & \scriptsize{Chan (2011) \cite{P0C0-A-42-1}} \\
\scriptsize{Human Detection} &\scriptsize{Public Swimming Pool} & \scriptsize{Chan (2013) \cite{P0C0-A-42}} \\
\scriptsize{Human Detection} &\scriptsize{Private Swimming Pool} & \scriptsize{Peixoto al. (2012) \cite{P0C0-A-44}} \\
\scriptsize{\textbf{4.2- Tank Environments}} &\scriptsize{} & \scriptsize{} \\
\scriptsize{Fish Detection} & \scriptsize{Aquarium of La Rochelle} & \scriptsize{Penciuc et al. (2006) \cite{P0C0-A-202}} \\
\scriptsize{Fish Detection} & \scriptsize{Aquarium of La Rochelle} & \scriptsize{Baf et al. (2007) \cite{P0C0-A-201}} \\
\scriptsize{Fish Detection} & \scriptsize{Aquarium of La Rochelle} & \scriptsize{Baf et al. (2007) \cite{P0C0-A-200}} \\
\scriptsize{Fish Detection} & \scriptsize{Fish Farming} & \scriptsize{Abe et al. (2016) \cite{P0C0-A-69-3}} \\
\scriptsize{\textbf{4.3- Open Sea Environments}} &\scriptsize{} & \scriptsize{} \\
\scriptsize{Fish Detection} & \scriptsize{Taiwan’s coral reefs} & \scriptsize{Kasavidis and Palazzo (2012) \cite{P0C0-A-68-1}} \\
\scriptsize{Fish Detection} & \scriptsize{Taiwan’s coral reefs} & \scriptsize{Spampinato et al. (2014) \cite{P0C0-A-63}} \\
\scriptsize{Fish Detection} & \scriptsize{UnderwaterChangeDetection Dataset} & \scriptsize{Radolko et al. (2017) \cite{P6C2-Dataset-2025}} \\
\hline
\end{tabular}}
\caption{Intelligent Visual Observation of Natural Environments: An Overview (Part IV)} \centering
\label{P0C2:Applications-4}
\end{table}
\begin{table}
\scalebox{0.70}{
\begin{tabular}{|l|l|l|l|}
\hline
\scriptsize{Categories} &\scriptsize{Sub-categories-Aims} &\scriptsize{Objects of interest} &\scriptsize{Authors-Dates} \\
\hline
\hline
\multirow{1}{*}{\scriptsize{Visual Hull Computing}}
&\scriptsize{\textbf{Image-based Modeling}} & \scriptsize{\textbf{Object}} & \scriptsize{} \\
& \scriptsize{Marker Free} & \scriptsize{Indoor Scenes} & \scriptsize{Matusik et al. (2000) \cite{P0C0-A-151}} \\
&\scriptsize{\textbf{Optical Motion Capture}} & \scriptsize{\textbf{People}} & \scriptsize{} \\
& \scriptsize{Marker Free} & \scriptsize{Indoor Scenes} & \scriptsize{Wren et al. (1997) \cite{P1C2-SG-1}} \\
& \scriptsize{Marker Free} & \scriptsize{Indoor Scenes} & \scriptsize{Horprasert et al. (1998) \cite{P0C0-A-110}} \\
& \scriptsize{Marker Free} & \scriptsize{Indoor Scenes} & \scriptsize{Horprasert et al. (1999) \cite{P0C0-A-111}} \\
& \scriptsize{Marker Free} & \scriptsize{Indoor Scenes} & \scriptsize{Horprasert et al. (2000) \cite{P0C0-A-112}} \\
& \scriptsize{Marker Free} & \scriptsize{Indoor Scenes} & \scriptsize{Mikic et al. (2002) \cite{P0C0-A-130}} \\
& \scriptsize{Marker Free} & \scriptsize{Indoor Scenes} & \scriptsize{Mikic et al. (2003) \cite{P0C0-A-131}} \\
& \scriptsize{Marker Free} & \scriptsize{Indoor Scenes} & \scriptsize{Chu et al. (2003) \cite{P0C0-A-140}} \\
& \scriptsize{Marker Free} & \scriptsize{Indoor Scenes} & \scriptsize{Carranza et al. (2003) \cite{P0C0-A-100}} \\
& \scriptsize{Marker Detection} & \scriptsize{Indoor Scenes} & \scriptsize{Guerra-Filho (2005) \cite{P0C0-A-101}} \\
& \scriptsize{Marker Free} & \scriptsize{Indoor Scenes} & \scriptsize{Kim et al. (2007) \cite{P0C0-A-141}} \\
& \scriptsize{Marker Free} & \scriptsize{Indoor Scenes} & \scriptsize{Park et al. (2009) \cite{P0C0-A-120}} \\
\hline
\multirow{1}{*}{\scriptsize{Human-Machine Interaction (HMI)}}
&\scriptsize{\textbf{Arts}} & \scriptsize{\textbf{People}} & \scriptsize{} \\
&\scriptsize{Static Camera} & \scriptsize{Interaction real/virtual} & \scriptsize{Levin (2006)\cite{P0C0-A-360}} \\
\cline{2-3}
&\scriptsize{\textbf{Games}} & \scriptsize{\textbf{People}} & \scriptsize{} \\
&\scriptsize{RGB-D Camera} & \scriptsize{Interaction real/virtual} & \scriptsize{Microsoft Kinect} \\
\cline{2-3}
&\scriptsize{\textbf{Ludo-Multimedia}} & \scriptsize{} & \scriptsize{} \\
&\scriptsize{} & \scriptsize{\textbf{Fish}} & \scriptsize{} \\
&\scriptsize{Aqu@theque Project} & \scriptsize{Aquarium of La Rochelle} & \scriptsize{Penciuc et al. (2006)\cite{P0C0-A-202}} \\
&\scriptsize{Aqu@theque Project} & \scriptsize{Aquarium of La Rochelle} & \scriptsize{Baf et al. (2007)\cite{P0C0-A-201}} \\
&\scriptsize{Aqu@theque Project} & \scriptsize{Aquarium of La Rochelle} & \scriptsize{Baf et al. (2007)\cite{P0C0-A-200}} \\
\hline
\hline
\multirow{1}{*}{\scriptsize{Vision-based Hand Gesture Recognition}}
&\scriptsize{\textbf{Human-Computer Interface (HCI}} & \scriptsize{\textbf{Hands}} & \scriptsize{} \\
&\scriptsize{Augmented Screen} & \scriptsize{Indoor Scenes} & \scriptsize{Park and Hyun (2013) \cite{P0C0-A-370}} \\
&\scriptsize{Hand Detection} & \scriptsize{Indoor Scenes} & \scriptsize{Stergiopoulou et al. (2014) \cite{P0C0-A-371}} \\
&\scriptsize{\textbf{Behavior Analysis}} & \scriptsize{\textbf{Hands}} & \scriptsize{} \\
&\scriptsize{Hand Detection} & \scriptsize{Indoor Car Scenes} & \scriptsize{Perrett et al. (2016) \cite{P0C0-A-374}} \\
&\scriptsize{\textbf{Sign Language Interpretation and Learning}} & \scriptsize{\textbf{Hands}} & \scriptsize{} \\
&\scriptsize{Hand Gesture Segmentation} & \scriptsize{Indoor/Outdoor Scenes} & \scriptsize{Elsayed et al. (2015) \cite{P0C0-A-372}} \\
&\scriptsize{\textbf{Robotics}} & \scriptsize{\textbf{Hands}} & \scriptsize{} \\
&\scriptsize{Control robot movements} & \scriptsize{Indoor Scenes} & \scriptsize{Khaled et al. (2015) \cite{P0C0-A-373}} \\
\hline
\hline
\multirow{1}{*}{\scriptsize{Content based Video Coding}}
& \scriptsize{\textbf{Video Content}} & \scriptsize{\textbf{Objects}} & \scriptsize{} \\
&\scriptsize{Static Camera} & \scriptsize{MPEG-4} & \scriptsize{Chien et al. (2012) \cite{P0C0-A-300}} \\
&\scriptsize{Static Camera} & \scriptsize{H.264/AVC} & \scriptsize{Paul et al. (2010)\cite{P0C0-A-310-1}} \\
&\scriptsize{Static Camera} & \scriptsize{H.264/AVC} & \scriptsize{Paul et al. (2013)\cite{P5C1-VC-1}} \\
&\scriptsize{Static Camera} & \scriptsize{H.264/AVC} & \scriptsize{Paul et al. (2013)\cite{P0C0-A-310-2}} \\
&\scriptsize{Static Camera} & \scriptsize{H.264/AVC} & \scriptsize{Zhang et al. (2010)\cite{P0C0-A-320-1}} \\
&\scriptsize{Static Camera} & \scriptsize{H.264/AVC} & \scriptsize{Zhang et al. (2012)\cite{P0C0-A-320}} \\
&\scriptsize{Static Camera} & \scriptsize{H.264/AVC} & \scriptsize{Chen et al. (2012)\cite{P0C0-A-321}} \\
&\scriptsize{Moving Camera} & \scriptsize{H.264/AVC} & \scriptsize{Han et al. (2012)\cite{P0C0-A-322}} \\
&\scriptsize{Static Camera} & \scriptsize{H.264/AVC} & \scriptsize{Zhang et al. (2012)\cite{P0C0-A-323}} \\
&\scriptsize{Static Camera} & \scriptsize{H.264/AVC} & \scriptsize{Geng et al. (2012)\cite{P0C0-A-324}} \\
&\scriptsize{Static Camera} & \scriptsize{H.264/AVC} & \scriptsize{Zhang et al. (2014)\cite{P5C1-VC-10}} \\
&\scriptsize{Static Camera} & \scriptsize{HEVC} & \scriptsize{Zhao et al. (2014)\cite{P5C1-VC-11}} \\
&\scriptsize{Static Camera} & \scriptsize{HEVC} & \scriptsize{Zhang et al. (2014)\cite{P0C0-A-327}} \\
&\scriptsize{Static Camera} & \scriptsize{HEVC} & \scriptsize{Chakraborty et al. (2014)\cite{P5C1-VC-2}} \\
&\scriptsize{Static Camera} & \scriptsize{HEVC} & \scriptsize{Chakraborty et al. (2014)\cite{P5C1-VC-3}} \\
&\scriptsize{Static Camera} & \scriptsize{HEVC} & \scriptsize{Chakraborty et al. (2017)\cite{P0C0-A-312}} \\
&\scriptsize{Static Camera} & \scriptsize{H.264/AVC} & \scriptsize{Chen et al. (2012) \cite{P3C1-OA-32}} \\
&\scriptsize{Static Camera} & \scriptsize{H.264/AVC} & \scriptsize{Guo et al. (2013) \cite{P3C1-OA-31}} \\
&\scriptsize{Static Camera} & \scriptsize{HEVC} & \scriptsize{Zhao et al. (2013) \cite{P3C1-OA-30}} \\
\hline
\end{tabular}}
\caption{Miscellaneous applications: An Overview (Part V)} \centering
\label{P0C2:Applications-5}
\end{table}
\section{Intelligent Visual Surveillance}
\label{P0C2:sec:IVS}
This is the main application of background modeling and foreground detection, and in this section we only reviewed papers that appeared after 1997 because before the techniques used to detect static or moving objects were based on two or three frames differences due to the limitations of the computer. Practically, the goal in visual surveillance is to automatically detect static or moving foreground objects as follows:
\begin{itemize}
\item \textbf{Static Foreground Objects (SFO):} Detection of abandoned objects is needed to assure the security of the concerned area. A representative approach can be found in Porikli et al. \cite{P0C0-A-5000} and a full survey on background model to detect stationary objects can be found in Cuevas et al. \cite{P0C0-Survey-100}.
\item \textbf{Moving Foreground Objects (MFO):} Detection of moving objects is needed to compute statistics on the traffic such as in road \cite{P0C0-A-1}\cite{P0C0-A-2}\cite{P0C0-A-3}\cite{P0C0-A-4}, airport \cite{P0C0-A-10} or maritime surveillance \cite{P0C0-A-20}\cite{P0C0-A-21}. The objects of interest are very different such as vehicles, airplanes, boats, persons and luggages. Surveillance can be more specific as in the case of the study for consumer behavior in stores \cite{P0C0-A-31}\cite{P0C0-A-32}\cite{P0C0-A-33}\cite{P0C0-A-34}{P0C0-A-35}.
\end{itemize}
\subsection{Traffic surveillance}
Traffic surveillance videos present their own characteristics in terms of locations of the camera, environments and types of the moving objects as follows:
\begin{itemize}
\item \textbf{Location of the cameras:} There are three kinds of videos in traffic videos surveillance: \textbf{(1)} videos taken by a fixed camera as in most of the cases, \textbf{(2)} aerial videos as in Reilly \cite{P0C0-A-9-79-13}, in Teutsch et al. \cite{P0C0-A-4}, and in ElTantawy and Shehata \cite{P3C1-PCP-944}\cite{P3C1-PCP-944-1}\cite{P3C1-PCP-944-2}\cite{P3C1-PCP-944-3}\cite{P3C1-PCP-944-4}, and \textbf{(3)} very high resolution satellite videos as in Kopsiaftis and Karantzalos \cite{P0C0-A-9-79-4}. In the first case, the camera can be highly-mounted \cite{P0C0-A-9-60} or not as in most of the cases. Furthermore, the camera can be mono-directional or omnidirectional \cite{P0C0-Sensors-SC-2}\cite{P7C1-10000}.
\item \textbf{Quality of the cameras:} Most of the time CCTV cameras are used but the quality of the cameras can varied from low-quality to high quality (HD Cameras). Low quality cameras which generate one and two frames per second and 100k pixels/frame are used to reduce both the data and the price. Indeed, a video generated by a low quality city camera is roughly estimated to be about 1GB to 10GB of data per day.
\item \textbf{Environments:} Traffic scenes present highways, roads and urban traffic environments with their different challenges. In highways scenes, there are often shadows and illumination changes. Road scenes often present environments with trees, and their foliage moves with the wind. In urban traffic scenes, there are often illumination changes such as highlight.
\item \textbf{Foreground Objects:} Foreground objects are all road users which have different appearance in terms of color, shape and behavior. Thus, moving foreground objects of interest are \textbf{(1)} any kind of moving vehicles such as cars, trucks, motorcycles (motorbikes), etc.., \textbf{(2)} cyclists on bicycles, and \textbf{(3)} pedestrians on a pedestrian crossing.
\end{itemize}
\indent Practically, all these characteristics generate intrinsic specificities and challenges as developed in Song and Tai \cite{P1C1-Histogram-4} and Hao et al. \cite{P0C0-A-9-45}, and they can be classified as follows:
\begin{enumerate}
\item \textbf{Background Values:} The intensity of background scene is generally the most frequently recorded one at its pixel position. So, the background intensity can be determined by analyzing the intensity histogram. However, sensing variation and noise from image acquisition devices may result in erroneous estimation and cause a foreground object to have the maximum intensity frequency in the histogram.
\item \textbf{Challenges due the cameras:}
\begin{itemize}
\item In the case of cameras placed on a tall tripod, tripod may moves due the wind \cite{P1C2-KDE-45}\cite{P1C2-KDE-46}. In the case of aerial videos, the detection has particular challenges due to high object distance, simultaneous object and camera motion, shadows, or weak contrast \cite{P0C0-A-9-79-13}\cite{P0C0-A-4}\cite{P3C1-PCP-944}\cite{P3C1-PCP-944-1}\cite{P3C1-PCP-944-2}\cite{P3C1-PCP-944-3}\cite{P3C1-PCP-944-4}. In the case of satellite videos, small size of the objects and the weak contrast are the main challenges \cite{P0C0-A-9-79-4}.
\item In the case of low quality cameras, the video is low quality, noisy, with compression artifacts, and low frame rate as developed in Toropov et al. \cite{P0C0-A-9-79-1}.
\end{itemize}
\item \textbf{Challenges due the environments:}
\begin{itemize}
\item Traffic surveillance needs to work 24/7 with different weather conditions in day and night scenes. Thus, a background scene dramatically changes over time by the shadow of background objects (e.g., trees) and varying illumination.
\item Shadows may move with the wind in the trees, which may makes the detection result too noisy.
\end{itemize}
\item \textbf{Challenges due the foreground objects:}
\begin{itemize}
\item The moving objects may have similar colors to those of the road and the shadow. Then, the background may be falsely
detected as an object or vice-versa.
\item Vehicles may stop occasionally at intersections because of traffic light or control signals. Such kind of transient stops
increase the weight of non-background Gaussian and seriously degrade the background estimation quality of a traffic image sequence.
\item In scenarios where vehicles are driving on busy streets, this is even more challenging due to possible merged detections.
\item False detection are caused by vehicle headlights during nighttime as developed in Li et al. \cite{P0C0-A-9-47}.
\end{itemize}
\item \textbf{Challenges in the implementation:} The computation time needs to be low as possible because most of the applications require real-time detection.
\end{enumerate}
Table \ref{P0C2:IVS-1} and Table \ref{P0C2:IVS-2} show an overview of the different publications in the field of traffic surveillance with information about the background model, the background maintenance, the foreground detection, the color space and the strategies used by the authors. Authors used uni-modal model or multi-modal model following where the camera is placed. For example, if the camera mainly filmed the road, the most used models are uni-modal models like the median, the histogram and the single Gaussian while if the camera is in a dynamic environment with waving trees, the most models used are multi-modal models like MOG models. For the color space, the authors often used the RGB color space but intensity and YCrCb are also employed to be more robust against illumination changes. For additional strategies, it concerns most of the time shadows detection because it is the most met challenges in this kind of applications.
\subsection{Airport surveillance}
Airport visual surveillance mainly concerns the area where aircrafts are parked and maintained by specialized ground vehicles such as fueling vehicles and baggage cars as well as tracking of individuals such as workers. The need of visual surveillance is given due to the following reasons: \textbf{(1)} an airport’s apron is a security relevant area, \textbf{(2)} it helps to improve transit time, i.e. the time the aircraft is parking on the apron, and \textbf{(3)} it helps to minimize costs for the company operating the airport, as personal can be deployed more efficiently, and to minimize latencies for the passengers, as the time needed for accomplishing ground services decreases. Practically, airport surveillance videos present their own characteristics as follows:
\begin{enumerate}
\item \textbf{Challenges due the environments:} Weather and light changes are very challenging problems.
\item \textbf{Challenges due the foreground objects:}
\begin{itemize}
\item Ground support vehicles may change their shape in an extended degree during the tracking period, e.g. a baggage car. Strictly rigid motion and object models may not work on tracking those vehicles.
\item Vehicles may build blobs, either with the aircraft or with other vehicles, for a longer period of time, e.g. a fueling vehicle during refueling process.
\end{itemize}
\end{enumerate}
Table \ref{P0C2:IVS-3} shows an overview of the different publications in the field of airport surveillance with information about the background model, the background maintenance, the foreground detection, the color space and the strategies used by the authors. We can see that only the median or the single Gaussian are employed for the background model as the tarmac is an uni-modal background. The color space used is the RGB color space for all the works.
\subsection{Maritime surveillance}
Maritime surveillance can be achieved in visible spectrum \cite{P0C0-A-20}\cite{P0C0-A-25} or IR spectrum \cite{P0C0-A-21}. The idea is to count, to track and to recognize boats in fluvial canals, in river, or in open sea. For fluvial canals of Miami, Socek et al. \cite{P0C0-A-29-1} proposed a hybrid foreground detection approach which combined a Bayesian background subtraction framework with an image color segmentation technique to improve accuracy. In an other work, Bloisi et al. \cite{P0C0-A-20} used the Independent Multimodal Background Subtraction (IMBS\cite{P2C0-200}) which has been designed for dealing with highly
dynamic scenarios characterized by non-regular and high frequency noise, such as water background. IMBS is a per-pixel, non-recursive, and non-predictive model. In the case of open sea environments, Culibrk et al. \cite{P1C5-70} used the original MOG \cite{P1C2-MOG-10} implemented on General Regression Neural Network (GRNN) to detect cargos. In an other work, Zhang et al. \cite{P0C0-A-25} used the median model to detect ships to track them. To detect foreign floating objects, Borghgraef et al. \cite{P0C0-A-29} employed the improved MOG model called Zivkovic-Heijden GMM \cite{P1C2-MOG-36-1}. To detect many kinds of vessels, Szpak and Tapamo used the single Gaussian model \cite{P0C0-A-29-4}, and can tracked in their experiments jet-skis, sailboats, rigid-hulled inflatable boats, tankers, ferries and patrol boats. In infrared video, Liu et al. \cite{P0C0-A-21} employed a modified histogram model. To detect sailboats, Sobral et al. \cite{P3C1-PCP-917} developed a double constrained RPCA based on saliency detection. In a comparison work, Tran and Le \cite{P0C0-A-26} compared the original MOG and ViBe to detect boats, and they concluded that ViBe is a suitable algorithm for detecting different kinds of boats such as cargo ships, fishing boats, cruise ships, and canoes which have very different appearance in terms of size, shape, texture and structure. To automatically detects and tracks ships (intruders) in the case of cage aquaculture, Hu et al. \cite{P0C0-A-29-5} used an approximated median based on AM \cite{P1C1-Median-1} with a wave ripple removal. In Table \ref{P0C2:IVS-3}, we show an overview of the different publications in the field of maritime surveillance with information about the background model, the background maintenance, the foreground detection, the color space and the strategies used by the authors. We can remark that the authors prefer to use multi-modal background models (MOG, Zivkovic-Heijden GMM, etc...) in this context because water presents a dynamic aspect. For the color space, RGB is often used in diurnal conditions as well as infrared for night conditions. Most of the time, additional strategies are employed like morphological processing and saliency detection to deal with the false positive detections due to the movement of the water.
\subsection{Coastal Surveillance}
Cullen et al. \cite{P0C0-A-27}\cite{P0C0-A-28} used the behavior subtraction model developed by Jodoin et al. \cite{P5C1-FSI-210} to detect salient events in coastal environments\protect\footnotemark[4] which can be interesting for many organizations to learn about the wildlife, land erosion, impact of humans on the environment, etc. For example, biologists interested in marine mammal protection wish to know whether humans have come too close to seals on a beach. US Fish and Wildlife Service wish to know how many people and cars have been on the beach each day, and whether they have disturbed the fragile sand dunes. Practically, Cullen et al. \cite{P0C0-A-27}\cite{P0C0-A-28} detected boats, motor vehicles and people appearing close to the shoreline. In Table \ref{P0C2:IVS-3}, the reader can find an overview of the different publications in the field of coastal surveillance with information about the background model, the background maintenance, the foreground detection, the color space and the strategies used by the authors.
\footnotetext[4]{http://vip.bu.edu/projects/vsns/coastal-surveillance/}
\subsection{Store surveillance}
The interest is more and more coming across detection of human in stores because marketing researchers in academia and industry seek for tools to aid their decision making. Unlike other types of sensors, vision presents an ability to observe customer experience without separating it from
the environment. By tracking the path traveled by the customer along the store, important pieces of information, such as customer dwell time
and product interaction statistics can be collected. One of the most important customer statistics is the information about the
shopper groups such as in Leykin and Tuceryan \cite{P0C0-A-30}\cite{P0C0-A-31}\cite{P0C0-A-32} and Avinash et al. \cite{P0C0-A-33}. Table \ref{P0C2:IVS-3} shows an overview of the different publications in the field of store surveillance with information about the background model, the background maintenance, the foreground detection, the color space and the strategies used by the authors. Either a uni-modal model and multi-modal model in RGB color space are used because the videos are generally filmed in indoor scenes.\\
\subsection{Military surveillance}
Detection of moving objects in military surveillance is often referred as target detection in literature. Most of the time, it used specific sensors like infrared cameras \cite{P4C2-F-62} and Synthetic-aperture radar (SAR) imaging \cite{P7C1-20000}. In practice, the goal is to detect persons and/or vehicles in challenging environments (forest, etc...) and challenging conditions (night scenes, etc...). In literature, several authors employed background subtraction methods for target detection either in infrared or SAR imaging as follows:
\begin{itemize}
\item \textbf{Infrared imaging:} For example, Baf et al. \cite{P4C2-F-62}\cite{P4C2-F-62-2} used a median background subtraction algorithm with a Choquet integral approach to classify objects as background or foreground in infrared video whilst Baf et al. \cite{P4C2-F-62-1} used a Type-2Fuzzy MOG (T2-FMOG) model.
\item \textbf{SAR imaging:} A sub-aperture image can be considered as combination of background image that contains clutter and
foreground image that contains moving target. For clutter, its scattered field is varying slowly in limit angular sector. For moving target, its image position is changing along azimuth viewing angle because of circular flight. Thus, target signature is moving in consecutive sub-aperture images. Thus, value of certain pixel would have sudden change when target signature is moving onto and -7leaving it. Based on this idea, Shen et al. \cite{P7C1-20000} employed a temporal median to obtain the background image. A log-ratio operator is then integrated into the process. The operator can be defined as the logarithm of the ratio of two images. This is equivalent to subtract two logarithm images. Finally, the moving targets are detected by applying Constant False Alarm Rate (CFAR) detector.
\end{itemize}
Because in this field videos are very confidential, authors present results on publicly civil datasets for publication.
\footnotetext[5]{http://vcipl-okstate.org/pbvs/bench/}
\begin{landscape}
\begin{table}
\scalebox{0.70}{
\begin{tabular}{|l|l|l|l|l|l|l|}
\hline
\scriptsize{Human Activities} &\scriptsize{Type} &\scriptsize{Background model} &\scriptsize{Background Maintenance} &\scriptsize{Foreground Detection} &\scriptsize{Color Space} &\scriptsize{Strategies} \\
\hline
\hline
\multirow{1}{*}{\scriptsize{Traffic Surveillance}}
&\scriptsize{\textbf{1) Road Surveillance}} &\scriptsize{} &\scriptsize{} &\scriptsize{}
&\scriptsize{} &\scriptsize{} \\
\cline{2-7}
&\scriptsize{\textbf{1.1) Road/Highways Traffic}} &\scriptsize{} &\scriptsize{} &\scriptsize{}
&\scriptsize{} &\scriptsize{} \\
&\scriptsize{Zheng et al. (2006) \cite{P0C0-A-1}} &\scriptsize{Histogram mode} &\scriptsize{Blind Maintenance} &\scriptsize{Difference}
&\scriptsize{RGB} &\scriptsize{Aggregation for small range} \\
&\scriptsize{Batista et al. (2006) \cite{P0C0-A-9-30}} &\scriptsize{Average} &\scriptsize{Running Average} &\scriptsize{Minimum} &\scriptsize{RGB} &\scriptsize{Double Backgrounds} \\
&\scriptsize{Monteiro et al. (2008) \cite{P0C0-A-9-31}} &\scriptsize{Median} &\scriptsize{Sliding Median} &\scriptsize{Minimum} &\scriptsize{RGB} &\scriptsize{Double Backgrounds-Shadow/Highlight Removal} \\
&\scriptsize{Monteiro et al. (2008) \cite{P0C0-A-9-31-1}} &\scriptsize{Median} &\scriptsize{Sliding Median}
&\scriptsize{Minimum} &\scriptsize{RGB} &\scriptsize{Double Backgrounds-Shadow/Highlight Removal} \\
&\scriptsize{Monteiro et al. (2008) \cite{P0C0-A-32}} &\scriptsize{Codebook \cite{P1C6-100}} &\scriptsize{Idem Codebook}
&\scriptsize{Idem Codebook} &\scriptsize{RGB} &\scriptsize{Shadow/Highlight Detection \cite{P5C1-CF-300}} \\
&\scriptsize{Monteiro (2009) \cite{P0C0-A-9-33}} &\scriptsize{Sliding Median} &\scriptsize{}
&\scriptsize{Minimum} &\scriptsize{RGB} &\scriptsize{Double Backgrounds-Shadow/Highlight Removal} \\
&\scriptsize{Hao et al. (2013) \cite{P1C2-KDE-159}} &\scriptsize{KDE \cite{P1C2-KDE-46}} &\scriptsize{Idem KDE}
&\scriptsize{Idem KDE} &\scriptsize{Joint Domain-Range Features \cite{P1C2-KDE-46}}&\scriptsize{Foreground Model} \\
&\scriptsize{Ling et al. (2014) \cite{P0C0-A-3}} &\scriptsize{Dual Layer Approach \cite{P0C0-A-3}} &\scriptsize{}
&\scriptsize{} &\scriptsize{} &\scriptsize{} \\
&\scriptsize{Sawalakhe and Metkar (2014) \cite{P0C0-A-9-43}} &\scriptsize{Spatio-Temporal BS/FD (ST-BSFD)} &\scriptsize{-}
&\scriptsize{AND} &\scriptsize{RGB} &\scriptsize{-} \\
&\scriptsize{Huang and Chen (2013) \cite{P0C0-A-9-62}} &\scriptsize{Cerebellar-Model-Articulation-Controller (CMAC) \cite{P0C0-A-9-62}} &\scriptsize{-} &\scriptsize{Threshold} &\scriptsize{YCrCb} &\scriptsize{Block} \\
&\scriptsize{Chen and Huang (2014) \cite{P0C0-A-9-61}} &\scriptsize{PCA-based RBF Network \cite{P0C0-A-9-61}}
&\scriptsize{Selective Maintenance} &\scriptsize{Euclidean distance} &\scriptsize{YCrCb} &\scriptsize{Block} \\
&\scriptsize{Lee et al (2015) \cite{P0C0-A-9-42}} &\scriptsize{GDSM with Running Average \cite{P0C0-A-9-42}} &\scriptsize{Selective Maintenance} &\scriptsize{AND} &\scriptsize{RGB} &\scriptsize{Shadow Detection \cite{P0C1-90-1}} \\
&\scriptsize{Aqel et al. (2015) \cite{P0C0-A-9-20}} &\scriptsize{SG on Intensity Transition} &\scriptsize{Idem SG}
&\scriptsize{Idem SG} &\scriptsize{RGB} &\scriptsize{-} \\
&\scriptsize{Aqel et al. (2016) \cite{P0C0-A-9-21}} &\scriptsize{SG on Intensity Transition} &\scriptsize{Idem SG}
&\scriptsize{Idem SG} &\scriptsize{RGB} &\scriptsize{Shadow Detection} \\
&\scriptsize{Wang et al. (2016) \cite{P5C1-MulF-9}} &\scriptsize{Median} &\scriptsize{} &\scriptsize{}
&\scriptsize{} &\scriptsize{} \\
&\scriptsize{Dey and Praveen (2016) \cite{P0C0-A-9-41}} &\scriptsize{GDSM with background subtraction \cite{P0C0-A-9-1}} &\scriptsize{Yes} &\scriptsize{AND} &\scriptsize{RGB} &\scriptsize{Post-processing} \\
&\scriptsize{Hadiuzzaman et al. (2017) \cite{P0C0-A-9-79-20}} &\scriptsize{Median} &\scriptsize{Yes} &\scriptsize{Idem Median}
&\scriptsize{Intensity} &\scriptsize{Shadow Detection} \\
\cline{2-7}
&\scriptsize{\textbf{1.2)} Urban Traffic} &\scriptsize{} &\scriptsize{} &\scriptsize{}
&\scriptsize{} &\scriptsize{} \\
&\scriptsize{\textbf{Conventional camera}} &\scriptsize{} &\scriptsize{} &\scriptsize{}
&\scriptsize{} &\scriptsize{} \\
&\scriptsize{Hwang et al. (2009) \cite{P0C0-A-9-48}} &\scriptsize{MOG-ALR \cite{P0C0-A-9-48}} &\scriptsize{Adaptive Learning Rate} &\scriptsize{Idem MOG} &\scriptsize{RGB} &\scriptsize{-} \\
&\scriptsize{Intachak and Kaewapichai (2011) \cite{P0C0-A-9-79-2}} &\scriptsize{Mean (Clean images)} &\scriptsize{Selective Maintenance} &\scriptsize{Idem Mean} &\scriptsize{RGB} &\scriptsize{Illumination Adjustment} \\
&\scriptsize{Milla et al. (2013) \cite{P0C0-A-9-79-3}} &\scriptsize{$\Sigma-\Delta$ filter} &\scriptsize{$\Sigma-\Delta$ filter}
&\scriptsize{$\Sigma-\Delta$ filter} &\scriptsize{Intensity} &\scriptsize{Short-term/Long-term backgrounds} \\
&\scriptsize{Toropov et al. (2015) \cite{P0C0-A-9-79-1}} &\scriptsize{MOG \cite{P1C2-MOG-10}} &\scriptsize{Idem MOG} &\scriptsize{Idem MOG} &\scriptsize{Color} &\scriptsize{Brightness Adjustment} \\
&\scriptsize{Zhang et al. (2016) \cite{P1C2-MOG-710}} &\scriptsize{GMMCM \cite{P1C2-MOG-710}} &\scriptsize{Idem MOG \cite{P1C2-MOG-10}} &\scriptsize{Confidence Period} &\scriptsize{Intensity} &\scriptsize{Classification of traffic density} \\
&\scriptsize{\textbf{Highly-mounted camera}} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{}
&\scriptsize{} \\
&\scriptsize{Gao et al. (2014) \cite{P0C0-A-9-60}} &\scriptsize{SG \cite{P1C2-SG-1}} &\scriptsize{Idem SG} &\scriptsize{Idem SG}
&\scriptsize{YCrCb} &\scriptsize{Shadow detection \cite{P0C1-90}} \\
&\scriptsize{Quesada and Rodriguez (2016) \cite{P3C1-PCP-1066}} &\scriptsize{incPCP \cite{P3C1-PCP-1063}} &\scriptsize{Idem incPCP} &\scriptsize{Idem incPCP} &\scriptsize{Intensity} &\scriptsize{-} \\
&\scriptsize{\textbf{Headlight Removal}} &\scriptsize{} &\scriptsize{} &\scriptsize{}
&\scriptsize{} &\scriptsize{} \\
&\scriptsize{Li et al. (2016) \cite{P0C0-A-9-47}} &\scriptsize{GMM \cite{P1C2-MOG-10}} &\scriptsize{Idem GMM} &\scriptsize{Idem GMM} &\scriptsize{RGB} &\scriptsize{Headlight/Shadow Removal} \\
&\scriptsize{\textbf{Intersection}} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} \\
&\scriptsize{Ding et al. (2012) \cite{P0C0-A-9-44}} &\scriptsize{CPS based GMM \cite{P0C0-A-9-44}} &\scriptsize{Idem GMM} &\scriptsize{Idem GMM}
&\scriptsize{RGB} &\scriptsize{Cyber Physical System} \\
&\scriptsize{Ding et al. (2012) \cite{P0C0-A-9-44}} &\scriptsize{CPS based FGD \cite{P6C2-Dataset-10}} &\scriptsize{Idem FGD} &\scriptsize{Idem FGD} &\scriptsize{RGB} &\scriptsize{Cyber Physical System} \\
&\scriptsize{Alldieck (2015) \cite{P0C0-A-9-79-12}} &\scriptsize{Zivkovic-Heijden GMM \cite{P1C2-MOG-36-1}} &\scriptsize{Idem GMM} &\scriptsize{Idem GMM} &\scriptsize{RGB/IR} &\scriptsize{Multimodal cameras} \\
&\scriptsize{Mendoca et Oliveira (2015) \cite{P0C0-A-9-79-6}} &\scriptsize{Context supported
ROad iNformation (CRON) \cite{P0C0-A-9-79-6}} &\scriptsize{Selective Maintenance} &\scriptsize{Idem AM} &\scriptsize{RGB} &\scriptsize{} \\
&\scriptsize{Li et al. (2016) \cite{P0C0-A-9-44-1}} &\scriptsize{incPCP \cite{P3C1-PCP-1062}} &\scriptsize{Idem incPCP} &\scriptsize{Idem incPCP} &\scriptsize{RGB} &\scriptsize{-} \\
&\scriptsize{\textbf{Obstacle Detection}} &\scriptsize{} &\scriptsize{} &\scriptsize{}
&\scriptsize{} &\scriptsize{} \\
&\scriptsize{Lan et al. (2015) \cite{P1C2-MOG-761}} &\scriptsize{SUOG \cite{P1C2-MOG-761}} &\scriptsize{Selective Maintenance}&\scriptsize{Idem GMM} &\scriptsize{RGB} &\scriptsize{Obstacle Detection Model} \\
\hline
\end{tabular}}
\caption{Intelligent Visual Surveillance of Human Activities: An Overview (Part 1). "-" indicated that the corresponding step used in not indicated in the paper.} \centering
\label{P0C2:IVS-1}
\end{table}
\end{landscape}
\begin{landscape}
\begin{table}
\scalebox{0.70}{
\begin{tabular}{|l|l|l|l|l|l|l|}
\hline
\scriptsize{Human Activities} &\scriptsize{Type} &\scriptsize{Background model} &\scriptsize{Background Maintenance} &\scriptsize{Foreground Detection} &\scriptsize{Color Space} &\scriptsize{Strategies} \\
\hline
\hline
&\scriptsize{\textbf{2)Vehicle Counting}} &\scriptsize{} &\scriptsize{} &\scriptsize{}
&\scriptsize{} &\scriptsize{} \\
&\scriptsize{Unzueta et al. (2012) \cite{P0C0-A-2}} &\scriptsize{Multicue approach \cite{P0C0-A-2}} &\scriptsize{} &\scriptsize{}
&\scriptsize{} &\scriptsize{} \\
&\scriptsize{Virginas-Tar et al. (2014) \cite{P0C0-A-9-50}} &\scriptsize{MOG-EM \cite{P1C2-MOG-90}} &\scriptsize{Idem MOG-EM} &\scriptsize{Idem MOG-EM} &\scriptsize{} &\scriptsize{Shadow Detection \cite{P5C1-CF-300}} \\
\cline{2-7}
&\scriptsize{\textbf{3) Vehicle Detection}} &\scriptsize{} &\scriptsize{} &\scriptsize{}
&\scriptsize{} &\scriptsize{} \\
&\scriptsize{\textbf{3.1) Conventional Video}} &\scriptsize{} &\scriptsize{} &\scriptsize{}
&\scriptsize{} &\scriptsize{} \\
&\scriptsize{Wang and Song (2011) \cite{P0C0-A-9-46}} &\scriptsize{GMM with Spatial Correlation Method \cite{P0C0-A-9-46}} &\scriptsize{Idem GMM} &\scriptsize{Idem GMM} &\scriptsize{HSV} &\scriptsize{Spatial Correlation Method} \\
&\scriptsize{Hadi et al. (2014) \cite{P0C0-A-9}} &\scriptsize{Histogram mode} &\scriptsize{Blind Maintenance} &\scriptsize{Absolute Difference} &\scriptsize{RGB} &\scriptsize{Morphological Processing} \\
&\scriptsize{Hadi et al. (2017) \cite{P0C0-A-9-1}} &\scriptsize{Histogram mode} &\scriptsize{Blind Maintenance} &\scriptsize{Absolute Difference} &\scriptsize{RGB} &\scriptsize{Morphological Processing} \\
&\scriptsize{\textbf{3.2) Aerial Video}} &\scriptsize{} &\scriptsize{} &\scriptsize{}
&\scriptsize{} &\scriptsize{} \\
& \scriptsize{Lin et al. (2009) \cite{P0C0-A-14}} &\scriptsize{Two CFD} &\scriptsize{-} &\scriptsize{-}
&\scriptsize{RGB} &\scriptsize{Translation} \\
&\scriptsize{Reilly (2012) \cite{P0C0-A-9-79-13}} &\scriptsize{Median} &\scriptsize{Idem Median} &\scriptsize{Idem Median}&\scriptsize{Intensity} &\scriptsize{-} \\
&\scriptsize{Teutsch et al. (2014) \cite{P0C0-A-4}} &\scriptsize{Independent Motion Detection \cite{P0C0-A-4}} &\scriptsize{}
&\scriptsize{} &\scriptsize{} &\scriptsize{} \\
&\scriptsize{\textbf{3.3) Satellite Video}} &\scriptsize{} &\scriptsize{} &\scriptsize{}
&\scriptsize{} &\scriptsize{} \\
&\scriptsize{Kopsiaftis and Karantzalos (2015) \cite{P0C0-A-9-79-4}} &\scriptsize{Mean} &\scriptsize{Idem Mean} &\scriptsize{Idem Mean} &\scriptsize{Intensity} &\scriptsize{-} \\
&\scriptsize{Yang et al. (2016) \cite{P0C0-A-9-79-41}} &\scriptsize{Local Saliency based Background Model based on ViBe (LS-ViBe) \cite{P0C0-A-9-79-41}} &\scriptsize{Idem ViBe} &\scriptsize{Idem ViBe} &\scriptsize{Intensity} &\scriptsize{-} \\
\cline{2-7}
&\scriptsize{\textbf{4) Illegally Parked Vehicles}} &\scriptsize{} &\scriptsize{} &\scriptsize{}
&\scriptsize{} &\scriptsize{} \\
&\scriptsize{Lee et al. (2007) \cite{P0C0-A-9-70}} &\scriptsize{Median} &\scriptsize{Selective Maintenance} &\scriptsize{Difference} &\scriptsize{RGB} &\scriptsize{Morphological Processing} \\
&\scriptsize{Zhao et al. (2013)\cite{P0C0-A-9-71}} &\scriptsize{Average} &\scriptsize{Running Average} &\scriptsize{Difference} &\scriptsize{HIS} &\scriptsize{Morphological Processing-Salient Object Detection} \\
&\scriptsize{Saker et al. (2015)\cite{P0C0-A-9-72}} &\scriptsize{GMM-PUC \cite{P1C2-MOG-762}} &\scriptsize{Idem GMM} &\scriptsize{Idem GMM} &\scriptsize{RGB} &\scriptsize{Detection of Stationary Object} \\
&\scriptsize{Chunyang et al. (2015) \cite{P0C0-A-9-73}} &\scriptsize{MOG \cite{P1C2-MOG-10}} &\scriptsize{Idem MOG} &\scriptsize{Idem MOG} &\scriptsize{RGB} &\scriptsize{Morphological Processing} \\
&\scriptsize{Wahyono et al. (2015) \cite{P0C0-A-9-74}} &\scriptsize{Running Average} &\scriptsize{Selective Maintenance} &\scriptsize{Difference} &\scriptsize{RGB} &\scriptsize{Dual background models} \\
\cline{2-7}
&\scriptsize{\textbf{5) Vacant parking area}} &\scriptsize{} &\scriptsize{} &\scriptsize{}
&\scriptsize{} &\scriptsize{} \\
&\scriptsize{Postigo et al. (2015) \cite{P0C0-A-9-75}} &\scriptsize{MOG-EM \cite{P1C2-MOG-90}} &\scriptsize{Idem MOG-EM} &\scriptsize{Idem MOG-EM} &\scriptsize{RGB} &\scriptsize{Transience Map} \\
&\scriptsize{Neuhausen (2015) \cite{P0C0-A-9-76}} &\scriptsize{SG} &\scriptsize{Selective Maintenance} &\scriptsize{Choquet Integral \cite{P4C2-F-70-1}} &\scriptsize{YCrCb-ULBP \cite{P5C1-TF-26}} &\scriptsize{Adaptive weight on Illumination Normalization} \\
\cline{2-7}
&\scriptsize{\textbf{6) Motorcycle (Motorbike) Detection}} &\scriptsize{} &\scriptsize{} &\scriptsize{}
&\scriptsize{} &\scriptsize{} \\
&\scriptsize{Silva et al. (2013) \cite{P0C0-A-9-49-2}} &\scriptsize{Zivkovic-Heijden GMM \cite{P1C2-MOG-36-1}} &\scriptsize{Idem GMM} &\scriptsize{Idem GMM} &\scriptsize{Intensity} &\scriptsize{-} \\
&\scriptsize{Waranusast et al. (2013) \cite{P0C0-A-9-49-1}} &\scriptsize{Zivkovic-Heijden GMM \cite{P1C2-MOG-36-1}} &\scriptsize{Idem GMM} &\scriptsize{Idem GMM} &\scriptsize{RGB} &\scriptsize{Morphological Operators} \\
&\scriptsize{Dahiya et al. (2016) \cite{P0C0-A-9-49}} &\scriptsize{Zivkovic-Heijden GMM \cite{P1C2-MOG-36-1}} &\scriptsize{Idem GMM} &\scriptsize{Idem GMM} &\scriptsize{Intensity} &\scriptsize{Detection Bike-riders} \\
\hline
\end{tabular}}
\caption{Intelligent Visual Surveillance of Human Activities: An Overview (Part 2). "-" indicated that the corresponding step used in not indicated in the paper.} \centering
\label{P0C2:IVS-2}
\end{table}
\end{landscape}
\begin{landscape}
\begin{table}
\scalebox{0.70}{
\begin{tabular}{|l|l|l|l|l|l|l|}
\hline
\scriptsize{Human Activities} &\scriptsize{Type} &\scriptsize{Background model} &\scriptsize{Background Maintenance} &\scriptsize{Foreground Detection} &\scriptsize{Color Space} &\scriptsize{Strategies} \\
\hline
\hline
\multirow{1}{*}{\scriptsize{Airport Surveillance}}
&\scriptsize{Blauensteiner and Kampel (2004) \cite{P0C0-A-10}} &\scriptsize{Median} &\scriptsize{Idem Median} &\scriptsize{Idem Median} &\scriptsize{RGB} &\scriptsize{-} \\
&\scriptsize{Aguilera et al. (2005) \cite{P0C0-A-11}} &\scriptsize{Single Gaussian} &\scriptsize{Idem SG} &\scriptsize{Idem SG} &\scriptsize{RGB} &\scriptsize{-} \\
&\scriptsize{Thirde et al. (2006) \cite{P0C0-A-12}} &\scriptsize{Single Gaussian} &\scriptsize{Idem SG} &\scriptsize{Idem SG} &\scriptsize{RGB} &\scriptsize{-} \\
&\scriptsize{Aguilera et al. (2006) \cite{P0C0-A-13}} &\scriptsize{Single Gaussian} &\scriptsize{Idem SG} &\scriptsize{Idem SG} &\scriptsize{RGB} &\scriptsize{-} \\
\hline
\multirow{1}{*}{\scriptsize{Maritime Surveillance}}
&\scriptsize{\textbf{1) Fluvial canals environment}} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} \\
&\scriptsize{Socek et al. (2005) \cite{P0C0-A-29-1}} &\scriptsize{Two CFD} &\scriptsize{-} &\scriptsize{Bayesian Decision \cite{P0C0-A-31}} &\scriptsize{RGB} &\scriptsize{Color Segmentation} \\
&\scriptsize{Bloisi et al. (2014) \cite{P0C0-A-20}} &\scriptsize{IMBS \cite{P2C0-200}} &\scriptsize{} &\scriptsize{}
&\scriptsize{} &\scriptsize{} \\
\cline{2-7}
&\scriptsize{\textbf{2) River environment}} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} \\
&\scriptsize{Zheng et al. (2013) \cite{P0C0-A-29-73}} &\scriptsize{LBP Histogram \cite{P5C1-TF-11}} &\scriptsize{LBP Histogram \cite{P5C1-TF-11}} &\scriptsize{LBP Histogram \cite{P5C1-TF-11}} &\scriptsize{RGB} &\scriptsize{-} \\
&\scriptsize{Mei et al. (2017) \cite{P3C4-DGS-16}} &\scriptsize{EAdaDGS \cite{P3C4-DGS-16}} &\scriptsize{Improved mechanism} &\scriptsize{Idem AdaDGS \cite{P3C4-DGS-10}} &\scriptsize{RGB} &\scriptsize{Multi-resolution} \\
\cline{2-7}
&\scriptsize{\textbf{3) Open sea environment}} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} \\
&\scriptsize{Culibrk et al. (2006) \cite{P1C5-70}} &\scriptsize{MOG-GNN \cite{P1C2-MOG-10}} &\scriptsize{Idem MOG} &\scriptsize{Idem MOG} &\scriptsize{Intensity} &\scriptsize{-} \\
&\scriptsize{Zhang et al. (2009) \cite{P0C0-A-25}} &\scriptsize{Median} &\scriptsize{} &\scriptsize{}
&\scriptsize{} &\scriptsize{} \\
&\scriptsize{Borghgraef et al. (2010) \cite{P0C0-A-29}} &\scriptsize{Zivkovic-Heijden GMM \cite{P1C2-MOG-36-1}} &\scriptsize{Idem Zivkovic-Heijden GMM} &\scriptsize{Idem Zivkovic-Heijden GMM} &\scriptsize{IR} &\scriptsize{-} \\
&\scriptsize{Arshad et al. (2010) \cite{P0C0-A-29-6}} &\scriptsize{-} &\scriptsize{-} &\scriptsize{-} &\scriptsize{RGB} &\scriptsize{Morphological Processing} \\
&\scriptsize{Arshad et al. (2011) \cite{P0C0-A-29-61}} &\scriptsize{-} &\scriptsize{-} &\scriptsize{-} &\scriptsize{RGB} &\scriptsize{Morphological Processing} \\
&\scriptsize{Szpak and Tapamo (2011) \cite{P0C0-A-29-4}} &\scriptsize{Single Gaussian \cite{P1C2-SG-1}} &\scriptsize{Idem SG}
&\scriptsize{Idem SG} &\scriptsize{Intensity} &\scriptsize{Spatial Smoothness} \\
& \scriptsize{Hu et al. (2011) \cite{P0C0-A-29-5}} &\scriptsize{Modified AM \cite{P0C0-A-29-5}} &\scriptsize{Idem Modified AM} &\scriptsize{Idem Modified AM} &\scriptsize{RGB} &\scriptsize{Fast 4-Connected Component Labeling} \\
&\scriptsize{Saghafi et al. (2012) \cite{P0C0-A-29-7}} &\scriptsize{Modified ViBe \cite{P0C0-A-29-7}} &\scriptsize{Modified ViBe} &\scriptsize{Modified ViBe} &\scriptsize{RGB} &\scriptsize{Backwash Cancellation Algorithm} \\
&\scriptsize{Xie et al. (2012) \cite{P0C0-A-29-71}} &\scriptsize{Three CFD} &\scriptsize{Selective Maintenance} &\scriptsize{AND} &\scriptsize{Intensity} &\scriptsize{} \\
&\scriptsize{Zhang et al. (2012) \cite{P0C0-A-29-72}} &\scriptsize{PCA \cite{P1C4-1}/GMM \cite{P1C2-MOG-10}} &\scriptsize{Idem PCA \cite{P1C4-1}/GMM \cite{P1C2-MOG-10}} &\scriptsize{Idem PCA \cite{P1C4-1}/GMM \cite{P1C2-MOG-10}} &\scriptsize{Intensity} &\scriptsize{-} \\
&\scriptsize{Arshad et al. (2014) \cite{P0C0-A-29-62}} &\scriptsize{-} &\scriptsize{-} &\scriptsize{-} &\scriptsize{RGB} &\scriptsize{Morphological Processing} \\
&\scriptsize{Liu et al. (2014) \cite{P0C0-A-21}} &\scriptsize{Modified Histogram \cite{P0C0-A-21}} &\scriptsize{Idem Histogram} &\scriptsize{Idem Histogram} &\scriptsize{IR} &\scriptsize{Adaptive Row Mean Filter} \\
&\scriptsize{Sobral et al. (2015) \cite{P3C1-PCP-917}} &\scriptsize{Double Constrained RPCA \cite{P3C1-PCP-917}} &\scriptsize{Idem RPCA} &\scriptsize{Idem RPCA} &\scriptsize{RGB} &\scriptsize{Saliency Detection} \\
&\scriptsize{Tran and Le (2016) \cite{P0C0-A-26}} &\scriptsize{ViBe \cite{P2C1-200}} &\scriptsize{Idem ViBe} &\scriptsize{Idem ViBe} &\scriptsize{RGB} &\scriptsize{Saliency Detection} \\
\hline
\multirow{1}{*}{\scriptsize{Store Surveillance}}
&\scriptsize{Leykin and Tuceryan (2007) \cite{P0C0-A-30}} &\scriptsize{Codebook \cite{P1C6-100}} &\scriptsize{Idem Codebook} &\scriptsize{Idem Codebook} &\scriptsize{RGB} &\scriptsize{-} \\
&\scriptsize{Leykin and Tuceryan (2005) \cite{P0C0-A-31}} &\scriptsize{Codebook \cite{P1C6-100}} &\scriptsize{Idem Codebook} &\scriptsize{Idem Codebook} &\scriptsize{RGB} &\scriptsize{-} \\
&\scriptsize{Leykin and Tuceryan (2005) \cite{P0C0-A-32}} &\scriptsize{Codebook \cite{P1C6-100}} &\scriptsize{Idem Codebook} &\scriptsize{Idem Codebook} &\scriptsize{RGB} &\scriptsize{-} \\
&\scriptsize{Avinash et al. (2012) \cite{P0C0-A-33}} &\scriptsize{Single Gaussian \cite{P1C2-SG-1}} &\scriptsize{Idem SG} &\scriptsize{Idem SG} &\scriptsize{RGB} &\scriptsize{-} \\
&\scriptsize{Zhou et al. (2017) \cite{P0C0-A-35}} &\scriptsize{MOG \cite{P1C2-MOG-1}} &\scriptsize{Idem MOG} &\scriptsize{Idem MOG} &\scriptsize{RGB} &\scriptsize{-} \\
\hline
\multirow{1}{*}{\scriptsize{Coastal Surveillance}}
&\scriptsize{Cullen et al. (2012) \cite{P0C0-A-27}} &\scriptsize{Behavior Subtraction \cite{P5C1-FSI-210}} &\scriptsize{Idem BS} &\scriptsize{Idem BS} &\scriptsize{RGB} &\scriptsize{-} \\
&\scriptsize{Cullen (2012) \cite{P0C0-A-28}} &\scriptsize{Behavior Subtraction \cite{P5C1-FSI-210}} &\scriptsize{Idem BS} &\scriptsize{Idem BS} &\scriptsize{RGB} &\scriptsize{-} \\
\hline
\multirow{1}{*}{\scriptsize{Swimming Pools Surveillance}}
&\scriptsize{\textbf{1) Online videos}} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} \\
&\scriptsize{1.1) Top view videos} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} \\
&\scriptsize{Eng et al. (2003) \cite{P0C0-A-40}} &\scriptsize{Block-based median \cite{P0C0-A-40}} &\scriptsize{Sliding Mean} &\scriptsize{Block-based Difference} &\scriptsize{CIELa*b*} &\scriptsize{Partial Occlusion Handling} \\
&\scriptsize{Eng et al. (2004) \cite{P0C0-A-40-1}} &\scriptsize{Region-based single multivariate Gaussian \cite{P0C0-A-40-1}} &\scriptsize{Idem SG} &\scriptsize{Region based SG} &\scriptsize{CIELa*b*} &\scriptsize{Handling Specular Reflection} \\
&\scriptsize{Chan (2011) \cite{P0C0-A-42-1}} &\scriptsize{SG/optical flow \cite{P0C0-A-42-1}} &\scriptsize{Idem SG} &\scriptsize{Designed Distance} &\scriptsize{RGB} &\scriptsize{-} \\
&\scriptsize{Chan (2014) \cite{P0C0-A-42}} &\scriptsize{MOG/optical flow \cite{P0C0-A-42}} &\scriptsize{Idem MOG} &\scriptsize{Idem MOG} &\scriptsize{RGB} &\scriptsize{-} \\
&\scriptsize{1.2) Underwater videos} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} \\
&\scriptsize{Fei et al. (2009) \cite{P0C0-A-41}} &\scriptsize{MOG} &\scriptsize{Idem MOG} &\scriptsize{} &\scriptsize{} &\scriptsize{Shadow Removal} \\
&\scriptsize{Lei and Zhao (2010) \cite{P1C7-118}} &\scriptsize{Kalman filter \cite{P1C7-103}} &\scriptsize{Idem Kalman filter} &\scriptsize{Idem Kalman filter} &\scriptsize{RGB} &\scriptsize{} \\
&\scriptsize{Zhang et al. (2015) \cite{P0C0-A-45}} &\scriptsize{-} &\scriptsize{-} &\scriptsize{-} &\scriptsize{RGB} &\scriptsize{Inter-frame based denoising} \\
\cline{2-7}
&\scriptsize{\textbf{2) Archived videos}} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} \\
&\scriptsize{Sha et al. (2014) \cite{P0C0-A-43}} &\scriptsize{-} &\scriptsize{-} &\scriptsize{-} &\scriptsize{RGB} &\scriptsize{-} \\
\cline{2-7}
&\scriptsize{\textbf{3) Private swimming pools}} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} \\
&\scriptsize{Peixoto et al. (2012) \cite{P0C0-A-44}} &\scriptsize{Mean/Two CFD \cite{P0C0-A-44}} &\scriptsize{Selective Maintenance} &\scriptsize{Mean Distance/Two CFD Distance} &\scriptsize{HSV} &\scriptsize{} \\
\hline
\end{tabular}}
\caption{Intelligent Visual Surveillance of Human Activities: An Overview (Part 3). "-" indicated that the background model used in not indicated in the paper.} \centering
\label{P0C2:IVS-3}
\end{table}
\end{landscape}
\section{Intelligent visual observation of animals and insects}
\label{P0C2:sec:AIB}
Surveillance with fixed cameras can also concern census and activities of animals in open protected areas (river, ocean, forest, etc...), as well as ethology in closed areas (zoo, cages, etc...). In these application, the detection done by background subtraction is followed by a tracking phase or a recognition phase \cite{P7C1-200}\cite{P7C1-210}\cite{P7C1-211}. In practice, the objects of interest are then animals such as birds \cite{P0C0-A-50}\cite{P0C0-A-51}\cite{P0C0-A-55}\cite{P0C0-A-56}\cite{P0C0-A-57}, fish \cite{P0C0-A-60}\cite{P0C0-A-61}, honeybees \cite{P0C0-A-70}\cite{P0C0-A-71}\cite{P0C0-A-72}\cite{P0C0-A-73}, hinds \cite{P0C0-A-75}\cite{P3C1-PCP-903}, squirrels \cite{P7C1-2000}\cite{P7C1-2001}, mice \cite{P3C1-RMC-91}\cite{P3C1-RMC-92} or pigs \cite{P0C0-A-77}. In practice, animals live and evolve in different environments that can be classified in three main categories: 1) Natural environments like forest, river and ocean, 2) study's environment like tank for fish and cages for mice, 3) farm environments for surveillance of pigs \cite{P1C1-Median-1} and livestock \cite{P7C1-300}. Thus, videos for visual observation of animals and insects present their own characteristics due the intrinsic appearance and behavior of the detected animals or insects, and the environments in which they are filmed. In these application, the detection done by background subtraction is followed by a tracking phase or a recognition phase \cite{P7C1-200}\cite{P7C1-210}\cite{P7C1-211}. Therefore, there are generally no a priori on the shape and the color of the objects when background subtraction is applied. In addition of these different intrinsic appearances in terms of size, shape, color and texture, and behavior in terms of velocity, videos which contains animals or insects present challenging characteristics due the background in natural environments which are developed in the Section \ref{P0C2:sec:IVO}. Pratically, events such as VAIB (Visual observation and analysis of animal and insect behavior) in conjunction with ICPR addressed the problem of the detection in animals and insects.
\subsection{Birds Surveillance}
Detection of birds is a crucial problem for multiple applications such as aviation safety, avian protection, and ecological science of migrant bird species. There are three kinds of bird observations: \textbf{(1)} observations at human made feeder stations \cite{P0C0-A-50}\cite{P0C0-A-51}, \textbf{(2)} observation at natural nesting stations \cite{P0C0-A-79}\cite{P0C0-A-56}\cite{P0C0-A-57}, and \textbf{(3)} observation in the air with camera looking at the roof-top of a building or recorded footages on lakes \cite{P0C0-A-55}. In the first case, as developed in Ko et al. \cite{P0C0-A-50}, birds at a feeder station present a larger per-pixel variance due to changes in the background generated by the presence of a bird. Rapid background adaptation fails because birds, when present, are often moving less than the background and often end up being incorporated into it. To address this challenge, Ko et al. \cite{P0C0-A-50}\cite{P0C0-A-51} designed a background subtraction based on distributions. In the second case, Goehner et al. \cite{P0C0-A-79} compared three background models (MOG \cite{P1C2-MOG-115}, ViBe \cite{P2C1-200}, PBAS \cite{P2C1-230}) to detect events of interest within uncontrolled outdoor avian nesting video for the Wildlife@Home\protect\footnotemark[6] project. The video are taken in environments which require background models that can handle quick correction of camera lighting problems while still being sensitive enough to detect the motion of a small to medium sized animal with cryptic coloration. To address these problems, Goehner et al. \cite{P0C0-A-79} added modifications to both the ViBe and PBAS algorithms by making these algorithms second-frame-ready and by adding a morphological opening and closing filter to quickly adjust to the noise present in the videos. Moreover, Goehner et al. \cite{P0C0-A-79} also added a convex hull around the connected foreground regions to help counter cryptic coloration.
\footnotetext[6]{http://csgrid.org/csg/wildlife/}
\subsection{Fish Surveillance}
Automated video analysis of fish is required in several type of applications: \textbf{(1)} detection of fish for recognition of species in a tank as in Baf et al. \cite{P0C0-A-201}\cite{P0C0-A-202} and in open sea as in Wang et al. \cite{P0C0-A-69}, \textbf{(2)} detection and tracking of fish for counting in a tank in the case of industrial aquaculture as in Abe et al. \cite{P0C0-A-69-3}, \textbf{(3)} detection and tracking of fish in open sea to study their behaviors in different weather conditions as in Spampinato et al.\cite{P0C0-A-60}\cite{P0C0-A-61}\cite{P0C0-A-62}\cite{P0C0-A-63}, and \textbf{(4)} in fish catch tracking and size measurement as in Huang et al. \cite{P0C0-A-67}. In all these applications, the appearances of fish are variable as they are non-rigid and deformable objects, and therefore it makes their identification of very complex.
\indent In 2007, Baf et al. \cite{P0C0-A-201}\cite{P0C0-A-202} studied different models (SG \cite{P1C2-SG-1}, MOG \cite{P1C2-MOG-10} and KDE \cite{P1C2-KDE-1}) for the Aqu@theque project, and concluded that SG and MOG offer good performance in time consuming and memory requirement, and that KDE is too slow for the application and requires too much memory. Because MOG gives better results than SG, MOG is revealed to be the most suitable for fish detection in a tank. In the EcoGrid project in 2008, Sampinato et al. \cite{P0C0-A-60}\cite{P0C0-A-62} used both a sliding Average and the Zivkovic-Heijden GMM \cite{P1C2-MOG-36-1} for fish detection in submarine video. In 2014, Sampinato et al. \cite{P0C0-A-61} developed a specific model called textons based KDE model to address the problem that the movement of fish is fairly erratic with frequent direction changes. For videos taken by Remotely Operated Vehicles (ROVs) or Autonomous Underwater Vehicles (AUVs), Liu et al. \cite{P0C0-A-65} proposed to combine with a logical "AND" the foreground detection obtained by the running average and the three CFD. In an other work, Huang et al. \cite{P0C0-A-67} proposed a live tracking of rail-based fish catching by combining background subtraction and motion trajectories techniques in highly noisy sea surface environment. First, the
foreground masks are obtained using SuBSENSE \cite{P2C0-40}. Then, the fish are tracked and separated from noise based on their trajectories. In 2017, Huang et al. \cite{P7C1-1000} detected moving deep-sea fishes with the MOG model and tracked
them with an algorithm combining Camshift with Kalman filtering. By analyzing the directions and trails of targets, both distance and velocity are determined.
\subsection{Dolphins Surveillance}
Detecting and tracking social marine mammals such as bottle nose dolphins, allow researchers such as ethologists and ecologists to explain their social dynamics, predict their behavior, and measure the impact of human interference. Practically, multi-camera systems give an opportunity to record the behavior of captive dolphins with a massive dataset from which long term statistics can be extracted. In this context, Karnowski et al. \cite{P0C0-A-66} used a background subtraction method to detect dolphins over time, and to visualize the paths by which dolphins regularly traverse their environment. \\
\subsection{Honeybees Surveillance}
Honeybees are generally filmed at the entrance of a hive to track and count different goal as follows: \textbf{(1)} detection of external honeybee parasites as in Knauer et al. \cite{P0C0-A-70}, \textbf{(2)} monitoring arrivals and departures at the hive entrance as in Campbell et al. \cite{P0C0-A-71}, \textbf{(3)} study of their sociability as in Kimura et al. \cite{P0C0-A-72}, and \textbf{(4)} remote pollination monitoring as in Babic et al. \cite{P0C0-A-73}. There are several reasons why honeybees detection is a difficult computer vision problem as developed in Campbell et al. \cite{P0C0-A-71} and in Babic et al. \cite{P0C0-A-73}.
\begin{enumerate}
\item Honeybees are small. In a typical image acquired from a hive-mounted camera a single bee occupies only a very small portion of the image (approximately $6 \times 14$ pixels). Honeybee detection can be easier with higher-resolution cameras or with multiple cameras placed closer to the hive entrance, but only at a substantial increase in cost as well as physical and computational complexity, limiting utility in practical setting.
\item Honeybees are fast targets. Indeed, honeybees cover a significant distance between frames. This movement complicates frame-to-frame matching as worker bees from a hive are virtually identical in appearance.
\item Honeybees present motion which appears to be chaotic. Indeed, honeybees transition quickly between loitering, crawling, and flying modes of movement and change directions unpredictably; this makes it impossible to track them using one unimodal motion model.
\item Bee hives are in outdoor scenes where lighting conditions vary significantly with the time of day, season and weather. Moreover, shadows are cast by the camera enclosure, moving bees, and moving foliage overhead. Even if it is possible to have clear lighting in the hive entry area, it demands onerous hive placement constraints vis-a-vis trees, buildings, and compass points. Artificial lighting is difficult to place in the field and could affect honeybee behavior.
\item The scene in front of a hive is often cluttered with honeybees grouping, occluding and/or overlapping each other. Thus, the moving objects detection aware of the fact that the detected moving object can sometimes contain more than one honeybee.
\item In the case of the pollen assessment \cite{P0C0-A-73}, it is needed to at least obtain additional information that is whether the group of honeybees has a pollen load or not, when it is not possible to segment individual honeybees.
\end{enumerate}
In 2016, Pilipovic et al. \cite{P0C0-A-74} studied different background models (frame differencing, median model \cite{P1C1-Median-1}, MOG model \cite{P1C2-MOG-10} and Kalman filter \cite{P1C7-100}) in this field, and concluded that MOG is best suited for detection honeybees in hive entrance video. In 2017, Yang \cite{P0C0-A-74-1} confirmed the adequacy of MOG by using a modified version \cite{P1C2-MOG-562-2}.
\subsection{Spiders Surveillance}
Iwatani et al. \cite{P0C0-A-760} proposed to design a hunting robot that mimics the spider’s hunting locomotion. To estimate the two-dimensional position and direction of a wolf spider in an observation box from video imaging, a simple background subtraction method is used because the environment is controlled. Practically, a gray scale image without the spider is taken in advance. Then, a pixel in each captured image is selected as a spider component candidate, if the difference between the background image and the captured image in grayscale is larger than a given threshold.
\subsection{Lizards Surveillance}
To census of endangered lizard species, it is important to automatically them from videos. In this context, Nguwi et al. \cite{P0C0-A-750} used a background subtraction method to detect lizards in video, followed by experiments comparing thresholding values and methods.
\subsection{Mice Surveillance}
Mice surveillance concern mice engaging in social behavior \cite{P6C2-Dataset-20000}\cite{P7C1-100}. Most of the time experts reviewed frame-by-frame the behavior but it is time consuming. In practice, the main challenges in this kind of surveillance is the big amount of videos and thus it requires fast algorithms to detect and recognize behaviors. In this context, Rezaei and Ostadabbas \cite{P3C1-RMC-91}\cite{P3C1-RMC-92} provided a fast Robust Matrix Completion (fRMC) algorithm for in-cage mice detection using the Caltech resident intruder mice dataset \cite{P6C2-Dataset-20000}.
\subsection{Pigs Surveillance}
Behavior analysis of livestock animals such as pigs under farm conditions is an important task to allow better management and climate regulation to improve the life of the animals. There are three main problems in farrowing pens as developed in Tu et al. \cite{P0C0-A-77}:
\begin{itemize}
\item \textbf{Dynamic background objects:} The nesting materials in the farrowing pen are often moved around because
of movements of the sow and piglets. The nesting materials can be detected as moving backgrounds.
\item \textbf{Light changes:} Lights are often switched on and off in the pig house. In the worst case, the whole segmented image
often appears as foreground in most statistical models when the strong global illumination change suddenly occurs.
\item \textbf{Motionless foreground objects:} Pigs and sows often sleeps over a long period. In this case, a foreground object that becomes motionless can be incorporated in the background.
\end{itemize}
First, Guo et al. \cite{P0C0-A-76} used a Prediction mechanism-Mixture of Gaussians algorithm called PM-MOG for detection of group-housed pigs in overhead views. In an other work, Tu et al. \cite{P0C0-A-77} employed a combination of modified MOG model and
the Dyadic Wavelet Transform (DWT) in gray scale videos. This algorithm accurately extracts the shapes of a sow under complex environments. In a further work, Tu et al. \cite{P0C0-A-77-1} proposed an illumination and reflectance estimation by using an Homomorphic Wavelet Filter (HWF) and a Wavelet Quotient Image (WQI) model based on DWT. Based on this illumination and reflectance estimation, Tu et al. \cite{P0C0-A-77-1} used the CFD algorithm of Li and Leung \cite{P5C1-MulF-6} which combined intensity and texture differences to detect sows in gray scale video.
\subsection{Hinds Surveillance}
There are three main problems to detect hinds as developed in Khorrami et al. \cite{P0C0-A-75}:
\begin{itemize}
\item\textbf{Camouflage:} Hinds may blend with the forest background by necessity
\item \textbf{Motionless foreground objects:} Hinds may sleep over a long period. In this case, hinds can be incorporated in the background.
\item \textbf{Rapid Motion:} Hinds can quicly move to escape a predator.
\end{itemize}
In camera-trap sequences, Giraldo-Zuluaga et al. \cite{P3C1-PCP-903}\cite{P3C1-PCP-904} used a multi-layer RPCA to detect hinds in forest in Colombia. Experimental results \cite{P3C1-PCP-903} against other RPCA models show the robustness of the multi-layer RPCA model in presence of challenges such as illumination changes.
\section{Intelligent Visual Observation of Natural Environments}
\label{P0C2:sec:IVO}
There is a general use tool to detect motion in ecological environments called MotionMeerkat \cite{P0C0-A-79-1}. MotionMeerkat\protect\footnotemark[7] alleviates the process of video stream data analysis by extracting frames with motion from a video. MotionMeerkat can either use Running Gaussian Average or MOG as background model. MotionMeerkat is successful in many ecological environments but is still subject to problems such as rapid lighting changes, and camouflage. In a further work, Weinstein \cite{P7C1-4} proposed to employ a background modeling based on convolutional neural networks and developed the software DeepMeerkat\protect\footnotemark[8] for biodiversity detection. For marine environment, there is a open source framework called Video and Image Analytics for a Marine Environment (VIAME) but it currently no contains background subtraction algorithms. Thus, advanced and designed background models are needed in natural environments. Practically, natural environments such as the forest canopy, river and ocean present an extreme challenge because the foreground objects may blend with the background by necessity. Furthermore, the background itself mainly changes following its characteristics as described in the following sections.
\footnotetext[7]{http://benweinstein.weebly.com/motionmeerkat.html}
\footnotetext[8]{http://benweinstein.weebly.com/deepmeerkat.html}
\begin{landscape}
\begin{table}
\scalebox{0.60}{
\begin{tabular}{|l|l|l|l|l|l|l|}
\hline
\scriptsize{Animal and Insect Behaviors} &\scriptsize{Type} &\scriptsize{Background model} &\scriptsize{Background Maintenance} &\scriptsize{Foreground Detection} &\scriptsize{Color Space} &\scriptsize{Strategies} \\
\hline
\hline
\multirow{1}{*}{\scriptsize{Birds Surveillance}}
&\scriptsize{\textbf{Birds}} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} \\
\cline{2-7}
&\scriptsize{\textbf{1) Feeder stations}} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} \\ &\scriptsize{Ko et al. (2008) \cite{P0C0-A-50}} &\scriptsize{KDE \cite{P1C2-KDE-45}} &\scriptsize{Blind Maintenance} &\scriptsize{Bhattacharyya Distance} &\scriptsize{RGB} &\scriptsize{Temporal Consistency} \\
&\scriptsize{Ko et al. (2010) \cite{P0C0-A-51}} &\scriptsize{Set of Warping Layer \cite{P0C0-A-51}} &\scriptsize{Blind Maintenance} &\scriptsize{Bhattacharyya distance} &\scriptsize{UYV} &\scriptsize{-} \\
\cline{2-7}
&\scriptsize{\textbf{2) Birds in air}} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} \\ &\scriptsize{Shakeri and Zhang (2012) \cite{P0C0-A-55}} &\scriptsize{Zivkovic-Heijden GMM \cite{P1C2-MOG-36-1}} &\scriptsize{Idem GMM} &\scriptsize{Idem GMM} &\scriptsize{RGB} &\scriptsize{Correspondence Component} \\
&\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{based on Point-Tracking} \\
&\scriptsize{Nazir et al. (2017) \cite{P0C0-A-79-2}} &\scriptsize{OpenCV Background Subtraction (WiseEye)} &\scriptsize{-} &\scriptsize{-}&\scriptsize{-} &\scriptsize{-} \\
\cline{2-7}
&\scriptsize{\textbf{3) Avian nesting}} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} \\ &\scriptsize{Goehner et al. (2015) \cite{P0C0-A-79}} &\scriptsize{MOG \cite{P1C2-MOG-115}, ViBe \cite{P2C1-200}, PBAS \cite{P2C1-230}} &\scriptsize{Idem MOG/PBAS/ViBe} &\scriptsize{Idem MOG/PBAS/ViBe} &\scriptsize{RGB} &\scriptsize{Morphological Processing} \\
&\scriptsize{Dickinson et al. (2008) \cite{P0C0-A-56}} &\scriptsize{MOG \cite{P0C0-A-56}} &\scriptsize{Idem MOG} &\scriptsize{Idem MOG} &\scriptsize{RGB} &\scriptsize{Spatially Coherent Segmentation \cite{P0C0-A-56-1} } \\
&\scriptsize{Dickinson et al. (2010) \cite{P0C0-A-57}} &\scriptsize{MOG \cite{P0C0-A-56}} &\scriptsize{Idem MOG} &\scriptsize{Idem MOG} &\scriptsize{RGB} &\scriptsize{Spatially Coherent Segmentation \cite{P0C0-A-56-1} } \\
\hline
\multirow{1}{*}{\scriptsize{Fish Surveillance}}
&\scriptsize{\textbf{1) Tank environment}} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} \\
\cline{2-7}
&\scriptsize{\textbf{1.1) Species Identification}} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} \\
&\scriptsize{Penciuc et al. (2006) \cite{P0C0-A-200}} &\scriptsize{MOG \cite{P1C2-MOG-10}} &\scriptsize{Idem MOG} &\scriptsize{Idem MOG} &\scriptsize{RGB} &\scriptsize{-} \\
&\scriptsize{Baf et al. (2007) \cite{P0C0-A-201}} &\scriptsize{MOG \cite{P1C2-MOG-10}} &\scriptsize{Idem MOG} &\scriptsize{Idem MOG} &\scriptsize{RGB} &\scriptsize{-} \\
&\scriptsize{Baf et al. (2007) \cite{P0C0-A-202}} &\scriptsize{MOG \cite{P1C2-MOG-10}} &\scriptsize{Idem MOG} &\scriptsize{Idem MOG} &\scriptsize{RGB} &\scriptsize{-} \\
\cline{2-7}
&\scriptsize{\textbf{1.2) Industrial Aquaculture}} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} \\
&\scriptsize{Pinkiewicz (2012) \cite{P0C0-A-69-5}} &\scriptsize{Average/Median} &\scriptsize{Idem Average/Idem Median} &\scriptsize{Idem Average/Idem Median} &\scriptsize{RGB} &\scriptsize{-} \\
&\scriptsize{Abe et al. (2017) \cite{P0C0-A-69-3}} &\scriptsize{Average} &\scriptsize{Idem average} &\scriptsize{Idem average} &\scriptsize{RGB} &\scriptsize{-} \\
&\scriptsize{Zhou et al. (2017) \cite{P0C0-A-69-4}} &\scriptsize{Average} &\scriptsize{Idem average} &\scriptsize{Idem average} &\scriptsize{Near Infrared} &\scriptsize{-} \\
\cline{2-7}
&\scriptsize{\textbf{2) Open sea environment}} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} \\
&\scriptsize{Spampinato et al. (2008) \cite{P0C0-A-60}} &\scriptsize{Sliding Average/Zivkovic-Heijden GMM \cite{P1C2-MOG-36-1}} &\scriptsize{-} &\scriptsize{-} &\scriptsize{-} &\scriptsize{AND} \\
&\scriptsize{Spampinato et al. (2010) \cite{P0C0-A-62}} &\scriptsize{Sliding Average/Zivkovic-Heijden GMM \cite{P1C2-MOG-36-1}} &\scriptsize{-} &\scriptsize{-} &\scriptsize{-} &\scriptsize{AND} \\
&\scriptsize{Spampinato et al. (2014) \cite{P0C0-A-63}} &\scriptsize{GMM \cite{P1C2-MOG-10}, APMM \cite{P2C1-20}, IM \cite{P1C1-Median-75}, Wave-Back \cite{P2C5-TDM-2}} &\scriptsize{-} &\scriptsize{-} &\scriptsize{-} &\scriptsize{Fish Detector} \\
&\scriptsize{Spampinato et al. (2014) \cite{P0C0-A-61}} &\scriptsize{Textons based KDE \cite{P0C0-A-61}} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} \\
&\scriptsize{Liu et al. (2016) \cite{P0C0-A-65}} &\scriptsize{Running Average-Three CFD \cite{P0C0-A-65}} &\scriptsize{Idem RA-TCFD} &\scriptsize{Idem RA-TCFD} &\scriptsize{RGB} &\scriptsize{AND} \\
&\scriptsize{Huang et al. (2016) \cite{P0C0-A-67}} &\scriptsize{SuBSENSE \cite{P2C0-40}} &\scriptsize{Idem SuBSENSE} &\scriptsize{Idem SuBSENSE} &\scriptsize{RGB-LBSP \cite{P5C1-TF-110}} &\scriptsize{Trajectory Feedback} \\
&\scriptsize{Seese et al. (2006) \cite{P0C0-A-68}} &\scriptsize{MOG \cite{P1C2-MOG-10}/Kalman filter \cite{P1C7-103}} &\scriptsize{Idem MOG/Kalman filter} &\scriptsize{Idem MOG/Kalman filter} &\scriptsize{Intensity} &\scriptsize{Intersection} \\
&\scriptsize{Wang et al. (2006) \cite{P0C0-A-69}} &\scriptsize{GMM \cite{P1C2-MOG-10}} &\scriptsize{Idem GMM} &\scriptsize{Idem GMM} &\scriptsize{RGB} &\scriptsize{Double Local Thresholding} \\
&\scriptsize{Huang et al. (2017) \cite{P7C1-1000}} &\scriptsize{GMM \cite{P1C2-MOG-10}} &\scriptsize{Idem GMM} &\scriptsize{Idem GMM} &\scriptsize{RGB} &\scriptsize{-} \\
\hline
\multirow{1}{*}{\scriptsize{Dolphins Surveillance}}
&\scriptsize{Karnowski et al. (2015) \cite{P0C0-A-66}} &\scriptsize{RPCA \cite{P3C1-PCP-1}} &\scriptsize{-} &\scriptsize{-} &\scriptsize{Intensity} &\scriptsize{-} \\
\hline
\multirow{1}{*}{\scriptsize{Honeybees Surveillance}}
&\scriptsize{Knauer et al. (2005) \cite{P0C0-A-70}} &\scriptsize{K-Clusters \cite{P1C6-1}} &\scriptsize{Idem K-Clusters} &\scriptsize{Idem K-Clusters} &\scriptsize{intensity} &\scriptsize{-} \\
&\scriptsize{Campbell et al. (2008) \cite{P0C0-A-71}} &\scriptsize{MOG \cite{P1C2-MOG-10}} &\scriptsize{Idem MOG} &\scriptsize{Idem MOG} &\scriptsize{RGB} &\scriptsize{-} \\
&\scriptsize{Kimura et al. (2012) \cite{P0C0-A-72}} &\scriptsize{-} &\scriptsize{-} &\scriptsize{-} &\scriptsize{-} &\scriptsize{-} \\
&\scriptsize{Babic et al. (2016) \cite{P0C0-A-73}} &\scriptsize{MOG \cite{P1C2-MOG-10}} &\scriptsize{Idem MOG} &\scriptsize{Idem MOG} &\scriptsize{RGB} &\scriptsize{-} \\
&\scriptsize{Pilipovic et al. (2016) \cite{P0C0-A-74}} &\scriptsize{MOG \cite{P1C2-MOG-10}} &\scriptsize{Idem MOG} &\scriptsize{Idem MOG} &\scriptsize{RGB} &\scriptsize{-} \\
\hline
\multirow{1}{*}{\scriptsize{Spiders Surveillance}}
&\scriptsize{Iwatani et al. (2016) \cite{P0C0-A-760}} &\scriptsize{Image without foreground objects} &\scriptsize{-} &\scriptsize{Threshold} &\scriptsize{Intensity} &\scriptsize{-} \\
\hline
\multirow{1}{*}{\scriptsize{Lizards Surveillance}}
&\scriptsize{Nguwi et al. (2016) \cite{P0C0-A-750}} &\scriptsize{-} &\scriptsize{-} &\scriptsize{-}&\scriptsize{-} &\scriptsize{}- \\
\hline
\multirow{1}{*}{\scriptsize{Pigs Surveillance}}
&\scriptsize{McFarlane and Schofield (1995) \cite{P1C1-Median-1}} &\scriptsize{Approximated Median} &\scriptsize{YEs} &\scriptsize{Idem Median} &\scriptsize{Intensity} &\scriptsize{-} \\
&\scriptsize{Guo et al. (2015) \cite{P0C0-A-76}} &\scriptsize{PM-MOG \cite{P0C0-A-76}} &\scriptsize{Idem MOG} &\scriptsize{Idem MOG} &\scriptsize{RGB} &\scriptsize{Prediction Mechanism} \\
&\scriptsize{Tu et al. (2014) \cite{P0C0-A-77}} &\scriptsize{MOG-DWT \cite{P0C0-A-77}} &\scriptsize{Idem MOG} &\scriptsize{Idem MOG} &\scriptsize{Intensity/Texture} &\scriptsize{OR} \\
&\scriptsize{Tu et al. (2015) \cite{P0C0-A-77-1}} &\scriptsize{CFD \cite{P5C1-MulF-6}} &\scriptsize{-} &\scriptsize{Difference} &\scriptsize{RGB} &\scriptsize{Illumination and Reflectance} \\
&\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{ Estimation} \\
\hline
\multirow{1}{*}{\scriptsize{Hinds Surveillance}}
&\scriptsize{Khorrami et al. (2012) \cite{P0C0-A-75}} &\scriptsize{RPCA \cite{P3C1-PCP-1}} &\scriptsize{-} &\scriptsize{-}&\scriptsize{Intensity} &\scriptsize{-} \\
&\scriptsize{Giraldo-Zuluaga et al. (2017) \cite{P3C1-PCP-903}} &\scriptsize{Multi-Layer RPCA \cite{P3C1-PCP-903}} &\scriptsize{-} &\scriptsize{-} &\scriptsize{RGB} &\scriptsize{-} \\
&\scriptsize{Giraldo-Zuluaga et al. (2017) \cite{P3C1-PCP-904}} &\scriptsize{Multi-Layer RPCA \cite{P3C1-PCP-903}} &\scriptsize{-} &\scriptsize{-} &\scriptsize{RGB} &\scriptsize{-} \\
\hline
\end{tabular}}
\caption{Background models used for intelligent visual observation of animals and insects: An Overview. "-" indicated that the background model used in not indicated in the paper.} \centering
\label{P0C2:AIB}
\end{table}
\end{landscape}
\subsection{Forest Environments}
The aim is to detect humans or animals but the motion of the foliage generate rapid transitions between light and shadow. Furthermore, humans or animals can be partially occluded by branches. First, Boult et al. \cite{P0C0-Sensors-SC-2} addressed these problems to detect humans into the woods with an omnidirectional cameras. In 2017, Shakeri and Zhang \cite{P7C1-1} employed a robust PCA method to detect animals in clearing zones. A camera trap is used to capture the videos. Experiments show that the proposed method outperforms most of the previous RPCA methods on the illumination change dataset (ICD). Yousif et al. \cite{P7C1-2} designed a joint background modeling and deep learning classification to detect and distinguish human and animals. The block-wise background modeling employ three features (intensity, histogram, Local Binary Pattern \cite{P0C0-Survey-26}, and Histogram of Oriented Gradient (HOG) \cite{P0C0-Survey-26}) to be robust against waving trees. Janzen et al. \cite{P7C1-3} detected movement in a region via background subtraction, image thresholding, and fragment histogram analysis. This system reduced the number of images for human consideration to one third of the input set with a success rate of proper identification of ungulate crossing between $60\%$ and $92\%$, which is suitable in larger study context.
\subsection{River Environments}
The idea is to detect foreign objects in the river (bottles, floating woods, etc... ) for \textbf{(1)} the preservation of the river or for \textbf{(2)} the preservation of the civil infrastructures such as bridges and dams on the rivers \cite{P0C0-A-90}\cite{P0C0-A-91}. In the first case, foreign objects pollute the environment and then animals are affected \cite{P1C7-104}. In the second case, foreign objects such as fallen trees, bushes, branches of fallen trees and other small pieces of wood can damage bridges and dams on the rivers. The risk of damage by trees is directly proportional to their size. Larger fallen trees are more dangerous than the smaller parts of fallen trees. These trees often remain wedged against the pillars of bridges and help in the accumulation of small branches, bushes and debris around. In these river environments, both background water waves and floating objects of interest are in motion. Moreover, the flow of river water varies from the normal flow during floods, and thus it causes more motion. In addition, small waves and water surface illumination, cloud shadows, and similar phenomena add non-periodical background changes. In 2003, Zhong et al. \cite{P1C7-104} used Kalman filter to detect bottles in waving river for an application of type (1). In 2012, Ali et al. \cite{P0C0-A-90} used a space-time spectral mode for an application of type (2). In a further work, Ali et al. \cite{P0C0-A-91} added to the MOG model a rigid motion model to detect floating woods.
\subsection{Ocean Environments}
The aim is to detect ships \textbf{(1)} ships for the optimization of the traffic which is the case in most of the applications, \textbf{(2)} foreign objects to avoid the collision with foreign objects \cite{P0C0-A-29}, and \textbf{(3)} foreign people (intruders) because ships are in danger of pirate attacks both in open waters and in a harbor environment \cite{P0C0-A-29-4}. These scenes are more challenging than calm water scenes because of the waves breaking near the shore. Moreover boat wakes and weather issues contribute to generate a highly dynamic background. Practically, the motion of the waves generate false positive detections in the foreground detection \cite{P0C0-A-95}. In a valuable, Prasad et al. \cite{P0C0-A-29-2} \cite{P0C0-A-29-3} provided a list of the challenges met in videos acquired in maritime environments, and applied on the Singapore-Marine dataset the 34 algorithms that participated in the ChangeDetection.net competition. Experimental results \cite{P0C0-A-29-2} show that all these methods are ineffective, and produced false positives in the water region or false negatives while suppressing
water background. Practically, the challenges can classified as follows as developed in Prasad et al. \cite{P0C0-A-29-2}:
\begin{itemize}
\item Weather and illumination conditions such as bright sunlight, twilight conditions, night, haze, rain, fog, etc..
\item The solar angles induce different speckle and glint conditions in the water.
\item Tides also influence the dynamicity of water.
\item Situations that affect the visibility influence the contrast, statistical distribution of sea and water, and visibility of
far located objects.
\item Effects such as speckle and glint create non-uniform background statistics which need extremely
complicated modeling such that foreground is not detected as the background and vice versa.
\item Color gamuts for illumination conditions such as night (dominantly dark), sunset (dominantly yellow and red), and bright daylight
(dominantly blue), and hazy conditions (dominantly gray) vary significantly.
\end{itemize}
\subsection{Submarine Environments}
There are three kinds of aquatic underwater environments (also called underwater environments): \textbf{(1)} swimming pools, \textbf{(2)} tank environments for fish, and \textbf{(3)} open sea environments.
\subsubsection{Swimming pools}
In swimming pools, there are water ripples, splashes and specular reflections. First, Eng et al. \cite{P0C0-A-40} designed a block-based median background model and used the CIELa*b* color space for outdoor pool environments to detect swimmers under amid reflections, ripples, splashes and rapid lighting changes. Partial occlusions are resolved using a Markov Random Field framework that enhances the tracking capability of the system. In a further work, Eng et al. \cite{P0C0-A-40-1} employed a region-based single multivariate Gaussian model to detect swimmers, and used the CIELa*b* color space as in Eng et al. \cite{P0C0-A-40}. Then, a spatio-temporal filtering scheme enhanced the detection because swimmers are often partially hidden by specular reflections of artificial nighttime lighting. In an other work, Lei and Zhao \cite{P1C7-118} employed a Kalman filter \cite{P1C7-103} to deal with light spot and water ripple. In a further work, Chan et al. \cite{P0C0-A-42} detected swimmers by computing dense optical flow and the MOG model on video sequences captured at daytime, and nighttime, and of different swimming styles (breaststroke, freestyle, backstroke). For private swimming, Peixoto et al. \cite{P0C0-A-44} combined the mean model and the two CFD, and used the HSV invariant color model space.
\subsubsection{Tank environments}
There are three kinds of tanks: \textbf{(1)} tanks in aquarium which reproduce the maritime environment, \textbf{(2)} tanks for industrial aquaculture, and \textbf{(3)} tanks for studies of fish's behaviors. The challenges met in tank environments can be classified as follows
\begin{itemize}
\item \textbf{Challenges due the environments:} Illumination changes are owed to the ambient light, the spotlights which light the tank from the inside and from the outside, the movement of the water due to fish and the continuous renewal of the water. In addition for tank in aquarium, moving algae generate false detections as developed in Baf et al. \cite{P0C0-A-201}\cite{P0C0-A-202}.
\item \textbf{Challenges due fish:} The movement of fish is different due to their species and the kind of tank. Furthermore, their number is different. In tank for aquarium, there are different species as in Baf et al. \cite{P0C0-A-201} where there are ten species of tropical fish. However, fish of the same species tend to have the same behavior. But, there are several species which swim at different depths. Furthermore, they can be occluded by algae or other fish. In an other way in industrial aquaculture, the number of fish is bigger than aquarium, and all the fish are from the same species and thus they have the same behavior. For example in Abe et al. \cite{P0C0-A-69-3}, there were 250 Japanese rice fish, of which 170-190 were detected by naked eye observation in the visible area during the recording period. Furthermore, these fish tend to swim at various depths in the tank.
\end{itemize}
\subsubsection{Open sea environments}
In underwater open sea environments, the degree of luminosity and water flow vary depending upon the weather and the time of the day. The water may
also have varying degrees of clearness and cleanness as developed in Spampinato et al. \cite{P0C0-A-60}. In addition in subtropical waters, algae
grow rapidly and appear on camera lens. Consequently, different degrees of greenish and bluish videos are produced. In order to reduce the presence of the algae, lens is frequently and manually cleaned. Practically, the challenges in open sea environments can classified as developed in Kavasidis and Palazzo \cite{P0C0-A-68-1} and Spampinato et al. \cite{P0C0-A-63}:
\begin{itemize}
\item \textbf{Light changes:} Every possible lighting conditions need to be taken into account because the video feeds are captured during the
whole day and the background subtraction algorithms should consider the light transition.
\item \textbf{Physical phenomena:} Image contrast is influenced by various physical phenomena such as typhoons, storms or sea currents which can easily compromise the contrast and the clearness of the acquired videos.
\item \textbf{Murky water:} It is important to consider that the clarity of the water during the
day could change due to the drift and the presence of plankton in order to investigate the movements of fish in their natural
habitat. Under these conditions, targets that are not fish might be detected as false positives.
\item \textbf{Grades of freedom:} In underwater videos the moving objects can move in all three dimensions whilst videos containing traffic
or pedestrians videos are virtually confined in two dimensions.
\item \textbf{Algae formation on camera lens:} The contact of sea water with the camera’s lens facilitates the quick formation of algae on top of camera.
\item \textbf{Periodic and multi-modal background:} Arbitrarily moving objects such as stones and periodically moving ojects such as plants subject to flood-tide and drift can generated false positive detections.
\end{itemize}
\indent In a comparative evaluation done in 2012 on the Fish4Knowledge dataset \cite{P6C2-Dataset-2020}, Kavasidis and Palazzo \cite{P0C0-A-68-1} evaluated the performance of six state-of-the-art background subtraction algorithms (GMM \cite{P1C2-MOG-10}, APMM \cite{P2C1-20}, IM \cite{P1C1-Median-75}, Wave-Back \cite{P2C5-TDM-2}, Codebook \cite{P1C6-100} and ViBe \cite{P2C1-200}) in the task of fish detection in unconstrained and underwater video. Kavasidis and Palazzo \cite{P0C0-A-68-1} concluded that:
\begin{enumerate}
\item At the blob level, the performance is generally good in videos which presented scenes under normal weather and lighting conditions and more or less static backgrounds, except from the Wave-Back algorithm. On the other hand, the ViBe algorithm excelled in nearly all the videos. GMM and APMM performed somewhere in the middle, with the GMM algorithm resulting slightly better than the PMM algorithm. The codebook algorithm gave the best results in the high resolution videos. \
\item At the pixel level, all the algorithms show a good pixel detection rate, i.e. they are able to correctly identify pixels belonging to an object, with values in the range between $83.2\%$ for the APMM algorithm and $83.4\%$ for ViBe. But, they provide a relatively high pixel false alarm rate, especially the Intrinsic Model and Wave-back algorithms when the contrast of the video was low, a condition encountered during low light scenes and when violent weather phenomena were present (typhoons and storms).
\end{enumerate}
\indent In a further work in 2017, Radolko et al. \cite{P6C2-Dataset-2025} identified the following five main difficulties:
\begin{itemize}
\item \textbf{Blur:} It is due to the forward scattering in water and makes it impossible to get a sharp image.
\item \textbf{Haze:} Small particles in the water cause back scatter. The effect is similar to a sheer veil in front of the
scene.
\item \textbf{Color Attenuation:} Water absorbs light stronger than air. Also, the absorption effect depends on the wavelength of
the light and this leads to underwater images with strongly distorted and mitigated colors.
\item \textbf{Caustics:} Light reflections on the ground caused by ripples on the water surface. They are similar to strong, fast moving shadows which makes them very hard to differentiate from dark objects.
\item \textbf{Marine Snow:} Small floating particles which strongly reflect light. Mostly they are small enough that they are
filtered out during the segmentation process, however, they still corrupt the image and complicate for example the modeling of the static background.
\end{itemize}
Experimental results \cite{P6C2-Dataset-2025} done on the dataset UnderwaterChangeDetection.eu \cite{P6C2-Dataset-2025} show that GSM \cite{P1C2-MOG-765} gives better performance than MOG-EM \cite{P1C2-MOG-90}, Zivkovic-Heijden GMM (also called ZHGMM) \cite{P1C2-MOG-36-1} and EA-KDE (also called KNN) \cite{P1C2-KDE-30}. In an other work, Rout et al. \cite{P1C2-MOG-776} designed a spatio-Contextual GMM (SC-GMM) that outperforms 18 background subtraction algorithms such as \textbf{1)} classical algorithms like the original MOG, the original KDE and the original PCA, and \textbf{2)} advanced algorithms like DPGMM (VarDMM) \cite{P2C1-11}, PBAS \cite{P2C1-230}, PBAS-PID \cite{P2C1-231}, SuBSENSE \cite{P2C0-40} and SOBS \cite{P1C5-404} both on the Fish4Knowledge dataset \cite{P6C2-Dataset-2020} and the dataset UnderwaterChangeDetection.eu \cite{P6C2-Dataset-2025}. \\
Thus, natural environments involve multi-modal backgrounds, and changes of the background structure need to be captured from the background model to avoid a big amount of false detection rate. Practically, events such as CVAUI (Computer Vision for Analysis of Underwater Imagery) 2015 and 2016 in conjunction with ICPR addressed the problem of the detection in ocean surface and underwater environments. \\
\section{Miscellaneous Applications}
\label{P0C2:sec:OMA}
\subsection{Visual Analysis of Human Activities}
Background subtraction is also used for visual analysis of human activities like in sport \textbf{(1)} when important decisions need to be made quickly, \textbf{(2)} for precise analysis of athletic performance, and \textbf{(3)} for surveillance in dangerous activities. For example, John et al. \cite{P0C0-A-502} provide a system that allow a coach to obtain real-time feedbacks to ensure that the routine is performed in a correct manner. During the initialisation stage, the stationary camera captures the background image without the user, and then each current image is subtracted to obtain the silhouette. This method is the simplest way to obtain the silhouette and is useful in this context as it is indoor scene with control on the light. In practice, the method was implemented inside an Augmented Reality (AR) desktop app that employs a single RGB camera. The detected body pose image is compared against the exemplar body pose image at specific intervals. The pose matching function is reported to have an accuracy of $93.67\%$. In an other work, Tamas \cite{P0C0-A-500} designed a system for estimating the pose of athletes exercising on indoor rowing machines. Practically, Zivkovic-Heijden GMM \cite{P1C2-MOG-36-1} and Zivkovic-KDE \cite{P1C2-KDE-30} available in OpenCV were tested with success but with the main drawbacks that these methods mark the shadows projecting to the background as foreground. Then, Tamas \cite{P0C0-A-500} developed a fast and accurate background subtraction method which allows to extract the head, shoulder, elbow, hand, hip, knee, ankle and back positions of a rowing athlete. For surveillance, Bastos \cite{P0C0-A-501} employed the original MOG to detect surfers on waves in Ribeira d’Ilhas beach (Portugal). The proposed system obtains a false positive rate of 1.77 for a detection rate of $90\%$ but the amount of memory and computational time required to process a video sequence is the main drawback of this system.
\begin{landscape}
\begin{table}
\scalebox{0.60}{
\begin{tabular}{|l|l|l|l|l|l|l|}
\hline
\scriptsize{Applications} &\scriptsize{Type} &\scriptsize{Background model} &\scriptsize{Background Maintenance} &\scriptsize{Foreground Detection} &\scriptsize{Color Space} &\scriptsize{Strategies} \\
\hline
\hline
\scriptsize{\textbf{Visual Hull Computing}}&\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} \\
\scriptsize{\textbf{1) Image-based Modeling}}&\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} \\
\scriptsize{Matusik et al. (2000) \cite{P1C2-SG-1}} &\scriptsize{Marker Free} &\scriptsize{MOG \cite{P1C2-MOG-1}} &\scriptsize{Idem MOG} &\scriptsize{Idem MOG} &\scriptsize{RGB} &\scriptsize{-} \\
\scriptsize{\textbf{2) Optical Motion Capture}} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} \\
\scriptsize{Wren et al. (1997) \cite{P1C2-SG-1}} &\scriptsize{Marker Free (Pfinder \cite{P1C2-SG-1})} &\scriptsize{SG \cite{P1C2-SG-1}} &\scriptsize{Idem SG} &\scriptsize{Idem SG} &\scriptsize{YUV} &\scriptsize{-} \\
\scriptsize{Horprasert et al. (1998) \cite{P0C0-A-110}} &\scriptsize{Marker Free} &\scriptsize{W4 \cite{P0C0-A-110-1}} &\scriptsize{Idem W4} &\scriptsize{Idem W4} &\scriptsize{Intensity} &\scriptsize{-} \\
\scriptsize{Horprasert et al. (1999) \cite{P0C0-A-111}} &\scriptsize{Marker Free} &\scriptsize{Codebook \cite{P0C0-A-111}} &\scriptsize{Idem Codebook \cite{P0C0-A-111}} &\scriptsize{Idem Codebook \cite{P0C0-A-111}} &\scriptsize{RGB} &\scriptsize{Shadow Detection} \\
\scriptsize{Horprasert et al. (2000) \cite{P0C0-A-112}} &\scriptsize{Marker Free} &\scriptsize{Codebook \cite{P0C0-A-111}} &\scriptsize{Idem Codebook \cite{P0C0-A-111}} &\scriptsize{Idem Codebook \cite{P0C0-A-111}} &\scriptsize{RGB} &\scriptsize{Shadow Detection} \\
\scriptsize{Mikic et al. (2002) \cite{P0C0-A-130}} &\scriptsize{Marker Free} &\scriptsize{Codebook \cite{P0C0-A-111}} &\scriptsize{Idem Codebook \cite{P0C0-A-111}} &\scriptsize{Idem Codebook \cite{P0C0-A-111}} &\scriptsize{RGB} &\scriptsize{Shadow Detection} \\
\scriptsize{Mikic et al. (2003) \cite{P0C0-A-131}} &\scriptsize{Marker Free} &\scriptsize{Codebook \cite{P0C0-A-111}} &\scriptsize{Idem Codebook \cite{P0C0-A-111}} &\scriptsize{Idem Codebook \cite{P0C0-A-111}} &\scriptsize{RGB} &\scriptsize{Shadow Detection} \\
\scriptsize{Chu et al. (2003) \cite{P0C0-A-140}} &\scriptsize{Marker Free} &\scriptsize{SG \cite{P1C2-SG-10}} &\scriptsize{Idem SG} &\scriptsize{Idem SG} &\scriptsize{HSV} &\scriptsize{-} \\
\scriptsize{Carranza et al. (2003) \cite{P0C0-A-100}} &\scriptsize{Marker Free} &\scriptsize{SG \cite{P1C2-SG-1}} &\scriptsize{Idem SG} &\scriptsize{Idem SG} &\scriptsize{YUV} &\scriptsize{Shadow Detecion} \\
\scriptsize{Guerra-Filho (2005) \cite{P0C0-A-101}} &\scriptsize{Marker Detection} &\scriptsize{Median} &\scriptsize{Idem Median} &\scriptsize{Idem Median} &\scriptsize{RGB } &\scriptsize{-} \\
\scriptsize{Kim et al. (2007) \cite{P0C0-A-141}} &\scriptsize{Marker Free} &\scriptsize{SGG (GGF) \cite{P1C2-SGG-1}} &\scriptsize{Idem SGG} &\scriptsize{Idem SGG} &\scriptsize{RGB} &\scriptsize{Small regions suppression} \\
\scriptsize{Park et al. (2009) \cite{P0C0-A-120}} &\scriptsize{Photorealistic Avatars} &\scriptsize{Codebook with online MoG} &\scriptsize{Idem Codebook} &\scriptsize{Idem Codebook} &\scriptsize{RGB} &\scriptsize{Markov Random Field (MRF)} \\
\hline
\hline
\scriptsize{\textbf{Human-Machine Interaction (HMI)}} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} \\
\scriptsize{\textbf{1) Arts}} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} \\
\scriptsize{Levin (2006) \cite{P0C0-A-360}} &\scriptsize{Art} &\scriptsize{-} &\scriptsize{-} &\scriptsize{-} &\scriptsize{-} &\scriptsize{-} \\
\scriptsize{\textbf{2) Games}} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} \\
\scriptsize{\textbf{3) Ludo-Multimedia Applications}} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} \\
\scriptsize{Penciuc et al. (2006) \cite{P0C0-A-202}} &\scriptsize{Fish Detection} &\scriptsize{MOG} &\scriptsize{Idem MOG} &\scriptsize{Idem MOG} &\scriptsize{RGB} &\scriptsize{-} \\
\scriptsize{Baf et al.(2007) \cite{P0C0-A-201}} &\scriptsize{Fish Detection} &\scriptsize{MOG} &\scriptsize{Idem MOG} &\scriptsize{Idem MOG} &\scriptsize{RGB} &\scriptsize{-} \\
\scriptsize{Baf et al.(2007) \cite{P0C0-A-200}} &\scriptsize{Fish Detection} &\scriptsize{MOG} &\scriptsize{Idem MOG} &\scriptsize{Idem MOG} &\scriptsize{RGB} &\scriptsize{-} \\
\hline
\hline
\scriptsize{\textbf{Vision-based Hand Gesture Recognition}} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} \\
\scriptsize{\textbf{1) Human Computer Interface (HCI)}} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} \\
\scriptsize{Park and Hyun (2013) \cite{P0C0-A-370}} &\scriptsize{Hand Detection} &\scriptsize{Average} &\scriptsize{Selective Maintenance} &\scriptsize{Idem Running Average} &\scriptsize{Intensity} &\scriptsize{-} \\
\scriptsize{Stergiopoulou et al. (2014) \cite{P0C0-A-371}} &\scriptsize{Hand Detection} &\scriptsize{Three CFD/BGS \cite{P0C0-A-4-10}} &\scriptsize{Idem CFD/BGS\cite{P0C0-A-4-10}} &\scriptsize{Idem CFD/BGS\cite{P0C0-A-4-10}} &\scriptsize{RGB} &\scriptsize{-} \\
\scriptsize{\textbf{2) Behavior Analysis}} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} \\
\scriptsize{Perrett et al. (2016) \cite{P0C0-A-374}} &\scriptsize{Hand Detection} &\scriptsize{PBAS \cite{P2C1-230}} &\scriptsize{Idem PBAS \cite{P2C1-230}} &\scriptsize{PBAS \cite{P2C1-230}} &\scriptsize{Intensity} &\scriptsize{Post-processing (Median filter)} \\
\scriptsize{\textbf{3) Sign Language Interpretation and Learning}} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} \\
\scriptsize{Elsayed et al. (2015) \cite{P0C0-A-372}} &\scriptsize{Hand Detection} &\scriptsize{First Frame without Foreground Objects} &\scriptsize{Running Average} &\scriptsize{Idem Running Average} &\scriptsize{YCrCb} &\scriptsize{-} \\
\scriptsize{\textbf{4) Robotics}} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} \\
\scriptsize{Khaled et al. (2015) \cite{P0C0-A-373}} &\scriptsize{Hand Detection} &\scriptsize{Average} &\scriptsize{Running Average} &\scriptsize{Idem Running Average} &\scriptsize{Intensity/Color} &\scriptsize{Contour Extraction Algorithm} \\\hline
\hline
\scriptsize{\textbf{Video Coding}} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} &\scriptsize{} \\
\scriptsize{Chien et al. (2002) \cite{P0C0-A-300}} &\scriptsize{MPEG-4 (QCIF Format)} &\scriptsize{Progressive Generation (CFD \cite{P5C1-CDFeatureI-300})} &\scriptsize{Progressive Maintenance} &\scriptsize{CD \cite{P5C1-CDFeatureI-300}} &\scriptsize{Intensity} &\scriptsize{Post Processing/Shadow Detection} \\
\scriptsize{Paul et al. (2010) \cite{P0C0-A-310-1}} &\scriptsize{H.264/AVC (CIF Format)} &\scriptsize{MOG on decoded pixel intensities} &\scriptsize{Selective Maintenance} &\scriptsize{Block-based Difference} &\scriptsize{Intensities} &\scriptsize{-} \\
\scriptsize{Paul et al. (2013) \cite{P5C1-VC-1}} &\scriptsize{H.264/AVC (CIF Format)} &\scriptsize{MOG on decoded pixel intensities} &\scriptsize{Selective Maintenance} &\scriptsize{Block-based Difference} &\scriptsize{Intensities} &\scriptsize{-} \\
\scriptsize{Paul et al. (2013) \cite{P0C0-A-310-2}} &\scriptsize{H.264/AVC} &\scriptsize{MOG \cite{P1C2-MOG-132}} &\scriptsize{-} &\scriptsize{-} &\scriptsize{Color} &\scriptsize{-} \\
\scriptsize{Zhang et al. (2010) \cite{P0C0-A-320-1}} &\scriptsize{H.264/AVC} &\scriptsize{Non-Parametric Background Generation \cite{P0C0-A-320-1}} &\scriptsize{Idem BG \cite{P0C0-A-320-1}} &\scriptsize{Idem BG \cite{P0C0-A-320-1}} &\scriptsize{Color} &\scriptsize{-} \\
\scriptsize{Zhang et al. (2012) \cite{P0C0-A-320}} &\scriptsize{H.264/AVC} &\scriptsize{SWRA \cite{P0C0-A-320}} &\scriptsize{Selective Maintenance} &\scriptsize{-} &\scriptsize{Color} &\scriptsize{-} \\
\scriptsize{Chen et al. (2012) \cite{P0C0-A-321}} &\scriptsize{H.264/AVC} &\scriptsize{Average} &\scriptsize{Selective Maintenance} &\scriptsize{-} &\scriptsize{Color} &\scriptsize{-} \\
\scriptsize{Han et al. (2012)\cite{P0C0-A-322}} &\scriptsize{H.264/AVC} &\scriptsize{-} &\scriptsize{-} &\scriptsize{-} &\scriptsize{Color} &\scriptsize{Panorama Background/Motion Compensation} \\
\scriptsize{Zhang et al. (2012) \cite{P0C0-A-323}} &\scriptsize{H.264/AVC} &\scriptsize{MSBDC \cite{P0C0-A-323}} &\scriptsize{Selective Maintenance} &\scriptsize{-} &\scriptsize{Color} &\scriptsize{-} \\
\scriptsize{Geng et al. (2012)\cite{P0C0-A-324}} &\scriptsize{H.264/AVC} &\scriptsize{SWRA \cite{P0C0-A-320}} &\scriptsize{Selective Maintenance} &\scriptsize{-} &\scriptsize{Color} &\scriptsize{-} \\
\scriptsize{Zhang et al. (2014) \cite{P5C1-VC-10}} &\scriptsize{} &\scriptsize{BMAP \cite{P5C1-VC-10}} &\scriptsize{Selective Maintenance} &\scriptsize{-} &\scriptsize{Color} &\scriptsize{-} \\
\scriptsize{Zhao et al. (2014) \cite{P5C1-VC-11}} &\scriptsize{HEVC} &\scriptsize{BFDS \cite{P5C1-VC-11}} &\scriptsize{-} &\scriptsize{-} &\scriptsize{Color} &\scriptsize{-} \\
\scriptsize{Zhang et al. (2014) \cite{P0C0-A-327}} &\scriptsize{HEVC} &\scriptsize{Running Average} &\scriptsize{-} &\scriptsize{-} &\scriptsize{Color} &\scriptsize{-} \\
\scriptsize{Chakraborty et al. (2014) \cite{P5C1-VC-2}} &\scriptsize{HEVC} &\scriptsize{KDE/Median} &\scriptsize{Selective Maintenance} &\scriptsize{-} &\scriptsize{Intensity} &\scriptsize{-} \\
\scriptsize{Chakraborty et al. (2014) \cite{P5C1-VC-3}} &\scriptsize{HEVC} &\scriptsize{KDE/Median} &\scriptsize{Selective Maintenance} &\scriptsize{-} &\scriptsize{Intensity} &\scriptsize{-} \\
\scriptsize{Chakraborty et al. (2017) \cite{P0C0-A-312}} &\scriptsize{HEVC} &\scriptsize{KDE/Median} &\scriptsize{Selective Maintenance} &\scriptsize{-} &\scriptsize{Intensity} &\scriptsize{Scene Adaptive Non-Parametric Technique} \\
\scriptsize{Chen et al. (2012) \cite{P3C1-OA-32}} &\scriptsize{H.264/AVC} &\scriptsize{RPCA (LRSD \cite{P3C1-OA-32})} &\scriptsize{-} &\scriptsize{-} &\scriptsize{Intensity} &\scriptsize{-} \\
\scriptsize{Guo et al. (2013) \cite{P3C1-OA-31}} &\scriptsize{H.264/AVC} &\scriptsize{RPCA (Dictionary Learning \cite{P3C1-OA-31})} &\scriptsize{-} &\scriptsize{-} &\scriptsize{Color} &\scriptsize{-} \\
\scriptsize{Zhao et al. (2013) \cite{P3C1-OA-30}} &\scriptsize{HEVC} &\scriptsize{RPCA (Adaptive Lagrange Multiplier \cite{P3C1-OA-30})} &\scriptsize{-} &\scriptsize{-} &\scriptsize{Color} &\scriptsize{-} \\
\hline
\end{tabular}}
\caption{Background models used for optical motion capture and video coding: An Overview. "-" indicated that the background model used in not indicated in the paper.} \centering
\label{P0C2:OMC}
\end{table}
\end{landscape}
\subsection{Optical motion capture}
\label{P0C2:sec:OMC}
The aim is to obtain a 3D model of an actors filmed by a system with multi-cameras wich can require markers \cite{P0C0-A-101} or not \cite{P0C0-A-100}\cite{P0C0-A-110}\cite{P0C0-A-130}\cite{P0C0-A-131}\cite{P0C0-A-140}\cite{P0C0-A-141}.
Because it is impossible to have a rigourous 3D reconstruction of a human model, a 3D voxel approximation \cite{P0C0-A-130}\cite{P0C0-A-131} obtained by shape-from-silhouette (also called visual hull) is computed with the silhouettes obtained from each camera. Then, the movememts are tracked and reproduced on human body model called avatar. Optical motion capture is used in computer game, virtual clothing application and virtual reality. In all optical motion capture systems, it requires in its first step to obtain a full and precise capture of human sihouette and movements from the different point of view provided by the multiple cameras. One common technique for obtaining silhouettes also used in television weather forecasts and for cinematic special effects for background substitution is chromakeying (also called bluescreen matting) which is based on the fact that the actual scene background is a single uniform color that is unlikely to appear in foreground objects. Foreground objects can then be segmented from the background by using color comparisons but chromakey techniques do not admit arbitrary backgrounds, which is a severe limitation as developed by Buehler et al. \cite{P0C0-A-150}. Thus, background subtraction is more suitable to obtain the silhouette. Practically, silhouettes are then extracted in each view by background subtraction, and thus this step is also called silhouette detection or silhouette extraction. Because the acquisition is made in indoor scenes, the background model required can be uni-modal, and shadows and highlights are the main challenges in this application. In this context, Wren et al. \cite{P1C2-A-102} used a single Gaussian model in YUV color space whilst Horprasert et al. \cite{P0C0-A-111}\cite{P0C0-A-112} used a statistical model with shadow and highlight suppression. Furthermore, Table \ref{P0C2:OMC} shows an overview of the different publications in the field with information about the background model, the background maintenance, the foreground detection, the color space and the strategies used by the authors. \\
\subsection{Human-machine interaction}
\label{P0C2:sec:HMI}
Several applications need interactions between human and machine through a video acquired in real-time by fixed cameras such as games (Microsoft's Kinect) and ludo-applications such as Aqu@theque \cite{P0C0-A-200}\cite{P0C0-A-201}\cite{P0C0-A-202}.
\begin{itemize}
\item \textbf{Arts and Games:} First, the person's body pixels are located with background subtraction, and then this information is used as the basis for graphical responses in interactive systems as developed in Levin et al. \cite{P0C0-A-360} website\protect\footnotemark[9]). In 2003, Warren \cite{P0C0-A-361} presented a vocabulary of various essential interaction techniques which can use this kind of body-pixel data. These schema are useful in "mirror-like" contexts, such as Myron Krueger's Videoplace \protect\footnotemark[10]), or video games like the PlayStation Eye-Toy, in which the participant can observe his own image or silhouette composited into a virtual scene.
\footnotetext[9]{http://www.flong.com/texts/essays/essaycvad/}
\footnotetext[10]{http://www.medienkunstnetz.de/works/videoplace/}
\item \textbf{Ludo-Multimedia Applications:} In this type of applications, the user can select a moving object of interest on a screen, and then information are provided. A representative example is the Aqu@theque project which allows a visitor of an aquarium to select on an interactive interface fishes that are filmed on line by a remote video camera. This interface is a touch screen divided into two parts. The first one shows the list of fishes present in the tank and is useful all the time. The filmed scene is visualized in the remaining part of the screen. The computer can supply information about fishes selected by the user with his finger. A fish is then automatically identified and some educational information about it is put on the screen. The user can also select each identified fish whose virtual representation is shown on another screen. This second screen is a virtual tank reproducing the natural environment where the fish lives in presence of it preys and predators. The behavior of every fish in the virtual tank is modeled. The project is based on two original elements: the automatic detection and recognition of fish species in a remote tank of an aquarium and the behavioral modeling of virtual fishes by multi-agents method.
\end{itemize}
\subsection{Vision-based Hand Gesture Recognition}
\label{P0C2:sec:HGR}
In vision-based hand gesture recognition, it is needed to detect, track and recognize hand gesture for several applications such as human-computer interface, behavior studies, sign language interpretation and learning, teleconferencing, distance learning, robotics, games selection and object manipulation in virtual environments. We have classified them as follows:
\begin{itemize}
\item \textbf{Human-Computer Interface:}
Common HCI techniques still rely on simple devices such as keyboard, mice, and joysticks, which are not enough to convoy the latest technology. Hand gesture has become one of the most important attractive alternatives to existing traditional HCI techniques. Practically, hand gesture detection for HCI is achieved using real-time video streaming by removing the background using a background algorithm. Then, every hand gesture can be used for augmented screen as in Park and Hyun \cite{P0C0-A-370} or for computer interface in vision-based hand gesture recognition as in Stergiopoulou et al. \cite{P0C0-A-371}.
\item \textbf{Behavior Analysis:} Perrett et al. \cite{P0C0-A-374} analyzed which vehicle occupant is interacting with a control on the center console when it is activated, enabling the full use of dual-view touch screens and the removal of duplicate controls. The proposed method is first based on hands detection made by a background subtraction algorithm incorporating information from a superpixel segmentation stage. Practically, Perrett et al. \cite{P0C0-A-374} chose PBAS \cite{P2C1-230} as background subtraction algorithm because it allows small foreground objects to decay into the background model quickly whilst larger objects persist, and superpixel Simple Linear Iterative Clustering (SLIC) algormothm as the superpixel segmentation method. Experimental results \cite{P0C0-A-374} on the centers panel of a car show that the hands can be effectivly detected both in day and night conditions.
\item \textbf{Sign Language Interpretation and Learning:} Elsayed et al. \cite{P0C0-A-372} proposed to detect moving hand area precisely in a real time video sequence using a threshold based on skin color values to improve the segmentation process. The initial background is the first frame without foreground objects. Then, the foreground detection is obtained with a threshold on the difference between the background and the current frame in YCrCb color space. Experimental results \cite{P0C0-A-372} on indoor and outdoor scenes show that this method can efficiently detect the hands.
\item \textbf{Robotics:} Khaled et al. \cite{P0C0-A-373} used a running average to detect the hands, and the 1\$ algorithm \cite{P0C0-A-373} for hand’s template matching. Then, five hand gestures are detected and translated into commands that can be used to control robot movements.
\end{itemize}
\subsection{Content-based video coding}
\label{P0C2:sec:CVC}
To generate video contents, videos have to be segmented into video objects and tracked as they transverse across the video frames. The registered background and the video objects are then encoded separately to allow the transmission of video objects only in the case when the background does not change over time as in video surveillance scenes taken by a fixed camera. So, video coding needs an effective method to separate moving objects from static and dynamic environments \cite{P0C0-A-300}\cite{P5C1-MulF-40}.
\indent For H.264 video coding, Paul et al. \cite{P5C1-VC-1}\cite{P0C0-A-310-1} proposed a video coding method using a reference frame which is the most common frame in scene generated by dynamic background modeling based on the MOG model with decoded pixel intensities instead of the original pixel intensities. Thus, the proposed model focuses on rate-distortion optimization whereas the original MOG primarily focuses on moving object detection. In a further work, Paul et al. \cite{P0C0-A-310-2} presented an arbitrary shaped pattern-based video coding (ASPVC) for dynamic background modeling based on MD-MOG. Even if these dynamic background frame based video coding methods based on MoG based background modeling achieve better rate distortion performance compared to the H.264 standard, they need high computation time, present low coding efficiency for dynamic videos, and prior knowledge requirement of video content. To address these limitations, Chakraborty et al. \cite{P5C1-VC-2}\cite{P5C1-VC-3} presented an Adaptive Weighted non-Parametric (WNP) background modeling technique, and further embedded it into HEVC video coding standard for better rate-distortion performance. Being non-parametric, WNP outperforms in dynamic background scenarios compared to MoG-based techniques without a priori knowledge of video data distribution. In a further work, Chakraborty et al. \cite{P0C0-A-312} improved WNP by using a scene adaptive non-parametric (SANP) technique developed to handle video sequences with high dynamic background.
\indent To address the limitations of the H.264/AVC video coding, Zhang et al. \cite{P0C0-A-320-1} presented a coding scheme for surveillance videos captured by fixed cameras. This scheme used a nonparametric background generation proposed by Liu et al. \cite{P0C0-A-320-2}. In a further work, Zhang et al. \cite{P0C0-A-320} proposed a Segment-and-Weight based Running Average (SWRA) method for surveillance video coding. In a similar approach, Chen et al. \cite{P0C0-A-321} used a timely and bit saving background maintenance model. In a further work, Zhang et al. \cite{P0C0-A-323} used a macro-block-level selective background difference coding method (MSBDC). In an other work, Zhang et al. \cite{P5C1-VC-10} presented a Background Modeling based Adaptive Background Prediction (BMAP) method. In an other approach, Zhao et al. \cite{P5C1-VC-11} proposed a background-foreground division based search algorithm (BFDS) to address the limitations of the HECV coding whilst Zhang et al. \cite{P0C0-A-327} used a running average. For moving cameras, Han et al. \cite{P0C0-A-322} proposed to compute a panorama background with motion compensation.
\indent Because H.264/AVC is not sufficiently efficient for encoding surveillance videos since it not exploits the strong background
temporal redundancy, Chen et al. \cite{P3C1-OA-32} used for the compression the RPCA decomposition model \cite{P3C1-PCP-1} which decomposed a surveillance video into the low-rank component (background), and the sparse component (moving objects). Then, Chen et al. \cite{P3C1-OA-32} developed different coding methods for the two different components by representing the frames of the background by very few independent frames based on their linear dependency. Experimental results \cite{P3C1-OA-32} show that the proposed RPCA method called Low-Rank and Sparse Decomposition (LRSD) outperforms H.264/AVC, up to 3 dB PSNR gain, especially at relatively low bit rate. In an other work, Guo et al. \cite{P3C1-OA-31} trained a background dictionary based on a small number of observed frames, and then separated every frame into the background and motion (foreground) by using the RPCA decomposition model \cite{P3C1-PCP-1}. In a further step, Guo et al. \cite{P3C1-OA-31} stored the compressed motion with the reconstruction coefficient of the background corresponding to the background dictionary. Experimental results \cite{P3C1-OA-31} show that this RPCA method significantly reduces the size of videos while gains much higher PSNR compared to the state-of-the-art codecs. In these RPCA video coding standards, the selection of Lagrange multiplier is crucial to achieve trade-off between the choices of low-distortion and low-bitrate prediction modes, and the rate-distortion analysis shows that a larger Lagrange multiplier should be used if the background in a coding unit took a larger proportion. To take into account this fact, Zhao et al. \cite{P3C1-OA-32} proposed a modified Lagrange multiplier for rate-distortion optimization by performing an in-depth analysis on the relationship between the optimal Lagrange multiplier and the background proportion, and then Zhao et al. \cite{P3C1-OA-32} presented a Lagrange multiplier selection model to obtain the optimal coding performance. Experimental results show that this Adaptive Lagrange Multiplier Coding Method (ALMCM) \cite{P3C1-OA-32} achieves $18.07\%$ bit-rate saving on CIF sequences and $11.88\%$ on SD sequences against the background-irrelevant Lagrange multiplier selection method.
Table \ref{P0C2:OMC} shows an overview of the different publications in the field with information about the background model, the background maintenance, the foreground detection, the color space and the strategies used by the authors. \\
\subsection{Background substitution}
This task is also called background cut and video matting. It consist in extracting the foreground from the input video and then combine it with a new background. Thus, background subtraction can be used in the first step as in Huang et al. \cite{P0C0-A-350}. \\
\subsection{Carried baggage detection}
Tzanidou \cite{P0C0-A-600} proposed a carried baggage detection based on background modeling which used multi-directional gradient and phase congruency. Then, the detected foreground contours are refined by classifying the edge segments as either belonging to the foreground or background. Finally, a contour completion technique by anisotropic diffusion is employed. The proposed method targets cast shadow removal, gradual illumination change invariance, and closed contour extraction.
\subsection{Fire detection}
Several fire detection systems \cite{P0C0-A-700}\cite{P0C0-A-710}\cite{P0C0-A-720}\cite{P0C0-A-730} use in their first step background subtraction to detect moving pixels. Second, colors of moving pixels are checked to evaluate if they match to pre-specified fire-colors, then wavelet analysis in both temporal and spatial domains is carried out to determine high-frequency activity as developed in Toreyin et al. \cite{P0C0-A-700}.
\subsection{OLED defect detection}
Organic Light Emitting Diode (OLED) is a light-emitting diode which is popular in the display industry due to its advantages such as colorfulness, light weight, large viewing angle, and power efficiency as developed in Jeon and Yoo \cite{P1C2-KDE-171}. But, the complex manufacturing process also produces defects. which may consistently affect the quality and life of the display. in this context, an automated inspection system based on computer vision is needed. Practically, OLED presents a feature of gray scale and repeating patterns, but significant intensity variations are also presented. Thus, background subtraction can be used for the inspection. For example, KDE based background model \cite{P1C2-KDE-171}
can be built by using multiple repetitive images around the target area. Then, the model is used to compute likelihood
at each pixel of the target image.
\section{Discussion}
\label{Challenges}
\subsection{Solved and unsolved challenges}
As developed in the previous sections, all these applications present their own characteristics in terms of environments and objects of interest, and then they present a less or more complex challenge for background subtraction. In addition, they are less or more recent with the consequence that there are less or more publications that addressed the corresponding challenges. Thus, in this section, we have grouped in Table \ref{P0C2:Applications} the solved and unsolved challenges by application to give an overview in which applications investigations need to be made. We can see that the main difficult challenges are camera jitter, illumination changes and dynamic backgrounds that occur in outdoor scenes. Future research may concern these challenges.
\begin{table}
\scalebox{0.65}{
\begin{tabular}{|l|l|l|l|}
\hline
\scriptsize{Applications} &\scriptsize{Scenes} &\scriptsize{Challenges} &\scriptsize{Solved-unsolved} \\
\hline
\hline
\scriptsize{1) Intelligent Visual Surveillance of Human Activities} & \scriptsize{} & \scriptsize{} & \scriptsize{} \\
\scriptsize{1.1) Traffic Surveillance} & \scriptsize{Outdoor scenes} & \scriptsize{Multi-modal backgrounds} & \scriptsize{Partially solved} \\
\scriptsize{} & \scriptsize{} & \scriptsize{Illumination changes} & \scriptsize{Partially solved} \\
\scriptsize{} & \scriptsize{} & \scriptsize{Camera jitter} & \scriptsize{Partially solved} \\
\scriptsize{1.2 Airport Surveillance} & \scriptsize{Outdoor scenes} & \scriptsize{Illumination changes} & \scriptsize{Partially solved} \\
\scriptsize{} & \scriptsize{} & \scriptsize{Camera jitter} & \scriptsize{Partially solved} \\
\scriptsize{} & \scriptsize{} & \scriptsize{Illumination changes} & \scriptsize{Partially solved} \\
\scriptsize{1.3) Maritime Surveillance} & \scriptsize{Outdoor scenes} & \scriptsize{Multimodal backgrounds} & \scriptsize{Partially solved} \\
\scriptsize{} & \scriptsize{} & \scriptsize{Illumination changes} & \scriptsize{Partially solved} \\
\scriptsize{} & \scriptsize{} & \scriptsize{Camera jitter} & \scriptsize{Partially solved} \\
\scriptsize{1.4) Store Surveillance} & \scriptsize{Indoor scenes} & \scriptsize{Multimodal backgrounds} & \scriptsize{Splved} \\
\scriptsize{1.5) Coastal Surveillance} & \scriptsize{Outdoor scenes} & \scriptsize{Multimodal backgrounds} & \scriptsize{Partially solved} \\
\scriptsize{1.6) Swimming Pools Surveillance} & \scriptsize{Outdoor scenes} & \scriptsize{Multimodal backgrounds} & \scriptsize{Solved} \\
\cline{2-4}
\scriptsize{2) Intelligent Visual Observation of Animal and Insect Behaviors} & \scriptsize{} & \scriptsize{} & \scriptsize{} \\
\scriptsize{2.1) Birds Surveillance} & \scriptsize{Outdoor scenes} & \scriptsize{Multimodal backgrounds} & \scriptsize{Partially solved} \\
\scriptsize{} & \scriptsize{} & \scriptsize{Illumination changes} & \scriptsize{Partially solved} \\
\scriptsize{} & \scriptsize{} & \scriptsize{Camera jitter} & \scriptsize{Partially solved} \\
\scriptsize{2.2) Fish Surveillance} & \scriptsize{Aquatic scenes} & \scriptsize{Multimodal backgrounds} & \scriptsize{Partially solved} \\
\scriptsize{} & \scriptsize{} & \scriptsize{Illumination changes} & \scriptsize{Partially solved} \\
\scriptsize{2.3) Dolphins Surveillance} & \scriptsize{Aquatic scenes} & \scriptsize{Multimodal backgrounds} & \scriptsize{Partially solved} \\
\scriptsize{} & \scriptsize{} & \scriptsize{Illumination changes} & \scriptsize{Partially solved} \\
\scriptsize{2.4) Honeybees Surveillance} & \scriptsize{Outdoor scenes} & \scriptsize{Small objects} & \scriptsize{Partially solved} \\
\scriptsize{2.5) Spiders Surveillance} & \scriptsize{Outdoor scenes} & \scriptsize{} & \scriptsize{Partially solved} \\
\scriptsize{2.6) Lizards Surveillance} & \scriptsize{Outdoor scenes} & \scriptsize{Multimodal backgrounds} & \scriptsize{Partially solved} \\
\scriptsize{2.7) Pigs Surveillance} & \scriptsize{Indoor scenes} & \scriptsize{Illumination changes} & \scriptsize{Partially solved} \\
\scriptsize{2.7) Hinds Surveillance} & \scriptsize{Outdoor scenes} & \scriptsize{Multimodal backgrounds} & \scriptsize{Partially solved} \\
\scriptsize{} & \scriptsize{} & \scriptsize{Low-frame rate} & \scriptsize{Partially solved} \\
\cline{2-4}
\scriptsize{3) Intelligent Visual Observation of Natural Environments} & \scriptsize{} & \scriptsize{} & \scriptsize{} \\
\scriptsize{3.1) Forest} & \scriptsize{Outdoor scenes} & \scriptsize{Multimodal backgrounds} & \scriptsize{Partially solved} \\
\scriptsize{} & \scriptsize{} & \scriptsize{Illumination changes} & \scriptsize{Partially solved} \\
\scriptsize{} & \scriptsize{} & \scriptsize{Low-frame rate} & \scriptsize{Partially solved} \\
\scriptsize{3.2) River} & \scriptsize{Aquatic scenes} & \scriptsize{Multimodal backgrounds} & \scriptsize{Partially solved} \\
\scriptsize{} & \scriptsize{} & \scriptsize{Illumination changes} & \scriptsize{Partially solved} \\
\scriptsize{3.3) Ocean} & \scriptsize{Aquatic scenes} & \scriptsize{Multimodal backgrounds} & \scriptsize{Partially solved} \\
\scriptsize{} & \scriptsize{} & \scriptsize{Illumination changes} & \scriptsize{Partially solved} \\
\scriptsize{3.4) Submarine} & \scriptsize{Aquatic scenes} & \scriptsize{Multimodal backgrounds} & \scriptsize{Partially solved} \\
\scriptsize{} & \scriptsize{} & \scriptsize{Illumination changes} & \scriptsize{Partially solved} \\
\cline{2-4}
\scriptsize{4) Intelligent Analysis of Human Activities} & \scriptsize{} & \scriptsize{} & \scriptsize{} \\
\scriptsize{4.1) Soccer} & \scriptsize{Outdoor scenes} & \scriptsize{Small objects} & \scriptsize{Solved} \\
\scriptsize{} & \scriptsize{} & \scriptsize{Illumination changes} & \scriptsize{Solved} \\
\scriptsize{4.2) Rowing} & \scriptsize{Indoor scenes} & \scriptsize{} & \scriptsize{Solved} \\
\scriptsize{4.3) Surf} & \scriptsize{Aquatic scenes} & \scriptsize{Dynamic backgrounds} & \scriptsize{Partially solved} \\
\scriptsize{} & \scriptsize{} & \scriptsize{Illumination changes} & \scriptsize{Partially solved} \\
\cline{2-4}
\scriptsize{5) Visual Hull Computing} & \scriptsize{} & \scriptsize{} & \scriptsize{} \\
\scriptsize{Image-based Modeling} & \scriptsize{Indoor scenes} & \scriptsize{Shadows/highlights} & \scriptsize{Solved} \\
\scriptsize{Optical Motion Capture} & \scriptsize{Indoor scenes} & \scriptsize{Shadows/highlights} & \scriptsize{Solved (SG)} \\
\cline{2-4}
\scriptsize{6) Human-Machine Interaction (HMI)} & \scriptsize{} & \scriptsize{} & \scriptsize{} \\
\scriptsize{Arts} & \scriptsize{Indoor scenes} & \scriptsize{} & \scriptsize{} \\
\scriptsize{Games} & \scriptsize{Indoor scenes} & \scriptsize{} & \scriptsize{} \\
\scriptsize{Ludo-Multimedia} & \scriptsize{Indoor scenes/Outdoor scenes} & \scriptsize{} & \scriptsize{} \\
\cline{2-4}
\scriptsize{7) Vision-based Hand Gesture Recognition} & \scriptsize{} & \scriptsize{} & \scriptsize{} \\
\scriptsize{Human Computer Interface (HCI)} & \scriptsize{Indoor scenes} & \scriptsize{} & \scriptsize{} \\
\scriptsize{Behavior Analysis} & \scriptsize{Indoor scenes/Outdoor scenes} & \scriptsize{} & \scriptsize{} \\
\scriptsize{Sign Language Interpretation and Learning} & \scriptsize{Indoor scenes/Outdoor scenes} & \scriptsize{} & \scriptsize{}\\
\scriptsize{Robotics} & \scriptsize{Indoor scenes} & \scriptsize{} & \scriptsize{} \\
\cline{2-4}
\scriptsize{7) Content based Video Coding} & \scriptsize{} & \scriptsize{Indoor scenes/Outdoor scenes} & \scriptsize{} \\
\hline\end{tabular}}
\caption{Solved and unsolved issues : An Overview} \centering
\label{P0C2:Applications}
\end{table}
\subsection{Prospective solutions}
Prospective solutions to handle the unsolved challenges can be the use of recent background subtraction methods based on fuzzy models \cite{P2C2-10}\cite{P5C1-FA-12}\cite{P5C1-FA-13}\cite{P5C1-FA-33}, RPCA models \cite{P3C1-PCP-940}\cite{P3C1-PCP-941}\cite{P3C1-PCP-942}\cite{P3C1-PCP-9420} and deep learning models \cite{P1C5-2100}\cite{P1C5-2150}\cite{P1C5-2162}\cite{P1C5-2163}\cite{P1C5-2163-1}\cite{P1C5-2167}. Among these recent models, several algorithms are potential usable algorithms for real applications:
\begin{itemize}
\item For fuzzy concepts, the foreground detection based on Choquet integral was tested with success for moving vehicles detection by Lu et al. \cite{P5C1-FA-31}\cite{P5C1-FA-34}.
\item For RPCA methods, Vaswani et al. \cite{P3C1-PCP-1030}\cite{P3C1-PCP-1030-1} provided a full study of robust subspace learning methods for background subtraction in terms of detection and algorithms's properties. Among online algorithms, incPCP\protect\footnotemark[11] algorithm \cite{P3C1-PCP-412} and its corresponding improvements \cite{P3C1-PCP-1061}\cite{P3C1-PCP-1062}\cite{P3C1-PCP-1063}\cite{P3C1-PCP-1064}\cite{P3C1-PCP-1064-1}\cite{P3C1-PCP-1065}\cite{P3C1-PCP-1068}\cite{P3C1-PCP-1069} as well as the ReProCS\protect\footnotemark[12] algorithm \cite{P3C1-PCP-1010} and its numerous variants \cite{P3C1-PCP-1011}\cite{P3C1-PCP-1019}\cite{P3C1-PCP-1020}\cite{P3C1-PCP-1027-1} present both advantages in terms of detection, real-time and memory requirements. In traffic surveillance, incPCP was tested with success for vehicle counting \cite{P3C1-PCP-1066}\cite{P3C1-PCP-1067} whilst an online RPCA algorithm for vehicle and person detection \cite{P3C1-PCP-1070}. In animals surveillance, Rezaei and Ostadabbas \cite{P3C1-RMC-91}\cite{P3C1-RMC-92} provided a fast Robust Matrix Completion (fRMC) algorithm for in-cage mice detection using the Caltech resident intruder mice dataset.
\item For deep learning, only Bautista et al. \cite{P1C5-2120} tested the convolutional neural network for vehicle detection in low resolution traffic videos. But, even if the recent deep learning methods can be naturally considered due there robustness in presence of the concerned unsolved challenges, most of the time they are still to time and memory consuming to be currently employed in real application cases.
\end{itemize}
Moreover, it is also interesting to consider improvements of the current used models (MOG \cite{P1C2-MOG-10}, codebook \cite{P1C6-100}, ViBe \cite{P2C1-200}, PBAS \cite{P2C1-230}). Instead of the original MOG, codebook and ViBe algorithms employed as in most of the reviewed works in this paper, several improvements of MOG \cite{P1C2-MOG-769}\cite{P1C2-MOG-770}\cite{P1C2-MOG-771}\cite{P1C2-MOG-773}\cite{P1C2-MOG-776}\cite{P1C2-MOG-777} as well as codebook \cite{P1C6-166}\cite{P1C6-172}\cite{P1C6-177}\cite{P1C6-190}, ViBe \cite{P2C1-217}\cite{P2C1-219}\cite{P2C1-229}\cite{P2C1-229-1} and PBAS \cite{P2C1-232} algorithms are potential usable methods for these real applications. For example, Goyal and Singhai \cite{P7C1-6000} evaluated six improvements of MOG on the CDnet 2012 dataset showing that Shah et al.'s MOG \cite{P1C2-MOG-717} and Chen et Ellis'MOG \cite{P1C2-MOG-628-1} both published in 2014 achieve significantly better detection while being usable in real applications than previously published MOG algorithms, that are MOG in 1999, Adaptive GMM {P1C2-MOG-92} in 2003, Zivkovic-Heijden GMM \cite{P1C2-MOG-36-1} in 2004, and Effective GMM \cite{P1C2-MOG-126} in 2005. Furthermore, there also exist real-time implementation of MOG \cite{P5C3-GPU-20}\cite{P5C3-GPU-23}\cite{P5C3-EI-2}\cite{P5C3-EI-3}\cite{P5C3-AI-101}, codebook \cite{P5C3-PI-10}, ViBe \cite{P2C1-216}\cite{P2C1-216-1} and PBAS \cite{P2C1-235}\cite{P2C1-236}\cite{P2C1-237}. In addition, robust background initialization methods \cite{P1C5-2130}\cite{P1C5-2164} as well as robust deep learned features \cite{P1C5-2200}\cite{P1C5-2210} with the MOG model could also be considered for very challenging environments like maritime and submarine environments.
\footnotetext[11]{https://sites.google.com/a/istec.net/prodrig/Home/en/pubs/incpcp}
\footnotetext[12]{http://www.ece.iastate.edu/~hanguo/PracReProCS.html}
\subsection{Datasets for Evaluation}
In this part, we quickly survey available datasets to evaluate algorithms in similar conditions than the real ones. For visual surveillance of human activities, there are several available dataset. Fist, Toyama et al. \cite{P6C2-Dataset-1} provided in 1999 the Wallflower dataset but it was limited to person detection with one Ground-Truth (GT) image by video. Li et al. \cite{P6C2-Dataset-10} developed a more larger dataset called I2R dataset with videos with both persons and cars in indoor and outdoor scenes. But, this dataset did not cover a very large spectrum of challenges and the GTs are also limited to 20 by video. In 2012, a breakthrough was done by the BMC 2012 dataset and especially by the CDnet 2012 dataset \cite{P6C2-Dataset-1000} that are very realistic large scale datasets with a big amount of videos and corresponding GTs. In 2014, the CDnet 2012 dataset was extended with additional camera-captured videos (~70,000 new frames) spanning 5 new categories, and became the CDnet 2014 dataset \cite{P6C2-Dataset-1001}. In addition, there also dataset for RGB-D videos (SBM-RGBD dataset \cite{P6C2-Dataset-110}), infrared videos (OTCBVS 2006), and
multi-spectral videos (FluxData FD-1665 \cite{P6C2-Dataset-200}). For visual surveillance of animals and insects, there are very less datasets. At the best of our knowledge, there are the following main datasets that are 1) Aqu@theque \cite{P6C2-Dataset-2000} for fish in tank, Fish4knowledge \cite{P6C2-Dataset-2020} for fish in open sea, 2) the Caltech resident intruder mice dataset \cite{P6C2-Dataset-20000} for social behavior recognition of mice, 3) the Caltech Camera Traps (CCT\protect\footnotemark[13]) dataset \cite{P7C1-200} which contains sequences of images taken at approximately one frame per second for census and recognition of speciesna d 4) the eMammal datasets which also camera trap sequences. All the link to these datasets are available on the Background Subtraction Website\protect\footnotemark[14]. Practically, we can note the absence of a large-scale dataset for visual surveillance of animals and insects, and for visual surveillance of natural environments.
\footnotetext[13]{https://beerys.github.io/CaltechCameraTraps/}
\footnotetext[14]{https://sites.google.com/site/backgroundsubtraction/test-sequences}
\subsection{Libraries for Evaluation}
Most of the time, authors as for example Wei et al. \cite{P7C1-5001} in 2018 employed one of the three background subtraction algorithms based on MOG that are available in OpenCV\protect\footnotemark[15], or provided an evaluation of these three algorithms in the context of traffic surveillance like in Marcomini and Cunha \cite{P7C1-6002} in 2018. But, these algorithms are less efficient that more recent algorithms available in the BGSLibrary\protect\footnotemark[16] and LRS Library\protect\footnotemark[17]. Indeed, BGSLibrary \cite{P7C1-7000}\cite{P7C1-7001} provides a C++ framework to perform background subtraction with currently more than $43$ background subtraction algorithms. In addition, Sobral \cite{P7C1-7010} provided a study of five algorithms from BGSLibrary in the context of highway traffic congestion classification showing that these recent algorithms are more efficient than the three background subtraction algorithms available in OpenCV. For LRSLibrary, it is implemented in MATLAB and focus on decomposition in low-rank and sparse components. The LRSLibrary this provides a collection of state-of-the-art matrix-based and tensor-based factorization algorithms. Several algorithms can be implemented in C to reach real-time requirements.
\footnotetext[15]{https://opencv.org/}
\footnotetext[16]{https://github.com/andrewssobral/bgslibrary}
\footnotetext[17]{https://github.com/andrewssobral/lrslibrary}
\section{Conclusion}
\label{Conclusion}
In this review, we have firstly presented all the applications where background subtraction is used to detect static or moving objects of interest. The, we reviewed the challenges related to the different environments and the different moving objects. Thus, the following conclusions can be made:
\begin{itemize}
\item All these applications show the importance of the moving object detection in video as it is the first step that is followed by tracking, recognition or behavior analysis. So, the foreground mask needs to be the most precise as possible and quickly as possible for a issue of real-time constraint. A valuable study of the influence of background subtraction on the further steps can be found in Varona et al. \cite{P0C2-2070}.
\item These different applications present several specificities and need to deal with specific critical situations due to \textbf{(1)} the location of the cameras which can generate small or large moving objects to detect in respect of the size of the images, \textbf{(2)} the type of the environments, and \textbf{(3)} the type of the moving objects.
\item Because the environments are very different, the background model needs to handle different challenges following the application. Furthermore, the moving objects of interest present very different intrinsic properties in terms of appearance. So, it is required to develop specific background models for a specific application or to find a universal background model which can be used in all the applications. To have a universal background model, the best way may to develop a dedicated background model for particular challenges, and to pick up the suitable background model when the corresponding challenges are detected.
\item Basic models are sufficiently robust for applications which are in controlled environments such as optical motion capture in indoor scenes. For traffic surveillance, statistical models offer a suitable framework but challenges such as illumination changes and sleeping/beginning foreground objects need to add specific developments. For natural environments and in particular maritime and aquatic environments, more robust background methods than the top methods of ChangeDetection.net competition are required for maritime and submarine environment as developed in Prasad et al. \cite{P0C0-A-29-2} in 2017. Thus, recent RPCA and deep learning models have to be considered for this kind of environments.
\end{itemize}
\bibliographystyle{plain}
| {'timestamp': '2019-01-14T02:16:01', 'yymm': '1901', 'arxiv_id': '1901.03577', 'language': 'en', 'url': 'https://arxiv.org/abs/1901.03577'} | arxiv |
\section{Concept And Contributions}
\label{sec:concept}
As stated in \secref{sec:introduction}, we adopt the ideas from
\cite{King2016, King2015, Haustein2015}. Similar
to these works, we present a sampling-based planning algorithm that explores
the composite configuration space $\mathcal{C}_{0:m}$ as a forward search over simple
robot-centric actions $u \in U$.
To predict the outcome of these actions, we apply a dynamic physics model $\Gamma$.
This, on the one hand, guarantees that the algorithm computes physically feasible solutions.
On the other hand, it shifts the assumptions on the effects of the actions from
the algorithm to the model. For instance, using a dynamic physics simulator as a
model allows our approach to compute solutions where the robot manipulates rolling or sliding
objects, or exploits object-to-object contacts.
In order to avoid
planning in a state space that includes velocities, however, we follow the
approach from \cite{Haustein2015} and limit our search to sequences of dynamic
actions between statically stable states. This means that all objects and the robot are
required to come to rest after each action within some time limit.
Formally, we assume the physics model $\Gamma$ to be a function
$\Gamma: \mathcal{C}_{0:m}^\text{free} \times U \to \mathcal{C}_{0:m}^\text{free} \cup \bot$ that
maps a configuration $x \in \mathcal{C}_{0:m}^\text{free}$ and an action $u$
to the resulting state $\Gamma(x, u) = x' \in \mathcal{C}_{0:m}^\text{free}$ of this action, or a special
value $\bot$, if the action leads to an invalid, i.e.\ non-resting, state.
We augment this physics-based search through two key concepts.
First, we provide the algorithm with guidance on how
to achieve \textit{transfer} actions using machine learning.
This enables our algorithm to compute object-centric actions without manually
designed primitives.
Second, we segment the search space $\mathcal{C}_{0:m}$, and accordingly the search tree,
in sets with similar object arrangements. This structures the search
and results in a more efficient exploration of $\mathcal{C}_{0:m}$ than
by the RRT algorithms in~\cite{King2015, Haustein2015, King2016}.
\begin{figure}[t]
\includegraphics[width=\columnwidth]{figures/config_space.pdf}
\centering
\caption{
An illustration of a slice of the configuration space $\mathcal{C}_{0:2}$
for a fixed object arrangement for a point robot. The red
areas show parts of $\mathcal{C}_{0:2}^\text{obst}$ that are inaccessible due to collisions
with static obstacles. The dark blue areas show parts that are in collision with
movable objects. The yellow arrow indicates a collision-free
\textit{transit} movement between two states $x^a, x^b$.
The light blue areas show subsets of $\mathcal{C}_{0:2}$
from which pushing the objects, i.e.\ a \textit{transfer} action,
is possible given a particular action space $U$.
If we intend to push an object in some desired direction (pink arrows), these
subsets are further restricted (pink striped areas).
}
\label{fig:slice_configuration_space}
\end{figure}
To illustrate these concepts, consider \figref{fig:slice_configuration_space}.
It shows an illustration of a cross section of the configuration space $\mathcal{C}_{0:2}$ for a
holonomic point robot and $m=2$ objects. We refer to such a cross section of states
$\{ x~\in~\mathcal{C}_{0:m} | x_{1:m}~=~x^f_{1:m}\}$ with a fixed object arrangement
$x^f_{1:m} = (x^f_1, \ldots, x^f_m)$ as slice of $\mathcal{C}_{0:m}$.
Navigating a robot within a slice, i.e.\ performing \textit{transit} actions,
is a classical motion planning problem
that is well studied~\cite{lavalle06book}. In particular,
steering the robot between two states
$x^a = (x_0^a, x^f_1, \ldots, x^f_m)$, $x^b = (x_0^b, x^f_1, \ldots, x^f_m)$
within the same slice ignoring obstacles is simple for many types of robots.
Navigating to a different slice, i.e.\ performing \textit{transfer} actions,
however, requires the robot to manipulate objects.
\begin{figure*}[!ht]
\includegraphics[width=\textwidth]{figures/overview.pdf}
\centering
\caption{
Our approach consists of an offline and online phase. In the offline phase,
a policy $\pi_\theta$ and a state generator $G_{\varphi}$ are learned from data generated
with a physics model. The generator provides samples of robot states that allow transporting
an object towards a desired state with a single action.
The policy provides such robot actions. Online, we apply a modified version
of the RRT algorithm to search for a rearrangement solution. The algorithm explores
the search space in slices of similar object arrangements. To purposefully transition
between different slices, it applies the policy and generator to push objects towards
target states.
}
\label{fig:system_overview}
\end{figure*}
The set of robot configurations from which this is achievable
within one action $u \in U$ is shown in \figref{fig:slice_configuration_space} in light blue.
This set is further restricted, if we intend
to push an object in a particular direction~(pink regions).
We refer to these states as \textit{manipulation states}.
The shape of the set of manipulation states depends on the shape of the object, the
action space $U$, and the robot's geometry.
Rather than approximating this manually through
primitives, we train a generative model to produce samples of manipulation states.
In order to transport an object to a desired state, our algorithm then first steers the robot
to such a sampled manipulation state. Then, once the robot is placed in a manipulation state,
the algorithm selects an action $u \in U$ to transport the object towards the desired state.
Selecting this action is generally also non-trivial. The most suitable
action depends on physical properties of the object and the state of the robot.
Hence, we additionally train a policy to provide this action to the planner.
With these two components in place,
our algorithm proceeds as illustrated in \figref{fig:concept}
and explores $\mathcal{C}_{0:m}$ slice-by-slice.
To summarize, the contributions of this work are:
\begin{itemize}
\item[1.] An efficient sampling-based algorithm for rearrangement planning that is
agnostic to the details of manipulation.
\item[2.] An approach to learn manipulation states and actions
using reinforcement learning and Generative Adversarial Networks (GANs).
\item[3.]An implementation and evaluation of this framework for robots endowed with
configuration spaces in $SE(2)$.
\end{itemize}
\section{Appendix}
\subsection{Online Supplementary Material}
Supplementary material is available online on
\textbf{\url{https://joshuahaustein.github.io/learning_rearrangement_planning/}}.
The website contains videos of example solutions computed by
our planner, as well as a video illustrating the extension strategy of our algorithm
when using the generator and policy. Additionally, the website contains videos that show
how the learned policy and generator behave for different arguments, such as different
physical parameters of the target object and different target states.
\section{Discussion And Conclusion}
\label{sec:discussion}
The goal of this work was to design an efficient algorithm
that can solve non-prehensile MAMO and rearrangement problems, while making
few limiting assumptions on the robot's manipulation abilities.
For this, we presented an algorithm based on the kinodynamic RRT algorithm
that explores the composite configuration space $\mathcal{C}_{0:m}$ of robot and objects.
The algorithm is agnostic to the robot's manipulation abilities
by modeling the effects of robot-centric actions through a dynamic physics model $\Gamma$.
It achieves efficiency by segmenting the search space into slices of similar object arrangements,
and deploying a learned pushing policy and robot state generator for guidance. The slice
segmentation allows the planner to select the most suitable states from its search tree
to extend towards a desired object arrangement. The learned robot state generator
provides the planner with robot states from which pushing an object in a desired direction
is possible. Similarly, the learned policy provides the planner with robot actions
achieving these pushes. Our experiments demonstrate that our approach can successfully
compute rearrangement solutions for various scenes without a human designer explicitly modeling the
robots manipulation abilities. Furthermore, all techniques together allow our algorithm
to explore its search space more efficiently than a comparable approach, leading to lower
average planning times.
\subsection{Slice-based Exploration}
The slice-based exploration structures the search and has several benefits over
a purely state-based exploration as applied in~\cite{King2015, Haustein2015, King2016}.
First, when selecting a state for extension, it naturally takes into account that the
planner operates on different subspaces of $\mathcal{C}_{0:m}$.
For many robots it is simpler to steer the robot between different states
within a slice than to compute actions that move objects between slices.
In a purely state-based approach, such as HybridActionRRT, this needs to be expressed
through a weighting factor that balances between robot and object state distances
when selecting a nearest neighbor.
In contrast, our slice-segmentation naturally reflects the difference between both types of states
and alleviates us from tuning such a weighting factor.
Second, the algorithm balances its effort on exploring \textit{transit}
actions within the different slices in a meaningful manner.
The subset $\mathcal{T} \cap s$ of explored states that lie
within the same slice $s$ form a sub-RRT for this slice\footnote{In principle, $\mathcal{T} \cap s$ may consist
of several disjoint connected components. This can occur if the robot first leaves the slice $s$ through
a \textit{transfer} action but later on enters the slice again through another \textit{transfer} action
that places the moved objects back to their original poses. We note, however, that this is
highly unlikely to occur.}.
This sub-RRT fulfills the task of classical robot path planning
given the object arrangement in $s$. It is extended every time $s$ is selected and
either expanded towards a uniformly sampled ($t=0$) or a manipulation state ($t \neq 0$).
The probability of this extension to occur is proportional to the measure of the Voronoi region
of $s$ w.r.t. $d_s$ in $\mathcal{S}$. Hence, the algorithm spends more time on exploring robot states
within slices for which not many neighboring object arrangements have been reached than for others.
\subsection{Forward Propagation through Physics Model}
As a physics-based approach, our approach shifts most assumptions on the manipulation abilities of the robot
and the mechanics of manipulation into the model $\Gamma$.
Treating this model as a black box has the benefit that it can be replaced with any physics model.
In our implementation we chose a rigid body physics simulator for this. Alternatively,
we could also choose, for instance, a learned model.
Assuming that $\Gamma$ is deterministic, however, implicitly assumes perfect
knowledge about the manipulated objects. In general, this is not feasible for
a robot operating in a real environment. As a consequence, solutions planned by our planner
have high chance of failure when executed on a real system due to inaccurate predictions
of $\Gamma$.
In the context of physics-based manipulation planning, this issue has recently been
addressed by several works~\cite{Johnson2016, Koval2015, King2017}. Koval et al.~\cite{Koval2015}
present a multi-arm-bandit-based meta-planner that selects the solution that is most robust
against model uncertainties from a set of solutions computed by a planner similar to ours.
King et al.~\cite{King2017} present a Monte-Carlo-Tree-Search-based algorithm that plans
robust non-prehensile MAMO solutions on belief space. In both works, our planner could be
applied as a primitive.
In future work, we intend to investigate how uncertainty in $\Gamma$ can be addressed further.
Here, we believe learning a pushing policy that is robust and provides uncertainty
reducing actions could be highly beneficial.
\subsection{Learning Pushing State Generator and Policy}
Learning the pushing state generator and policy from data generated using the physics model has
several advantages. First, retraining these allows an easy adaptation of the planner
to different robot embodiments and new object types. Second, we do not impose any unnecessary
restrictions on the robot's manipulation abilities. Third, both generator and policy
can be parameterized by expected physical properties of the objects and trained such
that the learned pushing behavior is robust against uncertainty in these quantities.
Training both policy and state generator for any robot, however, is challenging.
Our current approach to collecting training data has only been evaluated for robots with
configuration spaces in $SE(2)$. Due to the uniform random sampling, the procedure is
limited to robots with configuration and action spaces for which the probability of sampling
a robot state and action that pushes the target object is non-zero.
For robots with high degrees of freedom, e.g.\ a 7-DoF manipulator,
sampling such state-action pairs may either have zero or very low probability.
Hence, for such robots a more sophisticated data acquisition is required.
In future work, we plan to investigate this and extend our approach to robot manipulators.
Learning a pushing policy and state generator for such robots is particularly interesting as it
would allow the planner to purposefully utilize full-arm pushing actions that are difficult
to model otherwise.
We trained our pushing policy and generator to push a single object at a time.
While this doesn't restrict the planner to apply actions that push multiple objects at once,
learning a policy and a state generator for such multi-object pushing actions might be beneficial.
Another limitation of our current policy is its precision. While
it on average succeeds at reducing the distance to a desired state,
it does not succeed in reaching it exactly. In particular pushing an object towards
a desired orientation proved to be difficult for the trained policy.
Instead of training a one-step policy, we could alternatively integrate a
multi-step policy that operates as a closed-loop controller running in the physics model.
While this would likely improve the accuracy of pushing actions,
the additional computational overhead could prove disadvantageous.
In preliminary experiments, we equipped the algorithm with a local planner
for \textit{transit} actions that attempts to avoid collisions
when approaching a manipulation state. This version of our algorithm, however,
performed worse than the evaluated one that only applies straight line steering
for the robot. This indicates that there is a fundamental trade-off between
the versatility and computational overhead of local planners in the algorithm.
\subsection{Challenging Rearrangement Problems}
A major challenge in rearrangement planning arises from the need to clear obstructions.
Consider the problem shown in \figref{fig:discussion:challenging_problem}, where
the robot first needs to push an obstacle aside to push its target object to the goal.
The directions in which this obstacle can be pushed are very limited due to the static obstacles (red).
In other words, a solution to this problem needs to pass through a narrow passage of
object arrangements, which has low probability to be sampled.
\begin{figure}[t]
\center
\includegraphics[width=0.33\textwidth]{figures/door_problem.pdf}
\caption{A problem with a narrow passage in object arrangement.
To solve this problem the robot needs to push the blue object
downwards and then push the green box into the goal region.}
\label{fig:discussion:challenging_problem}
\end{figure}
As a sampling-based approach, our planner struggles with scenarios like this.
A higher level logic is required that replaces the uniform slice
sampling with a more sophisticated mechanism. The challenge here lies in
formulating such a logic without making strong assumptions on the robot's manipulation abilities.
The question whether an object is obstructed by another depends not only on the
objects and their states, but also on the robot's embodiment.
Hence, we see a potential line of future work in learning a high level policy
that is conditioned on the robot's actual manipulation abilities
and directs the search to solve more challenging rearrangement problems.
\vspace{-0.05cm}
\section{Experiments}
\label{sec:experiments}
We implemented and evaluated our approach for robots endowed with
configuration spaces in $SE(2)$, i.e.\ $\mathcal{C}_0 \subseteq SE(2)$.
Evaluating the approach for robots with higher dimensional configuration spaces
raises additional challenges that we will discuss in \secref{sec:discussion}.
For simplicity, we additionally limit our evaluation to holonomic robots. We note though
that our approach is not limited to such robots as long as we can efficiently compute a steering function.
Unless stated otherwise, we apply in our experiments a
planar robot with the geometry of a robotic gripper, as shown in \figref{fig:scenes}.
We choose this geometry because it has interesting properties for the system
to learn about.
The action space of all robots in our experiments is the space of bounded
translational and rotational velocities applied for some bounded duration:
$$U = \{(v_x, v_y) \in \mathbb{R}^2~|~v_x^2 + v_y^2 \leq \hat{v}\} \times [-\hat{\omega}, \hat{\omega}] \times [0, \hat{t}\,]$$
with bounds $\hat{v}, \hat{\omega}$ and $\hat{t}$.
As the robot is required to be at rest after each action,
the actions follow a ramp velocity profile with linear acceleration and deceleration phases
similar to \cite{Haustein2015}. Accordingly, the robot's steering
function computes an action that moves the robot on a straight line between two poses
ignoring obstacles.
We first present how the robot state generator and policy
for this type of robot can be learned. Thereafter, we evaluate
these learned models and their performance within the planning algorithm.
Additionally, we evaluate how our different design choices in the algorithm affect its
planning efficiency.
\subsection{Learning Generator and Policy for $SE(2)$-Robots}
\begin{figure*}[!ht]
\centering
\includegraphics[width=0.9\textwidth]{figures/policy_overview.pdf}
\caption{Architecture of forward models and the policy. The forward models are
first trained on input tuples ($x=(x_0, x_1), u, x'=(x_0', x_1'), \nu$).
The policy can then be trained by minimizing the rightmost output for
randomly sampled desired object states $x_1^d$, and
back-propagating through the forward models. The forward models are using
batch normalization (BN) \cite{ioffe2015batch} and leaky ReLUs
\cite{maas2013rectifier}.}
\label{fig:policy_overview}
\end{figure*}
\subsubsection{Data Generation}
The data set used for training the forward models $f_\mu$ and $f_{\sigma^2}$
consists of tuples $(x_0, x_i, u, x_0', x_i', \nu_i)$.
In order for both the generator and the policy to be applicable to different object types,
we generate this data for objects $i$ with different shapes, sizes, mass and friction coefficients.
The parameters $\nu_i$ describing these objects for the generator and policy contain
the width and height of the minimal bounding box, the mass and inertia, and the friction
coefficient between ground and object.
We collect the data by first randomly sampling a robot-object state
$x \in \mathcal{C}_{0:1}$ and an action $u \in U$. We then forward propagate these
through a stochastic physics model, which we acquire from $\Gamma$
as described in \secref{sec:method:learning:policy}.
If the resulting state is valid, i.e.\ the object comes to rest within a time limit $T_{\text{max}} = 8s$,
we add the tuple to our data set.
Lastly, since the robot's configuration space is also in $SE(2)$,
we can exploit redundancy in our learning problem.
That is, the results of the physical interaction between the robot and the object are translationally
and rotationally invariant. Therefore, we transform all states into a common reference frame
such that the robot state is placed at the origin, $x_0 = \mathbf{0}$.
\subsubsection{Forward Models}
Both forward models $f_{\sigma^2}$ and $f_\mu$ are learned with
neural networks shown in \figref{fig:policy_overview}.
The optimization is done using Adam \cite{kingma2014adam} in mini-batches of size 256
for \numprint{64000} steps. The final models are chosen based on validation scores on a held-out validation set.
We train both models by maximizing the log-likelihood of a multivariate
Gaussian, since the maximum likelihood estimate of normally distributed
variables is exactly the mean and the variance. Since we are only interested
in the variances, we let the covariance matrix be a diagonal matrix.
\subsubsection{Policy}
Based on the learned forward models we can learn the policy $\pi_\theta$
by minimizing \eqref{eq:variance_mean_decomp}.
The architecture of the policy is shown in \figref{fig:policy_overview}.
The policy is trained in batches from the same data as the forward models.
We augment the data tuples $(x_0, x_i, \nu_i, u, x')$ with object goal states $x_{i}^d$ by randomly sampling
from a Gaussian over the true successor state $x_i'$ observed in the data set.
The policy is trained for \numprint{40000} steps with the same optimizer and
mini-batch size as the forward models.
\begin{figure*}[!ht]
\centering
\includegraphics[width=0.9\textwidth]{figures/gan_overview_fixed.pdf}
\caption{GAN architecture. The generator is trained to mimic the samples
that a slower Markov Chain Monte Carlo algorithm provides. Samples
can then instead be obtained by a single forward pass of the generator network.}
\label{fig:gan_overview}
\end{figure*}
\subsubsection{Generative Model}\label{sec:feasible_state_sampling}
The GAN is trained from MCMC samples of robot states.
To generate these we first draw samples of initial object
and successor states $x_i, x_i'$ from our data set.
These samples are then translated to object frame, i.e.\ such that $x_i = \mathbf{0}$.
This simplifies the application of the transition kernel to produce proposal states for the MCMC method.
The initial proposals of robot states are drawn from a Gaussian distribution $\mathcal{N}(0, 0.01^2)$
for the positions, and a uniform distribution $U(-\pi, \pi)$ for the rotation.
Then, new states are proposed by adding Gaussian noise $\mathcal{N}(0, 0.05^2)$ to the position,
and Gaussian noise $\mathcal{N}(0, 0.5^2)$ to the rotation. Given a current robot state sample $x_0$,
a new sample $x_0'$ is accepted by the MCMC method with probability $\alpha$, defined as:
\begin{equation}
\alpha = \min(1, e^{\lambda \left(L_\theta(x_0,x_i,x_i',\nu_i) - L_\theta(x_0',x_i,x_i',\nu_i)\right)})
\end{equation}
Here, $\lambda$ is a temperature parameter that we set in our experiments set to $128$.
We used a burn-in of 100 iterations and thereafter added the following $300$ samples to a data set
for training the GAN. In total, we collected $2 \times 10^6$ MCMC samples for each GAN training.
The architecture of the GAN is shown in \figref{fig:gan_overview}.
In practice, the GAN objective from \eqref{eq:gan_objective} is split up into the following
three objectives:
\begin{equation}
\max_{\varphi_G} \mathbb{E}_{z}\left[\log(D_{\varphi_D}(G_{\varphi_G}(z, x_i, x_i^d, \nu_i)) )\right]
\end{equation}
\begin{equation}
\max_{\varphi_D} \mathbb{E}_{x_0 \sim p_\text{MCMC}}\left[ \log(D_{\varphi_D}(x_0, x_i, x_i^d, \nu_i)) \right]
\end{equation}
\begin{equation}
\min_{\varphi_D} \mathbb{E}_{z}\left[\log(D_{\varphi_D}(G_{\varphi_G}(z, x_i, x_i^d, \nu_i)) )\right]
\label{eq:discriminator_fake_loss}
\end{equation}
All three objectives are optimized in mini-batches of size 256 with RMSProp. To stabilize training,
the loss in \eqref{eq:discriminator_fake_loss} is trained with probability $0.5$ on a batch of generated
samples from a replay buffer, and otherwise on a recent batch from the generator.
The discriminator is regularized by adding the square of the logits
to the loss function. The training is run for \numprint{100000} iterations.
\subsection{Baselines for Evaluation}
To evaluate our algorithm and our learned models, we define several baselines.
\subsubsection{Simple Pushing Heuristic}
To evaluate the learned generator and policy,
we define a simple generator and policy that share similarities with typical
pushing primitives applied in prior rearrangement planning works.
To sample a manipulation state, we sample
a distance $r \sim \mathcal{N}(\mu_r, \sigma_r^2)$ and an angle
$\theta \sim \mathcal{N}(0, \sigma_\theta^2)$ for some manually specified $\mu_r, \sigma_r$
and $\sigma_\theta$. The robot is then placed next to the target object at the position
$\mathbf{x}_0 = \mathbf{x}_1 - r R_\theta \frac{\mathbf{x}_1^d - \mathbf{x}_1}{\|\mathbf{x}_1^d - \mathbf{x}_1\|}$,
where $\mathbf{x}_1,\mathbf{x}_1^d \in \mathbb{R}^2$ are the current and the desired object position,
and $R_\theta \in SO(2)$ a rotation matrix by angle $\theta$. The robot's orientation
is selected such that its palm faces in the pushing direction. From this robot pose
our simple policy steers the robot in a straight line to a position that is offset
by the dimensions of the object from the target position $\mathbf{x}_1^d$.
\subsubsection{HybridActionRRT}
To evaluate our planning algorithm, we compare it to King et al.'s~\cite{King2016}
HybridActionRRT algorithm. In brief, this algorithm differs from ours in that it
does not structure $\mathcal{C}_{0:m}$ in slices and applies a different strategy
for extending the search tree. The search tree is grown by first randomly sampling a full
state $x^d \in \mathcal{C}_{0:m}$ and then extending the tree from the state that is closest
to the sample $x^d$. Herein, \textit{closest} is defined by a distance function on $\mathcal{C}_{0:m}$ that
takes the states of all objects and the robot into account. In our experiments, we apply a distance
function similar to \eqref{eq:slice_distance} with an additional equally weighted
term for the distance in robot state.
The $\textsc{ExtendTree}$ function of this algorithm samples $k$ action sequences,
where each sequence is either with probability $p_\mathit{rand}$
sampled uniformly at random or a noisy sample of actions provided by a manipulation primitive.
Thereafter, all $k$ sequences are forward propagated through the physics model
and the one that results in a state closest to the random sample $x^d$ is added to the tree.
We equip this algorithm with two manipulation primitives:
\begin{itemize}
\item[1] \textit{Transit}: The robot is steered on a straight line from a start state to a goal state.
\item[2] \textit{Push}: The robot attempts to push an object $t$ from a start state to some goal state.
To compute such an action, we first use our generator to sample a robot pushing state.
Then an action that steers the robot to this state is concatenated with
an action provided by our policy for the same state.
Note that although this is a similar behavior as in our $\textsc{ExtendTree}$
function, the primitive does not propagate these actions through $\Gamma$.
Hence, any unintended contact that may occur during the approach motion is not
considered by this primitive.
\end{itemize}
For a fair comparison, we evaluate the algorithm for different choices of $k \in \{1, 4, 8\}$ and
$p_\mathit{rand}\in \{0, 0.25, 0.5, 0.75, 1\}$ and select the best.
Interestingly, the best performing choice for most test cases is $k=1$ and $p_\mathit{rand} = 0.0$.
This indicates that in our test cases there is not much being gained from performing random actions
rather than following the \textit{Push} primitive that is based on our policy and generator.
\subsubsection{PolicyGeneratorRRT}
To evaluate the effect of the slice-based exploration of our algorithm, we devise
a simplified version of our algorithm, PolicyGeneratorRRT. This algorithm
grows a tree on $\mathcal{C}_{0:m}$ similar to HybridActionRRT without
applying the concept of slices. In contrast to HybridActionRRT, however, it
applies the same $\textsc{ExtendTree}$ function as our algorithm.
Hence, the main difference to HybridActionRRT with the primitives defined above is that
an approach \textit{transit} and a following pushing action are propagated separately through $\Gamma$.
This allows the policy to be applied to the resulting state of the \textit{transit} action, i.e.\
it allows the policy, to some extent, to adapt to unintended contact during the approach motion.
\subsection{Technical Details}
We implemented the planning algorithms in C++ using OMPL \cite{sucan2012OMPL}.
Similarly, the simple generator and policy were also implemented in C++.
The learned generator and the learned policy in contrast were implemented in Python using PyTorch.
The communication between these and the planner was performed using Protobuf.
The overhead of this communication is not included
in our evaluation. As physics model we chose Box2D \cite{box2d}.
All experiments were run on Ubuntu 14.04 on an Intel(R) Core(TM) i7-3770 [email protected]
with $32GB$ RAM\@.
\subsection{Evaluation of Policy and Generator}
\label{experiments:oracle}
\subsubsection{Quantitative Evaluation}
\begin{figure}[t]
\setlength{\tabcolsep}{2pt}
\begin{tabular}{cc}
\begin{subfigure}[b]{0.24\textwidth}
\includegraphics[width=\textwidth]{figures/oracle_eval_feasible_normal.pdf}
\caption{Pushing results of a non-slippery object.}
\label{fig:1step-normal}
\end{subfigure}
&
\begin{subfigure}[b]{0.24\textwidth}
\includegraphics[width=\textwidth]{figures/oracle_eval_feasible_slippery.pdf}
\caption{Pushing results of a slippery object.}
\label{fig:1step-slippery}
\end{subfigure}
\end{tabular}
\caption{
Single push evaluations. We observe the Euclidean distance
of an object to a random goal pose before and after executing
the policy from a manipulation state. These histograms
show the normalized decrease in distances, i.e.\ the
distance after the execution divided by the distance before the execution.
The best possible normalized decrease is $1.0$.
\figref{fig:1step-normal} shows the result for an object that does not slide,
whereas \figref{fig:1step-slippery} shows results for an object with lower mass
and friction that does slide after being pushed.
}
\label{fig:oracle_evaluations}
\end{figure}
To evaluate our learned models, we compare their performance in transporting
a single object with that of the simple heuristic.
Our evaluation procedure follows the extension strategy of our planning
algorithm. Given an initial state of the object and a randomly sampled target state,
we first place the robot in a manipulation state produced by the generator.
Next, we query the policy to provide a single action to transport the object
towards the goal state and forward propagate this through the physics model
$\Gamma$. We then compare the Euclidean distance between the resulting object
state and the goal state.
\figref{fig:oracle_evaluations} shows the results of this procedure for two
different box-shaped objects that differ in mass and friction. One box is
slippery, i.e.\ it does not immediately come to rest after being pushed, and
one box is non-slippery. In case of the non-slippery box, we observe that both
the learned and the simple models on average succeed at transporting the object
towards the target position. Although the learned models on average reduce the
distance by more than half, the simple models are yet better in this case. For
the slippery object, in contrast, the learned models are significantly better than
the simple ones. Here, the learned models achieve similar results as in the
non-slippery case, whereas the simple heuristic often results in a significant
increase in distance. This highlights a weakness of such simple hand-made heuristics.
A behavior that works well for some types of objects may not work well for others.
The learned models, on the other hand, are parameterized by the expected physical
properties of the object and can thus adjust their behavior. Achieving similar results
with hand-made heuristics would require significant engineering efforts.
\subsubsection{Qualitative Evaluation}
\begin{figure*}[t]
\setlength{\tabcolsep}{2pt}
\begin{subfigure}[b]{1.0\textwidth}
\centering
\includegraphics[width=1.0\textwidth]{figures/gan-samples-rigid-multiple-compressed.pdf}
\caption{Learned manipulation states for a gripper-like robot. Most samples represent robot poses
where the fingers are facing the object, and the robot is placed opposite to
the pushing direction.}
\label{fig:gan_samples:gripper}
\end{subfigure}
\begin{subfigure}[b]{1.0\textwidth}
\centering
\includegraphics[width=1.0\textwidth]{figures/gan-samples-dual-point-multiple.pdf}
\caption{Learned manipulation states for a robot consisting of two squares.
The learned behavior is to push such that the object is trapped between both squares.}
\label{fig:gan_samples:two_point}
\end{subfigure}
\caption{Samples of robot states from our generative adversarial
network. The arrow represents a desired
push of an object starting in the origin. Each colored dot represents a robot position,
where the color is the rotation of the robot. Consult our online supplementary material
for a video showing how the samples are influenced by different arguments to the generator.
}
\label{fig:gan_samples}
\end{figure*}
Next, we qualitatively evaluate the learned generator.
\figref{fig:gan_samples} shows robot state samples produced by learned
generators for two different robots. \figref{fig:gan_samples:gripper} shows
these samples for our gripper-shaped robot and
\figref{fig:gan_samples:two_point} shows these for a robot consisting
of two small squares. In both cases, the generators learned how the robot
should be positioned relative to the object in order to push it in some desired
direction. More interestingly, however, is that in both cases it also learned a
preference in orientation of the robot. In the case of the gripper, it prefers
orientations such that the object is placed between the gripper's fingers. In
case of the two-point robot, it prefers orientations for which the robot
achieves two-point-contacts with the object. In both cases, these choices lead
to pushing behaviors that are more robust against uncertainty in object
properties than pushing from other orientations.
As can be seen, the samples show
that the generators learned distributions with a wide support over several possible
manipulation states. This is particularly useful, if some of these states are in collision
or can not be approached easily in the presence of obstacles. In particular for the gripper-shaped
robot, the generator learned states where the robot is facing perpendicular to the direction of transport.
Accordingly, the actions learned by the policy in these states, move the robot sideways.
Note that this is a behavior that makes specific use of the robot's geometric properties, i.e. its fingers.
One drawback of these wide distributions, however, is that there may
also be a small probability to sample distant states from which transporting the object
within one action is not possible. Such states are responsible for the cases
in \figref{fig:oracle_evaluations} where the distance to the goal is not decreased at all.
\begin{figure*}[ht]
\includegraphics[width=0.48\textwidth]{figures/all_success_rate_plot_iter.pdf}
\includegraphics[width=0.48\textwidth]{figures/all_success_rate_plot_time.pdf}
\caption{
Planning success rate as function of number of iterations (\textit{left})
and planning time (\textit{right}).
For any given number of iterations $n$,
the corresponding success rate can be interpreted as an empirically determined probability
that an algorithm successfully finds a solution within $n$
iterations. The shaded areas show the $95\%$ Wilson confidence
interval of this probability. After a total of $180s$ the ratio of successful
planning instances was:
SliceRRT-Learned: $99.2\%$, SliceRRT-Simple: $96.6\%$,
PolicyGeneratorRRT-Learned:$95.2\%$, PolicyGeneratorRRT-Simple: $91.9\%$,
HybridActionRRT-Learned: $92.2\%$, HybridActionRRT-Simple: $91.2\%$.
For SliceRRT and PolicyGeneratorRRT we chose $p_\mathit{rand} = 0.01$.
}
\label{fig:results:success_rates}
\end{figure*}
\subsection{Evaluation of the Planning Algorithm}
Next, we evaluate the effects of our different algorithm design choices as well as
how the learned models compare to the simple ones when used in a planner.
In the comparisons with our baselines, we refer to our algorithm by the name SliceRRT.
\subsubsection{Overall Performance}
We run all three algorithms with both the learned policy and generator as well
as the simple ones on six different scenes shown
in \figref{fig:scenes}. We run each algorithm-policy-generator combination for $640$ times on each scene
and record the runtime, the number of iterations and whether the algorithm succeeds at finding a solution
within a time budget of $180s$.
The planning success rates as a function of number of iterations are shown in
\figref{fig:results:success_rates} on the left.
As the number of iterations increases, more planning instances terminate successfully and the
success rates tend towards 1. Our SliceRRT algorithm achieves with both policy-generator models the steepest
initial increase as well as the highest success rates after the first \numprint{10000} iterations. The curves for
both PolicyGeneratorRRT and HybridActionRRT are significantly flatter for both the learned policy
and generator as well as the simple ones. Overall, the success rates remain below the one of SliceRRT.
It is notable that for each algorithm the learned policy and generator outperform the simple ones.
Similarly, the success rate as a function of planning time is
shown on the right of \figref{fig:results:success_rates} for the first $60s$.
Also here SliceRRT with learned policy and generator achieves the steepest initial increase and
highest final success rate. The difference, however,
between the simple and the learned policy and generator is smaller due to increased
computational costs of the learned models. We note, however, that this effect also depends on
implementation details.
Overall, these results indicate that:
\begin{itemize}
\item[\textbf{1.}] The learned policy and generator provide better guidance than the simple ones;
\item[\textbf{2.}] SliceRRT is more efficient in terms of iterations and runtime on the tested
problems than the other algorithms.
\end{itemize}
In particular, the poorer performance of PolicyGeneratorRRT shows that
the slice-based exploration increases the algorithm's efficiency significantly.
\subsubsection{Performance per Scene}
Next, we investigate how the average runtime differs per test scene, see \figref{fig:results:per_env}.
For all algorithms we observe for most scenes better or similar results for the
learned policy and generator than for the simple ones. The differences between
the learned and the simple models are most significant on Dual Slalom,
ABC, Long Slalom and Slippery Slalom. This confirms our observations from \secref{experiments:oracle}
as all of these scenes contain at least one object with low
friction and low mass.
The best results on most scenes are achieved by SliceRRT with learned policy
and generator. The differences are particularly strong on the different slalom
scenes. In these scenes the robot and the objects can potentially be very
distant and separated by static obstacles. It appears that the slice-based
exploration has its strongest benefit in these situations. The differences
between PolicyGeneratorRRT and HybridActionRRT are not as significant for many
scenes. Most notably is the difference for Movable Cage, where we have many
movable objects, which are initially close to each other. In such a situation
it is likely that the target object is moved through direct or indirect contact
when approaching a manipulation state. HybridActionRRT, in contrast to
PolicyGeneratorRRT, queries the policy before propagating the approach motion
to the manipulation state. Choosing a pushing action given an updated state,
as in PolicyGeneratorRRT, seems in this case to be most beneficial.
\begin{figure}[t]
\includegraphics[width=0.48\textwidth]{figures/iter_per_env.pdf}
\includegraphics[width=0.48\textwidth]{figures/runtime_per_env.pdf}
\caption{
Average number of iterations (\textit{top}) and average runtime (\textit{bottom})
per algorithm-policy-generator pair per tested scene.
}
\label{fig:results:per_env}
\end{figure}
\section{Method}
\label{sec:method}
\begin{algorithm}[ht]
\algsetup{linenosize=\tiny}
\small
\SetFuncSty{textsc}
\DontPrintSemicolon
\SetKw{Not}{not}
\SetKw{Is}{is}
\SetKwInOut{Constants}{Constants}
\KwIn{Start configuration $x^0 \in \mathcal{C}_{0:m}^\text{free}$,
maximum number of iterations $n_{\text{max}}$,
goal region $\mathcal{G} \subset \mathcal{C}_{0:m}^\text{free}$}
\KwOut{Solution $[(x^0, u^0) \ldots, (x^n, \bot)]$ or $\emptyset$}
\SetKwFunction{Tree}{Tree}
\SetKwFunction{Slice}{Slice}
\SetKwFunction{Add}{AddToSlice}
\SetKwFunction{SampleSlice}{SampleSlice}
\SetKwFunction{SelectNode}{SelectNode}
\SetKwFunction{ExtendTree}{ExtendTree}
\SetKwFunction{ExtractPath}{ExtractAndShortcut}
\SetKwFunction{SampleUniform}{SampleUniform}
\SetKwFunction{SamplePushingState}{QueryGenerator}
\SetKwFunction{SampleBiased}{RandomChoice}
$s^0 \gets $ \Slice{$x^0$} \tcp*[f]{Obtain the slice that $x^0$ lies in} \;
$\mathcal{S} \gets \{s^0\}$ \tcp*[f]{Set of all explored slices} \;
$\mathcal{T} \gets$ \Tree{$x^0$} \tcp*[f]{Tree of explored states} \;
\For{$j \gets 1, \ldots, n_{\text{max}}$} {
$s^d \gets$ \SampleSlice{} \;
$s^j \gets \wtfargmin{s \in \mathcal{S}} d_s(s, s^d)$ \tcp*[f]{Closest explored slice} \label{algo:line:closest_slice} \;
$t \gets $ \SampleBiased{$\{0\} \cup \{1, \ldots, m\}$} \;
\If{$t = 0$} {
$x_0^d \gets $ \SampleUniform{$\mathcal{C}_{0}^\text{free}$} \;
}
\Else {
$x_0^d \gets $ \SamplePushingState{$s^j, s^d, t$} \;
}
$x^j \gets \wtfargmin{x \in s^j} d_{\mathcal{C}_0}(x_0, x_0^d)$ \tcp*[f]{Closest state in $s^j$} \label{algo:line:closest_state}\;
$x^d \gets (x_0^d, s^d_1, \ldots, s^d_m)$ \tcp*[f]{Constructed target state} \;
$\mathcal{T}, \mathcal{S} \gets$ \ExtendTree{$x^j, x^d, t, \mathcal{T}, \mathcal{S}$} \;
\If{$\mathcal{T} \cap \mathcal{G} \neq \emptyset$} {
\Return \ExtractPath{$\mathcal{T}$} \;
}
}
\Return $\emptyset$ \;
\caption{The rearrangement planning algorithm.}
\label{algo:planner_main}
\end{algorithm}
An overview of our approach is shown in \figref{fig:system_overview}.
It consists of three key components: the planning algorithm, the generative model $G_{\varphi}$
and the pushing policy $\pi_\theta$. The planner computes a solution for an instance of our
problem when queried online.
Both the policy and the generator are trained offline and parameterized so that
they can be applied to objects of different shape, mass and friction
properties.
\subsection{Planning Algorithm}
\label{sec:method:planner}
The planning algorithm is outlined in \algref{algo:planner_main}.
We first provide a high-level overview of this algorithm
and then describe the details of its subroutines in the following subsections.
\subsubsection{Overview}
Given a start state $x^0 \in \mathcal{C}^\text{free}_{0:m}$,
the algorithm starts with initializing its search tree $\mathcal{T}$ and a set
$\mathcal{S}$, which keeps track of the slices of $\mathcal{C}_{0:m}^\text{free}$
that the explored states in $\mathcal{T}$ lie in. It then iteratively grows the search tree
$\mathcal{T}$ on $\mathcal{C}^\text{free}_{0:m}$ in a similar fashion to the
kinodynamic RRT algorithm until it either adds a goal state $g \in \mathcal{G}$
to the tree or a maximum number of iterations $n_\text{max}$ is reached.
In each iteration the algorithm needs to select where to extend its search
tree from. For this, it first randomly samples a slice $s^d$ by
sampling a random object arrangement. Next, it selects
the explored slice $s^j \in \mathcal{S}$ that is closest to $s^d$ w.r.t.\ some distance function $d_s$.
For the tree extension the algorithm will either attempt to perform a
\textit{transit} action within the selected slice $s^j$ or a \textit{transfer}
action towards the sampled slice $s^d$.
To decide this, it randomly chooses an index $t \in \{0, \ldots, m\}$.
In case it chooses the robot, $t=0$, the algorithm will attempt a
\textit{transit} action and uniformly samples a robot state $x_0^d$ as a goal for this transit.
In case it chooses an object, $t~\in~\{1, \ldots, m\}$,
it samples a robot state $x_0^d$ that likely allows it to push object $t$ from its
state $s_t^j$ in the current selected slice to its state $s_t^d$ in the randomly sampled slice.
For this, it applies the generator $G_{\varphi}$ that is described in more detail later.
In both cases, the algorithm then needs to select an actual composite state $x^j \in \mathcal{T}$
from the search tree $\mathcal{T}$ to extend from. Since it already selected the slice $s^j$ for extension,
it only needs to search for this state within this slice.
For this, it searches for the state $x^j \in \mathcal{T} \cap s^j$ that minimizes the robot state distance
$d_{\mathcal{C}_0}$ to the sampled robot state $x_0^d$.
Depending on the choice of $t$, the extend function \textsc{ExtendTree} will then either simply steer the robot
to $x_0^d$, or additionally attempt to push object $t$ towards $x_t^d$ using the policy $\pi_\theta$.
The above proceeds until the loop is terminated. If a goal state $g \in \mathcal{G}$ was
added to the tree, the algorithm returns a solution $(\xi, \tau)$ represented as sequence
of state and action tuples $\{(x^j, u^j)\}_{j=0}^{n}$ with $x^n = g$.
Each state in this solution $x^{j+1} = \Gamma(x^j, u^j)$ is the physical outcome of
the previous action applied to the previous state. If the algorithm failed to add a goal within
$n_\text{max}$ iterations, a special value $\emptyset$ is returned to indicate failure.
\subsubsection{Sampling}
Each iteration starts with the $\textsc{SampleSlice}$ function, which
samples a slice by sampling an object arrangement. This is done by either
uniformly sampling the space of object arrangements $\mathcal{C}_{1:m}$, or
with some probability $p_g$, by sampling the set of goal arrangements in $\mathcal{G}$.
Similarly, the function $\textsc{RandomChoice}$ samples an index $t \in \{0, 1, \ldots, m\}$
with bias towards either the robot $t = 0$ or a target object $t \in \mathbf{T}$.
\subsubsection{Selecting Nearest Neighbors}
To select the nearest explored slice $s^j \in \mathcal{S}$, we require a distance function $d_s$.
Measuring this distance, however, is challenging. Ideally, we would apply
a distance function that expresses a minimal cost that it takes the robot to move all objects
from one slice to the other. Such a cost, however, is generally not available, as
it would require to take all robot motions needed to clear occlusions as well as
simultaneous object manipulation into account.
Instead, we opt to approximate this through the distance function
\begin{equation}
d_s(s^a, s^b) = \sum_{i=1}^m d_{\mathcal{C}_i}(s^a_i, s^b_i).
\label{eq:slice_distance}
\end{equation}
that sums the distances of the individual object states.
\subsubsection{Extending the Tree}
In the $\textsc{ExtendTree}$ function, \algref{algo:extend_tree},
the search tree is either extended using a targeted extension strategy
or with some small probably $p_{rand}$ by a random action.
When following our strategy, it first uses a steering function for the robot to compute an action $u_0$
that attempts to move the robot from its current state $x_0^j$ towards
the sampled state $x^d_0$. This action is then forward propagated in the subroutine $\textsc{ExtendStep}$
using the physics model $\Gamma$. If this action leads to a valid state, the
$\textsc{ExtendStep}$ function adds the resulting state to the tree $\mathcal{T}$ and updates
$\mathcal{S}$ accordingly. Note that although
this action is intended to move only the robot, it may result in collision and thus
also move any of the $m$ movable objects. The $\textsc{ExtendStep}$ function therefore
returns the resulting composite state $x^c = \Gamma(x^j, u_0)$.
If $t$ is not the robot, $x^d_0$ is a manipulation state provided by our generator to push object $t$.
Hence, the algorithm next queries the policy $\pi_\theta$ in $\textsc{QueryPolicy}$ to achieve the desired push.
The returned action is then again passed to the $\textsc{ExtendStep}$ function and $\mathcal{T}$ and
$\mathcal{S}$ are updated accordingly.
\subsubsection{Physics Propagation}
Given a state $x \in \mathcal{C}_{0:m}^\text{free}$
the $\textsc{ExtendStep}$ function forward propagates an action $u$ through the
physics model $\Gamma$. An action is considered invalid, if the scene fails
to come to rest within some time limit, i.e.\ $\Gamma(x, u) = \bot$, or
if the action leads to collisions of either the robot or any movable object with static obstacles.
Collisions between movable objects, in contrast, are allowed and modeled accordingly.
If the propagation is valid and $x' = \Gamma(x, u)$ is within bounds, the search
tree $\mathcal{T}$ and $\mathcal{S}$ are updated accordingly.
\begin{algorithm}[t]
\algsetup{linenosize=\tiny}
\small
\SetFuncSty{textsc}
\DontPrintSemicolon
\SetKw{Not}{not}
\SetKw{Is}{is}
\SetKwInOut{Constants}{Constants}
\KwIn{Object identifier $t$,
current tree node $x^j \in \mathcal{T}$ to extend,
state to extend towards $x^d \in \mathcal{C}_{0:m}$,
search tree $\mathcal{T}$, explored slices $\mathcal{S}$}
\Constants{$p_{rand} \in [0,1]$}
\KwOut{Updated $\mathcal{T}$ and $\mathcal{S}$}
\SetKwFunction{Steer}{Steer}
\SetKwFunction{QueryAction}{QueryPolicy}
\SetKwFunction{ExtendStep}{ExtendStep}
\SetKwFunction{Uniform}{Uniform}
\If{\Uniform{$[0,1]$} $\leq p_{rand}$} {
$u \gets$ \Uniform{$U$} \;
$\bot, \bot, \mathcal{T}, \mathcal{S} \gets $\ExtendStep{$x^j, u, \mathcal{T}, \mathcal{S}$} \;
} \Else {
$u_0 \gets$ \Steer{$x_0^j, x_0^d$} \;
$\textit{valid}, x^c, \mathcal{T}, \mathcal{S} \gets $\ExtendStep{$x^j, u_0, \mathcal{T}, \mathcal{S}$} \;
\If{\textbf{not} $\text{valid}$ \textbf{or} $t \neq r$} {
\Return $\mathcal{T}, \mathcal{S}$ \;
}
$u \gets $ \QueryAction{$x^c_0, x_t^c, x_t^d$} \;
$\bot, \bot, \mathcal{T}, \mathcal{S} \gets $\ExtendStep{$x^c, u, \mathcal{T}, \mathcal{S}$} \;
}
\Return $\mathcal{T}, \mathcal{S}$
\caption{The \textsc{ExtendTree} function}
\label{algo:extend_tree}
\end{algorithm}
\subsubsection{Extracting and Shortcutting the Path}
If the algorithm succeeds at adding a goal state to the tree,
the function $\textsc{ExtractAndShortcut}$ extracts the solution
$(x^0, u^0), \ldots, (x^n, \bot)$ with $x^n \in \mathcal{G}$ from $\mathcal{T}$.
Due to the randomization of the algorithm, this solution may contain
multiple actions that are not required. We shortcut these using
the shortcut algorithm presented by King et.\ al \cite{King2015}. The algorithm selects
two pairs $(x^i, u^i), (x^j, u^j)$ and replaces $u^i$ with an action moving the robot from
state $x^i_0$ to $x^j_0$. Thereafter, it forward propagates this new action and all remaining actions $u^k$ with
$j \leq k < n$ through the physics model to probe whether the goal can still be achieved.
If this is the case and the resulting solution is shorter in terms of execution time,
the old solution is replaced by the new one. This process is repeated until either all pairs have been
attempted or a timeout occurred. The pairs can be selected in different orders, although uniform
random sampling performed best in our experiments.
\input{sections/method_learning}
\subsection{Learning the Policy and the Generator}
\label{sec:method:oracle}
The $\textsc{QueryGenerator}$ and $\textsc{QueryPolicy}$
functions provide the planner with a manipulation state and an action
to transport a single object $i$ from a state $x_i$ to some desired state $x_i^d$.
As illustrated in \secref{sec:concept}, there might be multiple such manipulation states that the
generator could sample. Similarly, in general there are several actions
that the policy could select to achieve the \textit{transfer}.
We can represent these two sets implicitly through two families of distributions
\begin{align}
&p(x_0|x_i^d, x_{1:m}, \nu_{0:m}, \mathcal{O}), \label{eq:generator_family} \\
&p(u | x_i^d, x_{0:m}, \nu_{0:m}, \mathcal{O}) \label{eq:policy_family}
\end{align}
that place all probability mass on the manipulation states and actions for
the desired object transport. Both types of distributions are conditioned
on the state of all objects $x_{1:m}$, physical properties of the objects and the robot $\nu_{0:m}$,
and all static obstacles~$\mathcal{O}$. The action distributions in \eqref{eq:policy_family} are additionally
conditioned on the state of the robot $x_0$.
With this representation, learning the generator and the policy could be achieved by learning parameters
$\theta$ and $\phi$ that characterize instances from these families of distributions.
Once learned, the generator and the policy could then produce the desired samples by
sampling from these distributions. Learning $\theta$ and $\phi$ for this
general case, however, is very difficult. The learned distributions would need
to be conditioned on an arbitrary number of movable objects $m$ as well
as all possible static obstacle configurations $\mathcal{O}$.
Therefore, instead, we simplify the problem to learning distributions of the form
\begin{align}
&p(x_0|x_i^d, x_{i}, \nu_{i}), \label{eq:simplified_generator_family} \\
&p(u | x_i^d, x_0, x_{i}, \nu_{i}) \label{eq:simplified_policy_family}.
\end{align}
In other words, we choose to learn the generator and the policy in an obstacle-free world
containing only the robot and a single object. We leave it to the planning algorithm to find
manipulation states and actions that are feasible in the full problem. Also, we learn
both policy and generator for a single robot at a time. Applying the planner to a different robot
requires training a different policy and generator. For brevity, we
thus omit the dependency on the robot's physical properties $\nu_0$.
In the following, we first present how we learn the policy, i.e.\ an instance of an action distribution,
from data generated offline. Thereafter, we derive an instance of a manipulation state distribution from
this policy and present how the generator can be trained to efficiently sample
from this distribution within the planner.
\subsubsection{Learning the Policy}
\label{sec:method:learning:policy}
The parameter $\theta$ that characterizes the policy
can be found by solving the problem
\begin{equation}
\label{eq:general_policy_expectation}
\min_{\theta} \mathbb{E}_{x_0, x_i^d, x_i, \nu_i}\Bigl[\mathbb{E}_{x_i', u}[d_{\mathcal{C}_i}(x_i',x_i^d) ~|~x_0, x_i^d, x_i, \nu_i, \theta] \Bigr]
\end{equation}
over some training distributions for $x_0, x_i^d, x_{i}, \nu_{i}$.
The inner expected value
\begin{multline}
\label{eq:general_policy_integral}
\mathbb{E}_{x_i', u}[d_{\mathcal{C}_i}(x_i',x_i^d)~|~x_0, x_i^d, x_i, \nu_i, \theta] = \\
\begin{aligned}
\iint d_{\mathcal{C}_i}(x_i',x_i^d)\,&p(x_i'|u, x_0, x_i, \nu_i)\,dx_i'\\ &p(u | x_i^d, x_0, x_i, \nu_i, \theta)\,\,du
\end{aligned}
\end{multline}
is the expected distance between a desired object state $x_i^d$ and the actual
state $x_i'$ that the policy parameterized by $\theta$ achieves, given it is
executed when the robot is in state $x_0$ and the object with properties $\nu_i$ is in state $x_i$.
The successor state distribution $p(x_i'|u, x_{0}, x_i, \nu_{i})$ describes
the physical outcome of an action. Although we could model this using the
deterministic physics model $\Gamma$, it proves useful to apply a
non-deterministic model for learning the policy. We
will motivate this shortly.
We simplify the expression in \eqref{eq:general_policy_integral} by
choosing our policy to be a deterministic function
$u_\theta \coloneqq \pi_\theta(x_0, x_i, x_i^d, \nu_i)$.
In other words, we enforce the action distribution to be a Dirac delta function
$p(u|x_i^d, x_0, x_i, \nu_i, \theta)~=~\delta(u~-~\pi_\theta(x_0, x_i, x_i^d, \nu_i)).$
With this, the expected distance in \eqref{eq:general_policy_integral} reduces to
\begin{equation}\label{eq:energy_function1}
\begin{aligned}
L_\theta(x_0, x_i, x_i^d, \nu_i) \coloneqq&\int d(x_i',x_i^d)\,p(x_i'|u_\theta, x_0, x_i,\nu_i)\,dx_i' \\
=&~\mathbb{E}_{x_i'}[d_{\mathcal{C}_i}(x_i',x_i^d)~|~u_\theta, x_0, x_i, \nu_i]
\end{aligned}
\end{equation}
and our problem of learning the policy becomes
\begin{equation}
\label{eq:simplified_policy_expectation}
\min_{\theta} \mathbb{E}_{x_0, x_i^d, x_i, \nu_i}\Bigl[ L_\theta(x_0, x_i, x_i^d, \nu_i) \Bigr].
\end{equation}
To solve this problem efficiently, we need to have access to the gradient of
the loss $L_\theta(x_0, x_i, x_i^d, \nu_i)$ w.r.t. $\theta$. To acquire this, we choose
the distance function on $\mathcal{C}_i \subseteq SE(2)$ to be of the form
$d_{\mathcal{C}_i}(x_i', x_i^d)=\sum_{j=1}^3\sigma_j(x_{ij}'~-~x_{ij}^d)^2$
with positive weights $\{\sigma_j\}_{j=1}^3$. The loss then becomes
\begin{equation}
\begin{aligned}
L_\theta(x_0, x_i, x_i^d, \nu_i)&=
\sum_{j=1}^3 \sigma_j \mathbb{E}_{x_i' }\left[ (x_{ij}' - x_{ij}^d)^2~|~u_\theta, x_0, x_i, \nu_i \right],
\end{aligned}
\end{equation}
where $x_{i0}, x_{i1} \in \mathbb{R}$ denote the object's position and $x_{i2}~\in~SO(2)$ its orientation.
Expanding the square and rewriting yields
\begin{multline}\label{eq:variance_mean_decomp}
L_\theta(x_0, x_i, x_i^d, \nu_i) = \\
\sum_{j=1}^3 \sigma_j \left( \text{Var}_{x_i'} (x_{ij}' ) + \left(\mathbb{E}_{x_i'}\left[ x_{ij}'\right] - x_{ij}^d\right)^2 \right),
\end{multline}
where both variance and expected value are conditioned on $x_0, x_i, \nu_i, u_\theta$.
This means we can express the loss $L_\theta$ as a function of forward models
\begin{equation}\label{eq:forward_mean}
f_\mu(x_0, x_i, \nu_i, u) = \mathbb{E}_{x_i'}\left[x_i' | x_0, x_i, \nu_i, u \right]
\end{equation}
and
\begin{equation}\label{eq:forward_var}
f_{\sigma^2}(x_0, x_i, \nu_i, u) = \text{Var}_{x_i'}(x_i' | x_0, x_i, \nu_i, u ).
\end{equation}
In particular, if these forward models are differentiable w.r.t. to the action argument $u$, we can
apply the chain rule in \eqref{eq:variance_mean_decomp} to obtain the gradient of $L_\theta$
w.r.t. $\theta$.
With this deterministic policy gradient~\cite{silver2014deterministic}
we can then learn the policy by solving~\eqref{eq:simplified_policy_expectation}.
We can obtain differentiable models $f_\mu$ and $f_{\sigma^2}$ through supervised learning from a
data set $\{(x_0^j, x_i^j, \nu_i^j, u^j, (x_i')^j)~|~j\in~\mathbb{N}\}$ of robot-object interactions.
We generate this data set offline using the physics model $\Gamma$.
Learning the models $f_\mu$ and $f_{\sigma^2}$ in this way has the advantage that
we are free in choosing any physics model $\Gamma$ for generating the data.
In particular, this allows us to choose models $\Gamma$ for which gradients w.r.t. $u$
are not available, as it is the case for many rigid body physics simulators.
\eqref{eq:variance_mean_decomp} also provides insight into why we choose
to apply a non-deterministic physics model for learning the policy.
If we applied a deterministic model, i.e.\ the successor state distribution
$p(x_i'|u, x_{0}, x_i, \nu_{i})$ had zero-variance, the variance term
in \eqref{eq:variance_mean_decomp} would disappear. Hence, our
policy could select any action $u \in U$ for a state $(x_0, x_i)$
that transports the object as close as possible to $x_i^d$.
Not all of these actions, however, are equally desirable in practice.
For instance, a robotic hand pushing an object with the tip of its finger
only works reliably if the object behaves exactly as predicted by the physics model.
Pushing the object with the palm of the hand, in contrast, is
more reliable, since the object is trapped between the fingers.
Thus, to raise preference for the policy to learn reliable actions,
we add observation noise to the object state $x_i$,
and the object's mass and friction parameters in $\nu_i$ when generating our data set.
Since the loss in \eqref{eq:variance_mean_decomp} is minimized by actions that achieve low
variance in successor state, this will result in our policy selecting actions
that achieve the desired push even under uncertainty in the modified physics
parameters.
\subsubsection{Acquiring a Manipulation State Distribution}
Given the trained policy, we derive a manipulation state distribution parameterized by $\phi$ by solving
\begin{equation}
\min_\phi \mathbb{E}_{x_i^d, x_i, \nu_i} \Bigl[\mathbb{E}_{x_0}\left[L_\theta(x_0, x_i, \nu_i, x_i^d)~|~x_i, \nu_i, x_i^d, \phi \right]\Bigr]
\end{equation}
over training distributions for $x_i^d, x_i, \nu_i$.
Here, the inner expected value
\begin{multline}
\mathbb{E}_{x_0}\left[L_\theta(x_0, x_i, \nu_i, x_i^d)~|~x_i, \nu_i, x_i^d,\phi \right] =\\
\int_{\mathcal{C}_0} L_\theta(x_0, x_i, \nu_i, x_i^d)\,p(x_0 | x_i, x_i^d, \nu_i, \phi)\,dx_0
\end{multline}
is the expected loss of the trained policy if we choose initial robot states according to
the distribution parameterized by $\phi$.
In principle, this expected value would be minimized by a Dirac delta function that places all its probability
mass at a robot state that minimizes the loss $L_\theta$ given the arguments $x_i, x_i^d, \nu_i$.
This, however, is undesirable. The loss $L_\theta$ is defined on a simplified problem that
only considers a single object. The state that minimizes $L_\theta$ may not be
feasible in the full problem with obstacles that is addressed by the planner.
Hence, instead, we opt for a wider distribution that provides the planner with
more diverse manipulation state samples. Namely, we choose $\phi$ to describe
an energy-based distribution of the form
\begin{equation}\label{eq:energy_distribution}
p(x_0|x_i^d, x_i, \nu_i) = \frac{1}{Z}e^{-\lambda L_\theta(x_0, x_i, x_i^d, \nu_i)},
\end{equation}
where $Z$ is a normalization constant and $\lambda~\in~\mathbb{R}^+$ a manually
selected parameter.
We choose this distribution since its modes are placed on the robot states
that allow pushing the object to the desired state in the obstacle-free world.
By letting $\lambda \rightarrow \infty$, we get a distribution with all its
probability mass placed on the minima of $L_\theta$ w.r.t. to the robot state.
Vice versa choosing small $\lambda$, we get a distribution with wider support,
which increases the chance of the distribution to cover the feasible manipulation states
of the full problem.
\subsubsection{Learning a Generative Model}
The forward models $f_\mu$ and $f_{\sigma^2}$ allow us to compute
$L_\theta$, and thus the density function in \eqref{eq:energy_distribution} efficiently.
For the $\textsc{QueryGenerator}$ routine in the planner, however, we need to produce
samples of robot states following this distribution.
We can acquire these using the Markov Chain Monte Carlo (MCMC) method:
\begin{equation}
x_0 \sim p_{\text{MCMC}}(x_0|x_i, x_i^d, \nu_i).
\end{equation}
This, however, takes several iterations for the distribution to
burn in and multiple forward passes through the learned forward models, making this
computationally too expensive to be used inside the planner. Hence, instead,
we generate a set of samples using this method offline, and train a (conditional)
generative adversarial network (GAN)~\cite{goodfellow2014generative}
to mimic this distribution online.
This way we can generate samples from the distribution with a single
forward pass through a neural network.
A GAN consists of two parts: a generator $G_{\varphi_G}$, and a discriminator $D_{\varphi_D}$.
Both are neural networks parameterized by $\varphi_G$ and $\varphi_D$ respectively.
The generator $G_{\varphi_G}(x_i, x_i^d, \nu_i, z)$ is a function
that maps a random real-valued sample $z \sim \mathcal{N}(\mathbf{0}, \mathbf{I})$ and its arguments
$x_i, x_i^d, \nu_i$ to a robot state sample. The discriminator outputs the probability that a
robot state sample $x_0$ is drawn from the \textit{true} distribution of manipulation states
$p_{\text{MCMC}}(x_0|x_i, x_i^d, \nu_i)$ that we obtain using MCMC.
Both models are trained by solving the following problem:
\begin{equation}
\label{eq:gan_objective}
\min_{\varphi_G} \max_{\varphi_D} V(\varphi_D, \varphi_G)
\end{equation}
with
\begin{multline}
V(\varphi_D, \varphi_G) =
\mathbb{E}_{x_0 \sim p_\text{MCMC}}\left[ \log(D_{\varphi_D}(x_0, x_i, x_i^d, \nu_i)) \right] + \\
\mathbb{E}_{z}\left[\log(1 - D_{\varphi_D}(G_{\varphi_G}(z, x_i, x_i^d, \nu_i), x_i, x_i^d, \nu_i) )\right]
\end{multline}
On the one hand, this objective trains the discriminator to distinguish between
true samples from $p_{\text{MCMC}}$ and samples generated by the generator.
On the other hand, it optimizes the generator to produce samples such that the discriminator
can not distinguish these generated samples from the true samples from $p_{\text{MCMC}}$.
Once learned the generator then serves as an efficient state sampler in the \textsc{QueryGenerator} function.
\subsubsection{Summary}
To summarize, the procedure to learn the deterministic policy $\pi_\theta$ and the generator
$G_\varphi$ consists of four steps illustrated in \figref{fig:system_overview} on the left.
First, we generate a data set of robot-object interactions using the physics model $\Gamma$.
Second, we train two forward models $f_\mu$ and $f_{\sigma^2}$ from this data set under observation
noise of the physical properties of the training objects. Third,
we use these forward models to compute the loss in \eqref{eq:variance_mean_decomp}
and train the policy $\pi_\theta$.
Fourth, we define an approximate manipulation state distribution
according to \eqref{eq:energy_distribution} and train the generator $G_\varphi$ to
imitate samples following this distribution.
\section{Problem Definition \texorpdfstring{$\And$}{And} Notation}
\label{sec:problem}
We consider a rearrangement planning problem where a robot
is tasked to rearrange multiple objects using only non-prehensile manipulation.
The robot operates in a bounded environment that contains $m$ movable objects among
static obstacles $\mathcal{O}$. Its goal is to rearrange a target set~$\mathbf{T} \subseteq \{1, \ldots, m\}$
of movable objects to some goal configurations~$\{g_i~|~i \in \mathbf{T}\}$.
This target set may either encompass all $m$ objects or only a subset.
To achieve its goal, the robot may manipulate any movable object while avoiding
collisions with the static obstacles. We assume that all objects are rigid bodies that are placed on a
single planar support surface and we disallow toppling over objects.
We formulate this problem as a motion planning problem on the composite configuration space
of all movable objects and the robot, $\mathcal{C}_{0:m} = \mathcal{C}_0 \times \cdots \times \mathcal{C}_m$.
Here, $\mathcal{C}_0$ is the configuration space of the robot and
$\mathcal{C}_i \subset \mathit{SE}(2)$ the configuration space of movable object $i \in \{1, \ldots, m\}$.
The composite configuration space is partitioned in free and obstacle space,
$\mathcal{C}_{0:m}~=~\mathcal{C}_{0:m}^\text{free}~\mathbin{\mathaccent\cdot\cup}~\mathcal{C}_{0:m}^\text{obst}$. We define
the free space $\mathcal{C}_{0:m}^\text{free}$ as the set of physically feasible configurations
in which no two objects or the robot overlap and there is no collision with any static obstacle.
Note that this definition includes configurations in which there is contact among
movable objects or between these and the robot.
For a composite configuration $x = (x_0, \ldots, x_m)~\in~\mathcal{C}_{0:m}$ we refer by
$x_i \in \mathcal{C}_i$ to the configuration of object~$i \geq 1$ and by $x_0 \in \mathcal{C}_0$ to the
configuration of the robot. We use the terms \textit{state} and \textit{configuration} interchangeably and
distinguish between two different states using the superscript notation $x^a$, $x^b$.
Our notation is summarized in \tableref{table:notation}.
\begin{table}
\resizebox{\columnwidth}{!}{%
\begin{tabular}{l|p{0.45\columnwidth}}
\textbf{Symbol} & \textbf{Description} \\ \hline
$m$ & Total number of movable objects\\
$\mathcal{O}$ & Static obstacles\\
$\mathcal{C}_0$ & Configuration space of the robot \\
$\mathcal{C}_i$ & Configuration space of object $i$ \\
$\mathcal{C}_{0:m}$ & Composite configuration space \\
$\mathcal{C}_{1:m}$ & Space of all object arrangements \\
$\mathcal{C}_{0:m}^\text{free}$ & Feasible configuration space\\
$\mathcal{C}_{0:m}^\text{obst}$ & Obstacle space\\
$x = (x_0, \ldots, x_m)$ & Composite state \\
$x_{1:m} = (x_1, \ldots, x_m)$ & Composite state of objects \\
$x^a, x^b$ & Two different composite states \\
$x_i$ & State of object $i$ \\
$x_0$ & State of the robot \\
$x_i^a, x_i^b$ & Two different states of object $i$ \\
$u \in U$ & Robot action in action space $U$ \\
$\mathbf{T} \subseteq \{1, \ldots, m\}$ & Target object set \\
$\mathcal{G} \subset \mathcal{C}_{0:m}^\text{free}$ & Goal region \\
$g_i \in \mathcal{C}_i$ & Goal configuration of object $i$ \\
$\xi: [0, t_\text{max}] \to \mathcal{C}_{0:m}^\text{free}$ & Path in $\mathcal{C}^\text{free}_{0:m}$ \\
$\tau: [0, t_\text{max}] \to U$ & Time-action mapping \\
$d_{\mathcal{C}_i}:\mathcal{C}_i \times \mathcal{C}_i \to \mathbb{R}$ & Distance function on $\mathcal{C}_i$ \\
$\Gamma: \mathcal{C}_{0:m} \times U \to \mathcal{C}_{0:m}$ & Deterministic physics model \\
$\bot$ & Empty value or invalid state\\
$s$ & A subset of $\mathcal{C}_{0:m}$ (a slice) with the same object arrangement\\
$s_{1:m}$ & Object arrangement in slice $s$\\
$s_{i}$ & Object i's state in slice $s$\\
$d_{s}:\mathcal{C}_{1:m} \times \mathcal{C}_{1:m} \to \mathbb{R}$ & Distance function on $\mathcal{C}_{1:m}$ \\
$G_\varphi$ & Robot state generator \\
$\pi_\theta$ & Pushing policy\\
$L_\theta$ & Policy loss function\\
$\mathcal{T}$ & Search tree of states in $\mathcal{C}_{0:m}^\text{free}$\\
$\mathcal{S}$ & Set of explored slices of $\mathcal{C}_{0:m}^\text{free}$\\
$\nu_i$ & Physical properties of object $i$ \\
$x_i^d$ & Desired state for object $i$ \\
$x_i'$ & Resulting state for object $i$ \\
\end{tabular}}
\caption{Notation used in this work.}
\label{table:notation}
\end{table}
The robot can interact with its environment through actions $u \in U$.
The purpose of our algorithm is to compute a time-action mapping $\tau:~[0,~t_\text{max}]~\to~U$
and a path $\xi:~[0, t_\text{max}]~\to~\mathcal{C}_{0:m}^\text{free}$,
where $t_\text{max} \geq 0$ is the duration of this solution.
The path $\xi$ describes which states the system transitions through
and the time-action mapping $\tau$ which action to execute at time
$t \in[0, t_\text{max}]$. Such a pair $(\xi, \tau)$ is physically feasible,
if the non-holonomic constraint $\dot{\xi}(t)~=~f_\text{physics}(\xi(t),~\tau(t))$ is
fulfilled for all $t \in [0, t_\text{max}]$. This constraint
expresses the fact that objects do not move by themselves,
but only as a result of forces exerted on them by the robot.
Given an initial state of the environment $x^0~\in~\mathcal{C}_{0:m}^\text{free}$
and a goal region~$\mathcal{G} \subseteq \mathcal{C}_{0:m}^\text{free}$,
the goal of our algorithm is to find a physically feasible tuple $(\xi, \tau)$ such
that $\xi(0) = x^0$ and $\xi(t_\text{max}) \in \mathcal{G}$.
We define $\mathcal{G} \subseteq \mathcal{C}_{0:m}^\text{free}$
as the set of states for which all target objects
$\mathbf{T}$ are located close to goal configurations $g_i \in \mathcal{C}_i$, i.e.
$$\mathcal{G}~=~\{x~\in~\mathcal{C}_{0:m}^\text{free}~|~\forall~i~\in \mathbf{T} : d_{\mathcal{C}_i}(x_i, g_i) \leq \epsilon_i \}$$
for some thresholds $\epsilon_i > 0$ and distance functions
$d_{\mathcal{C}_i}:~\mathcal{C}_i~\times~\mathcal{C}_i~\to~\mathbb{R}$.
\section{Related Works}
\label{sec:related_works}
Our problem definition falls into the category of manipulation planning.
Manipulation planning involves both planning the motion of a robot
and the manipulation of one or multiple objects in the presence of obstacles.
Conceptually, we can distinguish between related works that focus
on manipulating a single object
from approaches that manipulate
multiple objects. Manipulation planning for multiple objects can be further subdivided into
manipulation planning among movable obstacles (MAMO)~\cite{Stilman2007, Dogar2012},
rearrangement planning (RP)~\cite{Wilfong1991, Alami1994, Ben-Shahar1998b, Ota2004, Scholz2010, Krontiris2015, Krontiris2016, Garrett2018, Barry2013a, Havur2014, Jentzsch2015}
and navigation among movable obstacles (NAMO) \cite{Stilman2005, VandenBerg2009,Nieuwenhuisen2008}.
These subcategories differ in the definition
of the goal of the task. Applying our terminology, MAMO defines the target object set $\mathbf{T}$, or
alternatively $\mathcal{G}$, to only encompass a single object. The remaining
movable obstacles may need to be rearranged to succeed at the task, but their final
configurations are not relevant.
In contrast, in RP the target set $\mathbf{T}$ encompasses all movable objects, i.e.\ the task
is to rearrange all objects to specific locations. Finally, in NAMO the goal is to navigate the
robot to a goal configuration when clearing the path from obstacles
is required. In this case, the goal is only defined for the robot, i.e.\ $\mathbf{T} = \{0\}$, and
the final configurations of the movable obstacles are not of interest.
Since we allow $\mathbf{T}$ to be any subset of $\{1, \ldots, m\}$, our problem covers
manipulation planning for a single object, MAMO and RP, but not NAMO.
Our work addresses the special cases of these problem classes
when all objects are located on a single support surface
and the robot only applies non-prehensile manipulation. For brevity, we refer
to our problem simply as a rearrangement planning problem.
\subsection{Complexity and Concepts}
\label{sec:related_works:concepts}
Manipulation planning and in particular rearrangement planning is challenging.
Wilfong et al. \cite{Wilfong1991} showed that NAMO is NP-hard, and that
rearrangement planning is PSPACE-hard. The complexity arises from the high dimensional
search space and the constraint that objects only move as a consequence
of the robot's actions. Alami et al.~\cite{Alami1994} therefore classify robot
actions into two categories. \textit{Transit} actions are collision-free robot motions, whereas
\textit{transfer} actions denote actions that manipulate objects. Planning
\textit{transit} actions is a classical robot motion planning problem, whereas
planning \textit{transfer} actions requires additional reasoning about the mechanics of manipulation.
Depending on the type of action, a manipulation planner operates on different lower dimensional
subspaces of the configuration space $\mathcal{C}_{0:m}$~\cite{Alami1994, Ben-Shahar1998a, Simeon2004}.
If a robot moves without contact, it transitions between states within a subspace of
$\mathcal{C}_{0:m}^\text{free}$ for which all objects are at the
same location. When, for instance, the robot grasps an object, it transitions to a different subspace,
in which the grasped object and the robot move simultaneously.
Other types of manipulation implicitly define different subspaces with different transition points.
The challenges of manipulation planning lie within computing motions within
each of these subspaces, finding transition points between them, as well as
computing a global path that moves via multiple subspaces towards a goal.
\subsection{Manipulation Planning with Pick-And-Place}
Many works on manipulation planning apply pick-and-place
for \textit{transfer} actions \cite{Alami1994, Simeon2004, Ota2004, Stilman2007, Krontiris2014,
Krontiris2015, Krontiris2016, Garrett2018}. From a planning perspective this is attractive for two reasons.
First, it restricts where a transition from a \textit{transit}
to a \textit{transfer} action can occur, i.e.\ at the configurations where the robot
grasps a resting object.
Second, it simplifies modeling how a state $x = (x_0, \ldots, x_m)$ evolves during a
\textit{transfer} action. Assuming the robot grasps object $k$, a pick-and-place operation
moves $x$ to $x'$ such that only $x_0 \neq x_0'$ and $x_k \neq x_k'$, while
all other objects remain at the same location, i.e.\ $x_i' = x_i$. Furthermore, the new object
state $x_k'$ can be directly computed from the new robot state $x_0'$
given a known transformation between the grasped object and the robot's end-effector's frame.
The early work by Alami et al. \cite{Alami1994} presents two algorithms building on this.
The first algorithm addresses rearrangement planning of multiple objects and assumes a finite set of grasps and
placements. The second addresses manipulation planning for a single
polygonal object under continuous grasps. Simeon et al. \cite{Simeon2004} adapted this approach to
manipulation planning for a single object under continuous grasps and
placements using probabilistic roadmaps.
Later, Stilman et al.~\cite{Stilman2007} addressed the problem of MAMO using pick-and-place.
The algorithm first computes which objects collide with the desired pick-and-place
operation on the target object and then recursively attempts to clear these obstructions.
To limit the recursion depth, the approach assumes \textit{monotone} problems,
where each obstructing object needs to be moved at most once.
Krontiris et al. \cite{Krontiris2015} integrate a modification of this MAMO algorithm
as local planner into a bidirectional RRT algorithm~\cite{lavalle06book} to solve rearrangement problems.
The RRT algorithm explores the space of object arrangements and utilizes the MAMO
algorithm to compute pick-and-place sequences to transition between different arrangements.
More recently~\cite{Krontiris2016}, the same authors augmented this approach
using minimal constraint removal paths~\cite{Hauser2014} to compute an order in which to move
the objects that minimizes obstructions, thus avoiding the extensive backtracking of the original MAMO algorithm.
This results in a non-monotone rearrangement planning algorithm that
was demonstrated to solve even challenging problems with many objects efficiently.
\subsection{Manipulation Planning with Diverse Manipulation Types}
\label{sec:related_works:diverse}
A robot can rearrange objects more effectively and efficiently when it is not only limited to
pick-and-place, but can also apply non-prehensile manipulation like pushing.
Pushing is useful as it is faster to execute,
can reduce uncertainty \cite{Dogar2010} and can be applied to heavy or multiple objects simultaneously.
Hence, several existing works aim at combining diverse types of
manipulation \cite{Dogar2012, Barry2013, Barry2013a, Havur2014, Jentzsch2015} in a single planner.
In these works, the different types of manipulation are abstracted as
manipulation primitives. A manipulation primitive defines what its preconditions
and effects are. For instance, for a picking primitive the precondition
is that the robot's end effector is located at a grasp pose relative to a target object.
Its effect is then, as described above, the change of a single object's pose
and the robot's configuration.
Similarly, one can formalize primitives for pushing. Here, however, in
general both the preconditions and effects are more challenging to model.
A robot may push an object $k$ with its various parts from many different
robot configurations.
Furthermore, the pushed object may slide or collide with other objects, resulting
in state changes for these as well. This renders modeling
the resulting state $x'$ of a pushing operation challenging.
To simplify this, the works in this category commonly limit the implemented pushing primitives
to cases where a single object is pushed with the robot's end-effector. The effect
of pushing is often assumed to be simply the translation of the robot's end-effector
applied to the pushed object.
More sophisticated pushing primitives are presented by Dogar et al.~\cite{Dogar2012}.
The authors apply a quasistatic
pushing model~\cite{Lynch1996} to compute capture regions of different
pushing primitives. These capture regions describe sets of object poses relative to a
robot link, e.g.\ the palm of a robotic hand. If an object is located within
the capture region of a primitive, it is guaranteed to end up
inside a known subregion of this region once the primitive was executed.
This allows to compute solutions for MAMO under object pose uncertainty,
but is limited by the quasistatic assumption that inertial forces are negligible.
Furthermore, the approach is limited to manipulating a single object at a time.
\subsection{Manipulation Planning with Pushing}
There have also been works that solely focus on manipulation planning for
pushing~\cite{Lynch1996, Nieuwenhuisen2005, Zhou2017}.
Lynch et al.\ \cite{Lynch1996} studied the controllability
of a single object pushed with point or line contacts
under the quasistatic assumption.
The authors present a planner based on Dijkstra's
algorithm to plan pushing a single object among static obstacles
using stable line contacts that can be executed open-loop.
More recently, Zhou et al.\ \cite{Zhou2017} showed that quasistatic push planning of an object
using a single contact can be reduced to computing a Dubins path. The authors applied
this in the RRT algorithm to plan pushing paths that avoid obstacles with the
pusher and the object. While these approaches produce very accurate solutions
that can be executed open-loop, they are limited to situations where the
quasistatic assumption holds and only a single object is pushed.
In rearrangement planning it may be more efficient to push multiple
objects simultaneously than in sequence. Ben-Shahar et al.\
\cite{Ben-Shahar1998a, Ben-Shahar1998b} present a rearrangement planner that, in principle,
allows pushing objects simultaneously. The approach performs a hill-climbing
search on a grid-discretization of the composite configuration space. The
search minimizes a cost function that denotes the minimal cost to reach the
goal. This cost is precomputed on the discrete search space using a reverse
pushing model that could take object-object contacts and non-quasistatic
physics into account. Obtaining such a general reverse pushing model, however, is
difficult and the authors present only a simplified model in their experiments.
\subsubsection{Integrating a Physics Model}
Over the last decades rigid-body physics simulators have become widely
available~\cite{bullet, box2d, ode, mujoco}. These simulators
can model the physical interactions between a robot and its surrounding objects.
Integrating such a physics model with a motion planning algorithm
allows to predict the effects of robot actions.
Zito et al.\ \cite{Zito2012} use this approach to plan to push a single object.
Kitaev et al.\ \cite{Kitaev2015} combine a physics model with stochastic
trajectory optimization to compute grasp approach motions in clutter. A similar
idea has been applied to rearrangement planning and MAMO in \cite{King2015} and \cite{Haustein2015}.
These works integrate a physics model
into the kinodynamic RRT algorithm~\cite{LaValle2001}.
In \cite{King2015}, a quasistatic multi-body pushing model is used to
generate solutions where the robot utilizes its full-arm to push multiple object simultaneously.
In \cite{Haustein2015}, instead a dynamic physics model is used that allows
generating solutions where a robot pushes and thrusts sliding objects into place.
In both \cite{King2015} and \cite{Haustein2015} the RRT algorithm explores
$\mathcal{C}_{0:m}$ by forward propagating randomly selected robot actions through the
physics model. These robot-centric actions move the robot
and make no explicit assumption on how an object may be manipulated.
As a consequence, both approaches can achieve a diverse set of manipulation actions, but
suffer from a poor exploration of the search space.
Consider two states $x^a, x^b~\in~\mathcal{C}_{0:m}$ for which some object state differs,
i.e. $x^a_k \neq x^b_k$ for an object $k$.
Without any object-centric pushing primitives, the algorithms lack guidance on how to
select an action that takes the search from $x^a$ closer to $x^b$.
Randomly sampling robot-centric actions may lead to incidental contact with an object,
but it is very unlikely to sample an action that moves the object towards the desired state.
This diminishes the RRT's property of rapidly exploring the search space.
King et al.~\cite{King2016} address this by augmenting the approach from \cite{King2015}
with object-centric pushing primitives. These primitives
are similar to the ones described in \secref{sec:related_works:diverse}, but their effects are modeled
using the physics model. This in combination with random robot-centric actions
significantly improves the algorithm's performance.
However, designing these primitives manually still poses a limiting factor.
First, providing the algorithm with diverse primitives such as pushing with the elbow, or pushing
with the forearm is labor-intensive. Second, adapting the planner to a different robot generally
requires the human designer to create new primitives. Third, selecting the most
suitable primitive within the planner efficiently becomes challenging for a large set of
primitives.
\subsubsection{Learning for Pushing}
\label{sec:related_works:learning}
An alternative to modeling pushing analytically is to apply machine learning.
The works by Scholz et al.~\cite{Scholz2010} and Elliot et al.~\cite{Elliott2016}
learn probabilistic forward models for manually designed manipulation primitives to rearrange objects.
As these forward models are learned from the real world, the approaches make few assumptions
on the outcome of the physical interactions. Object-to-object contacts, however,
are not modeled. Furthermore, the use of manipulation primitives limits the
type of contact the robot applies.
Another probabilistic model-based approach was proposed by Wang et
al.~\cite{Wang2017} and addresses push planning for a single object
under uncertainty. The authors propose to first learn a distribution of
stochastic pushing outcomes in a world containing no obstacles. Then, given
the task to push the object to some goal in the presence of obstacles, the
approach first constructs several search trees of collision-free object poses
using the RRT algorithm. The nodes of these search trees are then treated as the states of a
finite state Markov decision process (MDP), where the transition probabilities
are given by the pushing distribution learned beforehand. In this MDP, an
optimal value function and policy are then computed iteratively to solve the
given problem. This approach has the benefit that the learned pushing policy
is robust against uncertainty. Also, being model-based reduces the amount of
data needed to train the policy \cite{atkeson1997comparison}. The approach,
however, does not address how to plan the motion of the robot, and instead
assumes that the robot can always transition to any pose relative to the
object. Besides, the value function and policy are based on a dynamics model
which is only valid for the single trained object. Pushing a different object
requires learning a new model.
To remove restrictions on the type of contact, and the type of objects, Finn et
al. \cite{finn2017deep} present an end-to-end approach for pushing. Instead of
explicitly modeling the manipulated object, the approach learns probabilities
of how pixels move in a camera image as a result of robot actions. These learned
probability distributions are, however, only informative for short time scales,
and are unlikely to generalize to longer time-scales and planning in complex
scenes.
In contrast to these model-based approaches, Andrychowicz et
al.~\cite{andrychowicz2017hindsight} apply Q-learning to learn a policy for
pushing a single object in an obstacle-free environment. As the previously
mentioned works \cite{finn2017deep} and \cite{Wang2017}, this makes
few to no assumptions on the type of contact. Being model-free also means
that the dependence on a correct approximation of the dynamics is no longer
needed. Any changes to the environment or the pushed object, however, requires
training the policy from scratch again.
\subsection{Our Approach}
The goals of this work are to devise an algorithm that
\begin{itemize}
\item computes solutions to the problem defined in \secref{sec:problem},
\item makes few limiting assumptions on how the robot can manipulate objects,
\item maintains planning efficiency.
\end{itemize}
The ideas from \cite{King2015} and \cite{Haustein2015} address the first two
goals by integrating a physics model into the kinodynamic RRT algorithm.
Both approaches, however, suffer from a poor exploration rate, which leads to
long planning times. King et al. \cite{King2016} demonstrated how the efficiency of this family of
algorithms can be improved by equipping them with object-centric actions. The proposed action
primitives, however, require a human designer and thus reintroduce limiting assumptions
on the robot's manipulation abilities. The learning-based approaches presented in
\secref{sec:related_works:learning} either also require some primitives or
do not allow manipulating multiple objects at a time.
\section{Introduction}
\label{sec:introduction}
In cluttered environments, a robot frequently encounters situations
in which it needs to rearrange objects.
A planning algorithm needs to reason about
\textit{which} objects to move, \textit{where} to move them and \textit{how} to move them.
To achieve this, one needs to model the robot's manipulation abilities
and how these affect the environment. Many existing approaches simplify this
by limiting manipulation to primitives like pick-and-place or straight-line pushing with
the robot's end-effector. Pushing is commonly further limited to a single
object at a time and it is assumed that the object moves quasistatically, i.e.\ that
inertial forces are neglectable and the object does not slide.
We are interested in enabling robots to utilize a wider range of non-prehensile
manipulation skills. We aim to enable a robot to push
multiple objects simultaneously with any of its parts and not just
its end-effector. Modeling such skills explicitly, however, is labor-intensive
and difficult to adjust to different robot embodiments and objects.
Therefore, in this work, we devise an algorithm for planar non-prehensile rearrangement planning
that does not require manually designed manipulation primitives.
\begin{figure}[t]
\includegraphics[width=\columnwidth]{figures/figure_1_slices.pdf}
\centering
\caption{
Our planning algorithm rearranges movable objects on a plane (drawn in green and blue)
in the presence of obstacles (red) using non-prehensile manipulation.
The algorithm explores the composite configuration space
of robot and objects in slices. Each slice corresponds to an object
arrangement and is the subset of configurations with this arrangement.\\
\textbf{Slice a:}
Configurations that lie within the same slice are connected through collision-free
robot motions (yellow arrows). To purposefully transition towards a target slice $t$,
our algorithm first selects an object (green) to transport towards the target.
Thereafter, it samples a robot state from a learned distribution (colored points)
from which the desired transport is feasible.\\
\textbf{Slice b:}
After steering the robot to the sampled state, it applies a learned policy to push
the object towards the target. The outcome of every robot action is modeled using
a dynamic physics model, which also allows modeling unintended additional contact.\\
\textbf{Slice c:}
The model also models object-object contact,
which enables the approach to push multiple objects simultaneously.\\
\textbf{Video:} An illustrative video of this and additional supplementary material
can be found on \url{https://joshuahaustein.github.io/learning_rearrangement_planning/}
}
\label{fig:concept}
\end{figure}
Instead, our approach
combines recent works on physics-based
non-prehensile rearrangement planning~\cite{Cosgun2011, King2015, Haustein2015, King2016} with
reinforcement learning and generative modeling.
Physics-based rearrangement planners explore the composite configuration
space of objects and robot by performing a forward search over simple robot-centric actions.
A physics model is applied to predict whether any action leads to collision
and what the effects of this collision are. This allows the
planner to exploit any manipulation the robot can achieve with its motions.
The key ideas of this work lie in augmenting this physics-based approach
through the following concepts (see also \figref{fig:concept}):
\begin{itemize}
\item[1.] We provide the algorithm with learned guidance on how to manipulate objects.
For this, we train a generative model to efficiently produce samples from the set of robot configurations
from which transporting an object towards a desired state is feasible. We achieve this
by applying Generative Adversarial Networks (GANs). Additionally, we
train a one-step policy that, once the robot is placed in such a
configuration, provides object-specific pushing actions.
\item[2.] We structure the search by segmenting the search space into sets of configurations with
similar object arrangements. This acknowledges that steering the robot is simpler
than rearranging objects, and allows the algorithm to efficiently select suitable
nearest neighbors for its search tree extension.
\end{itemize}
As a physics-based rearrangement planner, our approach can compute solutions
where the robot pushes multiple objects simultaneously, as often as needed, and with any
of its parts. In contrast to related approaches, our
algorithm is more efficient and easily adapted to different object types
and robot geometries.
We implement our approach for robots endowed with configuration spaces in $SE(2)$,
and evaluate it experimentally.
We observe the efficacy of our design choices and achieve more than 2x planning
speedup compared to a state-of-the-art physics-based approach on various test scenarios.
The remainder of this work is structured as follows. First, we formalize the
problem we address in \secref{sec:problem} and summarize related works in
\secref{sec:related_works}. Then, in \secref{sec:concept} we provide a more detailed
overview of our concepts and contributions.
We present the details of our approach in \secref{sec:method}, and evaluate
it in \secref{sec:experiments}. We discuss limitations and future
work in \secref{sec:discussion}.
| {'timestamp': '2019-01-14T02:14:23', 'yymm': '1901', 'arxiv_id': '1901.03557', 'language': 'en', 'url': 'https://arxiv.org/abs/1901.03557'} | arxiv |
\section{Introduction}
\label{sec:intro}
In recent years, the simultaneous wireless information and power transfer has gained momentum in the realm of energy harvesting (EH) technologies. In this contribution, we focus on systems employing a time-splitting EH approach \cite{zhou2013, GA,RSV, Ku16}, i.e., during a first phase the receiver collects energy from RF microwave radiation and in a second phase it uses the harvested energy for data transfer.
An interesting application of such EH approaches arises for wireless systems under jamming attacks. In the past, two main counter-jamming approaches have been commonly considered: direct sequence spread spectrum (DSSS) and frequency hopping spread spectrum (FHSS),
\cite{Wei12,Xiao15}. More recently, the use of multiple antennas has been exploited in \cite{wang2018} against both jamming and eavesdropping. In the first two approaches, the impact of power constrained jammers can be limited by increasing the spectral resources because the optimal jamming strategy is to spread the jamming power over the entire bandwidth; whereas the former requires an increased number of antennas. In the present work, we alternatively explore the possibility of mitigating jamming attacks by using EH \emph{without increasing the spectral or the spatial resources}. So far, there has only been a limited number of contributions in this area \cite{FSL, XCDN, Veronica_ICC17, EVBChorti}.
In \cite{FSL}, the jamming interference is harvested and exploited in a two-way channel assuming that the jammer's policy is fixed (i.e., the jammer is not strategic). Furthermore, in \cite{XCDN} a cooperative relay wiretap channel is studied, in which the helping nodes harvest energy from the legitimate link and then generate interference to the eavesdropper. On the other hand, in \cite{EVBChorti}, it is shown that EH can be exploited to mitigate jamming attacks in wireless secret key generation (SKG) systems and that it is possible to neutralize the jammer, i.e., to fully compensate its impact on the SKG rate. Building on this idea, the objective of the present work is to investigate whether EH at the legitimate transmitter can be an efficient measure against jamming attacks. We investigate the strategic interaction between a pair of legitimate nodes and a jammer employing as utility function the Shannon capacity.
The main contributions of this paper can be summarized as follows. First, we demonstrate that the jamming attack can be prevented entirely by adjusting the EH duration, i.e., the jammer can be neutralized (or forced to remain silent). This is only possible when the quality of the channel in the harvesting link is higher than in the jamming link. Nevertheless, neutralizing the jammer imposes too stringent restrictions on the EH duration and on the legitimate transmit power and hence is not optimal.
Second, we formulate a zero-sum game between the legitimate users and the jammer and derive the Nash equilibrium (NE) analytically. At the NE, both players transmit at full power, while, the optimal EH duration depends on the system parameters. Interestingly, we show that the NE always outperforms neutralizing the jammer. At the NE, the jamming interference is not fully cancelled but rather exploited, particularly efficient in the high jamming interference regime.
This work represents a proof of concept of the potential use of EH against jamming attacks, relying on widely used system model assumptions \cite{zhou2013,GA,RSV,Wei12,Xiao15,EVBChorti,Veronica_ICC17}. Demonstration of the proposed EH policy in a real testbed is left as future work, in which the effect of imperfect channel estimation, type I and II jamming detection errors, implementation aspects of EH, etc., will also be considered.
\section{System model}
\label{sec:system}
\begin{figure}[t]
\setlength{\unitlength}{0.08in}
\centering
\begin{picture}(26,11)
\put(-5.5,6){\framebox(4,4){\small Alice}}
\put(2.75,1){\framebox(4,4){\small Jay}}
\put(11,6){\framebox(4,4){\small Bob}}
\put(-1.5,8){\vector(1,0){12.5}}
\put(4,8.5) {\small $H$}
\put(2.75,3){\vector(-2,1){6}}
\put(-2,3.1) {\small ${G}_{A}$}
\put(6.75,3){\vector(2,1){6}}
\put(10,3.3) {\small ${G}_{B}$}
\put(21,8.5){\small Time sharing EH}
\put(20,4){\line(1,0){13.5} }
\put(20,3.5){\line (0,1){1}}
\put(25,3.5){\line (0,1){1}}
\put(33.5,3.5){\line (0,1){1}}
\put(21.5, 5){\small $\tau T$}
\put(20.5, 1.5){\small EH}
\put(20,-0.5){\small phase}
\put(26.5, 5){\small $(1-\tau) T$}
\put(25.5, 1.5){\small Transmission}
\put(28,-0.5){\small phase}
\end{picture}
\caption{System model and time sharing scheme at Alice's side.}
\label{fig:systemmodel}
\end{figure}
The system model, depicted in Fig. \ref{fig:systemmodel}, comprises three nodes: a legitimate transmitter, Alice, its intended receiver, Bob, and a malicious jammer, Jay.
The channel coefficients in the links Alice-Bob, Jay-Alice and Jay-Bob are denoted by $H$, $G_A$ and $G_{B}$, respectively and model fading; they are assumed
to remain constant during each EH and transmission cycle and to change independently from one cycle to the next. We assume that full channel state information is available at all nodes.
When Alice sends a message $X_A$ to Bob, Jay can jam the transmission.
Bob's observation $Y_B$ can be expressed as:
\begin{eqnarray}
\label{yb}
Y_{B} &=& H X_A + G_{B} X_J+ Z_{B},
\end{eqnarray}
where the message $X_A\sim\mathcal{N}(0,p)$ is drawn from a Gaussian codebook under a short-term power constraint $0\leq p\leq P$. Finally, $Z_{B}\sim\mathcal{N}(0,N_B)$ models the effect of the additive white Gaussian noise (AWGN) in the Alice-Bob link.
We consider that Jay transmits Gaussian jamming signals $X_J\sim\mathcal{N}(0,\gamma)$ and $0 \leq \gamma\leq \Gamma$ represents the jamming power.
This paper studies whether EH can be exploited to harvest the jamming interference and boost the transmit power.
We assume a time sharing scheme with two phases: the first phase of duration $\tau T$, where $T$ is the symbol period, is dedicated to EH. The second phase of duration $(1-\tau)T$ is dedicated to information transmission.
Alice's observation during the EH phase is then given by:
\begin{eqnarray}
\label{yaFD}
Y_{A} &=& G_{A} X_J + Z_{A},
\end{eqnarray}
where $Z_{A}\sim\mathcal{N}(0,N_A)$ models the effect of AWGN noise in the link Jay-Alice.
As commonly assumed \cite{GA}, the harvested energy is proportional to the energy of the received signal:
\begin{equation}
E =\tau T \zeta \mathbb{E}\left[|Y_A|^2\right] =\tau T \zeta \left(\gamma |G_{A}|^2 + N_{A}\right), \label{eq:energy}
\end{equation}
where $\zeta \in[0,1]$ is the harvesting efficiency parameter. The average power harvested during the EH phase is used in the information transmission phase and is given as follows:
\begin{eqnarray}
\label{eq:E}
p^{EH}&=&\frac{\tau}{1-\tau}\zeta \left(\gamma |G_{A}|^2 + N_{A}\right).
\end{eqnarray}
The multiplicative term $\frac{1}{1-\tau}$ in the above expression stems from keeping the energy constant during each transmission phase of duration $(1-\tau) T$
\cite{EVBChorti}. The initially available transmit power (aside from the harvested one) is also enhanced to $\frac{p}{1-\tau}$ for the same reason. Under the above assumptions and using standard time sharing arguments \cite{Cover}, the Shannon capacity of the Alice-Bob link is given by
\begin{equation}
\label{eq:CEH}
C^{EH}(p, \tau,\gamma) =\frac{(1-\tau)}{2}\log \left( 1 + \frac{\left(\frac{p}{1-\tau} + p^{EH}\right)|H|^2}{\gamma |G_{B}|^2 + N_B}
\right).
\end{equation}
Note that the multiplicative term $(1-\tau)$ in front of the logarithm represents the reduction of the Shannon capacity due to time sharing.
\section{Jammer Neutralization}
\label{sec:NJ}
In this Section, we first investigate whether it is possible to neutralize the jammer.
We note that $C^{EH}$ is increasing with the transmit power $p$ for fixed $\tau$ and $\gamma$. On the other hand, $C^{EH}$ is not necessarily decreasing with the jamming power: since the interference is harvested and $p^{EH}$ increases with $\gamma$, the Shannon capacity may even increase with the interfering power $\gamma$ for specific system parameters. Although this may seem counter-intuitive, consider the case in which the interfering link is very poor $|G_B|^2 << 1$ (e.g., Jay is very far from Bob). In this case, the interference at Bob is negligible: $\gamma |G_{B}|^2 + N_B \simeq N_B$ and, hence, $C^{EH}$ increases with $\gamma$ due to $p^{EH}$. We prove this result rigorously by investigating the first-order derivatives of $C^{EH}$.
\begin{Proposition}
\label{prop:threshold}
\textit{
For fixed $p$ and $\tau$, if $\frac{ |G_A|^2}{N_A}> \frac{|G_{B}|^2}{N_B}$, then $ C^{EH}(p, \tau,\gamma) $ is monotonically increasing w.r.t. $\gamma$ if $p\le p_{th}(\tau)\triangleq \tau K$, with $K\triangleq \left(\frac{ |G_{A}|^2 N_B}{ |G_{B}|^2}- N_A \right) \zeta$, and it is monotonically decreasing w.r.t. $\gamma$ if $p > p_{th}(\tau)$. This implies:
\begin{eqnarray}
\arg \max_{\gamma \in [0, \Gamma]} C^{EH}(p,\tau,\gamma) & = & 0,\text{ if } p\le p_{th}(\tau), \\
\arg \max_{\gamma \in [0, \Gamma]} C^{EH}(p,\tau,\gamma) & = & \Gamma,\text{ if } p> p_{th}(\tau).
\end{eqnarray}
Otherwise, $ C^{EH}(p, \tau,\gamma) $ is always monotonically decreasing w.r.t. $\gamma$ for any fixed $p$ and $\tau$ and
\begin{eqnarray}
\arg \max_{\gamma \in [0, \Gamma]} C^{EH}(p,\tau,\gamma) & = & \Gamma.
\end{eqnarray}}
\end{Proposition}
Intuitively, if the quality of the harvesting link is higher than that of the jamming link $\frac{ |G_{A}|^2}{N_A}> \frac{|G_{B}|^2}{N_B},$
then the legitimate users can neutralize the jammer by tuning the transmit power $p$ and the EH policy $\tau$ such that $p\le p_{th}(\tau)$. This highlights the existence of a power threshold $p_{th}(\tau)$ below which, harvesting the jamming interference in the first phase overcomes the harmful jamming in the second phase. The optimal strategy $(p,\tau)$ that neutralizes the jammer (NJ) is given below.
\begin{thm}
\label{thm:NJ}
\textit{If $\frac{ |G_A|^2}{N_A}> \frac{|G_{B}|^2}{N_B}$, the strategy that maximizes the capacity while neutralizing the jammer $(p^{NJ}, \tau^{NJ})$ is given as follows:}
\textit{ a) If $p_{th}^{-1}(P) >1$, then $(p^{NJ},\tau^{NJ}) = ( p_{th}(\hat\tau), \hat\tau)$,
where $p_{th}^{-1}(p) = \frac{p}{K}$ is the inverse function of $p_{th}(\tau)$.}
\textit{ b) Otherwise, the optimal strategy is
\begin{eqnarray}
\nonumber
(p^{NJ},\tau^{NJ}) & =& \underset{(p,\tau) \in\{(p_1,\tau_1),(p_2,\tau_2)\}}{\arg \max } C^{EH}(p,\tau,0), \\ \nonumber
(p_1,\tau_1)&= &( \min\{p_{th}(\hat\tau),P\}, \min\{\hat\tau,p_{th}^{-1}(P)\}),\\ \nonumber
(p_2,\tau_2)&= &(P, \max\{\tilde{\tau},p_{th}^{-1}(P)\}),
\end{eqnarray}
where $\hat \tau\in (0,1)$ and $\tilde{\tau}\in (0,1)$ are the unique solutions of the equations
$$\frac{\partial C^{EH}(p_{th}(\tau),\tau,0) }{\partial \tau}=0 \textit{\ and \ } \frac{\partial C^{EH}(P,\tau,0) }{\partial \tau}=0$$
respectively, which can be easily computed numerically.\footnote{Finding explicit expressions for $\hat{\tau}$ and $\tilde{\tau}$ is non trivial and involves solving nonlinear equations containing both logarithmic and fractional terms. Instead, we can exploit numerical methods based on iterative one-dimensional search (e.g., {\tt fzero} in MATLAB\textregistered) or methods relying on trust region or Levenberg-Marquardt techniques (e.g., {\tt fsolve} in MATLAB\textregistered).}
}
\end{thm}
\begin{figure}[t]
\centering
\includegraphics[width=0.95\columnwidth]{belmega_WCL2018-0885_fig1.eps}
\caption{Shannon capacity while neutralizing the jammer as a function of SIR. The jammer cannot be neutralized if the harvesting link is poor. Transmitting at full power $P$ is not always optimal.}
\label{fig:NJ}
\end{figure}
Fig. \ref{fig:NJ} illustrates the Shannon capacity obtained while neutralizing the jammer, $C^{EH}(p^{NJ}, \tau^{NJ}, 0)$, as a function of the signal to interference power ratio (SIR) defined as $SIR = P/\Gamma$ in the range $P/\Gamma=-30$ dB to $P/{\Gamma}=10$ dB, for various settings w.r.t. the channels gains for $N_A=-10$ dBm, $N_B=-7$ dBm, $\Gamma=10$ dBm, $\zeta=0.8$. These parameters were chosen to showcase the different regimes in terms of the optimal strategies at the NJ and NE states. Nevertheless, all our remarks and observations are general and remain valid irrespective of the specific choice of the system parameters.
The capacity $C^{EH}(p^{NJ}, \tau^{NJ}, 0)$ is zero for $|H|^2=0.2$, $|G_{A}|^2=0.2$, $|G_{B}|^2=1$ since the minimum condition on the harvesting link quality is not met and the jammer cannot be neutralized. In the other settings, we can identify two regimes depending on whether $p_{th}^{-1}(P) \leq 1$ or not. When the SIR is low, the system is in case b) of Theorem \ref{thm:NJ} and increasing $P$ increases the feasible set of the optimization problem and, hence, the optimal value of the capacity. At higher SIR, the system shifts to case a), in which the optimal solution that neutralizes the jammer no longer depends on $P$. The dashed black curve depicts the average $C^{EH}(p^{NJ}, \tau^{NJ}, 0)$ over 10,000 random realizations of the channel gains drawn from a standard Gaussian distribution.
We remark that to neutralize the jammer a non-zero EH duration is required, i.e, $\tau^{NJ}>0$, during which little energy can actually be harvested (as the jammer is silent). Also, the transmit power may be required to be below the maximum available power.
In light of this, we next investigate the optimal strategies of both parties in this competitive interaction.
\section{Optimal Strategies: Game Theoretic Analysis}
\label{sec:GT}
In this Section, we study the adversarial interaction between the legitimate users and the jammer using a non-cooperative game \cite{TiroleFudembergGT}. More specifically, we formulate a two-player zero-sum game defined as the triplet: \\ $\mathcal{G} = \{ \{L,J\}, \{A_{L}, A_{J}\}, C^{EH}(a_{L}, a_{J}) \},$
where $L$ and $J$ denote the opposing players; $A_{L} = [0,P] \times [0,1]$ and $A_{J}=[0, \Gamma]$ denote the possible actions the two players can take; and $C^{EH}(a_L,a_J)$ is both the utility of $L$ and the cost of $J$. The strategy of legitimate users is denoted by $a_{L}=(p,\tau)$ and that of the jammer by $a_{J}=\gamma$.
A natural solution of the game is the NE, denoted by $(a_{L}^{NE},a_{J}^{NE})$, which is stable to unilateral deviations:
\begin{eqnarray}
\nonumber
C^{EH}(a_{L}^{NE},a_{J}^{NE}) &\ge& C^{EH}(a_{L},a_{J}^{NE}), \ \ \forall a_L\neq a_L^{NE},\\ \nonumber
C^{EH}(a_{L}^{NE},a_{J}^{NE}) &\le& C^{EH}(a_{L}^{NE},a_{J}), \ \ \forall a_J\neq a_J^{NE}.
\end{eqnarray}
Neither the legitimate player nor the jammer have any interest in deviating from the NE state knowing that their opponent is playing the NE strategy.
\begin{Proposition}
\label{prop:NJnotNE}
\textit{The NJ state, $(p^{NJ}, \tau^{NJ}, 0)$ in Theorem \ref{thm:NJ}, is not a NE of the game $\mathcal{G}$.}
\end{Proposition}
\textit{Proof:} If $p_{th}^{-1}(P)>1$ then $(p^{NJ},\tau^{NJ})= (p_{th}(\hat\tau),\hat\tau)$, from Theorem \ref{thm:NJ}. This cannot be a NE, because it implies that $p_{th}(\hat\tau)<P$, and since $C^{EH}$ is increasing in $p$ then player $L$ should transmit at maximum power at the NE: $p^{NE}=P$. Otherwise, we have two cases: $ (p^{NJ},\tau^{NJ})= (P, \max\{\tilde{\tau},p_{th}^{-1}(P)\})$ and $ (p^{NJ},\tau^{NJ})= (P, p_{th}^{-1}(P))$. Neither can be NE: since the jammer is silent ($\gamma^{NJ}=0$) and only the noise $N_A$ is harvested, the legitimate user will deviate from $\tau^{NJ}>0$ to $\tau=0$. EH operates as a threat to neutralize the jammer, which results in an inefficient time sharing policy.
The game's NE is given in the following theorem.
\begin{thm}
\label{thm:NE}
\textit{The NE of the game $\mathcal{G}$ is $(p^{NE}, \tau^{NE},\gamma^{NE}) = (P,\tau^{NE},\Gamma)$,
where $\tau^{NE}\in\{0,\tau^*\}$ with $\tau^*\in (0,1)$ the unique solution of
\begin{eqnarray}
\frac{\partial C^{EH}(P,\tau,\Gamma) }{\partial \tau}=0
\end{eqnarray}
(which can be easily computed numerically), depending on the system parameters. Moreover, the NE always outperforms the NJ state.}
\end{thm}
\textit{Proof}: The transmit power is maximum $p^{NE}=P$ since $C^{EH}$ is increasing in the transmit power $p$. Then, we prove by \emph{reductio ad absurdum} that at the NE we have: $p_{th}(\tau^{NE})\le p^{NE}$, implying that $\gamma^{NE}=\Gamma$ from Proposition \ref{prop:threshold}. Finding $\tau^{NE}$ reduces to solving the optimization problem:
\begin{eqnarray}
\tau^{NE} = \arg \max_{\tau \in [0, 1]} \ C^{EH}(P,\tau,\Gamma).
\end{eqnarray}
Based on the first and second order derivatives, $C^{EH}(P,\tau,\Gamma)$ is concave and either decreases ($\tau^{NE}=0$) or it has a unique critical point ($\tau^{NE}=\tau^*$), depending on the parameters.
To prove that the NE always outperforms the NJ state, we use two ingredients. From Proposition \ref{prop:threshold}, whenever $p=p_{th} (\tau)$, the Shannon capacity is constant w.r.t. $\gamma$ and, hence, $C^{EH} (p^{NJ}, \tau^{NJ},0) = C^{EH}(p^{NJ},\tau^{NJ}, \Gamma)$. From the NE definition and knowing that $p^{NE} =P$ and $\gamma^{NE}=\Gamma$:
\begin{eqnarray}
(P, \tau^{NE})= \arg\max_{p,\tau} \ C^{EH} (p,\tau, \Gamma).
\end{eqnarray}
These two facts yield that the NE outperforms the NJ state: $C^{EH} (p^{NJ}, \tau^{NJ},0) \leq C^{EH}(P, \tau^{NE}, \Gamma)$.
\begin{figure}[t]
\centering
\includegraphics[width=0.95\columnwidth]{belmega_WCL2018-0885_fig2.eps}
\caption{NE vs. NJ efficiency: $F^{NJ}$ in \eqref{eq:FNJ} as a function of SIR. The NE always outperforms the NJ state. At low SIR, exploiting the dominant jamming interference is more beneficial than silencing the jammer. At high SIR, neutralizing the jammer via EH is inefficient.}
\label{fig:NEvsNJ}
\end{figure}
\begin{figure}[t]
\vspace{-0.2in}
\begin{center}
\includegraphics [width=0.95\columnwidth]{belmega_WCL2018-0885_fig3.eps}
\caption{EH efficiency: $F$ in \eqref{eq:F} as a function of SIR. EH is particularly beneficial at low SIR when the dominant jamming interference can be exploited. At high SIR, the interference becomes negligible and EH is less useful.}
\label{fig:NEvsnoEH}
\end{center}
\vspace{-0.2in}
\end{figure}
In Fig. \ref{fig:NEvsNJ}, we compare the capacity at the NE, $C^{EH}(P,\tau^{NE}, \Gamma)$, with the capacity when neutralizing the jammer, $C^{EH}(p^{NJ},\tau^{NJ},0)$, normalized to the former by illustrating
\begin{eqnarray}
\label{eq:FNJ}
F^{NJ} \triangleq\frac{C^{EH}(P,\tau^{NE},\Gamma) - C^{EH}(p^{NJ},\tau^{NJ}, 0) }{C^{EH}(P,\tau^{NE},\Gamma)}.
\end{eqnarray}
The simulation setting is identical to Fig. \ref{fig:NJ}. We remark that the NE always outperforms the NJ policy, which is consistent to our analysis. The intuition is that, when neutralizing the jammer, Alice does not necessarily transmit at maximum power $P$ and has to spend a minimum proportion of time $\tau^{NJ}>0$ for EH, as a threat to force the jammer to remain silent, even though no energy can actually be harvested during this time. Only in two of the four specific channel settings, the capacity at the NJ state equals the NE capacity and only at specific SIR values (the $0\%$ minimum points). Surprisingly, using EH to neutralize the jammer is not beneficial in most cases. Instead, the legitimate users should harvest the jamming interference and use it for information transmission. The $100\%$ relative gain curve corresponds to the case in which the jammer cannot be neutralized because of the poor quality of the harvesting link. The dashed black curve represents the average efficiency of the NE w.r.t. the NJ state and shows a relative gain between $64\%-75\%$.
In the same setting, in Fig. \ref{fig:NEvsnoEH} we evaluate the efficiency of EH as a measure against a strategic jammer and compare the capacity at the NE, $C^{EH}(P,\tau^{NE}, \Gamma)$, with $C^{EH}(P,0,\Gamma)$, the capacity in absence of EH capability normalized to the former, by analyzing
\begin{eqnarray}
\label{eq:F}
F \triangleq \frac{C^{EH}(P,\tau^{NE},\Gamma) - C^{EH}(P,0,\Gamma) }{C^{EH}(P,\tau^{NE},\Gamma)}.
\end{eqnarray}
At low SIR, the relative EH gain in terms of capacity is very high, approaching $100\%$ when the gain of the harvesting link is high. The jamming interference is dominant and exploiting it for useful communication is very beneficial. At high SIR, the gain from EH decreases progressively towards zero since the jamming interference that can be harvested becomes negligible. The potential of using EH as an anti-jamming measure is demonstrated by the substantial relative gains in terms of Shannon capacity that can on average reach $95\%$ in the low SIR regime.
\section{Conclusion}
\label{conclu}
In this paper, we showed that EH can be exploited to efficiently mitigate jamming attacks.
We proved that a jammer can be completely neutralized by appropriately tuning the transmit power and the EH duration. However, this restricts the transmit power of the legitimate user and requires a minimum harvesting duration, during which little energy can actually be harvested (as the jammer is forced to remain silent). Therefore, neutralizing the jammer is not necessarily optimal. Employing a zero-sum game formulation, we showed that at the NE both players should transmit at full power and the optimal EH duration depends on the system parameters.
Our simulation results show that EH can offer substantial gains in terms of capacity.
At low SIR, the average gains can reach $95\%$, showcasing the high potential of EH as an efficient counter-jamming measure.
\bibliographystyle{IEEEtran}
\normalsize
| {'timestamp': '2019-01-14T02:13:21', 'yymm': '1901', 'arxiv_id': '1901.03543', 'language': 'en', 'url': 'https://arxiv.org/abs/1901.03543'} | arxiv |
\section{Background}
\label{sec:background}
This section provides the relevant background on Siamese neural networks, a class of feed-forward artificial neural networks. Siamese networks find application in a number of problems where it is required to learn a similarity or distance function between pairs of equally dimensioned signals, ranging from face verification \cite{chopra2005learning} to real-time object tracking \cite{bertinetto2016fully}. Siamese networks are composed by (at least) two topologically identical and independent \textit{subnetworks} which share an identical set of learnable parameters. In most image and video applications, each subnetwork typically includes one or more convolutional layers for extracting features from the input signal spatial domain. Optionally, a number of fully connected layers projects such features to a typically lower-dimensional space, yielding a vector of features representing the signal provided as input to the subnetwork. The output of each subnetwork can be seen as a (compact) description of the input signal, which is thus often defined as \textit{descriptor}. Finally, one predefined or learnable distance function measures the similarity between the two descriptors produced by each subnetwork. In this context, the network produces as output a measure of the extent to which two input patches are similar or dissimilar. Concerning the patch matching problem addressed by this work, Siamese architectures enable to independently compute each patch descriptor, allowing for patch matching with precomputed descriptors. Therefore, in the following, we use a Siamese architecture as the cornerstone of our network, whereas we leave the application of our feature fusion approach to other network architectures for future research.
\section{Conclusions and future works}
\label{sec:conclusion}
In this work, we proposed to fuse convolutional features from the convolutional layers with features from the discrete cosine transform in a deep neural network for binary patch matching. Qualitative experiments suggest that different types of features are complementary in discriminating patches. Quantitative experiments over three challenging datasets confirm that our feature fusion approach outperforms several existing state of the art techniques based on convolutional features only. A careful design of the network topology and training procedures allowed us to capture distinctive features within the patches, enabling a very competitive architecture that also deploys feature fusion, allowing for performance improvement. We leave for our future investigations experimenting with different transform functions and evaluating our framework within a complete image matching pipeline.
\section{Experimental Evaluation}
\label{sec:experiments}
\begin{figure}[t]
\centering
\includegraphics[width=4.5cm]{images/lnynewnew.pdf}
\caption{Examples of matching pairs of patches (vertical) extracted from the Liberty (L), Notredame (N) and Yosemite (Y) datasets.}
\label{fig:lny}
\end{figure}
We evaluate our proposed architecture for patch matching over three datasets \cite{brown2011discriminative} of 64$\times$64 patches extracted from 3D reconstructions of the \textit{Liberty} statue (\(L\)), the \textit{Notredame} cathedral (\(N\)) and the \textit{Yosemite} mountains (\(Y\)), centered upon Difference of Gaussians (DoG) key points with canonical scale and orientation, as shown in Fig.~\ref{fig:lny}. Following the approach of \cite{brown2011discriminative}, we train the network three times, one for each dataset, and we evaluate its performance on the two other datasets for a total of 6 different training/testing \textit{setups} per experiment (e.g., the \(L/N\) setup indicates training on Liberty and testing on Notredame). For each setup, the network is trained with \(250000\) pairs of matching pairs and \(250000\) pairs of non-matching patches, whereas testing is performed over \(25000\) pairs of matching and \(25000\) pairs of non-matching patches. We implemented the proposed architecture using the \textit{Torch7} framework and trained our network following the procedure described in the Sec.~\ref{sec:training} over an NVIDIA K80 GPU. We rely on gradient descent with adaptive gradient optimization as defined in \cite{duchi2011adaptive}, with an initial learning rate set to \(10^{-4}\) and over batches of \(100\) pairs of samples (\(100\) matching samples and \(100\) non-matching samples per batch). The training ends when the error on the testing set has not decreased over the past \(10\) epochs or after \(400\) epochs. Coherently with \cite{brown2011discriminative}, first we compute ROC curves by thresholding the normalized Hamming distance between pairs of binary B-long descriptors, then, for each setup, we measure the False Positive Rate (FPR) for a True Positive Rate (TPR) set to \(95\)\%. In the following, we refer to the FPR computed for a TPR of \(95\)\% simply as \textit{patch classification error} for the sake of brevity.
Preliminarily, we experiment to find the convolutional configuration of the network architecture in Fig.~\ref{fig:struttura} that yields the best baseline performance when \(B=128\) bits. Namely, we want to find the best tradeoff between the number and resolution of convolutional \textit{featuremaps}. To this end, we first vary the number of convolutional modules \(M \in \{2,3,4\}\) (as M increases, the number of \textit{featuremaps} doubles while their resolution is halved horizontally and vertically). Furthermore, we experiment dropping the \textit{maxpooling} layer in \textit{M}-th convolutional module which additionally allows us to double the \textit{featuremaps} resolution without affecting their count. As this experiment focuses on convolutional features, we deactivate the DCT branch of each subnetwork (i.e., \(F_D=0\)). Table~\ref{tab:1} shows the performance of six different network configurations (\textit{-mp} rows account for the cases where the \textit{M}-th module \textit{maxpooling} layer is disabled). \(FMN\) and \(FMR\) columns indicate number and resolution of the \textit{featuremaps} respectively, where \(FMN \times FMR = F_C\). We observe that \(8\times8\) \textit{featuremaps} consistently yield the best results: our hypothesis is that larger \textit{featuremaps} do not convey enough semantic information, whereas smaller \textit{featuremaps} lack the spatial resolution to preserve texture details.
\begin{table}[htpb]
\centering
\centerline{
\fontsize{6}{10}\selectfont{
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|}
\hline
\textbf{M} & \textbf{FMN} & \textbf{FMR} & \textbf{N/L} & \textbf{Y/L} & \textbf{L/N} & \textbf{Y/N} & \textbf{L/Y} & \textbf{N/Y} & \textbf{AVG} \\
\hline
\textbf{2} & \multirow{2}{*}{128} & 16x16 & 9.77 & 13.75 & 6.34 & 7.41 & 12.03 & 10.66 & 9.99 \\
\textbf{2\textit{-mp}} & & 32x32 & 11.41 & 14.72 & 8.13 & 8.11 & 13.01 & 11.81 & 11.20 \\
\hline
\textbf{3} & \multirow{2}{*}{256} & 8x8 & 8.75 & 13.11 & 5.55 & 6.68 & 11.53 & 9.83 & \textbf{9.24} \\
\textbf{3\textit{-mp}} & & 16x16 & 10.16 & 13.42 & 6.43 & 7.15 & 11.9 & 10.25 & 9.77 \\
\hline
\textbf{4} & \multirow{2}{*}{512} & 4x4 & 9.14 & 13.44 & 6.63 & 6.68 & 12.08 & 10.42 & 9.68 \\
\textbf{4\textit{-mp}} & & 8x8 & 8.58 & 13.17 & 5.41 & 6.92 & 11.28 & 9.74 & \textbf{9.18} \\
\hline
\end{tabular}
}
}
\vspace{5pt}
\caption{Patch classification error [\%] as a function of the number and resolution of convolutional featuremaps \((B=128)\)
\label{tab:1}
\end{table}
\FloatBarrier
Next, we evaluate the entire network performance when DCT features are fused with convolutional features while accounting for network complexity. Input patches resolution is \(64\times64\) pixels, so each input patch DCT can be represented as a vector of \(4096\) real-valued coefficients. To keep the complexity low, we consider only the first \(F_D=561\) lower frequency coefficients selected as described in Sec.~\ref{sec:structure}. The additional network complexity due to the introduction of the DCT features, defined as \(F_D/F_C\), is negligible as it takes the values of 3.42\% and 1.71\% for the \(M=3\) and \(M=4\) cases, respectively. Table~\ref{tab:2} shows the results of the experiment: the second column reports the actual number of convolutional features \(F_C\) compared to the number of DCT features \(F_D=561\). As a general trend, we see that fusing DCT and convolutional features always improve the performance. Most importantly, the configuration with \(M=3\) convolutional modules (\(16945\) fused features) now yields better performance than the \(M=4-\textit{mp}\) configuration (\(33329\) fused features), despite the overall network complexity is reduced nearly by a twofold factor (about 9M parameters versus 17M parameters). The experiment shows that fusing convolutional features with transformed domain features further improves performance while keeping the network complexity under control.
\begin{table}[htbp]
\centering
\centerline{\fontsize{6.7}{10}\selectfont{
\begin{tabular}{|c|c|c|c|c|c|c|c|c|}
\hline
\multirow{2}{*}{\textbf{M}} & \boldmath $F_C$ \unboldmath & \multirow{2}{*}{\textbf{N/L}} & \multirow{2}{*}{\textbf{Y/L}} & \multirow{2}{*}{\textbf{L/N}} & \multirow{2}{*}{\textbf{Y/N}} & \multirow{2}{*}{\textbf{L/Y}} & \multirow{2}{*}{\textbf{N/Y}} & \multirow{2}{*}{\textbf{AVG}}\\
& \boldmath $+ F_D$ \unboldmath & & & & & & & \\
\hline
\textbf{3} & 16348 & 8.75 & 13.11 & 5.55 & 6.68 & 11.53 & 9.83 & 9.24 \\
\textbf{3,DCT} & +561 & 8.83 & 12.32 & 5.54 & 6.31 & 11.16 & 9.84 & \textbf{9.00} \\
\hline
\textbf{4\textit{-mp}} & 32768 & 8.58 & 13.17 & 5.41 & 6.92 & 11.28 & 9.74 & 9.18 \\
\textbf{4\textit{-mp},DCT} & +561 & 9.11 & 12.22 & 5.85 & 6.30 & 11.33 & 9.98 & 9.13 \\
\hline
\textbf{4} & 8192 & 9.14 & 13.44 & 6.63 & 6.68 & 12.08 & 10.42 & 9.68 \\
\textbf{4,DCT} & +561 & 9.03 & 12.99 & 6.00 & 6.55 & 12.10 & 10.35 & 9.50 \\
\hline
\end{tabular}
}}
\vspace{5pt}
\caption{Patch classification error [\%] as a function of the type and number of features: feature fusion enables the best performance with controlled complexity increase \((B=128)\).}
\label{tab:2}
\end{table}
\begin{table}[b]
\centering
\begin{tabular}{|c|c|c|}
\hline
\ & \textbf{N/L} & \textbf{N/Y} \\ \hline
\textbf{Common False Negatives [\%]} & 29.0 & 28.5 \\
\textbf{Common False Positives [\%]} & 16.5 & 14.7 \\
\hline
\end{tabular}
\vspace{5pt}
\caption{Fraction of patch pairs misclassified both by convolutional and DCT features: different types of features lead to different errors, thus are complementary \((B=128)\).}
\label{tab:3}
\end{table}
We attempt now to understand why feature fusion boosts performance. Without loss of generality, we repeat the previous experiment over a smaller training set of \(100000\) training pairs extracted from the Notredame dataset (\(50\)\% matching, \(50\)\% non matching), testing over \(10000\) pairs of patches from the Liberty (i.e. N/L setup) and \(10000\) pairs from the Yosemite (i.e. N/Y setup) datasets. We aim at assessing the effect of convolutional and DCT features separately, on an equal number of features basis (i.e., \(F_C=F_D\)). Therefore, we first experiment with a configuration of our architecture in Fig.~\ref{fig:struttura} where all the features generated by the DCT are provided as input to the fully connected layers without zig-zag selection, whereas the convolutional features are dropped altogether (i.e., \(F_D=4096, F_C=0\)). Next, we experiment dropping all the DCT features and considering instead a convolutional architecture with \(M=5\) modules (i.e., \(F_D=0, F_C=4096\)). Table~\ref{tab:3} reports the percentage of misclassified pairs of patches in both scenarios, quantified as the intersection of the sets over their union. We break down such erroneously classified pairs of patches in terms of \textit{common false negatives} and \textit{common false positives} for a threshold on the normalized Hamming Distance computed over the quantized descriptors that are equal to \(0.325\). The ratio of pairs of patches that are misclassified in both scenarios is significantly lower than \(30\)\%. This experiment suggests that convolutional and DCT features convey complementary information, thus explaining the increased ability to discern between patches of matching and non-matching pairs we observed when fusing convolutional and DCT features. Fig.~\ref{fig:top5} shows the Top-5 misclassified nonmatching samples (corresponding to a \(29\)\% of \textit{common false positives} in Table~\ref{tab:3}). Only the second column in the left image (convolutional features only) is also found as third column in the right image (DCT features only), confirming that different types of features yield to complementary classification errors.
\begin{figure}[t]
\centering
\includegraphics[width=0.5\columnwidth]{images/top5new.pdf}
\caption{Top-5 misclassified non-matching samples for the Notredame/Liberty (N/L) setup with convolutional features only (top row) and DCT features only (bottom row).}
\label{fig:top5}
\end{figure}
\begin{figure}[t]
\centering
\includegraphics[width=0.5\columnwidth]{images/patch_matching.pdf}
\caption{The patch classification error decreases as B increases; this happens faster when applying feature fusion.}
\label{fig:patch_matching}
\end{figure}
\begin{table*}[t]
\centering
\centerline{\fontsize{9}{12}\selectfont{
\begin{tabular}{|c|c|c|c|c|c|c|c|c|}
\hline
\textbf{~~~REF~~~} & \textbf{~~~B [bit]~~~} & \textbf{~~~N/L~~~} & \textbf{~~~Y/L~~~} & \textbf{~~~L/N~~~} & \textbf{~~~Y/N~~~} & \textbf{~~~L/Y~~~} & \textbf{~~~N/Y~~~} & \textbf{~~~AVG~~~} \\
\hline
\textbf{BinBoost} & \multirow{2}{*}{64} & \multirow{2}{*}{16.90} & \multirow{2}{*}{22.88} & \multirow{2}{*}{20.49} & \multirow{2}{*}{18.97} & \multirow{2}{*}{21.67} & \multirow{2}{*}{14.54} & \multirow{2}{*}{19.24}\\
\textbf{\cite{trzcinski2013boosting}} & & & & & & & & \\
\hline
\textbf{DELFT} & 64 & 19.11 & 20.43 & 13.59 & 12.34 & 19.25 & 17.36 & 17.01\\
\textbf{\cite{liu2016euclidean}} & 128 & 16.27 & 18.32 & 9.31 & 10.56 & 15.77 & 13.94 & 14.03\\
\hline
\textbf{Cov.Opt} & \multirow{2}{*}{1024} & \multirow{2}{*}{8.25} & \multirow{2}{*}{14.84} & \multirow{2}{*}{12.16} & \multirow{2}{*}{8.50} & \multirow{2}{*}{14.84} & \multirow{2}{*}{7.09} & \multirow{2}{*}{11.00}\\
\textbf{\cite{simonyan2014learning}} & & & & & & & & \\
\hline
\textbf{DeepCD} & 192 & 8.31 & 16.29 & 14.45 & 13.62 & 18.38 & 8.97 & 13.34\\
\textbf{\cite{yang2017deepcd}} & 768 & \textbf{3.73} & \textbf{9.97} & 7.82 & 7.67 & 11.75 & \textbf{4.35} & 7.55\\
\hline
\multirow{4}{*}{\textbf{Proposed}} & 64 & 11.68 & 16.48 & 8.52 & 9.13 & 14.16 & 12.89 & 12.14 \\
& 128 & 8.83 & 12.32 & 5.54 & 6.31 & 11.16 & 9.84 & 9.00 \\
& 192 & 7.56 & 11.74 & 4.84 & 5.40 & 9.71 & 8.58 & 7.97 \\
& 256 & 7.30 & 10.87 & \textbf{4.29} & \textbf{4.83} & \textbf{8.83} & 8.05 & \textbf{7.36} \\
\hline
\end{tabular}
}}
\vspace{5pt}
\caption{Patch classification error [\% FPR, TPR=95\%] of our framework compared with different competitors: our approach consistently yields best results on an equal bit rate basis.}
\label{tab:4}
\end{table*}
Next, we experiment varying the descriptor bitrate beyond the \(B=128\) bits considered in our experiments so far. We experiment with the configuration \(M=3\) with feature fusion (\(F_C=16384,F_D=561\)), which provided the best performance-complexity trade-off in Table~\ref{tab:2}, and its counterpart with convolutional features only (\(F_D=0\)). As expected, Fig.~\ref{fig:patch_matching} shows that the patch classification error decreases when B increases. Most importantly, Fig.~\ref{fig:patch_matching} shows that the error decreases faster when fusing features, i.e. feature fusion improves the performance-bitrate trade-off of our framework. Fig.~\ref{fig:patch_matching} includes a third line that corresponds to the configuration where non-quantized descriptors are considered in place of binary descriptors. For \(B=64\), the performance loss due to descriptor quantization is lower than 1\% and further decreases rapidly as B increases. Hence, sign quantization precisely matches the descriptors space into the Hamming space conserving the relative distance between vectors and allowing vector similarity preservation.
Finally, Table 4 compares our framework with several state-of-the-art approaches in binary patch matching. Our approach outperforms all the competitors on an equal bitrate basis. Our approach is outperformed on the N/L, Y/L, and N/Y setups only by \textit{DeepCD} \cite{yang2017deepcd}, which however relies on an aggregated descriptor rate of \(768\) bits that largely exceeds our maximum considered bitrate of \(B=256\) bits.
\section{Introduction}
Comparing image patches is a key task in a number of computer vision applications such as object identification, photo stitching, stereo baseline estimation, etc. Patch comparison usually takes place by comparing local descriptors that are robust to rotations, scale, illumination and, to some extents, perspective, and changes. Descriptors such as SIFT had to be handcrafted according to the specific task or considered signal. Recent advances in deep learning showed that it is possible to train a neural network to automatically learn and compare local descriptors without necessarily resorting to handcrafted descriptors.
Over the past years, a number of descriptors designs based upon Convolutional Neural Networks (CNN) have been proposed \cite{zheng2017sift}. The work of \cite{zagoruyko2015learning} explores different CNN architectures, showing that best results are achieved when pairs of patches are jointly encoded and a decision network is trained to learn an appropriate inter-patch distance metric. The authors of \cite{simo2015discriminative} address the problem of generating SIFT-like descriptors within a deep learning framework, showing that deep learning generated descriptors can be used as a drop-in replacement for SIFT descriptors as they retain key properties such as invariance to rotations, illumination and perspective changes. In \cite{zbontar2016stereo}, the specific problem of matching wide baseline stereo images by comparing local patches using a siamese CNN is addressed. The authors show that the network patch matching accuracy can be greatly enhanced augmenting the training set of patches by rotation and illumination changes. In \cite{yang2017deepcd}, an approach based on fusing two complementary and asymmetric descriptors extracted from the convolutional domain is proposed. The authors of \cite{zhu2016deep} address the related yet different problem of learning global hash codes over whole images. Their approach is limited to small size images due to complexity constraints. In addition, global descriptors are inherently unsuited for geometric verification, showing the advantages of local descriptors based approaches. Finally, in \cite{yi2016lift} a complete image matching pipeline based on a deep learning framework is presented: whereas such architecture goes beyond the scope of the present work, it clearly shows the potentials of image matching architectures based on deep learning frameworks.
Our goal is to learn patch descriptors that are highly discriminative and, at the same time, rate efficient and computationally lightweight to generate and compare. According to such requirements, many of the above designs fall short in one or more aspect. In \cite{simo2015discriminative}, descriptors are devised as a drop-in replacement for SIFT descriptors, thus they are encoded as real-valued vectors, whereas binary vectors are desirable in reason of their improved rate efficiency. In \cite{zagoruyko2015learning} best performance is achieved by jointly encoding pairs of patches, an approach that is not suitable for the common case where the reference patch is available only through its descriptor at query time. Such approach also requires replicating the same decision network learned at training time when deployed on the field, impacting significantly in terms of complexity. The approach of \cite{yang2017deepcd} shows state-of-the-art results, however at the expense of duplicating the feature extraction pipeline complexity. For such reasons, how to learn and compare patch descriptors that are at the same time discriminative and efficient both in terms of rate and complexity is still an open research issue.
In this work, we introduce the idea of fusing features from the convolutional layers and from the discrete cosine transform to learn binary patch descriptors within a deep learning framework. DCT features have been previously considered for feature dimensionality and redundancy reduction in patch matching and face recognition problems \cite{sorwar2001texture,pan2000image}. However, to the best of our knowledge, no previous work has considered the problem of fusing features from the convolutional and the DCT domains within a deep learning framework. We propose a framework that is designed around a Siamese network, which allows to independently generate descriptors from single patches. We learn real-valued compact descriptors by minimizing a loss function of the cosine distance between pairs of descriptors, where the cosine distance happens to be the best-fitting real-valued relaxation for the Hamming distance, enabling straightforward descriptors quantization and subsequent comparison. We experiment with three challenging datasets, showing better performance than state-of-the-art competitors for identical bitrate and comparable performance to more complex approaches despite lower bitrate. The rest of this paper is organized as follows. In Sec.~\ref{sec:background} relevant background literature is surveyed. Sec.~\ref{sec:proposed} describes the proposed convolutional approach to patch matching via feature fusion in terms of network architecture and training procedures. Sec.~\ref{sec:experiments} provides a thorough experimental validation of the framework over three sets of real image patches. Sec.~\ref{sec:conclusion} draws the conclusions and discusses potential directions for further investigations.
\section{Proposed Method}
\label{sec:proposed}
In this section, we first describe a Siamese convolutional network architecture suitable for convolutional and DCT feature fusion. Next, we describe a fully-supervised training procedure with the associated loss function. Finally, we briefly describe the descriptor quantization process.
\begin{figure*}[t]
\centering
\includegraphics[width=15cm]{images/struttura.pdf}
\caption{Our proposed Siamese convolutional architecture for convolutional and DCT feature fusion.}
\label{fig:struttura}
\end{figure*}
\subsection{Network Architecture}
\label{sec:structure}
The architecture in Fig.~\ref{fig:struttura} relies on a Siamese topology where the two subnetworks receive as input a pair of same size image patches \((I_1,I_2)\).
Each subnetwork is structured as follows: the first part is composed of M \textit{convolutional modules}, where each \textit{k}-th module $m_k$ (\(k \in {1, ..., M} \)) is composed by one convolutional layer with an hyperbolic tangent nonlinearity and one 2$\times$2 max-pooling layer. All the convolutional layers are composed of 5$\times$5 filters (kernels), and convolutions are of the wide type with border padding and one-pixel stride.
The number of filters in the first \((m=1)\) module's convolutional layer is set to \(64\) and doubles at each module, thus the number of \textit{featuremaps} produced as output by each convolutional layer doubles with index \(k\).
However, the resolution of each \textit{featuremap} is reduced by a fourfold factor after each max-pooling layers, so the overall number of features generated by each module shrinks by a factor of two after each \textit{m}-th module.
The number of \textit{convolutional features} produced as output by the \textit{k}-th module is referred to as \(F_C\) in the following.
Fig.~\ref{fig:struttura} shows that, for each subnetwork, a parallel branch of the pipeline implements a 2D discrete cosine transform of the input signal.
Next, a subset of \(F_D\) coefficients from the top-left corner of the transformed patch matrix is selected in zig-zag scanning order starting from the DC coefficient. The result is a number of \(F_D\) additional \textit{DCT features} that complements the \(F_C\) convolutional features.
Finally, the \(F_C\) convolutional features are concatenated with the \(F_D\) DCT features, yielding a vector of \(F_C+F_D\) \textit{fused features} that represents a projection of the input signal to a \((F_C+F_D)\)-dimensional space. Fused features are processed by a first fully connected layer with \(512\) units (neurons) with hyperbolic tangent activation functions. A second fully connected layer with B units, to which we refer as \textit{bottleneck layer} in the following, generates a B-elements patch descriptor. Accordingly, the two subnetworks receive as input the pair of image patches \((I_1,I_2)\) and produce as output the corresponding pair of descriptors \((d_1,d_2)\) of B real-valued elements each.
In order to establish the similarity between the two descriptors \((d_1,d_2)\), we resort to the cosine distance function, which produces an output in the range [-1,1], and it is defined as
\begin{equation}
\small
C(d_1,d_2) \mathrel{\ensurestackMath{\stackon[1pt]{=}{\scriptstyle\Delta}}} \frac{\langle d_1, d_2 \rangle}{\|d_1\| \hfill \cdot \|d_2\|} = \frac{\sum_{j=1}^{B} d_{1,j} d_{2,j}}{\sqrt{\sum_{j=1}^{B}d_{1,j}^2} \hfill \sqrt{\sum_{j=1}^{B}d_{2,j}^2}}.
\label{eqn:cosine}
\end{equation}
\\*
Such cosine distance represents the ultimate output of the proposed network. Hence, when a pair of patches \(x=(I_1,I_2)\) is fed into the network, the associated cosine distance \(y=C(d_1,d_2)\) between its descriptors is produced. The cosine distance enjoys several useful properties: first, it is always continuous and differentiable, thus it allows fully supervised, end-to-end, training of the network as discussed in the following; moreover, cosine distance affinity with the Hamming distance enables straightforward descriptor quantization and binary comparison as described in Sec.~\ref{sec:quantization}.
Finally, let us define as \textit{network complexity} the number of learnable parameters in the network. Concerning the architecture showed in Fig.~\ref{fig:struttura}, the complexity of the first fully connected layer (\(512\) units) dominates the overall network complexity. Thus, the network complexity is approximately equal to \((F_C +F_D) \cdot 512\), i.e. its complexity increases linearly with the number of fused features.
\subsection{Training}
\label{sec:training}
Let us define as the \textit{i}-th \emph{training sample} the pair of identically sized image patches \(x_i=(I_1^i,I_2^i)\). \(I_1^i\) and \(I_2^i\) are said to be \textit{matching} (equivalently, that \(x^i\) is a matching sample) whenever \(I_1^i\) and \(I_2^i\) represent the same image detail, and \textit{non-matching} otherwise. Let \(y^i = C(d_1^i, d_2^i)\) and \(l^i\) be the network output and the corresponding target \textit{label} (i.e., the expected network outcome), respectively. Our ultimate goal is to learn network parameters such that the network generates pairs of discriminative descriptors \((d_1^i, d_2^i)\). However, as we aim at training the network end-to-end with a fully supervised approach, we recast the problem on learning parameters such that the network, given as input the \textit{i}-th sample \(x^i\), generates an output for which \(y^i=l^i\). To this end, the choice of the training label \(l^i\) is pivotal. Concerning pairs of matching patches, the network is expected to produce similar descriptors such that \(C(d_1^i, d_2^i) \approx 1\), so we impose \(l^i=1\) for matching samples. Considering the comparison of non-matching pairs of patches, we observe that such process is equivalent to comparing random i.i.d. patches \((I_1^i,I_2^i)\), which in turn is equivalent to measuring the cosine distance between the associated i.i.d. descriptors \((d_1^i,d_2^i)\). Given two zero-mean i.i.d. \((d_1^i,d_2^i)\), we experimentally observed that \(C(d_1^i, d_2^i)\) has a zero-mean Normal distribution, i.e. \(E[C(d_1^i, d_2^i)]=0\). For all the experiments we run, we verified that the descriptors generated by our network are identically distributed and have zero-mean, therefore we impose \(l^i=0\) for non-matching samples.
With the training labels defined as indicated, the network can be trained via error gradient backpropagation, finding the parameters minimizing a loss function that, for the \textit{i}-th training sample, is defined as
\begin{equation}
L(l_i,y_i) = (l_i-C(d_1^i,d_2^i))^2.
\label{eqn:loss}
\end{equation}
\\*
That is, the network is trained to minimize a sample classification error function defined as the square error between the desired and the actual network outcome (i.e., the sample label). Regarding the practical aspects of the training procedure, we verified that normalizing the input patches over their own \(l_2\) norm increases the robustness and generalization capacity of the network with respect to illumination variations. Also, we follow the common practice of normalizing the input patches with respect to mean pixel intensity and standard deviation as calculated over the entire training set. We also observed that Spatial Batch Normalization as defined in \cite{ioffe2015batch} speeds up the training and boosts performance. Similarly, we normalize the DCT features \(F_D\) with respect to mean and standard deviation values over the entire coefficients set so that their value share the same distribution of the convolutional features \(F_C\).
\subsection{Descriptor Quantization}
\label{sec:quantization}
Binary descriptors enable lower bitrates and simple Hamming distance computation. Having verified that the trained network generates zero-mean descriptors, we quantize the B-elements descriptors \((d_1,d_2)\) over 1 bit via sign quantization, obtaining single bit, B-long descriptors \((b_1,b_2)\). Our choice of the cosine distance as similarity function is instrumental to comparing the binary descriptors \((b_1,b_2)\) via a simple Hamming distance. In fact, the cosine distance definition between \(d_1\), and \(d_2\) in Eq.~\ref{eqn:cosine} can be recasted as the L2-normalized inner product between \(d_1\) and \(d_2\). Given the definition of Hamming distance
\begin{equation}
H(b_1,b_2) \mathrel{\ensurestackMath{\stackon[1pt]{=}{\scriptstyle\Delta}}} \|b_1\| + \|b_2\| -2\langle b_1,b_2\rangle,
\label{eqn:hd}
\end{equation}
\noindent
where \(\langle \cdot,\cdot \rangle\) indicates the inner product, and \(\|\cdot\|\) refers to the bit count of the sequence, it follows that the cosine distance is equivalent to the Hamming distance, up to a scaling factor and an additive term. Therefore, pairs of binary descriptors are simply compared via the normalized Hamming distance
\begin{equation}
H_N(b_1,b_2) = \frac{1}{B} H(b_1,b_2),
\label{eqn:nhd}
\end{equation}
\noindent
which is close to 0 for pairs of matching patches, and close to 1 otherwise, and performance is computed as explained in the following section. | {'timestamp': '2019-01-14T02:13:44', 'yymm': '1901', 'arxiv_id': '1901.03547', 'language': 'en', 'url': 'https://arxiv.org/abs/1901.03547'} | arxiv |
\section{Introduction}
\label{introduction}
Recent advancements in image-to-image transformation problems, in which the image from one domain is transformed to the corresponding image of another domain. The domain specific problem has its applications in the fields of image processing, computer graphics and computer vision
that includes image colorization
\cite{DC,CIC}
image super-resolution
\cite{DLISR,SISRDL}
image segmentation
\cite{SISDPN,SASIS}
image style transfer \cite{ISTCNN,PLRTSTSR}
and
face photo-sketch synthesis
\cite{FSSSRGS,fccn}.
In this paper, a cyclic-synthesized generative adversarial network (CSGAN) is proposed for the image-to-image transformation. Fig. \ref{fig:qualititative} highlights the improved performance of the CSGAN method for sketch to face synthesis compared to the latest state-of-the-art methods.
\begin{figure}[!t]
\begin{center}
\includegraphics[width=\linewidth , height=6 cm]{CombinedDiagram.png}
\setlength{\belowcaptionskip}{-20pt}
\caption{Sample results from CUHK dataset \cite{chuk} in $1^{st}$ and $2^{nd}$ rows and FACADES dataset \cite{facades} in $3^{rd}$ and $4^{th}$ rows. The $1^{st}$ and $2^{nd}$ columns show the input images and ground truth images, respectively. The $3^{rd}$, $4^{th}$, and $5^{th}$ columns represent the transformed images using DualGAN \cite{dualGAN}, CycleGAN \cite{CyclicGAN}, and proposed CSGAN, respectively. Note that the artifacts in DualGAN and CycleGAN are marked with red color rectangles in $2^{nd}$ and $3^{rd}$ columns, respectively.}
\label{fig:qualititative}
\end{center}
\end{figure}
Traditionally, the above mentioned image-to-image transformation problems are handled by different transformation mechanisms \cite{chuk}, \cite{NLAID}, as per the need.
Even, some of the image-to-image transformation problems are dealt with other strategies such as classification, regression, etc.
A multi-scale Markov random fields (MRF) based face photo-sketch synthesis model is proposed to transfer the face sketch into a photo and vice-versa \cite{chuk}. An image quilting method for texture synthesis is presented by \cite{chuk} as an image transfer problem that uses patch based image stitching. A non local means method is proposed for image denoising based on an average of all pixel values in the image \cite{NLAID}.
\begin{figure*}[t]
\begin{center}
\includegraphics[width=\linewidth, height= 10cm]{CSGAN1.jpg}
\setlength{\belowcaptionskip}{-18pt}
\caption{Network architecture of the proposed CSGAN for image-to-image transformation. The cyclic-synthesized loss is proposed in this paper to utilize the relation between synthesized and cycled images in both the image domains. Thus, in addition to the adversarial loss and cycle-consistency loss, we have used cyclic-synthesized loss also to train the network. The adversarial loss is represented in the blue color rectangles which is calculated between 1) the generator $G_{AB}$ and the discriminator $D_B$, and 2) the generator $G_{BA}$ and the discriminator $D_A$. The cycle-consistency loss is shown in the black color and is calculated as $L_1$ loss between the real and cycled images. The cyclic-synthesized loss is shown in the red color and is calculated as $L_1$ loss between the synthesized and cycled images.}
\label{CSGAN}
\end{center}
\end{figure*}
Later with the development of Deep Learning, Convolutional Neural Networks (CNNs) became very popular and widely used for different computer vision problems
like object recognition
\cite{ICDCN},
object localization
\cite{EOLCNN},
human action prediction
\cite{3DCNNHAR} and
medical image analysis
\cite{CNNMIA}.
The CNN based methods \cite{DCLR}
and \cite{ISTCNN} for image-to-image transformation automatically learn the transformation function.
It depends on the network architecture in the training phase with the given loss function. For example, \cite{DCLR} implemented a CNN based network for image colorization that uses Euclidean distance (i.e., $L_2$) as a loss function. A colorful image colorization network is designed by \cite{CIC} which uses the multinomial cross entropy loss and gives better results compared to the \cite{DCLR} because of the averaging tendency of the Euclidean distance. \cite{ISTCNN} used combination of squared error and mean square error as the loss function for the image style transfer.
Even though, the CNN based methods learn the transformation automatically, its performance depends on the selection of the loss functions that best suit for particular domain transformation.
Goodfellow et al. proposed the Generative Adversarial Network (GAN) for image generation in a given dataset \cite{gan}. It uses two networks, namely generator to generate the new samples and discriminator to distinguish between the generated and real samples.
The competitive training of generator and discriminator is done such that the generator learns how to generate more realistic fake image, whereas the discriminator learns how to distinguish between the generated high quality fake image and real image.
Generative Adversarial Networks (GANs) were initially proposed to generate models that are nearer to the training samples based on the given noise distribution. Later on the GANs were also used for different applications
like image blending \cite{TRHRIB}, semantic segmentation \cite{SSUAN}, single image super-resolution \cite{PRSISRGAN} and image inpainting \cite{FLIP}, etc. These methods were introduced for particular applications, thus the generalized framework is still missing.
Isola et al. explored the Pix2Pix as the $1^{st}$ common framework to work on image-to-image translation using Conditional GANs (cGANs) for paired image datasets \cite{cGAN}.
Wang et al. proposed a perceptual adversarial networks (PANs) for solving image-to-image transformation problems. The PANs combines the perceptual adversarial loss with the generative adversarial loss to solve this problem \cite{PAN}.
The perceptual adversarial loss of PAN enforces the network to learn the similarity between image pairs more semantically.
Zhu et al. presented a framework with inverse mapping function for unsupervised data using Cycle-Consistent Adversarial Network (CycleGAN) \cite{CyclicGAN}.
The CyclicGAN transfer the images in two domains in both ways, i.e., in froward as well as in backward direction.
Yi et al. developed a framework for image-to-image translation in an unsupervised setting using Dual-GAN mechanism \cite{dualGAN}. Wang et al. proposed a framework for photo-sketch synthesis involving multi-adversarial networks (PS2MAN) \cite{ps2-man}.
In spite of the above mentioned recent developments, there are still gaps in terms of network architecture of the generator and discriminator, restrain on the size of the datasets and choice of the objective functions.
The above mentioned network architectures mainly differ in terms of the loss functions used for the training.
Most of the recent works included the Adversarial loss calculated between generators and discriminators, the Cycle-consistency loss calculated between the Real\_Images and Cycled\_Images, and the Synthesized loss calculated between the Real\_Images and Synthesized\_Images.
All these losses are used to minimize the gap between real and generated images.
Even after considering all these losses, we still find the scope to minimize the loss between the Synthesized\_Images and Cycled\_Images. As per the best of our knowledge, no existing network utilizes the loss between the Synthesized\_Images and Cycled\_Images.
Synthesized\_Images are generated from the generators by giving Real\_Images as the input and the same generators are used to generate the Cycled\_Images by taking the Synthesized\_Images as the input.
In this paper, we propose a new loss function called as the Cyclic\_Synthesized loss, which is first of its kind.
The contributions of this paper are mainly three-fold:
\begin{itemize}
\item We proposed a new loss function Cyclic-Synthesized Loss (CS Loss) that increases the quality of the results produced with reduced artifacts.
\item We proposed the CSGAN architecture based on the CS Loss for image-to-image transformation.
\item We evaluated our method over two benchmark datasets with baseline image quality assessment metrics and our method shows the better/comparable performance as compared to the state-of-the-art methods.
\end{itemize}
\section{Proposed CSGAN Architecture}
In this section, first, we describe the problem formulation, followed by the depiction of the proposed method and its objective function. Later, the generators and discriminators architecture are discussed in detail.
For a given dataset $X \in \{(A_i),(B_i)\}_{i=1}^{n}$ which consists of the $n$ number of the paired images of two different domains $A$ and $B$, the goal of our method is to train two transformation functions, i.e., $G_{AB}:A \rightarrow B$ and $G_{BA}:B \rightarrow A$. The $G_{AB}$ is a generator that takes a Real\_Image $(R_A)$ from domain $A$ as the input and tries to transform it into a Synthesized\_Image $(Syn_B)$ of domain $B$. The $G_{BA}$ is another generator that takes a Real\_Image $(R_B)$ in domain $B$ as the input and tries to translate it into a Synthesized\_Image $(Syn_A)$ of domain $A$. In addition to the above two generators, the proposed method consists of two discriminators $D_A$ and $D_B$ to distinguish between $R_A$ and $Syn_A$ in domain $A$ and $R_B$ and $Syn_B$ in domain $B$, respectively. The CycleGAN also used these two discriminators \cite{CyclicGAN}. The real image of domain $A$, $R_A$ and the real image of domain $B$, $R_B$ are transformed into the synthesized image in domain $B$, $Syn_B$ and synthesized image in domain $A$, $Syn_A$, respectively as,
\begin{equation}
\label{fake_imagesB}
Syn_B=G_{AB}(R_A)
\end{equation}
\begin{equation}
\label{fake_imagesA}
Syn_A=G_{BA}(R_B)
\end{equation}
The synthesized images (i.e., $Syn_B$ and $Syn_A$) are again transformed into cycled images in another domain (i.e., $Cyc_A$ and $Cyc_B$), respectively as,
\begin{equation}
\label{cycled_imagesA}
Cyc_A=G_{BA}(Syn_B)=G_{BA}((G_{AB}(R_A))
\end{equation}
\begin{equation}
\label{cycled_imagesB}
Cyc_B=G_{AB}(Syn_A)=G_{AB}(G_{BA}(R_B))
\end{equation}
The overall work of the proposed CSGAN method as shown in Fig. \ref{CSGAN}
is to transform image $R_A$ from domain $A$ to $B$
by giving it to the generator network $G_{AB}$, results in the synthesized image $Syn_B$. The Synthesized image $Syn_B$ from domain $B$
and again transformed into the original domain $A$.
by giving it to the generator network $G_{BA}$, results in the cycled image $Cyc_A$.
In the same way the real image $R_B$ from domain $B$ is first transformed into the domain $A$
as the synthesized image $Syn_A$
and then transformed back into the domain $B$.
as the cycled image $Cyc_B$ by using the generator networks $G_{BA}$ and $G_{AB}$, respectively. The discriminator network $D_A$ is used to distinguish between the real image $R_A$ and synthesized image $Syn_A$. In the same way, the discriminator network $D_B$ is used to distinguish between the real image $R_B$ and synthesized image $Syn_B$.
To generate the synthesized images nearest to the real images, the loss between them is to be minimized. This signifies the need for efficient loss function.
\subsection{Proposed Cyclic-Synthesized Loss }\label{CS_Loss}
In this paper, the Cyclic-Synthesized loss is proposed to reduce the above mentioned artifacts.
The generator network $G_{BA}$ used to generate the Synthesized\_Image $Syn_A$ from the Real\_Image $R_B$ is also used to generate the Cycled\_Image $Cyc_A$ from the Synthesized\_Image $Syn_B$. In a similar way, the generator network $G_{AB}$ used to generate the Synthesized\_Image $Syn_B$ from the Real\_Image $R_A$ is also used to generate the Cycled\_Image $Cyc_B$ from the Synthesized\_Image $Syn_A$ as shown in Fig. \ref{CSGAN}. The distance between the Synthesized\_Image and the Cycled\_Image should be low as both are generated from the same generator. By this, the proposed Cyclic-Synthesized loss is calculated as $L_1$ loss between the Synthesized\_Image ($Syn_A$) and the Cycled\_Image ($Cyc_A$) in domain $A$ and the Synthesized\_Image ($Syn_B$) and the Cycled\_Image ($Cyc_B$) in domain $B$. The Cyclic-Synthesized loss is defined as follows,
\begin{equation}
\label{LCSA}
\mathcal{L}_{CS_A}=\left \| Syn_A-Cyc_A \right \|_1=\left \| G_{BA}(R_B)-G_{BA}(G_{AB}(R_A))\right\|_1
\end{equation}
\begin{equation}
\label{LCSB}
\mathcal{L}_{CS_B}=\left \| Syn_B-Cyc_B \right \|_1=\left \| G_{AB}(R_A)-G_{AB}(G_{BA}(R_B))\right\|_1
\end{equation}
where the $\mathcal{L}_{CS_A}$ is the Cyclic-Synthesized loss in domain $A$ (i.e., between $Syn_A$ and $Cyc_A$) and $\mathcal{L}_{CS_B}$ is the Cyclic-Synthesized loss in domain $B$ (i.e., between $Syn_B$ and $Cyc_B$).
\subsection{CSGAN Objective Function}
The objective function ($\mathcal{L}$) for the proposed CSGAN method combines the proposed Cyclic-Synthesized loss with existing Adversarial loss and Cycle-consistency loss as follows,
\begin{equation}
\label{LFINAL}
\begin{split}
\mathcal{L}_(G_{AB}, G_{BA}, D_A,
D_B)=\mathcal{L}_{LSGAN_A}+\mathcal{L}_{LSGAN_B} \\ +\lambda_A\mathcal{L}_{cyc_A} +\lambda_B{\mathcal{L}_{cyc_B}}+\mu_A\mathcal{L}_{CS_A}+\mu_B\mathcal{L}_{CS_B}.
\end{split}
\end{equation}
\label{LCYCA}
where $\mathcal{L}_{CS_A}$ and $\mathcal{L}_{CS_B}$ are the proposed Cyclic-Synthesized loss explained in subsection \ref{CS_Loss}; $\mathcal{L}_{LSGAN_A}$, $\mathcal{L}_{LSGAN_B}$ are the adversarial loss and $\mathcal{L}_{cyc_A}$, $\mathcal{L}_{cyc_B}$ are the Cycle-consistency loss proposed in CycleGAN \cite{CyclicGAN}. The adversarial loss and the Cycle-consistency loss are described in detail in following sub-sections:
\subsubsection{Adversarial Loss}
The generator networks $G_{AB}:A \rightarrow B$ and $G_{BA}: B \rightarrow A$ used in the proposed model are trained using the adversarial loss that comes from the discriminator against the generator network over a common objective function similar to the adversarial loss of original GAN \cite{gan}. The Generator network generates an image that looks similar to the original image, whereas the Discriminator distinguishes between the real and generated images. In this way both the Generator and discriminator networks are trained simultaneously by eliminating the problem of generating blurred images when $L_1$ or $L_2$ loss functions are used \cite{cGAN}. Similar to the CycleGAN \cite{CyclicGAN}, the least square loss introduced in \cite{LSGAN}, is used in the proposed method as the Adversarial loss. The least square loss stabilizes the training procedure to generate the high quality results. The adversarial loss between the Generator network $G_{AB}$ and the Discriminator network $D_B$ is computed as follows,
\begin{equation}
\begin{split}
\label{LSGANB}
\mathcal{L}_{LSGAN_B}(G_{AB}, D_B, A, B) &= \mathbb{E}_{B \sim P_{data}(B)} [(D_B(R_B)-1)^2] \\ +\mathbb{E}_{A \sim P_{data}(A)} [D_B(G_{AB}(R_A))^2].
\end{split}
\end{equation}
Similarly, the adversarial loss between the Generator network $G_{BA}$ and the Discriminator network $D_A$ is computed as follows,
\begin{equation}
\begin{split}
\label{LSGANA}
\mathcal{L}_{LSGAN_A}(G_{BA}, D_A, B, A) &= \mathbb{E}_{A \sim P_{data}(A)} [(D_A(R_A)-1)^2] \\
+\mathbb{E}_{B \sim P_{data}(B)} [D_A(G_{BA}(R_B))^2].
\end{split}
\end{equation}
where $G_{AB} $ and $G_{BA}$ are used to transform the images from $A\rightarrow B$ and $B\rightarrow A$, respectively, and $D_A$ and $D_B$ are used to distinguish between the original and transformed images in the domains of $A$ and $B$, respectively. The Adversarial loss works as a good learned transformation function that can learn the distributions from the input images in training and generate similar looking images in testing. Even though Adversarial loss removes the problem of blurred images, still it produces the artifacts in the images due to the lack of the sufficient goodness measure.
\subsubsection{Cycle-consistency Loss}
The Cycle-consistency loss as discussed in \cite{CyclicGAN} is also used in the objective function of the proposed method. It is calculated as $L_1$ loss between the Real\_Image ($R_A$) and the Cycled\_Image ($Cyc_A$) in domain $A$ and the Real\_Image ($R_B$) and the Cycled\_Image ($Cyc_B$) in domain $B$. The Cycle-consistency loss is defined as follows,
\begin{equation}
\label{LCYCA}
\mathcal{L}_{cyc_A}=\left \| R_A-Cyc_A \right \|_1=\left \| R_A-G_{BA}(G_{AB}(R_A))\right\|_1
\end{equation}
\begin{equation}
\label{LCYCB}
\mathcal{L}_{cyc_B}=\left \| R_B-Cyc_B \right \|_1=\left \| R_B-G_{AB}(G_{BA}(R_B))\right\|_1
\end{equation}
where the $\mathcal{L}_{cyc_A}$ is the Cycle-consistency loss in domain $A$ (i.e., between $R_A$ and $Cyc_A$) and $\mathcal{L}_{cyc_B}$ is the Cycle-consistency loss in domain $B$ (i.e., between $R_B$ and $Cyc_B$).
We used $L_1$ distance instead of $L_2$ distance as the $L_2$ distance produces more blurred results when compared to the $L_1$ distance. The two losses $\mathcal{L}_{cyc_A}$ and $\mathcal{L}_{cyc_B}$ act as the forward and backward consistencies and introduce the constraints to reduce the space of possible mapping functions. Due to the large size of networks and with more mapping functions, the two losses serve the purpose of regularization while learning network parameters.
The above mentioned losses, i.e., Adversarial loss and Cycle-consistency loss used in CycleGAN \cite{CyclicGAN} and DualGAN \cite{dualGAN} produced good quality images. However, there is a need to minimize the artifacts produced as shown in Figure \ref{fig:qualititative} for which we propose the Cyclic-Synthesized loss in this paper.
\subsection{Network Architectures}
In this paper, the Generator and Discriminator architectures are adapted from \cite{CyclicGAN}. The Generator network, as shown in Table\ref{Generator Network}
consists of $3$ Convolutional Layers followed by $9$ residual blocks and $3$ Deconvolutional Layers, is basically adapted from \cite{PLRTSTSR}.
A brief description about the Generator and Discriminator networks are presented in this subsection.
The used Discriminator network in the proposed method is a $70 \times 70$ PatchGAN taken from \cite{cGAN}. This network consists of the $4$ Convolutional Layers, each one is a sequence of Convolution-InstanceNorm-LeakyReLU, followed by $1$ Convolutional Layer to produce a $1$ dimensional output.as shown in Table \ref{Discriminator Network}
In the $1^{st}$ convolutional layer, we do not use any normalization.
\begin{table}[!t]
\caption{Generator Network Architecture. The $r\_p$, $s$ and $p$ denote the size of reflection padding, stride, and padding, respectively.}
\label{Generator Network}
\begin{center}
\scalebox{1}{
\begin{tabular}{@{}l l}
\hline
Input: & Image ($256$x$256$) \\
\hline
\hline
[layer $1$]& r\_p=$3$; Conv2d $(7,7,64)$, s=$1$; ReLU;\\
\hline
[layer $2$]& Conv2d$(3,3,128)$, s=$2$, p=$1$; InstanceNorm; ReLU;\\
\hline
[layer $3$]& Conv2d $(3,3,256)$, s=$2$, p=$1$; InstanceNorm; ReLU;\\
\hline
[layer $4$] & \makecell{r\_p=$1$; Conv2d $(3,3,256)$, s=$1$; InstanceNorm; ReLU;\\
r\_p=$1$; Conv2d $(3,3,256)$, s=$1$; InstanceNorm;} \\
\hline
[layer $5$] & \makecell{r\_p=$1$; Conv2d $(3,3,256)$, s=$1$; InstanceNorm; ReLU;\\
r\_p=$1$; Conv2d $(3,3,256)$, s=$1$; InstanceNorm;} \\
\hline
[layer $6$] & \makecell{r\_p=$1$; Conv2d $(3,3,256)$, s=$1$; InstanceNorm; ReLU;\\
r\_p=$1$; Conv2d $(3,3,256)$, s=$1$; InstanceNorm;} \\
\hline
[layer $7$] & \makecell{r\_p=$1$; Conv2d $(3,3,256)$, s=$1$; InstanceNorm; ReLU;\\
r\_p=$1$; Conv2d $(3,3,256)$, s=$1$; InstanceNorm;} \\
\hline
[layer $8$] & \makecell{r\_p=$1$; Conv2d $(3,3,256)$, s=$1$; InstanceNorm; ReLU;\\
r\_p=$1$; Conv2d $(3,3,256)$, s=$1$; InstanceNorm;} \\
\hline
[layer $9$] & \makecell{r\_p=$1$; Conv2d $(3,3,256)$, s=$1$; InstanceNorm; ReLU;\\
r\_p=$3$; Conv2d $(3,3,256)$, s=$1$; InstanceNorm;} \\
\hline
[layer $10$] & \makecell{r\_p=$1$; Conv2d $(3,3,256)$, s=$1$; InstanceNorm; ReLU;\\
r\_p=$1$; Conv2d $(3,3,256)$, s=$1$; InstanceNorm;} \\
\hline
[layer $11$] & \makecell{r\_p=$1$; Conv2d $(3,3,256)$, s=$1$; InstanceNorm; ReLU;\\
r\_p=$1$; Conv2d $(3,3,256)$, s=$1$; InstanceNorm;} \\
\hline
[layer $12$] & \makecell{r\_p=$1$; Conv2d $(3,3,256)$, s=$1$; InstanceNorm; ReLU;\\
r\_p=$1$; Conv2d $(3,3,256)$, s=$1$; InstanceNorm;} \\
\hline
[layer $13$]& DeConv2d $(3,3,128)$, s=$2$, p=$1$; InstanceNorm; ReLU;\\
\hline
[layer $14$]& DeConv2d $(3,3,64)$, s=$2$, p=$1$; InstanceNorm; ReLU;\\
\hline
[layer $15$]& r\_p=$3$; Conv2d $(7,7)$, s=$1$; Tanh;\\
\hline
\hline
Output:& Image ($256$x$256$)\\
\hline
\end{tabular}
}
\end{center}
\end{table}
\subsubsection{Generator Architecture}
The Generator network, as shown in Table\ref{Generator Network}
consists of $3$ Convolutional Layers followed by $9$ residual blocks and $3$ Deconvolutional Layers, is basically adapted from \cite{PLRTSTSR}.
Instead of batch normalization we used instance normalization because in image generation networks the later one have shown great superiority over the previous one \cite{CyclicGAN}. The input image of dimension $256 \times 256$ in source domain is given to the network. The network follows a series of down convolutions and up convolutions to retain the $256$x$256$ in another domain.
\begin{table}[t]
\caption{Discriminator Network Architecture. The $s$ and $p$ denote the stride and the padding, respectively.}
\label{Discriminator Network}
\begin{center}
\scalebox{1}{
\begin{tabular}{l l}
\hline Input: &Image($256$x$256$) \\
\hline
\hline
[layer $1$]& Conv2d $(4,4,64)$, s=$2$, p=$1; $ LReLU;\\
\hline
[layer $2$]& Conv2d $(4,4,128)$, s=$2$, p=$1$; InstanceNorm; LReLU;\\
\hline
[layer $3$]& Conv2d $(4,4,256)$, s=$2$, p=$1$; InstanceNorm; LReLU;\\
\hline
[layer $4$]& Conv2d $(4,4,512)$, s=$1$, p=$1$; InstanceNorm; LReLU;\\
\hline
[layer $5$]& Conv2d $(4,4,1)$, s=$1$, p=1;\\
\hline
\hline
Output:& (Real/Fake) Score\\
\hline
\end{tabular}
}
\end{center}
\end{table}
\subsubsection{Discriminator Architecture}
The used Discriminator network in the proposed method is a $70 \times 70$ PatchGAN taken from \cite{cGAN}. This network consists of the $4$ Convolutional Layers, each one is a sequence of Convolution-InstanceNorm-LeakyReLU, followed by $1$ Convolutional Layer to produce a $1$ dimensional output as shown in Table \ref{Discriminator Network}
In the $1^{st}$ convolutional layer, we do not use any normalization.
The Discriminator network takes an image of dimension $256 \times 256$ and generates a probability of an image being either fake or real (i.e., a score between $0$ for fake and $1$ for real). The Leaky ReLUs with slope 0.2 is used as the activation function in the Discriminator network.
\section{Experimental Setup}
This section, is devoted to present the experimental setup such as datasets, evaluation metric, training details and methods compared.the
datasets used in the proposed method are described first, followed by the description of the evaluation metrics, the training details of the proposed method and the GAN methods used for the results comparison.
\subsection{DataSets}
To appraise the efficiency of the proposed CSGAN method, we have evaluated the method on two publicly available datasets, namely CUHK and Facades. The subsection describes the datasets in brief.
\subsubsection{CUHK Student Dataset }
The CUHK\footnote{http://mmlab.ie.cuhk.edu.hk/archive/facesketch.html} dataset consists of $188$ face image pairs of sketch and corresponding face of students \cite{chuk}.
The cropped version of the CUHK dataset is used in this paper. The images are resized to the dimension of $256 \times 256$ from the original dimension of $250 \times 200$.
Among $188$ images, $100$ images are used for the training and rest for the testing.
\subsubsection{CMP Facades Dataset}
The CMP Facades\footnote{http://cmp.felk.cvut.cz/~tylecr1/facade/} dataset has $606$ image pairs of labels and corresponding facades with dimensions of $256 \times 256$. The $400$ image pairs are used for the training and remaining for the testing.
\subsection{Evaluation Metrics}
The quantitative as well as qualitative results are computed in this paper in order to get the better understanding of the performance of the proposed method. The Structural Similarity Index (SSIM) \cite{SSIM}, Mean Square Error (MSE) and Peak Signal to Noise Ratio (PSNR) evaluation measures are adapted to report the results quantitatively.
These evaluation measures are very common in image-to-image transformation problem to judge the similarity between the generated image and ground truth image.
We also used the Learned Perceptual Image Patch Similarity (LPIPS) metric proposed by \cite{LPIPS} and used in \cite{TMI2MT}.
The LPIPS calculates the distance between the real and generated images by employing the more emphasis on perceptual similarity.
The results are also depicted in the form of the produced images along with the real images for the qualitative comparison.
\begin{table}[t]
\caption{The average scores of the SSIM, MSE, PSNR and LPIPS metrics for the proposed CSGAN and latest state-of-the art methods trained on CUHK Dataset.The values in bold highlights the best values, and the italic represents the next best.}
\label{chuk_table}
\begin{center}
\scalebox{1}{
\begin{tabular}{|c|c|c|c|c|c|}
\hline
\textbf{Methods} & \multicolumn{4}{ c |}{\textbf{Metrics}} \\
\cline{2-5}
& SSIM & MSE & PSNR & LPIPS \\
\hline
GAN & $0.5398$ & $94.8815$ & $28.3628$ & $0.157$ \\
\hline
Pix2Pix & $0.6056$ & $89.9954$ & $28.5989$ & $0.154$ \\
\hline
DualGAN & $0.6359$ & $\mathit{85.5418}$ & $\mathit{28.8351}$ & $0.132$
\\
\hline
CycleGAN & $\mathit{0.6537}$ & $89.6019$ & $28.6351$ & $0.099$ \\
\hline
PS2GAN & $0.6409$ & $86.7004$ & $28.7779$ & $\mathit{0.098}$\\
\hline
CSGAN & $\mathbf{0.6616}$ & $\mathbf{84.7971}$ & $\mathbf{28.8693}$ & $\mathbf{0.094}$ \\
\hline
\end{tabular}
}
\end{center}
\end{table}
\begin{table}[t]
\caption{The average scores of the SSIM, MSE, PSNR and LPIPS metrics for the proposed CSGAN and latest state-of-the art methods trained on FACADES Dataset.The values in bold represents the best values, and the italic represents the next best.}
\label{Facades_table}
\begin{center}
\scalebox{1}{
\begin{tabular}{|c|c|c|c|c|}
\hline
\textbf{Methods} & \multicolumn{4}{ c |}{\textbf{Metrics}} \\
\cline{2-5}
& SSIM & MSE & PSNR & LPIPS \\
\hline
GAN & $0.1378$ & $103.8049$ & $27.9706$ & $0.252$ \\
\hline
Pix2Pix & $\mathit{0.2106}$ & $\mathbf{101.9864}$ & $\mathbf{28.0569}$ & $\mathbf{0.216}$ \\
\hline
DualGAN & $0.0324$ & $105.0175$ & $27.9187$ & $0.259$
\\
\hline
CycleGAN & $0.0678$ & $104.3104$ & $27.9489$ & $0.248$ \\
\hline
PS2GAN & $0.1764$ & $\mathit{102.4183}$ & $\mathit{28.032}$ & $0.221$\\
\hline
CSGAN & $\mathbf{0.2183}$ & $103.7751$ & $27.9715$ & $\mathit{0.22}$ \\
\hline
\end{tabular}
}
\end{center}
\end{table}
\begin{figure*}[t]
\begin{center}
\includegraphics[width=\linewidth, height=11 cm]{cuhk_2.png}
\setlength{\belowcaptionskip}{-20pt}
\caption{Represents qualitative resemblance of sketch to photo transformation using CUHK dataset. From left to right: Input, Ground truth, GAN, Pix2Pix, DualGAN, CyclicGAN, PS2GAN and CSGAN. The CSGAN achieves lowest artifacts and generates the realistic and fair images. }
\label{cuhk_fig}
\end{center}
\end{figure*}
\begin{figure*}[t]
\begin{center}
\includegraphics[width=\linewidth, height=11 cm]{facades_2.png}
\setlength{\belowcaptionskip}{-18pt}
\caption{Qualitative comparison of labels to buildings transformation results on FACADES dataset. From left to right: Input, Ground truth, GAN, Pix2Pix, DualGAN, CycleGAN, PS2GAN, and CSGAN. The CSGAN generates the realistic and fair images with lowest artifacts. }
\label{facades_fig}
\end{center}
\end{figure*}
\subsection{Training Information}
From our observation, the default settings of CycleGAN \cite{CyclicGAN} results in blurred images while trying to resize the input image from an arbitrary dimension to the fixed dimension $256 \times 256$. The resultant blurred images ultimately causes the deformations in the generated output images. So, in order to avoid this problem, the $256 \times 256$ dimensional images are used for the experiments in this paper. In each experiment, both the generator and discriminator networks are trained from scratch for $200$ epochs with the batch size as $2$.
\setlength{\belowcaptionskip}{-20pt}
The Adam solver \cite{adam} is used in this experiment for training the networks with momentum term $\beta1$ as $0.5$. It is reported in \cite{dcgan} that the higher value of $\beta1$ such as $0.9$ can lead to poor stabilization. Initially, for the first $100$ epochs, the learning rate is fix to $0.0002$ and linearly decaying to $0$ for next $100$ epochs. To initialize the network weights,we have used the Gaussian Distribution with mean as $0$ and standard deviation as $0.02$. The joint training of generator and discriminator networks are performed.
For the proposed CSGAN, the values of the weight factors $\lambda_A$ and $\lambda_B$ both are set to $10$ and the values of the weight factors $\mu_A$ and $\mu_B$ both are set to $30$ (see Equation \ref{LFINAL}). The default settings are used for the weight factors in compared methods as per the corresponding source paper.
Two GPUs in parallel, namely PASCAL TITAN X (12GB)
\footnote{Generously donated by NVIDIA Corp. through the Academic Partnership Program} and GeForce GTX 1080 (8GB) are used for training the networks.
\subsection{Compared Methods}
For analyzing the results the proposed CSGAN method is compared with five different state-of-the-art methods, namely GAN \cite{gan}, Pix2Pix \cite{cGAN}, DualGAN \cite{dualGAN}, CycleGAN \cite{CyclicGAN} and PS2MAN \cite{ps2-man}. For a fair comparison with the proposed CSGAN method as well as other methods, PS2MAN is implemented using a single adversarial network only i.e., PS2GAN. All these methods are compared with proposed method for paired image-to-image translation.
\subsubsection{GAN} The original GAN was proposed for the new sample generation from the noise vector \cite{gan}. In this paper, the Pix2Pix\footnote{https://github.com/phillipi/pix2pix \label{Pix2Pix}} \cite{cGAN} code is modified into GAN for image-to-image translation by removing the conditional property and $L_1$ loss.
\subsubsection{Pix2Pix} The results are produced by using the code provided by the authors of Pix2Pix \cite{cGAN} with the same default settings.
\subsubsection{DualGAN} The results are generated by using the code provided by the authors of DualGAN\footnote{https://github.com/duxingren14/DualGAN} \cite{dualGAN} with the same default settings.
\subsubsection{CycleGAN} The results are obtained by using the code provided by the authors of CycleGAN\footnote{https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix} \cite{CyclicGAN} with the same default settings.
\subsubsection{PS2GAN} The results are generated by modifying the original PS2MAN method proposed by \cite{ps2-man}, that uses a multiple adversarial networks. For a fair comparison with the proposed CSGAN method as well as other methods, PS2MAN is implemented using a single adversarial network only i.e., PS2GAN. The PS2GAN consists of the synthesized loss in addition to the losses mentioned in the CycleGAN \cite{CyclicGAN}.
\section{Experimental Results and Analysis}
In this section, results obtained by the proposed CSGAN method are compared against the five different base line image-to-image transformation methods like GAN, Pix2Pix, DualGAN, CycleGAN and PS2GAN. Both Quantitative and Qualitative analysis of the results are presented to reveal the improved performance of the proposed method.
\subsubsection{Quantitative Evaluation}
Table \ref{chuk_table} and Table \ref{Facades_table} list the comparative results over the CUHK sketch-face and FACADES labels-buildings datasets, respectively using five different state-of-the-art methods along with the proposed CSGAN method.
In terms of the average scores given by the SSIM, the MSE, the PSNR and the LPIPS metrics, the proposed CSGAN method clearly shows improved results over the other compared methods. It is also observed that the proposed CSGAN generates more structurally and perceptually similar faces for a given sketch as it has highest value for SSIM and lowest value for LPIPS. The lowest value of MSE and highest value of PSNR points out that the proposed method generates the faces with more pixel level similarity.
Thus, the proposed method is able to provide a very balanced trade-off between pixel-level similarity and structure/perceptual-level similarity.
In terms of structural similarity, i.e., the average SSIM score, the proposed CSGAN method outperforms the state-of-the-art GAN based methods. In terms of perceptual similarity, i.e., the proposed CSGAN is very close to the the best performing Pix2Pix method. One of the possible reason for it is due to the poor performance of adversarial loss itself. The performance improvement due to the proposed cyclic-synthesized loss (CS Loss) is dependent upon the performance of adversarial loss because the images used in CS Loss are not the original images, rather the synthesized and cycled images. It can be seen from the LPIPS results over FACADES dataset (see Table \ref{Facades_table}), that the LPIPS is poor for all the methods.
For the FACADES dataset and in the context of the MSE and the PSNR metrics (i.e., the pixel-level similarity), the proposed method is not able to produce the best result due to the huge amount of difference between the labels and buildings domains.
\subsubsection{Qualitative Evaluation}
Fig. \ref{cuhk_fig} and Fig. \ref{facades_fig} show the qualitative comparison of the CSGAN results on CUHK and FACADES datasets, respectively, with five different state-of-the-art methods. The GAN, Pix2Pix and DualGAN are unable to generate the output even close to ground truth and contain the different type of artifacts such as face distortion, background patches, missing blocks, etc.
The results of PS2GAN have the brightness inconsistency as well as missing patches in different samples.
The results of CycleGAN is reasonably better, but still suffers with the color inconsistencies for different samples.
These shortcomings are removed in the results of the proposed CSGAN method which are more realistic as compared to the other methods in terms of the shape, color, texture and reduced artifacts.
\section{Conclusion}
In this paper, we proposed a new method for image-to-image transformation called as CSGAN. The CSGAN is based on the Cyclic-Synthesized loss.
Ideally, the cycled image should be similar to the synthesized image in a domain. The Cyclic-Synthesized loss finds the error between the synthesized and cycled images in both the domains.
By adding the Cyclic-Synthesized loss to the objective function (i.e., other losses such as Adversarial loss and Cycle-consistency loss), the problem of unwanted artifacts is minimized. The performance of proposed CSGAN is validated over two benchmark image-to-image translation datasets and the outcomes are analyzed with the recent state-of-the-art methods. The thorough experimental analysis, confirms that the proposed CSGAN outperforms the state-of-the-art methods.
The performance of the proposed method is also either better or comparable over other datasets.
In future we want to extend our work towards optimizing the generator and discriminator networks and to focus on unpaired datasets i.e., towards unsupervised learning
\section*{Acknowledgement}
The authors would like to thanks the NVIDIA Corp. for donating us the NVIDIA GeForce Titan X Pascal GPU used in this research.
\bibliographystyle{IEEEtran}
| {'timestamp': '2019-01-14T02:14:20', 'yymm': '1901', 'arxiv_id': '1901.03554', 'language': 'en', 'url': 'https://arxiv.org/abs/1901.03554'} | arxiv |
\section{Introduction}
An automatic speech recognition (ASR) system converts a speech recording to a stream of orthographic words. Various technologies can be applied to enrich such word streams, such as attributing speech segments to different speakers, identifying the speakers by name, dividing the word stream into sentences and adding punctuation symbols. Rich transcription makes ASR results more readable and valuable for human users. It also enhances the content for various down-stream natural language processing (NLP) applications, such as spoken document retrieval, summarization, machine translation, semantic navigation, speech data mining, and others.
This paper describes the recent improvements to Tallinn University of Technology (TT\"{U}) Estonian speech transcription system. The system is designed to handle mainly semi-spontaneous speech from various domains, such a broadcast conversations, lecture recordings and interviews. Previous versions of the system have been described in \cite{alumae2014recent} and \cite{alumae2012transcription}. One current focus of the system is better handling of data recorded ``in the wild'', such as interviews and meetings recorded in adverse real world acoustic conditions. In addition to speech-to-text, the system also performs automatic punctuation restoration and speaker identification. The speaker identification system can identify a wide range of public figures by voice and is trained in a weakly supervised manner.
The described system is free and open source \footnote{http://github.com/alumae/kaldi-offline-transcriber}. It is used as the backend for our public web-based speech transcription service \footnote{http://bark.phon.ioc.ee/webtrans} and by several Estonian media-monitoring companies for transcribing radio and TV broadcasts.
\section{Training data}
\subsection{Speech data}
Speech data that is used for training the acoustic models is summarized in Table \ref{tbl:speech_data}. Only the duration of the segments containing transcribed speech is shown, i.e., segments containing music, long periods of silence or are left untranscribed is excluded.
\begin{table}[tb]
\caption{ Training data for speech recognition.}
\begin{subtable}{.49\linewidth}
\caption{\label{tbl:speech_data}Acoustic model training data.}
\begin{tabular}{lr}
\hline
Source & Amount (h) \\
\hline
Broadcast conversations & 114.0 \\
Broadcast news & 37.2 \\
Conference speeches, lectures & 37.9 \\
Spontaneous speech \cite{lippus2011acoustic} & 39.6 \\
Parliament speeches & 31.0 \\
BABEL speech database \cite{eek1999estonian} & 7.0 \\
Other & 1.8 \\
\hline
Total & 268.5 \\
\hline
\end{tabular}
\end{subtable}
\begin{subtable}{.49\linewidth}
\caption{\label{tbl:text_data} Language model training data.}
\begin{tabular}{lr}
\hline
Source & Tokens (M) \\
\hline
Web & 434 \\
Newspapers & 196 \\
Magazines and journals & 28 \\
Parliament transcripts & 15 \\
Social media (blogs, comments) & 9.4 \\
Broadcast conversation transcripts & 0.98 \\
Broadcast news transcripts & 0.33 \\
Lecture and conference transcripts & 0.28 \\
\hline
Total & 690 \\
\hline
\end{tabular}
\end{subtable}
\end{table}
Most of the speech data (broadcast speech, conference and lecture speeches, parliament speeches) used for training are collected in Tallinn University of Technology during the past 10 years \cite{meister2012new}.
In addition to transcribed speech data, we make use of large amounts of untranscribed speech data. The data originates from real usage of our public web-based speech transcription service. The service is used mostly for transcribing lectures, interviews, meetings and other types of mostly semi-spontaneous speech. The user-made audio recordings are often recorded in noisy environments, using a microphone positioned relatively far from the user (e.g., a smart phone lying on the table). Therefore, this kind of data has often significant reverberation and background noise. The data was randomly selected from the 2017 service usage data. To eliminate very random usage data, the recordings were picked from the recordings uploaded by about 50 most active service users. The total number of recordings is 2122 and the total duration is 908 hours. We use this data for automatically extracting background noise segments, which in turn are used as in-domain training data for noise augmentation (see Section \ref{sec:am}).
\subsection{Text data}
Text data sources used for training the language models
(LMs) are listed in Table \ref{tbl:text_data}, with the number of tokens in each source after normalization and compound word splitting. Most of the written language
corpora are compiled at the University of Tartu \cite{kaalep2005corpora}. In order
to have up-to-date language data, we scrape additional
web data from news portals and blogs. Finally, transcriptions
of conversational broadcast data (talk shows, telephone interviews) and conference speeches are used as a sample of spoken language.
Before using the text data for LM training, text normalization
is performed. Texts are tokenized, split into sentences
and recapitalized, i.e., converted to a form where names and
abbreviations are correctly capitalized while normal words at
the beginning of sentences are written in lower case.
Recapitalization is performed using a simple count-based model that converts a capitalized word at the beginning of the sentence to its most common intra-sentence form. For expanding
numbers into words, a non-trivial approach is needed as
the exact textual representation of each number depends on
the inflection. However, the inflection of a number is usually
not visible in orthography and is inferred from the context
by human readers. To determine the inflection of a written
number, we employ a semi-supervised machine learning approach
similar to [8]: a support vector machine classifier is
first built using the numbers that are already written as words
in training texts, and the classifier is then used to determine
the inflection for the rest of the numbers. Neighboring words
and their suffixes are used as features for the classifier.
As Estonian is a heavily compounding and inflective language,
the lexical variety of the language is very high. To reduce
the out-of-vocabulary (OOV) rate of the LM, compound
words are decomposed into compound segments, using the
word structure information assigned by a morphological analyzer
\cite{kaalep2001complete}. Compound words are later reconstructed from the output of the speech recognition system using a hidden-event n-gram model \cite{alumae2007automatic}.
\section{Speech recognition system}
Our speech recognition system is based on the Kaldi toolkit \cite{kaldi}. It incorporates many novel techniques recently implemented in Kaldi, such as factored time-delay neural network (TDNN-F) acoustic models and a neural network language model that uses words and character-based features. In the following, we focus on the details that are different from the standard Kaldi recipes.
The system also includes a speaker diarization module based on the LIUM SpkDiarization toolkit \cite{meignier2010lium} and a rule-based pronunciation dictionary. They haven't significantly changed since 2014 and are described in detail in \cite{alumae2014recent}.
\subsection{Acoustic modeling}
\label{sec:am}
Our neural network acoustic model uses the recently introduced TDNN-F architecture \cite{povey2018semi} and is trained with lattice-free MMI criterion \cite{povey2016purely}. The hyper-parameters of the training setup are mostly borrowed from the best-performing Kaldi Switchboard recipe, as it uses similar amount of training data. I-vector based speaker adaptation is used.
To make the system more robust towards adverse acoustic conditions, we use heavy data augmentation for training the neural network acoustic model. We use nine-fold data augmentation: the original training data is three-fold speed-perturbed (using speedup factors 0.9, 1.0 and 1.1) and volume-perturbed. A second copy of the training data is artificially reverberated with various small and medium room impulse responses and mixed with various environmental background noises from the MUSAN corpus \cite{musan}. Similarly to the clean data, this noise-augmented copy is further three-fold replicated using noise and volume perturbation. This is based on the approach implemented in the Kaldi recipes for multi-condition training \cite{ko2017study}.
rs
To further adapt the acoustic models for real-world acoustic conditions, we create a second reverberated and noisy copy of the clean training data. Instead of using various background noises from an external corpus, we extract the non-speech sections from our untranscribed real usage data, using a speed activity detection (SAD) system. We first train a deep-neural network based SAD model on noise-augmented transcribed clean speech data, and then use it to extract non-speech segments from the untranscribed noisy speech data.
Non-speech segments extracted from individual recordings are concatenated and used as background noises for the second noise augmentation round. Details of this method can be found in \cite{asadullah2018}.
As a result, the acoustic model is trained on nine copies of the original training data (clean, noise-augmented with external noises, noise-augmented with in-domain noises, each with three-fold speed and volume perturbation).
\subsection{Language modeling}
Language model (LM) vocabulary is created by selecting the 200\,000 most
likely case-sensitive compound-split units from the unigram
mixture of the individual training corpora, optimized on the development data.
For each corpus, a 4-gram LM is built, using interpolated modified Kneser-Ney
discounting. The individual LMs are interpolated into
one by using interpolation weights optimized on development
data. Finally, the LM is heavily pruned to less than one tenth
in size using entropy pruning. Even more aggressively pruned LM is created for the
first pass of decoding.
We also use a recurrent neural network LM (RNNLM), trained with the recent Kaldi implementation \cite{xu2018neural}.
Since there is no proper way to statically interpolate neural network LMs, we employ the following method to create optimally balanced training data for the neural network LM, in order to avoid biasing it towards written data when all data would be pooled: we define a maximum number of sentences for training a RNNLM, $N_{rnnlm}$ (with $N_{rnnlm}=3\,000\,000$ in the reported experiments) and then subsample or oversample sentences from the individual LM training corpora so that the number of the retained sentences from each of the corpora would be proportional to the optimal LM interpolation weights that were computed earlier when creating $N$-gram language models. We also define an upper limit $f_{max}=10$ for oversampling and a smoothing factor $\beta=0.5$ to make the sampling factors less peaky. The final sampling factor for each LM subcorpus is calculated as:
\[
f_{i} = min \left( f_{max}, { \left( \frac{w_i * N_{rnnlm}}{N_i}\right) }^\beta \right)
\]
where $w_i$ is the optimal LM interpolation weight for subcorpus $i$ and $N_i$ the number of total sentences in subcorpus $i$.
\subsection{Recovering out-of-vocabulary words}
Although we perform compound splitting and use a large vocabulary, speech still contains words that are not covered by our language model vocabulary. This includes both proper names not seen in language model training data, as well as common nouns, verbs and adjectives in rare inflections. In order to improve the recognition of such OOV words, we use a special decoding graph modification recently implemented in Kaldi: the OOV words are represented in the decoding graph using an $n$-gram phoneme language model, estimated on the pronunciations of all in-vocabulary words. After decoding, the most likely phoneme sequence corresponding to recognized OOV words can be reconstructed. To turn the phoneme sequence into a word, we use an approach based on finite state transducers (FSTs). We manually constructed an FST that represents Estonian letter-to-phoneme rules, using the Pynini toolkit \cite{gorman2016pynini}. Most of the rules handle context-sensitive rewrite rules for plosive phonemes, but there are also rules for deriving the Estonian pronunciation for common foreign consonant clusters, so that a name \textit{Chris} is transformed to a pronunciation $/k r i s/$ and so on. The FST framework allows to easily invert a transducer, which can be used to convert the grapheme-to-phoneme converter into a phoneme-to-grapheme converter. However, converting phonemes to graphemes is much more ambigious: for example, the phoneme sequence $/k r i s/$ can correspond (according to the inverted FST) to words \textit{kris}, \textit{krys}, \textit{Grys}, \textit{Chriz}, \textit{criz} and many others, without any ranking. To disambiguate between such variants, we compose the result of the phoneme-to-grapheme translation with another FST that represents a grapheme 5-gram model, estimated over all in-vocabulary words. This assigns a higher probability to those words that contain letter sequences which occur more often in in-vocabulary words. The final recovered word is simply the one with the highest probability.
The described implementation is available at https://github.com/alumae/et-g2p-fst.
\subsection{Experimental results}
We measure speech recognition word error rate (WER) in three domains: broadcast conversations, consisting mostly of radio talkshows, speeches of a linguistics conference and a set of user recordings recorded ``in the wild''. The first two of them are described in detail in \cite{alumae2014recent}. The third set consists about five hours of randomly selected user data uploaded to our public web-based transcription service. The development set is about two hours and a test set of about three hours in length.
\begin{table}[tb]
\caption{\label{tbl:wer} Word error rates for different types of test data, using the full system and with one of the proposed improvements deactivated.}
\centerline{
\begin{tabular}{l|cc|cc|cc|>{\centering\arraybackslash}p{1.3cm}}
\hline
System & \multicolumn{2}{>{\centering\arraybackslash}p{1.7cm}|} {Broadcast conversations} & \multicolumn{2}{>{\centering\arraybackslash}p{1.7cm}|} {Conference speeches} & \multicolumn{2}{>{\centering\arraybackslash}p{1.7cm}|} {User recordings} & Average relative WER incr.
\\
& Dev & Test & Dev & Test & Dev & Test \\
\hline
\textbf{Full system} & \textbf{11.0} & \textbf{8.1} & \textbf{14.5} & \textbf{12.9} & 29.4 & \textbf{22.7} & \\
6-fold data augmentation (not 9) & 11.0 & 8.2 & 14.9 & 13.4 & 30.1 & 23.0 & +1.9\% \\
No OOV model & 11.3 & 8.3 & 15.2 & 14.0 & \textbf{ 29.2 }& 23.1 & +3.3\% \\
No RNNLM rescoring & 11.8 & 9.0 & 15.9 & 14.0 & 31.2 & 24.6 & +8.5\% \\
\hline
2014 system \cite{alumae2014recent} & 18.0 & 17.9 & 23.7 & 26.3 & N/A & N/A & +88\%\\
\hline
\end{tabular}}
\end{table}
Table \ref{tbl:wer} lists WER results of the ablation study, showing the performance of the full system and with either of the three system components removed. It also shows the reported WER results in \cite{alumae2014recent} for the first two domains. Average relative deterioration of the WER, compared to the full system, is given in the last column.
As expected, the nine-fold data augmentation with in-domain noise (as opposed to six-fold data augmentation) has the biggest effect in the more difficult domains (conference speeches and user recordings). It doesn't deteriorate the results in broadcast speech where the acoustic conditions are mostly clean.
The proposed OOV recovery approach reduces WER in most cases. Analyzing the actual recognition hypotheses shows that this method can greatly improve the readability of transcripts containing OOV words. Although the phoneme-based OOV word reconstruction is not always accurate (e.g., OOV foreign names are transcribed using Estonian pronunciation rules), it is cognitively easier to understand than the text produced by the earlier system where OOV words are replaced by acoustically and lexically similar in-vocabulary words. Some examples of successful and failed OOV recoveries are given in Table \ref{tbl:oov_recovery}.
\begin{table}[tb]
\caption{\label{tbl:oov_recovery} Examples of words that were recognized using the proposed OOV-recovery system. The reconstructed words are written in bold.}
\centerline{
\begin{tabular}{p{3.5cm}|p{3.5cm}|p{3.5cm}}
\hline
Reference & Without OOV recovery & With OOV recovery \\
\hline
\textit{valdkondlikult} &\textit{valdkond likult} & \textit{\textbf{valdkondlikult}} \\
\textit{sugu m\"{a}rkivatest} & \textit{sugum\"{a}rki vetes} & \textit{sugu \textbf{m\"{a}rkivatest}} \\
\textit{liibukad retuusid }& \textit{liibutav viiret uusi} & \textit{\textbf{liibuked retoosid}} \\
\textit{hingamiseta pausid} & \textit{hingamispausid} & \textit{\textbf{hingamisetabausid}} \\
\textit{t\"{u}lis ja n\"{a}\"{a}kluses} & \textit{t\"{u}lis ja n\~{o}rkuses }& \textit{\textbf{t\"{a}lise n\"{a}\"{a}kluses}} \\
\hline
\end{tabular}}
\end{table}
\section{Punctuation recovery system}
To improve readability of ASR output we restore commas, periods and question marks using a bidirectional RNN punctuation recovery model~\cite{tilk2016brnn}, with improvements described below.
Firstly, due to inflection and compounding, the used 100000 word vocabulary provides poor
coverage. As a result, many words are mapped to a shared UNK token. To produce more informative
embeddings for the out-of-vocabulary words, we train a character based RNN on the existing
100000 word embeddings to generate new embeddings on the fly. The approach is inspired from
\cite{pinter2017}, but our model is unidirectional as our experiments did not show improvements with a
bidirectional model, and uses gated recurrent units \cite{cho2014gru} instead of LSTM.
Second problem is that the original version of the punctuation restoration model \cite{tilk2016brnn}
segments text into fixed length sequences and punctuation restoration is performed on full sequences.
The problem with this approach is that close to the end of the sequence the number of forward
context words diminishes (zero at the last word) reducing the utility of the backwards recurrence.
Sufficient forward context is important for accurate predictions, as is evident from the significantly
inferior performance of unidirectional models \cite{tilk2015lstm}. We propose a simple fix --- use the
full sequence as input to the model, but treat the last $n$ words as padding and do not attempt to
generate punctuation for them.
\subsection{Experimental results}
The experiments use the pre-trained Estonian models from ~\cite{tilk2016brnn}. The embedding generator has 256 hidden units and an input vocabulary of 73 characters plus one UNK symbol. Word embeddings are grouped by word length into minibatches of up to 64 items and 10\% of minibatches are used for validation. The rest of the training settings are identical to the punctuation recovery model ~\cite{tilk2016brnn}.
For sequence padding we set $n=10$.
On the manually transcribed reference transcripts, the proposed methods improve the F1-score
by 0.5-1.1\% and slot error rate (SER) by 1.3-2.2\% relative. On the ASR output
the relative improvements are 0.5-0.6\% in F1-score and 0.1-0.2\% in SER. Smaller improvements
on the ASR output can partially be explained by the fact that the ASR system produces a smaller
amount of unknown words (4.7\% in ASR output vs. 6.3\% in manually transcribed text), making
the generated embeddings less useful. Both proposed approaches can be applied to already existing
models without retraining.
\section{Speaker identification system}
The transcription system performs speaker identification, covering a a wide set of Estonian public figures, such as politicians, state officials, scientists and artists.
Conventional speaker identification models are usually trained on data where the speech segments corresponding to the target speakers are hand-annotated. However, the process of hand-labelling speech data is expensive and doesn't scale well, especially if a large set of speakers needs to be covered. Instead, we use a method to train speaker identification models using only the information about speakers appearing in each of the recordings in training data, without any segment level annotation \cite{karu2018}. Obtaining or creating such training data is much easier than segment-annotated data. We use 6000 recordings (originating from between 2004 to 2016) of the main evening news programme \textit{P\"{a}evakaja} of Estonian Public Broadcasting as training data. Most recordings in the archive are accompanied with metadata that lists all speakers (both news reporters and interviewees) speaking in that programme. We use the weakly-supervised training method to construct models for almost 5000 unique speakers. Evaluation is performed on 16 manually annotated recordings of the same news programme from a period not covered by the training set.
Evaluation reveals that the method results in a 45\% recall rate of speakers appearing in new news programmes, using a 95\% precision threshold, given reference speaker segmentations.
Table \ref{tbl:sid} lists time-weighted identification error rate (IER), precision and recall values after oracle and automatic diarization. A detailed description of the method and the results are given in \cite{karu2018}.
\begin{table}[tbh]
\caption{\label{tbl:sid}Time-weighted speaker identification results on manually segmented and automatically segmented \textit{P\"{a}evakaja} evaluation set.}
\label{tbl:paevakaja_results2}
\vspace{2mm}
\centerline{
\begin{tabular}{|l|c|c|c||c|c|c|}
\hline
\textbf{Speakers} & \textbf{IER} & \textbf{Precision} & \textbf{Recall} & \textbf{IER} & \textbf{Precision} & \textbf{Recall} \\
\hline
\hline
& \multicolumn{3}{l||}{\textit{Oracle diarization}} & \multicolumn{3}{l|}{\textit{Automatic diarization}} \\
\hline
All & 28\% & 96\% & 75\% & 35\% & 93\% & 66\% \\
\hline
Anchors & 4\% & 98\% & 98\% & 14\% & 94\% & 89\% \\
\hline
Non-anchors & 78\% & 89\% & 24\% & 80\% & 90\% & 22\% \\
\hline
\end{tabular}}
\end{table}
\section{Conclusion}
This paper described the current state of the TT\"{U} Estonian speech transcription system. The system achieves 8.1\% WER on a test set of broadcast conversations, 12.9\% WER on conference speeches and 22.7\% WER on various user-made recordings ``from the wild''. The system also performs punctuation recovery and speaker identification. The speaker identification models are created using weakly supervised training and achieve 66\% time-weighted speaker recognition recall at 93\% precision on a broadcast news test set.
| {'timestamp': '2019-01-14T02:17:37', 'yymm': '1901', 'arxiv_id': '1901.03601', 'language': 'en', 'url': 'https://arxiv.org/abs/1901.03601'} | arxiv |
\section*{\refname
\newcommand{\mathbin{\genfrac{}{}{0pt}{}{}{+}}}{\mathbin{\genfrac{}{}{0pt}{}{}{+}}}
\newcommand{\mathbin{\genfrac{}{}{0pt}{}{}{-}}}{\mathbin{\genfrac{}{}{0pt}{}{}{-}}}
\newcommand{\genfrac{}{}{0pt}{}{}{\cdots}}{\genfrac{}{}{0pt}{}{}{\cdots}}
\setlength{\belowcaptionskip}{-1pt}
\setlength{\textfloatsep}{0.3cm}
\usepackage{graphicx}
\hypersetup{
colorlinks = true,
urlcolor = blue,
linkcolor = blue
}
\newcommand\TTt{\rule{0pt}{1.5ex}}
\newcommand\TTs{\rule{0pt}{1.8ex}}
\newcommand\TT{\rule{0pt}{2.5ex}}
\newcommand\TB{\rule[-1.2ex]{0pt}{0pt}}
\newcommand{\mlt}[1]{ \begin{tabular}[c]{@{}l@{}}#1\end{tabular}}
\newcommand{\mct}[1]{ \begin{tabular}[c]{@{}c@{}}#1\end{tabular}}
\newcommand\Maple{{\sf Maple}}
\begin{document}
\title{Semantic Preserving Bijective Mappings of Mathematical
Formulae between Document Preparation Systems and Computer Algebra Systems}
\author{
Howard S. Cohl\,\inst{1}
\and
Moritz Schubotz\,\inst{2}
\and
Abdou Youssef\,\inst{3}
\and
Andr\'{e} Greiner-Petter\,\inst{4}
\and
J\"urgen Gerhard\,\inst{5}
\and
Bonita V.~Saunders\,\inst{1}
\and
Marjorie A.~McClain\,\inst{1}
}
\institute{\hspace{-0.15cm}Applied and Computational Mathematics Division,
NIST,
Gaithersburg, Maryland, U.S.A.,
\email{\{howard.cohl,bonita.saunders,marjorie.mcclain\}@nist.gov}
\and%
\hspace{-0.10cm}Dept.~of Computer and Information Science,
University of Konstanz, Konstanz, Germany,
\email{[email protected]}\\
\and%
\hspace{-0.10cm}Dept.~of Computer Science, GWU,
Washington DC, U.S.A.,
\email{[email protected]}\\
\and%
\hspace{-0.10cm}
DSIMG,
Technische Universit\"{a}t, Berlin, Germany,
\email{[email protected]}\\
\and%
\hspace{-0.10cm}Maplesoft, Waterloo, Ontario, Canada,
\email{[email protected]}\\
\and%
\hspace{-0.10cm}Poolesville High School, Poolesville, Maryland, U.S.A.,
\email{\{joonb3,kchen1250\}@gmail.com}\\
}
\authorrunning{Cohl, Schubotz, Youssef, Greiner-Petter, Erhard, McClain, Saunders, Bang, and Chen}
\clearpage
\maketitle
\thispagestyle{firststyle}
\vspace{-0.745cm}
\begin{abstract}
Document preparation systems like \LaTeX\ offer the ability to render mathematical expressions as
one would write these on paper. Using \LaTeX, \LaTeXML, and tools generated for use in the National
Institute of Standards (NIST)
Digital Library of Mathematical Functions, semantically enhanced mathematical \LaTeX\ markup
(semantic \LaTeX) is achieved by using a semantic macro set. Computer algebra systems (CAS)
such as {\sf Maple} and {\sf Mathematica} use alternative markup to represent mathematical
expressions.
By taking advantage of Youssef's Part-of-Math tagger and CAS internal representations,
we develop algorithms to translate mathematical expressions represented in semantic \LaTeX\ to
corresponding CAS representations and vice versa.
We have also developed tools for translating the entire {\sf Wolfram} Encoding Continued Fraction
Knowledge and University of Antwerp Continued Fractions for Special Functions datasets,
for use in the NIST Digital Repository of Mathematical Formulae.
The overall goal of these efforts is to provide semantically enriched standard conforming
\MathML{} representations to the public for formulae in digital mathematics libraries.
These representations include presentation \MathML{}, content \MathML{}, generic \LaTeX,
semantic \LaTeX, and now CAS representations as well.
\end{abstract}
\vspace{-1.00cm}
\section{Problem and Current State}
\vspace{-0.2cm}
Scientists often use document preparation systems (DPS) to write scientific papers. The
well-known DPS \LaTeX\ has
become a de-facto standard for writing mathematics papers.
On the other hand, scientists working with formulae which occur in their research often
need to evaluate special or numerical values, create figures, diagrams and tables.
One often uses computer algebra systems (CAS), programs which provide tools for symbolic
and numerical computation of mathematical expressions.
DPS such as \LaTeX, try to render mathematical expressions as accurately
as possible and give the opportunity for customization of the layout of mathematical
expressions. Alternatively, CAS represent expressions for use in symbolic computation
with secondary focus on the layout of the expressions. This difference in format is a common
obstacle for scientific workflows.
For example, consider the Euler-Mascheroni (Euler) constant represented by $\gamma$. Since generic
\LaTeX{} \cite{CohlDRMF2} does not provide any semantic information, the \LaTeX\ representation
of this mathematical constant is just the command for the Greek letter \verb|\gamma|.
{\sf Maple} and {\sf Mathematica}, well-known CAS, represent the Euler constant $\gamma$ with
\verb|gamma| and \verb|EulerGamma| respectively. Scientists writing scientific
papers, who use CAS often need to be aware of representations in both DPS and CAS.
Often different CAS have different capabilities, which implies that scientists
might need to know several CAS representations for mathematical symbols, functions, operators,
etc. One also needs to be aware when CAS do not support direct translation.
We refer to CAS translation as either the forward or backward translation respectively
as DPS source to CAS source or vise-versa.
For instance, the CAS representation of the number $e\approx 2.71828$ (the base of the natural
logarithm) in {\sf Mathematica} is \verb|E|, whereas in {\sf Maple} there is no directly translated symbol.
In {\sf Maple}, one needs to evaluate the exponential function at one
via \verb|exp(1)| to reproduce its value.
For a scientist, $\gamma$ and $e$ might represent something altogether different from these
constants, such as a variable, function, distribution, vector, etc. In these cases, it would
need to be translated in a different way.
In order to avoid these kinds of semantic ambiguities (as well as for other reasons), Bruce
Miller at NIST, developing for the Digital Library of Mathematical Functions (DLMF)
(special functions and orthogonal polynomials of
classical analysis) project, has created a set of semantic \LaTeX{} macros
\cite{MillerYoussef2003,miller16}.
Extensions and `simplifications' have been provided by the Digital Repository of
Mathematical Formulae (DRMF) project. We refer to this extended set of semantic \LaTeX\ macros
as the DLMF/DRMF macro set, and the mathematical \LaTeX\ which uses this semantic macro set
as semantic \LaTeX.
Existing tools which attempt to achieve CAS translations include import/export
for \LaTeX{} expressions (such as \cite{Maple:LatexFunction,Mathematica:LatexFunction}),
as well as for \MathML.
CAS functions such as these, mostly provide only presentation translation in \LaTeX\ and do not
provide semantic solutions or workarounds to hidden problems such as subtle differences in CAS
function definitions. These differences may also include differences in domains or complex branch
cuts of multivalued functions. To fill this lack of knowledge in the CAS translation
process, one needs to provide additional information in the DPS source itself and to
create interactive documents with references to definitions, theorems and other
representations of mathematical expressions. Our approach in this paper, is to develop
independent tools for translation between different CAS and semantic \LaTeX\ representations
for mathematical expressions.
We provide detailed information about
CAS translation and warn about the existence
of known differences in definitions, domains and branch cuts.
For the DRMF, we have decided to focus on CAS translation between the semantic \LaTeX\ representations
of classical analysis and internal CAS representations for {\sf Maple} and {\sf Mathematica}.
\vspace{-0.4cm}
\subsection{A CAS, generic and semantic \LaTeX\ representation example}
\label{ACASgenericandsemantic}
\vspace{-0.2cm}
An example of a mathematical expression is $P_n^{(\alpha,\beta)}(\cos(a\Theta))$
where $P_n^{(\alpha,\beta)}$ is the Jacobi polynomial \cite[(18.5.7)]{NIST:DLMF}.
Table
\ref{firsttable1}
illustrates several DPS and CAS representations
for this mathematical expression.
\begin{table}[t]
\centering
\caption{DPS and CAS representations for Jacobi polynomial expression}
\vspace{0.2cm}
\begin{tabular}{ | c | c | }
\hline
\TT\TB Different Systems & Different Representations \\\hline
\TT\TB Generic \LaTeX\ & \verb|P_n^{(\alpha,\beta)}(\cos(a\Theta))| \\ \hline
\TT\TB semantic \LaTeX\ & \verb|\JacobiP{\alpha}{\beta}{n}@{\cos@{a\Theta}}| \\ \hline
\TT\TB {\sf Maple} & \verb|JacobiP(n,alpha,beta,cos(a*Theta))| \\ \hline
\TT\TB {\sf Mathematica} & \verb|JacobiP[n,\[Alpha],\[Beta],Cos[a \[CapitalTheta]]]|\\
\hline
\end{tabular}
\label{firsttable1}
\end{table}
Translating the generic \LaTeX{} representation is difficult (see \cite{CohlDRMF2}) since
the semantic context of the $P$ is obscured. If it represents a special function, one
needs to ascertain which function it represents, because there are many examples of
standard functions in classical analysis which are given by a $P$. The semantic
\LaTeX\ representation of this mathematical expression encapsulates the
mostly-unambiguous semantic meaning of the mathematical expression. This facilitates
translation between it and CAS representations. We use the first scan of the
Part-of-Math (POM) tagger \cite{you17} to facilitate translation between
semantic \LaTeX\ and CAS representations.
\vspace{-0.4cm}
\section{The Part-of-Math tagger}
\label{MLPTagger}
\vspace{-0.3cm}
There are different approaches for interpreting \LaTeX.
There exist several parsers for \LaTeX, for instance {\tt texvcjs},
which is a part of {\sf Mathoid} \cite{Schubotzmathoid}. There is also
\LaTeXML\ \cite{LaTeXML1,MillerYoussef2003} which processes \LaTeX.
There is also an alternative grammar developed by Ginev \cite{Ginev}.
A new approach has been developed \cite{you17} which is not a fully fledged grammar but only
extracts POM from math \LaTeX. The purpose of the POM is to extract
semantic information from mathematics in \LaTeX. The tagger works in several stages
(termed {\em scans}) and interacts with several machine learning (ML) based
algorithms.
Given an input \LaTeX{} math document, the first scan of the
tagger examines terms and groups them into sub-expressions when indicated.
For instance \verb|\frac{1}{2}| is a sub-expression of numerator and
denominator. A term is, in the sense of Backus-Naur form, a pre-defined
non-terminal expression and can
represent \LaTeX{} macros, environments, reserved symbols
(such as the \LaTeX\ line break command \verb|\\|) or numerical or alphanumerical
expressions. Sub-expressions and terms get tagged due the first scan of
the tagger, with two separate tag categories: (1) definite tags (such as
{\em operation}, {\em function}, {\em exponent}, etc.) that the tagger
is certain of; and tags which consist of alternative and tentative features
which include alternative roles and meanings. These second category of tags
are drawn from a specific knowledge base which has been collected for the
tagger. Tagged terms are called math terms. Math terms are rarely distinct at
this stage and often have multiple features.
Scans 2 and 3 are expected to be completed in the next 2 years. These involve some
natural language processing (NLP) algorithms as well as ML-based algorithms
\cite{Schubotzetal16,
DBLP}.
Those scans will:~(1) select the right features from
among the alternative features identified in the first scan; (2) disambiguate
the terms; and (3) group subsequences of terms into unambiguous sub-expressions
and tag them, thus deriving definite mostly-unambiguous semantics of math terms
and expressions. The NLP/ML
algorithms include math topic modeling, math context modeling, math document
classification (into various standard areas of math), and definition-harvesting
algorithms.
Specifically, to narrow down the role/meaning of a math term, it helps to know which
area of mathematics the input document is in. This calls for a {\em math-document classifier}.
Furthermore, knowing the topic, which is more specific than the area of the document, will
shed even more light on the math terms. Even more targeted is the notion of {\em context} which,
if properly formulated, will take the POM tagger a long way in narrowing down the tag choices.
In \cite{you17}, Youssef defines a new notion of a math-term's context, which involves several
components, such as (1) the area and topic of the term's document; (2) the document-provided
definitions; (3) the topic model and theme class of the term's {\em neighborhood} in the
document; (4) the actual mathematical expression containing the term; as well as (5) a small number
of natural language sentences surrounding the mathematical expression.
Parts of this context are the textual definitions and explanations
of terms and notations which can be present or absent from the input document. These can also
be near the target terms or far and distributed from them. The NLP/ML-based algorithms for the
2\textsuperscript{nd} and 3\textsuperscript{rd} scans of the tagger will model and track the
term's contexts, and will harvest
definitions and explanations and associate them with the target terms.
\vspace{-0.5cm}
\section{Semantic \LaTeX{} to CAS translation}\label{sec:LatexToCAS}
\vspace{-0.3cm}
We have used a mathematical language parser (MLP) as
an interface for the above-described first scan of the POM tagger
to build syntax trees of mathematical expressions in \LaTeX{} and provide CAS translations from
semantic \LaTeX{} to CAS representations.
The MLP provides all functionality to interact with the results of the POM
tagger.
We extended the general information of each term to its CAS representation,
links to definitions on the DLMF/DRMF websites, as well as the corresponding
CAS websites. We also add information about domains, position of branch cuts and
further explanations if necessary. Since the multiple scans of the POM tagger
are still a work in progress, our CAS translation is based on the first scan (see
\S \ref{MLPTagger}). Fig.~\ref{syntaxtree} shows the syntax tree corresponding to
the \LaTeX\ expression \verb|\sqrt[3]{x^3} + \frac{y}{2}|; note that `\verb|x|'
and `\verb|3|' in `\verb|x^3|' are not treated (in Fig.~\ref{syntaxtree}) as siblings
(i.e., children of `\verb|^|') because the first scan of the tagger does not recognize
this hierarchy (but it will be rectified in POM Scans 2 and 3).
The general CAS translation process translates
each node without changing the hierarchy of the tree recursively.
With this approach, we are able to translate nested function calls.
\begin{figure}[t]
\centering
\includegraphics[clip, trim=0.2cm 0.2cm 0.2cm 0.2cm, width=0.95\textwidth]{SyntaxTree}
\caption{Syntax tree of
$\sqrt[3]{x^3} + \frac{y}{2}$
produced by the first scan of the POM tagger.}
\label{syntaxtree}
\end{figure}
The syntax tree obtained by the first POM scan depends on the known terms
of the tagger. Although the tagger's first scan tags macros if those macros'
definition are provided to it, it is currently agnostic of the DLMF/DRMF macros.
Therefore, as it currently stands, the first scan of the tagger extracts, but does not
recognize/tag DLMF/DRMF macros as hierarchical structures, but rather treats those
macros as sequences of terms. The syntax tree in Fig.~\ref{syntaxtreeUseCase} was created
by the tagger for our Jacobi polynomial example in \S\ref{ACASgenericandsemantic}.
The tagger extracts expressions enclosed between open and closed curly
braces\phantom{,}\{...\} which we refer to as {\it delimited balanced expressions}.
The given argument is a sub-expression
and produces another hierarchical tree structure.
\begin{figure}[t]
\centering
\includegraphics[clip, trim=0.2cm 0.2cm 0.2cm 0.2cm, width=0.95\textwidth]{SyntaxTreeUseCase}
\caption{Syntax tree for Jacobi polynomial expression
generated by the first POM scan.}
\label{syntaxtreeUseCase}
\end{figure}
\vspace{-0.4cm}
\subsection{Implementation}
\vspace{-0.1cm}
CAS translations for DLMF/DRMF macros are stored in {\tt CSV} files, to make them easy
to edit. Besides that, CAS translations for Greek letters and mathematical
constants are stored separately in JSON files. In addition to the DLMF/DRMF macro
set, generic \LaTeX{} also provides built-in commands for
mathematical functions, such as \verb|\frac| or \verb|\sqrt|. CAS
translations for these macros are defined in another JSON file.
Since the POM tagger assumes the existence of special formatted lexicon files to
extract information for unknown commands, the {\tt CSV} files containing
CAS translation information has to be converted into lexicon files. Table \ref{sineLexiconEntry}
shows a part of the lexicon entry for the DLMF/DRMF macro
\verb|\sin@@{z}|\footnote{The usage of multiple @ symbols in Miller's \LaTeX\ macro set provides capability
for alternative presentations, such as $\sin(z)$ and $\sin\;z$ for one and two @ symbols respectively.}.
Translations to CAS are realized by patterns with placeholders. The symbol \verb|$i|
indicates the $i$-th variable or parameter of the macro.
\begin{wraptable}[8]{r}[-.5cm]{5.0cm}
\vspace{-0.8cm}
\caption{A lexicon entry.}
\begin{tabular}{| l | l |}
\hline
\TT\TB DLMF & \verb|\sin@@{z}| \\\hline
\TT\TB DLMF-Link & \href{http://dlmf.nist.gov/4.14\#E1}
{dlmf.nist.gov/4.14\#E1}\\\hline
\TT\TB \Maple{} & \verb|sin($0)|\\\hline
\TT\TB {\sf Mathematica} & \verb|Sin[$0]|\\\hline
\end{tabular}
\label{sineLexiconEntry}
\end{wraptable}
Our CAS translation process is structured recursively. A CAS translation
of a node will be delegated to a specialized class for certain kinds of nodes.
Even though our CAS translation process assumes semantic \LaTeX{} with DLMF/DRMF macros,
we sometimes allow for extra information obtained from generic \LaTeX{} expressions.
For instance, we distinguish between the following cases: (1) a Latin letter is used
for an elementary constant; (2) a generic \LaTeX{} command (such as the \LaTeX\
command for a Greek letter) is used for an elementary constant.
In both cases, the program checks if there are known
DLMF/DRMF macros to represent the constant in semantic \LaTeX{}.
If so, we inform the user of the DLMF/DRMF macro for the constant,
but the Latin letter or \LaTeX\ command is not translated.
There are currently only three known Latin letters where this occurs,
the imaginary unit $i$,
Euler's number $e$,
and Catalan's constant $C$.
If one wants to translate the Latin letter to the constant,
then one needs to use the designated macro. In these three
cases they are \verb|\iunit|, \verb|\expe| and \verb|\CatalansConstant|.
Examples of \LaTeX\ commands which may represent elementary constants are
$\pi$ and $\alpha$ which are often used to represent the ratio of a circle's
circumference to its diameter, and the fine-structure constant respectively
which are \verb|\cpi| and \verb|\finestructure|.
Hence, Latin and Greek letters will be always translated as Latin and Greek letters
respectively.
\begin{figure}[t]
\centering
\includegraphics[clip, trim=0.2cm 0.2cm 0.2cm 0.2cm, width=0.9\textwidth]{ProgramFlowchart}
\caption{Flow diagram for translation between
semantic \LaTeX\ and a CAS representations. The MLP is the only
interface to the POM tagger and provides all functionality for
interaction with the results of the POM tagger (such as analyzing the
syntax tree and extracting information from the lexicon.)}
\label{translationflowchart}
\end{figure}
The program consists of two executable JAR files. One organizes
the transformation from {\tt CSV} files to lexicon files, while the other
translates the generated syntax tree to a CAS representation.
Fig.~\ref{translationflowchart} describes the CAS translation process. The program
currently supports forward CAS translations for \Maple{} and {\sf Mathematica}.
\section{{\sf Maple} to semantic \LaTeX{} translation}
\Maple{} has its own syntax and programming language, and users
interact with \Maple{} by entering commands and expressions in
\Maple{} syntax. For example, the mathematical expression
${\displaystyle \int_0^\infty (\pi+\sin(2x))/x^2 dx,}$
would be entered in \Maple{} as \\[-0.25cm]
\begin{equation}
\label{eq:2nd}
\texttt{int((Pi+sin(2*x))/x\^{}2, x=0..infinity)}.
\end{equation}
In the sequel, we will refer to \Maple{} syntax such as the syntactically
correct format (\ref{eq:2nd}) as (i) the {\tt 1D} {\sf Maple} representation.
\Maple{} also provides a (ii) {\tt 2D} representation (whose internal format
is similar to \MathML{}), and its display is similar to the \LaTeX{} rendering of
the mathematical expression. In addition, \Maple{} uses two internal
representations (iii) \verb|Maple_DAG|,
and (iv) {\verb|Inert_Form|} representation.
Note that, even though DAG commonly refers to the general graph theoretic/generic
data structure, {\it directed acyclic graph}, in {\sf Maple} it has become synonymous
with ``{\sf Maple} internal data structure,'' whether it actually represents a DAG
or not.
\begin{wrapfigure}[19]{r}[-0.4cm]{5.5cm}
\vspace{-0.2cm}
\begin{center}
\includegraphics[clip, trim=0.5cm 0.51cm 0.5cm 0.51cm, width=0.48\textwidth]{DAG-1.pdf}
\caption{Example {\tt Maple\textunderscore DAG} for (\ref{eq:2nd}).}
\label{DAGfigit}
\end{center}
\vspace{-0.4cm}
\end{wrapfigure}
In our translation from \Maple{} to semantic \LaTeX{}, only the \Maple{} {\tt 1D}
and \verb|Inert_Fo|-\\
\verb|rm| representations are used.
Programmatic access to the \Maple{} kernel (its internal data structures/commands)
from other programming
languages such as {\sf Java} or {\sf C} is possible through a published
application programming interface (API) called {\sf OpenMaple} \cite[\S 14.3]{MPG}.
The {\sf OpenMaple} {\sf Java} API is used in this project. Some of
the functionality used includes
(1) parsing a string in {\tt 1D} representation and converting
it to its \verb|Maple_DAG| and {\verb|Inert_Form|} representations (see below);
(2) accessing elements of \Maple's internal data structures;
(3) performing manipulations on \Maple{} data structures
in the \Maple{} kernel.
Mathematical expressions in \Maple{} are internally represented as
\verb|Maple_DAG| representations. Fig.~\ref{DAGfigit} illustrates
the {\verb|Maple_DAG|} representation of the 1D \Maple{} expression (\ref{eq:2nd}).
The variable $x$ is stored only once in memory, and all three occurrences of it
refer to the same \Maple{} object. This type of common subexpression
reuse is the reason why \Maple{} data structures are organized as {\verb|DAG|}s
and not as trees.
In addition to mathematical expressions, \Maple{} also has a variety
of other data structures (e.g., sets, lists, arrays, vectors,
matrices, tables, procedures, modules). The structure of a \verb|Maple_DAG| is in the form
\setlength\unitlength{1cm}
\hspace{-1mm}\raisebox{-1mm}
{\framebox(1.30,0.45){{\it Header}\hspace{2pt}}\hspace{0.1mm}%
\framebox(1.1,0.45){{\it Data$_1$}\TTs}\hspace{-1.0mm}
\framebox(0.4,0.45){$\cdots$\TTt}\hspace{-1.0mm}
\framebox(1.1,0.45){{\it Data$_n$\TTs}}}\,.\hspace{0.035cm}
{\it Header} encodes both the type and the length $n$ of the {\verb|Maple_DAG|} and
$Data_1,$\hspace{0.05cm}$\dots,$\hspace{0.05cm}$Data_n$ are {\verb|Maple_DAG|}s (see \cite[Appendix A.3]{MPG}).
For this project, another tree-like representation that closely
mirrors the internal {\verb|Maple_DAG|} representation (and can be accessed more
easily through the {\sf OpenMaple} {\sf Java} API) was chosen, the
{\verb|Inert_Form|}. The {\verb|Inert_Form|} is given by nested function calls
of the form \verb|_Inert_XXX|$\,\,(Data_1,\ ...,\ Data_n)$,
where \texttt{XXX} is a type tag (see \cite[Appendix A.3]{MPG}), and
$Data_1,\ \dots,\ Data_n$ can themselves be {\verb|Inert_Form|}s. In \Maple, the
{\verb|Inert_Form|} representation can be obtained via the command
\texttt{ToInert}. For example, the {\verb|Inert_Form|} representation of the
\Maple{} expression (\ref{eq:2nd}) is
\begin{sloppypar}
\hspace{-0.3cm}\noindent {\scriptsize \texttt{\_Inert\_FUNCTION( \_Inert\_NAME("Int"), \_Inert\_EXPSEQ(
\_Inert\_PROD( \_Inert\_SUM( \_Inert\_NAME("Pi"), }}
\end{sloppypar}
\begin{sloppypar}
\hspace{-0.3cm}\noindent {\scriptsize \texttt{\_Inert\_FUNCTION( \_Inert\_NAME("sin"), \_Inert\_EXPSEQ( \_Inert\_PROD(
\_Inert\_NAME("x"), }}
\end{sloppypar}
\begin{sloppypar}
\hspace{-0.3cm}\noindent {\scriptsize \texttt{\_Inert\_INTPOS(2))))), \_Inert\_POWER( \_Inert\_NAME("x"), \_Inert\_INTNEG(2))) }}
\end{sloppypar}
\begin{sloppypar}
\hspace{-0.3cm}\noindent {\scriptsize \texttt{\_Inert\_EQUATION( \_Inert\_NAME("x"), \_Inert\_RANGE( \_Inert\_INTPOS(0),
\_Inert\_NAME("infinity")))))}}.
\end{sloppypar}
\noindent In order to facilitate access to the {\verb|Inert_Form|} from the {\sf OpenMaple} {\sf Java} API,
the {\verb|Inert_Form|} is converted to a {\tt nested list} representation, where the first element
of each (sub)-list is an \texttt{\_Inert\_XXX} tag. For example, the \Maple{} equation
\texttt{x=0..infinity} which contains the integration bounds (which is a sub-{\verb|Maple_DAG|}
of \Maple{} expression (\ref{eq:2nd})), is as follows in the {\tt nested list} representation
of the {\verb|Inert_Form|}:\\
\noindent{\scriptsize\texttt{\phantom{\hspace{-0.27cm}|}
[\_Inert\_EQUATION, [\_Inert\_NAME, "x"], [\_Inert\_RANGE, [\_Inert\_INTPOS, 0], [\_Inert\_NAME, "infinity"]]]\hspace{-0.015cm}.
}}
\subsection{Implementation}\label{sec:backwardTranslationImplementation}
\begin{figure}[b]
\centering
\includegraphics[clip, trim=0.2cm 0.2cm 0.2cm 0.0cm, width=0.8\textwidth]{MapleTranslation}
\caption{The program flow diagram explains the translation
from \Maple{} to semantic \LaTeX. The input string is parsed into a \Maple{}
object and \Maple{} procedures create a new internal form of the object and
builds a {\tt nested list} from this new form. The CAS translation process assembles
the semantic \LaTeX{} expression by translating each element recursively.}
\label{multiplescanapproach2}
\end{figure}
Our CAS translation engine enters the {\tt 1D Maple} representation via
the {\sf OpenMaple} API for {\sf Java} \cite{OpenMapleAPI} and converts
the previously described {\verb|Inert_Form|} to a {\tt nested list} representation.
For \Maple{} expressions, the {\tt nested list} has a tree structure.
We have organized the backward translation in a similar fashion
to the forward translation (see \S \ref{sec:LatexToCAS}).
Since \Maple{} automatically tries to simplify input expressions, we
implemented some additional changes to prevent such simplifications
and changes to the input expression. We would prefer that the representation
of a translated expression remain as similar as possible to the input expression.
This facilitates user comprehension, as well as the debugging process, of the
CAS translation. \Maple's internal representation presents obstacles when
trying to keep an internal expression in the syntactical form of the input
expression. For instance, \Maple{} performs automatic (1) simplification
of input expressions; (2) representation of radicals as powers with fractional
exponents (e.g., \verb|\sqrt[5]{x^3}| represented as \verb|x^{3/5}|);
(3) representation of negative terms as positive terms multiplied by \verb|-1|
(since \Maple{}'s internal structure has no primitives for negation or
subtraction); and (4) representation of division by a term as a multiplication
of that term raised to a negative power (since \Maple{}'s internal structure
has no primitives for division).
To prevent automatic simplifications in \Maple{}, one can enclose input expressions
between single quotes \textquotesingle ...\textquotesingle,
also known as {\tt unevaluation quotes}. This does not
prevent arithmetic simplifications but does prevent all other simplifications to the input expression.
For instance, if we have input \verb|sin(Pi)+2-1|, then the output is \verb|1|; and if we
have input \textquotesingle\verb|sin(Pi)+2-1|\textquotesingle, then the output is \verb|sin(Pi)+1|.
By using unevaluation quotes, \Maple{} does not convert a radical to a power with fractional
exponents, and the internal representation remains an unevaluated \verb|sqrt| (for square roots)
or \verb|root| (for higher order radicals).
\Maple{} automatically represents a negative term such as \verb|-a| by a
product \verb|a*(-1)|. To resolve this we
first switch the order of the terms so that constants are in front, e.g., \verb|(-1)*a|, and
then check if the leading constant is positive or negative. If it is negative, we remove the
multiplication and insert a negative sign in front of the term.
\Maple's rendering engine only changes negative powers to fractions if the
power is a ratio of integers, otherwise it keeps the exponent representation.
We only translate terms with negative integer exponents to fractions,
and otherwise retain the internal exponent representation. For this purpose, we
perform a preprocessing step (in \Maple{}) that introduces a new {\tt DIVIDE} element in the
tree representation.
For instance, without the {\tt DIVIDE} element the input
\verb|(1/(x+3))^(-I)| produces \verb|\left((3+x)^{-1}\right)^{-\iunit}|,
and with the {\tt DIVIDE} element it produces \verb|\left(\frac{1}{3+x}\right)^{-\iunit}|.
\setcounter{footnote}{0}
\setcounter{mpfootnote}{0}
Using the above described manipulations, a typical translated expression is very similar
to the input expression. As an example, without any of the techniques above, the
input expression \verb|cos(Pi*2)/sqrt((3*beta)/4-3*I)| would be automatically
simplified and changed internally, and the resulting semantic \LaTeX\ would be
\verb|2\idt(3\idt\beta+12\idt\iunit\idt(-1))^{-\frac{1}{2}}|.\footnote{\textbackslash{\tt idt} is
our semantic \LaTeX\ macro which represents multiplication
without any corresponding presentation appearance.}
With unevaluation quotes, the CAS translation produces \\[0.1cm]
\noindent{\footnotesize\phantom{|\!\!\!\!}\verb|\cos@{\cpi\idt2}\idt\left(\sqrt{\beta\idt\frac34+\iunit\idt(-3)}\right)^{-1}|}.\\
Furthermore, with our improvements for subtractions, we translate the radicand
to\\ \verb|\frac{3}{4}\idt\beta-3\idt\iunit|, and with the {\tt DIVIDE} element, we translate the
base with exponent \verb|-1| as a fraction, and our translated expression is\\
\noindent{\footnotesize \phantom{|}\verb|\frac{\cos@{2\idt\cpi}}{\sqrt{\frac{3}{4}\idt\beta-3\idt\iunit}}|},\\
which is very similar to the input expression.
\section{Evaluation}
\label{evaluation}
Here, we describe our approach for validating the correctness of our mappings, as well as discuss
the performance of our system obtained on a hand crafted test set.
One validation approach is to take advantage of numerical evaluation using software tools such as
the {\sf DLMF Standard Reference Tables} (DLMF Tables) \cite{DLMF:Tables}, CAS, and software
libraries\footnote{See for instance:~\href{http://dlmf.nist.gov/software/}{http://dlmf.nist.gov/software}.}.
These tools provide numerical evaluation for special functions with their own unique features. One
can validate forward CAS translations by comparing numerical values in CAS to ground truth values.
Another validation approach is to use mathematical relations between different
functions. For instance, if we forward translate two functions separately,
one could determine if the relation between the two translated functions remains valid.
One example relation is for the Jacobi elliptic
functions ${\rm sn}$, ${\rm cn}$, ${\rm dn}$, and the complete elliptic integral $K$
\cite[Table 22.4.3]{NIST:DLMF}, namely
${\rm sn}(z+K(k),k)={\rm cn}(z,k)/{\rm dn}(z,k),$ where $z\in{\mathbb C},$ and $k\in(0,1)$.
In the limit as $k\to0$, this relation produces
$\sin@{z+\frac{\pi}{2}} = \cos(z),$
where $z\in{\mathbb C}$.
The DLMF provides relations such as these for many special functions.
An alternative relation is particularly helpful to validate CAS translations with different positions
of branch cuts, namely the relation between the parabolic cylinder function $U$ and the modified
Bessel function of the second kind
\cite[(12.7.10)]{NIST:DLMF}
$U(0,z) = \sqrt{z/(2\pi)}K_{1/4}(\tfrac{1}{4}z^2),$
where $z\in{\mathbb C}$.
Note that $z^2$ is no longer on the principal branch of the modified Bessel function of the second
kind when
${\mathrm{ph}}(z) \in (\frac{\pi}{2},\pi)$,
but a CAS would still compute values on the principal branch.
Therefore, a CAS translation from \verb|\BesselK{\frac{1}{4}}@{\frac{1}{4}z^2}| to \verb|BesselK(1/4,(1/4)*z^2)|
is incorrect if
${\mathrm{ph}}(z) \in (\frac{\pi}{2},\pi)$, even though the equation is true in that domain.
In order for the CAS to verify the formula in that domain, it must use \cite[(10.34.4)]{NIST:DLMF}
for the function on the right-hand side.
Other validation tests may not be able to identify a problem with this CAS translation.
One obstacle for such relations are the limitations of ever-improving
CAS simplification functions. Define the {formula difference}, as the difference between
the left- and right-hand sides of a mathematical formula. CAS simplify for the Jacobi elliptic/trigonometric
relation should produce \verb|0|, but might have more difficulties with the parabolic cylinder
function relation.
However, CAS simplify functions work more effectively on round trip tests.
\subsection{Round trip tests}\label{roundtriptests}
One of the main techniques we use to validate CAS translations are round trip
tests which take advantage of CAS simplification functions. Since we have developed
CAS translations between semantic \LaTeX{} $\leftrightarrow$ \Maple, round trip tests are
evaluated in \Maple.
\Maple's simplification function is called \verb|simplify|.
Two expressions are symbolically equivalent, if \verb|simplify| returns
zero for the {formula difference}. On the other hand, it is
not possible to disprove the equivalence of the expressions when the function
returns something different to zero.
Our round trip tests start either from a valid semantic \LaTeX{} expression
or from a valid \Maple{} expression. A CAS translation from the start representation
to the other representation and back again is called one cycle. A round trip reaches
a fixed point, when the string representation is identical to its
previous string representation. The round trip test concludes when it reaches a
fixed point in both representations. Additionally, we test if the fixed point
representation in \Maple{} is symbolically equivalent to the input representation by
simplifying the differences between both of these with the \Maple{} simplify function.
Since there is no mathematical equivalence tester for \LaTeX{} expressions (neither generic
nor semantic \LaTeX), we manually verify \LaTeX\ representations for our test cases by
rendering the \LaTeX{}.
\begin{wraptable}[8]{l}[0.0cm]{7.0cm}
\vspace{-0.7cm}
\caption{A round trip test reach a fixed point.}
\begin{tabular}{|c|c|}
\hline step & semantic \LaTeX{}/\Maple{} representations
\\\hline
0 & \verb|\frac{\cos@{a\Theta}}{2}|\TT\\
1 & \verb|(cos(a*Theta))/(2)| \\
2 & \verb|\frac{1}{2}\idt\cos@{a\idt\Theta}| \\
3 & \verb|(1)/(2)*cos(a*Theta)| \\
\hline
\end{tabular}
\label{fixedpointtablehere}
\end{wraptable}
As shown in \S\ref{sec:backwardTranslationImplementation}, prior to backward
translation, in round trip testing, there will be differences between input
and output \Maple{} representations. After adapting these changes,
and assuming the functions exist in both semantic \LaTeX\ and CAS, the round
trip test should reach a fixed point. In fact, we reached a fixed point in
semantic \LaTeX{} after one cycle and in \Maple{} after $1\tfrac12$ cycles
(see Table \ref{fixedpointtablehere} for an example) for most of the cases we tried.
If the input representation is
already identical to \Maple's representation, then the fixed point will be reached
after at most a half cycle.
One example exception is for CAS translations which introduce additional function
compositions on arguments. For instance, Legendre's incomplete elliptic
integrals \cite[(19.2.4-7)]{NIST:DLMF} are defined with the
amplitude $\phi$ in the first argument, while \Maple's implementation takes the trigonometric
sine of the amplitude as the first argument. For instance, one has the CAS translations
\verb|\EllIntF@{\phi}{k}| $\mapsto$ \verb|EllipticF(sin(phi),k)|, and
\verb|\EllIntF@{\asin@{z}}{k}| $\mapsfrom$ \verb|EllipticF(z,k)|.
These CAS translations produce an infinite chain of sine and inverse sine function calls.
Because round trip tests prevent simplification during the
translation process (see \S\ref{sec:backwardTranslationImplementation}), \Maple{} is not
used to simplify the chain until the round trip test is concluded.
\subsection{Summary of evaluation techniques}
\label{Summaryofevaluationtechniques}
Equivalence tests for special function relations are able to verify relations
in CAS as well as identify hidden problems such as differences in branch cuts and CAS
limitations. We use the simplify method to test equivalences.
For the relations in \S\ref{evaluation}, CAS simplify for the Jacobi elliptic function
example yields \verb|0|. Furthermore, a spectrum of real, complex, and complex conjugate
numerical values for $z$ and $k\in(0,1)$ the {formula difference} converges to zero
for an increasing precision. If simplification returns something other than zero, we can
test the equivalence for specific values. For the Bessel function relation, the
{formula difference} for $z=1+i$ converges to zero for increasing precision, but
does not converge to zero if $z=-1+i$. However, using analytic continuation
\cite[(10.34.4)]{NIST:DLMF}, it does converges to zero. Clearly, the numerical evaluation
test is also able to locate branch cut issues in the CAS translation. Furthermore, this
provides a very powerful debugging method for our translation as well as for CAS functionality.
This was demonstrated by discovering an overall sign error in DLMF equation \cite[(14.5.14)]{NIST:DLMF}.
Round trip tests are also useful for identifying
syntax errors in the semantic \LaTeX\ since the CAS translation then fails. The simplification
procedure is improved for round trip tests, because it only needs to simplify similar expressions with
identical function calls. However, this approach is not able to identify hidden problems that
a CAS translation might need to resolve in order to be correct, if the round trip test has
not reached a fixed point. Other than with the round trip test approach, we have not
discovered any automated tests for backward CAS translations.
We have evaluated 37 round trip test cases which produce a fixed point,
similar to that given in Table \ref{fixedpointtablehere}.
These use formulae from the DLMF/DRMF and produce a difference of the left- and right-hand
sides equaling \verb|0|.
We have created a test dataset\footnote{We are planning to make the dataset
available from \href{http://drmf.wmflabs.org/}{http://drmf.wmflabs.org}.} of 4,165 semantic \LaTeX\ formulae, extracted from
the DLMF. We translated each test case to a representation in \Maple{} and used \Maple's
{\tt simplify} function on the formula difference to verify that the
translated formulae remain valid. Our forward translation tool (\S\ref{sec:LatexToCAS})
was able to translate 2,232 (approx. 53.59\%) test cases and verify 477 of these.
Pre-conversion improved the effectiveness of {\tt simplify} and were used to
convert the translated expression to a different form before simplification of the formula
difference. We used conversions to exponential and hypergeometric form and expanded the
translated expression. Pre-conversion increased the number of formulae verified to 662 and
1,570 test cases were translated but not verified. The remaining 1,933 test cases were not
translated, because they contain DLMF/DRMF macros without a known translation to \Maple{}
(987 cases), such as the $q$-hypergeometric function \cite[(17.4.1)]{NIST:DLMF} (in 58 cases),
or an error appeared during the translation or verification process (639 cases). Furthermore,
316 cases were ignored, because they did not contain enough semantic information to provide a
translation or the test case was not a relation. It is interesting to note that we were able to
enhance the semantics of 74 Wronskian relations by rewriting the macro so that it included the variable
that derivatives are taken with respect to as a parameter. A similar semantic enhancement
is possible for another 186 formulae where
the potentially ambiguous prime
notation `\hspace{0.03cm}\textquotesingle\hspace{0.03cm}' is used for derivatives.
\\[0.1cm]
\noindent
\hspace{-0.111cm}
{\bf\large\!\hspace{0.04cm}Acknowledgements\hspace{0.02cm}}\footnote{The mention of specific products, trademarks, or brand
names is for purposes of identification only. Such mention is not to be interpreted in any way
as an endorsement or certification of such products or brands by the National Institute of
Standards and Technology, nor does it imply that the products so identified are necessarily
the best available for the purpose. All trademarks mentioned herein belong to their
respective owners.}
We are indebted to Wikimedia Labs, the XSEDE project,\\[0.25cm] Springer-Verlag,
the California Institute of Technology, and Maplesoft for their
contributions and continued support. We would also like to thank
Eric Weisstein for supplying the Wolfram {\tt eCF} dataset,
Annie Cuyt, Franky Backeljauw, and Stefan Becuwe for supplying the
University of Antwerp {\tt CFSF} {\sf Maple} dataset, and Adri Olde Daalhuis for discussions
related to complex multivalued functions.
\label{sect:bib}
\printbibliography[keyword=primary]
\end{document}
| {'timestamp': '2021-09-20T02:21:40', 'yymm': '2109', 'arxiv_id': '2109.08655', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08655'} | arxiv |
\section{Introduction}
\label{sec:intro}
The proceedings of BMVC are published only in electronic form, but it is still assumed
that readers of the papers may wish to print the paper. This document
illustrates the required paper format, which is designed to read well either printed
with two pages per sheet (``2-up''), or on screen. Note that printing with one page
per sheet will produce a ``large print'' version, which in many cases is not what is desired.
To approximate the old BMVC format, print at one page per sheet, but do not choose
the option to ``scale to fit paper''.
\LaTeX\ users should use this template in order to prepare their paper.
Users of other packages should emulate the style and layout of this
example. Note that best results will be achieved using {\tt pdflatex},
which is available in most modern distributions.
\subsection{Paper length}
Paper length of the final version must not exceed 10~pages, {\em not counting} the bibliography.
{\bf Only} the bibliography should be {\em excluded} from the page count: {\bf all} appendices must be counted within the {\em 10~pages limit} or supplied as supplementary material. Papers must not have altered margins and formatting from those laid down by this style guide.
The bibliography should begin immediately after the paper text. It may
be of any length, within reason. It must {\em not} include
annotations, figures, or any other paraphernalia intended to subvert the
paper length requirement.
\begin{figure}
\begin{tabular}{ccc}
\bmvaHangBox{\fbox{\parbox{2.7cm}{~\\[2.8mm]
\rule{0pt}{1ex}\hspace{2.24mm}\includegraphics[width=2.33cm]{images/eg1_largeprint.png}\\[-0.1pt]}}}&
\bmvaHangBox{\fbox{\includegraphics[width=2.8cm]{images/eg1_largeprint.png}}}&
\bmvaHangBox{\fbox{\includegraphics[width=5.6cm]{images/eg1_2up.png}}}\\
(a)&(b)&(c)
\end{tabular}
\caption{It is often a good idea for the first figure to attempt to
encapsulate the article, complementing the abstract. This figure illustrates
the various print and on-screen layouts for which this paper format has
been optimised: (a) traditional BMVC print format; (b) on-screen
single-column format, or large-print paper; (c) full-screen two column, or
2-up printing. }
\label{fig:teaser}
\end{figure}
\subsection{Citations}
When citing a multi-author paper, you may save space by using ``{\em et
alia}'', shortened to ``\emph{et al}\bmvaOneDot'' (not ``{\em et.\ al.}'' as ``{\em et}'' is
a complete word.) The provided \verb'\emph{et al}\bmvaOneDot' macro is a useful {\em aide
memoire} in this regard. However, use it only when there are three or more
authors. Thus, the following is correct: `` Frobnication has been trendy
lately. It was introduced by Alpher~\cite{Alpher02}, and subsequently
developed by Alpher and Fotheringham-Smythe~\cite{Alpher03}, and Alpher
\emph{et al}\bmvaOneDot~\cite{Alpher04}.''
This is incorrect: ``... subsequently developed by Alpher \emph{et al}\bmvaOneDot~\cite{Alpher03} ...''
because reference~\cite{Alpher03} has just two authors. If you use the
\verb'\emph{et al}\bmvaOneDot' macro, then you need not worry about double periods
when used at the end of a sentence as in Alpher \emph{et al}\bmvaOneDot.
We use {\tt natbib}, so citations in random order are nicely sorted:
\cite{Alpher03,Alpher02,Authors06b,Authors06}. However, we don't use the
compress option, as we want each reference to have its own hyperlink and
popup window.
\subsection{Footnotes}
Please use footnotes\footnote {This is what a footnote looks like. It
often distracts the reader from the main flow of the argument.} sparingly.
Indeed, try to avoid footnotes altogether and include necessary peripheral
observations in
the text (within parentheses, if you prefer, as in this sentence). If you
wish to use a footnote, place it at the bottom of the column on the page on
which it is referenced. Use Times 8-point type, single-spaced.
\begin{figure*}
\begin{center}
\fbox{\rule{0pt}{2in} \rule{.9\linewidth}{0pt}}
\end{center}
\caption{Example of a short caption, which should be centered.}
\label{fig:short}
\end{figure*}
\begin{table}
\begin{center}
\begin{tabular}{|l|c|}
\hline
Method & Frobnability \\
\hline\hline
Theirs & Frumpy \\
Yours & Frobbly \\
Ours & Makes one's heart Frob\\
\hline
\end{tabular}
\end{center}
\caption{Results. Ours is better.}
\end{table}
\subsection{Mathematics}
Please number all of your sections and displayed equations. It is
important for readers to be able to refer to any particular equation. Just
because you didn't refer to it in the text doesn't mean some future reader
might not need to refer to it. It is cumbersome to have to use
circumlocutions like ``the equation second from the top of page 3 column
1''. (Note that the ruler will not be present in the final copy, so is not
an alternative to equation numbers). All authors will benefit from reading
Mermin's description~\cite{Mermin89} of how to write mathematics.
\subsection{References}
List and number all bibliographical references in 9-point Times,
single-spaced, at the end of your paper. When referenced in the text,
enclose the citation number in square brackets, for
example~\cite{Authors06}. Where appropriate, include the name(s) of
editors of referenced books.
\subsection{Color}
Color is valuable, and will be visible to readers of the electronic copy.
However ensure that, when printed on a monochrome printer, no important
information is lost by the conversion to grayscale.
\section{Evaluation Metrics}
\label{sec:metrics}
In this section we provide the formal definitions for the PointGoal Navigation success metrics presented in Section 3. As previously stated, performance is evaluated using four key metrics: Success, SPL~\cite{anderson2018evaluation}, Soft-SPL~\cite{datta2020integrating}, and Distance to Goal. Distance to Goal measures the agent's geodesic distance to the target when the \texttt{stop} action was called. Success indicates whether the agent predicted \texttt{stop} within $R_\text{PG}$ of the goal, where $R_\text{PG} = 0.36$ meters in all of our experiments. SPL weighs the Success value by the length of the agent's path compared to the optimal path. Soft-SPL replaces the binary Success indicator with percent progress towards goal.
Formally, let $s_T$ be the coordinate of the agent when \texttt{stop} was called, $g$ be the goal coordinate, and $d_\text{init}$ be the initial geodesic distance to goal, and $p$ be the length of the path taken by the agent, then
\begin{align}
\text{DistToGoal} &= \text{GeoDist}(s_T, g) \\
\text{Success} &= \mathbf{1}[[{\text{DistToGoal} \leq R_{PG}}]] \\
\text{SPL} &= \text{Success} \cdot \left( \frac{d_\text{init}}{\max{(d_\text{init}, p)}} \right) \\
\text{Soft-SPL} &= \left(1 - \frac{\text{DistToGoal}}{d_\text{init}} \right) \cdot \left( \frac{d_\text{init}}{\max{(d_\text{init}, p)}} \right)
\end{align}
Note that throughout this paper, we will report Success, SPL and Soft-SPL as percentages for exposition clarity.
Throughout this work we focus on SPL and soft-SPL given our focus on serializing learning self-localization and navigation. Intuitively, SPL can be understood as a measure of an agents self-localization ability, while Soft-SPL serves as a measure of the quality of a navigation policy. This is because in order to achieve a non-zero SPL, an agent is required to accurately predict its position relative to the goal coordinate and call the \texttt{stop} action accordingly. As such, achieving a high SPL score is more heavily dependent on an agent's ability to accurately localize itself throughout an episode. Soft-SPL on the other hand does not have this stringent self-localization requirement. Instead, Soft-SPL gauges how much closer the agent is to the goal coordinate at the end of an episode relative to its distance from the goal at the beginning of the same episode. As such, Soft-SPL informs researchers of the quality of a navigation policy even for unsuccessful episodes, providing a more holistic understanding of an agent's navigation ability compared to SPL.
\section{Implementation Details}
\label{sec:supplementary}
In this section we provide implementation details on our proposed architecture as a supplement to Section 4.
\subsection{Visual-Encoder}
As mentioned in Section 4, our ResNet-18~\cite{he2016resnet} encoder takes in two consecutive, single channel 360 by 640 depth observations and produces two fixed-length embeddings.
Each depth observation is passed through an average pool with kernel size 3 and passed through a ResNet-18 backbone to produce a visual encoding. Note, the ResNet-18 visual encoder is pretrained as mentioned in Section 5. The output of the pre-trained and frozen ResNet-18 backbone is then passed through two additional basic residual blocks to reduce the channel dimension to 85.
Let $v_t$ denote the visual encoding for the current frame and $v_{t-1}$ denote the previous frame visual encoding.
The visual encodings $v_{t}$ and $v_{t-1}$ are then used to generate the embeddings. First, $v_t$ is flattened and pass thought a 1-layer MLP with LayerNorm and ReLU to produce a 384 dim vector $E_v$. Next, $v_t - v_{t-1}$ is flattened and passed through a 2-layer MLP with LayerNorm and ReLU to produce a 128 dim vector $E_f$ -- $E_f$ is set to the zero vector when $t=0$. $E_f$ is used as the input to the ego-motion auxiliary loss calculations mentioned in Section 5.
\subsection{State-Encoder}
Our state encoder is comprised by a 2-Layer LSTM with \texttt{input size} = 512 and \texttt{hidden dim} = 512. Here, the \texttt{visual embedding} $E_v$ and the \texttt{flow embedding} $E_f$, as well as a \texttt{context embedding}, $E_c$ composed of an embedding of the PointGoal and an embedding of the previous action are used as inputs. The vectors $E_v$ and $E_f$ are computed as specified in Section 8.1, and and are concatenated together, where $[E_v, E_f]$ is a 512-d vector. Then the PointGoal observation (goal coordinate relative to the agent's \emph{initial position}) is passed through a linear layer to produce a 512-d vector representation of the PointGoal. Next, the previous action performed by the agent is encoded into a 512-d vector using a word embedding layer. The PointGoal embedding and the previous action embedding are then summed with $[E_v, E_f]$ to produce the LSTM input.
The LSTM state encoder outputs a 512-d belief state $b_t$. The belief state is used as the input in our self-tracking auxiliary losses (Section 5).
\subsection{Information Bottleneck}
Given the predicted belief state $b_t$, we encode $b_t$ and the PointGoal updated with ground truth \compassgps, $G$, into a latent variable $Z$. We first embed the ground truth PointGoal observation into a 32-d vector $g_t$ using a lineear layer and concatenate this vector with $b_t$. The resulting concatenated vector $[b_t, g_t]$ of dimension 544 is then used as input to a 2-layer MLP with a hidden size of 128, a LayerNorm + ReLU activation (note that the final linear layer does not use an activation), and an output size of 64.
The 64-d output is then split into $\mu$ and standard deviation $\sigma$ of a normal distribution. We use a softplus activation on $\sigma$ and no activation on $\mu$. $Z$ is then sampled from $N(\mu, \sigma)$.
During evaluation, $G$ is unknown and thus we set $\mu$ to the zero vector and $\sigma$ to the ones vector as we use the standard normal distribution as the prior in the information bottleneck.
Using the output from the self-tracking auxiliary loss, we update the PointGoal to be relative to the current agent location. We then pass this through a linear layer to create a 32-d vector and concatenate with $Z$. The 64-d vector is then compressed to 32-d with a linear layer and ReLU.
To encourage the agent to not rely on \compassgps (as it won't be available at training time) we add an penalty to the objective based on the amount of information $Z$ contains. Specifically, we use the same training objective as presented in Goyal \emph{et al}\bmvaOneDot
\begin{align}
\mathcal{J}(\theta) &= \mathcal{J}^\text{PPO}(\theta) - \mathbb{E} \left[ \beta I(p(Z | G, S);N(0, I)) \right] \\
& \leq \mathcal{J}^\text{PPO}(\theta) - \mathbb{E} \left[\beta D_\text{KL}(p(Z | G, S) | N(0, I)) \right]
\end{align}
where $G$ is the ground-truth \compassgps, $S$ is our belief state, $I(Z;N(0, I))$ is the mutual information between latent variable $Z$ and the standard normal distribution, $D_\text{KL}$ is the Kullback–Leibler divergence and $\mathcal{J}^\text{PPO}(\theta)$ is the objective function defined in Section 3.
In practice, we find that the gradients for the KL divergence term can be highly correlated leading to worse performance. To decorate, we random subsample to 20\% before taking the mean, we denote this as \texttt{subsampled\_mean}.
\subsection{Tracking Auxiliary Losses}
\xhdr{Ego-motion estimation.} We use the \texttt{flow embedding}, $E_f$ calculated in Section 8.1 to predict ego-motion as an auxiliary loss. To do this, we first pass $E_f$ through a single linear layer in order to convert $E_f$ into a 3 dimenasional tensor representative of the change in pose of the agent, $\Delta_{\text{ego-motion}} = [\Delta_{x}, \Delta_{y}, \Delta_{\theta}]$. Let $\hat{\Delta}_{P}$ denote the predicted ego-motion delta for position and let $\hat{\Delta}_{H}$ denote the ego-motion delta for heading. Next, we obtain the ground truth \texttt{GPS} reading for frames $t$ and $t - 1$, as well as the ground truth \texttt{Compass} readings for frames $t$ and $t - 1$ from the environment. We compute the ground truth deltas as $\Delta_{P} = \texttt{GPS}_t - \texttt{GPS}_{t-1}$ and $\Delta_{H} = \texttt{Compass}_t - \texttt{Compass}_{t-1}$. Given the aforementioned deltas, we define these auxiliary losses as:
\begin{align}
L_{\Delta_\text{Position}} &= \texttt{subsampled\_mean} \left[\left( \hat{\Delta}_{P} - \Delta_{P} \right)^2 \right]
\end{align}
\begin{align}
L_{\Delta_\text{Heading}} = \texttt{subsampled\_mean} \left[\texttt{angular\_distance}\left(\hat{\Delta}_H, \Delta_H\right) \right]
\end{align}
\xhdr{Self-tracking.} We use the state encoding $b_t$ computed in Section 8.2 to calculate self-tracking losses. The first loss, Position loss, is defined as the MSE loss of the agent's predicted position and the ground truth position. This is computed by first passing the state encoding through a two-layer MLP with at 256-d hidden dimension and a ReLU hidden activation.
The \texttt{GPS\_head} thus decodes the predicted GPS reading $\hat{P} = [\hat{x}, \hat{y}]$ from the 512-d state encoding $b_t$. Next, given the ground truth GPS reading $P$, we compute the \texttt{GPS\_loss}, $L_\text{Position}$ as follows:
\begin{align}
L_\text{Position} &= \texttt{subsampled\_mean} \left[\left( \hat{P} - P \right)^2 \right]
\end{align}
The second tracking loss, Heading Loss, is defined as the angular distance between the agent's predicted compass heading and the ground truth heading across. This is computed by first passing the state encoding through a second two layer MLP.
The \texttt{Compass\_head} thus decodes the predicted Compass reading $(\hat{H} = \hat{\theta})$ from the 512-d state encoding $b_t$. Next, given the ground truth Compass reading $H$, we compute the \texttt{Compass\_loss}, $L_\text{Heading}$ as follows:
\begin{align}
L_{\text{Heading}} = \texttt{subsampled\_mean} \left[\texttt{angular\_distance}\left(\hat{H}, H\right) \right]
\end{align}
\input{tables/results-2019-setting}
\begin{figure*}
\centering
\includegraphics[width=0.45\linewidth]{figures/2020_ablation_SPL_vs_steps.pdf}
\includegraphics[width=0.45\linewidth]{figures/2020_ablation_Soft_SPL_vs_steps.pdf}
\caption{\textbf{Realistic setting SPL and Soft-SPL Vs. Steps (300M Experience Steps - DSR)}.
Our ablation studies reveal a similar trend to the ablation study on the semi-idealized setting. Agents which include our proposed auxiliary losses showcase much higher performance in terms SPL and Success, indicating improved self-tracking precision. We also note that the inclusion of the Info Bot marginally increases the performance in terms of SPL when comparing AUX+IB to No Info Bot. Soft-SPL remains comparable between all agents given that Soft-SPL is insensitive to precise self-tracking. Curves in this figure are smoothed using a windowed average over three values.
}
\label{fig:figures/2020_ablation_success_vs_steps.pdf}
\end{figure*}
\begin{figure}
\centering
\includegraphics[width=0.45\linewidth]{figures/2019_scratch_spl_vs_steps.pdf}
\includegraphics[width=0.45\linewidth]{figures/2019_scratch_softspl_vs_steps.pdf}
\caption{\textbf{Semi-Idealized SPL and Soft-SPL with pretrained encoder vs. training from scratch}. Adding a pretrained encoder to the model results in superior performance throughout training in terms of both SPL and Soft-SPL. The pretrained visual encoder provides the agent with a visual representation already amenable to learning navigation, allowing it to more quickly pickup on action sequences that lead to high reward. Curves in this figure are smoothed using a windowed average over three values.}\label{fig:2019-ablation-scratch}
\end{figure}
\begin{figure*}
\centering
\includegraphics[width=0.45\linewidth]{figures/2019_ablation_SPL_vs_steps_full.pdf}
\includegraphics[width=0.45\linewidth]{figures/2019_ablation_softspl_vs_steps_full.pdf}
\caption{\textbf{Semi-Idealized Setting SPL and Soft-SPL Vs. Steps (300M Experience Steps - DSR)}. While the full ablation curves do not illustrate gains in sample efficiency from the Info Bot as well, they serve to illustrate our methods full potential in terms of SPL, achieve +58.20 SPL relative to the baseline. Additionally, we find that adding DSR in the semi-idealized setting reduces the sample efficiency gaps between No Info Bot and AUX+IB. Curves in this figure are smoothed using a windowed average over three values.}\label{fig:idealized-ablation-full}
\end{figure*}
\begin{figure*}
\centering
\includegraphics[width=0.45\linewidth]{figures/2019_nav.pdf}
\includegraphics[width=0.45\linewidth]{figures/2020_nav.pdf}
\caption{\textbf{Semi-Idealized (left) and Realistic (right) Setting SPL Vs. Steps (DSR)}. While both agent's presented include auxiliary losses to incentives the learning self-localization, only AUX+IB has access to privileged information through an information bottleneck. Including the information bottleneck yields slightly higher navigation performance due to the lower MSE errors in self-localization for both the semi-idealized and realistic settings during training.}\label{fig:nav}
\end{figure*}
\begin{figure*}
\centering
\includegraphics[width=0.45\linewidth]{figures/2019_nav_zoom.pdf}
\includegraphics[width=0.45\linewidth]{figures/2020_nav_zoom.pdf}
\caption{\textbf{Semi-Idealized (left) and Realistic (right) Setting SPL Vs. Steps (DSR, Zoomed In)}. Here we focus on the initial portions of the curves shown in \reffig{fig:nav}. This alternate view of the data exposes the immediate effect that the information bottleneck has on the SPL of the agent, improving sample efficiency. Note, this is much more noticeable in the realistic setting, where the information bottleneck has a larger impact on the overall tracking precision.}\label{fig:nav_zoom}
\end{figure*}
\begin{figure*}
\centering
\includegraphics[width=0.45\linewidth]{figures/2019_aux_losses.pdf}
\includegraphics[width=0.45\linewidth]{figures/2020_aux_losses.pdf}
\caption{\textbf{Semi-Idealized (left) and Realistic (right) Setting Auxiliary MSE Losses Vs. Steps (DSR)}. While both agent's presented include auxiliary losses to incentives the learning self-localization, only AUX+IB has access to privileged information through an information bottleneck. Including the information bottleneck yields lower MSE errors in self-localization (sum of all Auxiliary Losses reported in Section 4) for both the semi-idealized and realistic settings during training, indicating better tracking performance. As such, we argue that serializing the learning of navigation and self-localization via an information bottleneck yields better performance when jointly learning navigation and tracking in the absence of idealized localization.}\label{fig:aux_losses}
\end{figure*}
\begin{figure*}
\centering
\includegraphics[width=0.45\linewidth]{figures/2019_aux_losses_zoom.pdf}
\includegraphics[width=0.45\linewidth]{figures/2020_aux_losses_zoom.pdf}
\caption{\textbf{Semi-Idealized (left) and Realistic (right) Setting Auxiliary MSE Losses Vs. Steps (DSR, Zoomed In)}. Here we focus on the initial portions of the curves shown in \reffig{fig:aux_losses}, where a divergence between the self-localization MSE losses can begin to be observed. This alternate view of the data exposes spikes in the loss curves both with and without the information bottleneck, illustrating the detrimental effect that changes in the navigation policy has on self-localization. Adding the information bottleneck to serializing the learning of navigation and self-localization yields better self-localization performance even early in training.}\label{fig:aux_losses_zoom}
\end{figure*}
\begin{figure*}
\centering
\includegraphics[width=0.90\linewidth]{figures/trajectories_new.pdf}
\caption{\textbf{Sample Trajectories for Our Agent (above) and Baseline Agent (below)}. The blue curve depicts the agent's path, while the green curve depicts the optimal oracle path. While the absence of auxiliary losses does affect the agent's ability to precisely self-localize, preventing it from stopping within the threshold distance of the PointGoal, it does not hamper the agent's ability to navigate towards the goal. This is evidenced by high Soft-SPL values for both AUX+IB and the No Both baseline in this PointGoal navigation episode.}\label{fig:trajectories}
\end{figure*}
\begin{figure*}
\centering
\includegraphics[width=0.45\linewidth]{figures/2020_KL_fixed_1.pdf}
\includegraphics[width=0.45\linewidth]{figures/2020_spl_beta_1.pdf}
\caption{Realistic Setting KL Divergence between $p(Z | S, G)$ and $N(0, I)$ prior (left) and SPL (right) Vs. Steps ($\beta = 1.0$, DSR). Using too small of a fixed beta value promotes the overuse of privileged information at training time. This yields poor performance at evaluation time once the policy learned by the agent becomes reliant on privileged information.}\label{fig:beta_1}
\end{figure*}
\begin{figure*}
\centering
\includegraphics[width=0.45\linewidth]{figures/2020_KL_beta_5e-3.pdf}
\includegraphics[width=0.45\linewidth]{figures/2020_spl_beta_5e-3.pdf}
\caption{Realistic Setting KL Divergence between $p(Z | S, G)$ and $N(0, I)$ prior (left) and SPL (right) Vs. Steps ($\beta$ decay, DSR). The training curve presented indicates that the agent's policy learned with low beta is unable to adapt to a high beta regime, requiring the agent to relearn a policy from scratch once the final beta region is reached.}\label{fig:beta_5e-3}
\end{figure*}
\section{#1}
\vspace{-0.06in}
}
\newcommand{\csubsection}[1]{
\vspace{-0.1in}
\subsection{#1}
\vspace{-0.05in}
}
\newcommand{\csubsubsection}[1]{
\vspace{-0.06in}
\subsubsection{#1}
\vspace{-0.05in}
}
| {'timestamp': '2021-09-20T02:22:10', 'yymm': '2109', 'arxiv_id': '2109.08677', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08677'} | arxiv |
\section{Introduction}
Reliable broadcast is widely used for replicating data in countless applications: storage systems, state-machine replication, cryptocurrencies, etc.
%
Intuitively, a reliable broadcast protocol allows a system member (the \emph{source}) to broadcast a value, and ensures that correct system members agree on the value they deliver, despite arbitrary (\emph{Byzantine}~\cite{lamport1982byzantine}) behavior of some of them (including the source) and asynchrony of the underlying network.
%
More precisely, the primitive ensures the following properties:
%
\begin{itemize}
\item (Validity) If the source broadcasts $m$, then every correct process eventually delivers $m$.
\item (Consistency) If correct processes $p$ and $q$ deliver, respectively, $m$ and $m'$, then $m = m'$.
\item (Integrity) Every correct process delivers at most one value, and, if the source is correct, only if it previously broadcast it.
\item (Totality) If a correct process delivers a value, then all correct processes eventually deliver some value.
\end{itemize}
Classical reliable broadcast algorithms, starting from Bracha's broadcast~\cite{bracha1987asynchronous},
assume that ``enough'' system members remain correct.
In the \emph{uniform} fault model, where processes
fail with equal probabilities, independently of each other, this assumption implies that only less than one third of processes can fail~\cite{bracha1985asynchronous}.
More general fault models can be captured via \textit{quorum systems}~\cite{malkhi1998byzantine}.
Formally, a quorum system is a collection of member subsets (\emph{quorums}).
Every two quorums must have at least one correct process in common, and in every system run, at least one quorum must only contain correct processes.
Intuitively, quorums encapsulate \emph{trust} the system members express to each other.
Every quorum can act on behalf of the whole system: before delivering a value from a potentially Byzantine source, one should make sure that a quorum of system members have \emph{acknowledged} the value.
Conventionally, these trust assumptions are centralized: all participants share the same quorum system.
In a large-scale distributed system, it might be, however, difficult to expect that all participants come to the same trust assumptions.
It could be more realistic to resort to \emph{decentralized trust} assumptions by allowing each participant to individually choose its quorum system.
Damg{\aa}rd et al.~\cite{damgaard2007secure} appear to be the first to consider the decentralized trust setting.
They focused on solving broadcast, verifiable secret sharing and multiparty computation, assuming \emph{synchronous} communication.
Recently, the approach has found promising applications in the field of cryptocurrencies, with the advent of Ripple~\cite{schwartz2014ripple} and Stellar~\cite{mazieres2015stellar} that were conceived as \emph{open} payment systems, alternatives to \textit{proof-of-work}-based protocols~\cite{nakamoto2008bitcoin,ethereum}.
In particular, Stellar and its followups~\cite{garcia2018federated,garcia2019deconstructing} determine necessary and sufficient conditions on the individual quorum systems, so that a well-defined subset of participants can solve the problems of consensus and reliable broadcast.
In this paper, we propose to take a more general, and arguably more realistic, perspective on decentralized trust.
Instead of determining the weakest model in which a given problem can be solved, we rather focus on determining the strongest problem that can be solved in a given model.
Indeed, we might have to accept that individual trust assumptions are chosen by the users independently and may turn out to be poorly justified.
Furthermore, as in the real world, where a national economy typically exhibits strong internal trust but may distrust other national economies, the system may have multiple mutually distrusting ``trust clusters''.
Therefore it is important to characterize the class of problems that can be solved, given specific decentralized trust assumptions.
To this purpose, we introduce a class of \emph{relaxed} broadcast abstractions, \emph{$k$-consistent reliable broadcast} ($k$-CRB), $k\in\mathbb{N}$, that appear to match systems with decentralized trust.
If the source of the broadcast value is correct, then
$k$-CRB ensures the safety properties of reliable broadcast (Consistency and Integrity).
However, if the source is Byzantine, then Consistency is relaxed so that correct participants are allowed to deliver \emph{up to $k$} distinct values.
Moreover, we also refine the Totality property: if a correct process delivers a value, then every \emph{live} correct process\footnote{A process is live in a given execution if at least one of its quorums consists of correct processes only. Intuitively, we may not be able to guarantee liveness to the processes that, though correct, do not ``trust the right guys''.} eventually delivers a value \emph{or} produces an irrefutable evidence that the source is Byzantine.
In other words, we introduce the \emph{accountability} feature to the broadcast abstraction: either the live correct processes agree on the values broadcast by the source or detect its misbehavior.
The question now is how to determine the smallest $k$ such that $k$-CRB can be implemented given specific decentralized trust assumptions.
We show that the trust assumptions induce a collection of \emph{trust graphs}.
It turns out that the optimal $k$ is then precisely the size of the largest \emph{maximum independent set} over this collection of graphs.
Reliable broadcast is a principal building block for higher-order abstractions, such as state-machine replication~\cite{pbft} and asset transfer~\cite{cons-crypto,astro-dsn}.
We see this work as the first step towards determining the strongest relaxed variants of these abstractions that can be implemented in decentralized-trust settings.
The rest of the paper is organized as follows. In Section~\ref{sec:model}, we present our system model. In Section~\ref{sec:b_protocol}, we recall definitions of classical broadcast primitives and introduce a relaxed variant adjusted for decentralized trust settings---\textit{k-consistent broadcast} ($k$-CB).
Section~\ref{sec:lower} introduces graph representations of trust assumptions, which are used to establish a lower bound on parameter $k$ of relaxed broadcast.
In Section~\ref{sec:algo}, we introduce a stronger primitive, $k$-consistent reliable broadcast ($k$-CRB) and describe its implementation.
Finally, we discuss related work in Section~\ref{sec:related}, and we draw our conclusions in Section~\ref{sec:conclusion}.
\section{System Model}
\label{sec:model}
\subsection{Processes}
A system is composed of a set of \emph{processes} $\Pi = \{p_1,...,p_n\}$.
Every process is assigned an \emph{algorithm} (we also say \emph{protocol}), an automaton defined as a set of possible \textit{states} (including the \textit{initial state}), a set of \textit{events} it can produce and a transition function that maps each state to a corresponding new state.
An event is either an $input$ (a call operation from the application or a message received from another process) or an $output$ (a response to an application call or a message sent to another process); \textit{send} and \textit{receive} denote events involving communication between processes.
\subsection{Executions and failures}
A \textit{configuration} $C$ is the collection of states of all processes. In addition, $C^0$ is used to denote a special configuration where processes are in their initial states.
An \textit{execution} (or a \textit{run}) $\Sigma$ is a sequence of events,
where every event is associated with a distinct process and
every \textit{receive}($m$) event has a preceding matching \textit{send}($m$) event.
A process \textit{misbehaves} in a run (we also call it \emph{Byzantine}) if it produces an event that is not prescribed by the assigned protocol, given the preceding sequence of events, starting from the initial configuration $C^0$.
If a process does not misbehave, we call it \emph{benign}.
In an infinite run, a process \textit{crashes} if it prematurely stops producing events required by the protocol;
if a process is benign and never crashes we call it \emph{correct}, and it is
\emph{faulty} otherwise.
Let $\textit{part}(\Sigma)$ denote the set of processes that produce events in an execution $\Sigma$.
\subsection{Channels and digital signatures}
Every pair of processes communicate over a \textit{reliable channel}: in every infinite run, if a correct process $p$ sends a message $m$ to a correct process $q$, $m$ eventually arrives, and $q$ receives a message from $p$ only if $p$ sent it.
We impose \emph{no synchrony assumptions}.
In particular, we assume no bounds on the time required to convey a message from one correct process to another.
In the following, we assume that all messages sent with a protocol execution are \emph{signed}, and the signatures can be \emph{verified} by a third party.
In particular, each time a process $p$ receives a protocol message $m$ from process $q$, $p$ only accepts $m$ if it is properly signed by $q$.
We assume a computationally bound \emph{adversary}: no process can forge the signature of a benign process.
\subsection{Decentralized trust}
We now formally define our decentralized trust assumptions.
A \emph{quorum map} $\mathcal Q: \Pi \rightarrow 2^{2^{\Pi}}$ provides every process with a set of process subsets:
for every process $p$, $\mathcal Q(p)$ is the set of \emph{quorums of $p$}.
We assume that $p$ includes itself in each of its quorums: $\forall Q\in \mathcal Q(p): p\in Q$.
Intuitively, $\mathcal Q(p)$ describes what process $p$ \emph{expects} from the system.
We implicitly assume that, from $p$'s perspective, for every quorum $Q\in\mathcal Q(p)$, there is an execution in which $Q$ is precisely the set of correct processes.
However, these expectations may be violated by the environment.
We therefore introduce a \emph{fault model} $\mathcal F\subseteq 2^{\Pi}$ (sometimes also called an \emph{adversary structure}) stipulating which process subsets can be faulty.
In this paper, we assume \emph{inclusion-closed} fault models that do not force processes to fail: $\forall F\in \mathcal F,\; F'\subseteq F: \; F'\in \mathcal F$.
An execution $\Sigma$ \emph{complies with $\mathcal F$} if the set of faulty processes in $\Sigma$ is in $\mathcal F$.
Given a faulty set $F\in \mathcal F$, a process $p$ is called \emph{live in $F$} if it has a \emph{live quorum in $F$}, i.e., $\exists Q\in \mathcal Q(p): Q \cap F = \emptyset$.
Intuitively, if $p$ is live in every $F\in \mathcal F$, such that $p\notin F$, then its trust assumptions are justified by the environment.
For example, let the uniform \emph{$f$-resilient} fault model: $\mathcal F=\{F\subseteq \Pi: |F|\leq f\}$.
If $\mathcal Q(p)$ includes all sets of $n-f$ processes, then $p$ is guaranteed to have at least one live quorum in every execution.
On the other hand, if $\mathcal Q(p)$ expects that a selected process $q$ is always correct ($q\in \cap_{Q\in\mathcal Q(p)} Q$), then $p$ is not live in any execution with a faulty set such that $q\in F$. %
In the rest of the paper, we assume that the model is provided with \emph{trust assumptions} $(\mathcal Q,\mathcal F)$, where $\mathcal Q$ is a quorum map and $\mathcal F$ is a fault model.
\section{The Broadcast Primitive}
\label{sec:b_protocol}
The broadcast abstraction exports input events $\textit{broadcast}(m)$ and output events $\textit{deliver}(m)$, for value $m$ in a \emph{value set} $\mathcal M$.
Without loss of generality, we assume that each broadcast instance has a dedicated \textit{source}, i.e., the process invoking the $\textit{broadcast}$ operation.\footnote{One can easily turn this (one-shot) abstraction into a \emph{long-lived} one, in which every process can broadcast arbitrarily many distinct values by equipping each broadcast value with a source identifier and a unique \emph{sequence number} and its signature.}
Below we recall the classical abstractions of consistent and reliable broadcast \cite{cachin2011introduction}.
The \emph{consistent broadcast} abstraction satisfies:
\begin{itemize}
\item (Validity) If the source is correct and broadcasts $m$, then every correct process eventually delivers $m$.
\item (Consistency) If correct processes $p$ and $q$ deliver $m$ and $m'$ respectively, then $m = m'$.
\item (Integrity) Every correct process delivers at most one value and, if the source $p$ is correct, only if $p$ previously broadcast it.
\end{itemize}
A reliable broadcast protocol satisfies the properties above, plus:
\begin{itemize}
\item (Totality) If a correct process delivers a value, then all correct processes eventually deliver a value.
\end{itemize}
For our lower bound, we introduce a relaxed version of consistent broadcast.
A \textit{$k$-consistent broadcast protocol} ($k$-CB) ensures that in every execution $\Sigma$ (where $F \in \mathcal{F}$ is its faulty set), the following properties are satisfied:
\begin{itemize}
\item (Validity) If the source is correct and broadcasts $m$, then every \emph{live} correct process eventually delivers $m$.
\item ($k$-Consistency) Let $M$ be the set of values delivered by the correct processes, then $|M| \leq k$.
\item (Integrity) A correct process delivers at most one value and, if the source $p$ is correct, only if $p$ previously broadcast it.
\end{itemize}
In this paper, we restrict our attention on \emph{quorum-based} protocols~\cite{losa2019stellar}.
Intuitively, in a quorum-based protocol, every process $p$ is expected to make progress if the members of one of its quorums $Q\in\mathcal Q(p)$ appear correct to $p$.
This should hold even if the actual set of correct processes in this execution is different from $Q$.
The property has been originally introduced in the context of consensus protocols~\cite{losa2019stellar}. Here we extend it to broadcast.
Formally, we introduce the following property that completes the specification of $k$-CB:
\begin{itemize}
\item (Local Progress) For all $p \in \Pi$ and $Q \in \mathcal Q(p)$,
there is an execution in which only the source and processes in $Q$ take steps, $p$ is correct, and $p$ delivers a value.
\end{itemize}
The key differences of a \textit{k}-CB over a classical consistent broadcast lies in the Validity and the \textit{k}-Consistency properties.
Our Validity property only ensures progress to \emph{live} correct processes (based on their local quorums).
Also, since some processes may trust the "wrong guys", it might happen that a faulty source convinces the correct processes to deliver distinct values.
However, given a fault model $\mathcal{F}$, the \textit{k}-Consistency property establishes an upper bound $k$ in values that can be delivered.
In the classical consistent broadcast, no conflict is allowed in values delivered for a given $\mathcal{F}$, the bound $k$ on such primitive is then equal to $1$ (which clearly also holds for reliable broadcast).
\section{Bounds for \textit{k}-consistent broadcast protocol}
\label{sec:lower}
\subsection{A Graph Representation of Executions}
We use our trust assumptions $(\mathcal Q,\mathcal F)$ to build a graph representation of the execution, in order to investigate the cases in which disagreement may occur in the network, that is, when two or more correct processes deliver distinct values.
Let $S: \Pi \rightarrow 2^{\Pi}$ be a map providing each process with one of its quorums, that is, $S(p) \in \mathcal Q(p)$.
Let $\mathcal S$ be the family of all possible such maps $S$.
Given $F \in \mathcal{F}$ and $S \in \mathcal S$, we build an undirected graph $G_{F,S}$ as follows:
the nodes in $G_{F,S}$ are correct processes ($\Pi-F$) and the edges are drawn between a pair of nodes if their quorums intersect in at least one correct process.
Formally, $G_{F,S}$ is a pair $(\Pi_{F},E_{F,S})$ in which:
\begin{itemize}
\item $\Pi_{F} = \Pi - F$
\item $(p, q) \in E_{F,S} \Leftrightarrow S(p) \cap S(q) \not\subseteq F$
\end{itemize}
\begin{example}
\label{ex:graphs}
Let us consider the system where $\Pi = \{p1,p2,p3,p4\}$, given the faulty set $F = \{p3\}$ and the quorum system for each process:
\[ \mathcal Q(p1) = \{\{p1,p2,p3\},\{p1,p3,p4\}\} \ \ \ \ \mathcal Q(p2) = \{\{p1,p2,p3\},\{p2,p3,p4\}\} \]\[\mathcal Q(p3) = \{\{p1,p2,p4\},\{p2,p3,p4\}\} \ \ \ \ \mathcal Q(p4) = \{\{p1,p3,p4\},\{p2,p4\},\{p3,p4\}\} \]
If we consider only the correct processes ($p1$, $p2$ and $p4$), there are $12$ different combinations of quorums $S \in \mathcal S$ for these trust assumptions. Now let $S_1 \in \mathcal S$ with: $S_1(p1) = \{p1,p2,p3\}$, $S_1(p2) = \{p2,p3,p4\}$ and $S_1(p4) = \{p2,p4\}$. And let $S_2 \in \mathcal S$ with: $S_2(p1) = \{p1,p2,p3\}$, $S_2(p2) = \{p2,p3,p4\}$ and $S_2(p4) = \{p3,p4\}$. Figure \ref{ex1_graphs} shows the graphs $G_{F,S_1}$ and $G_{F,S_2}$, observe that every pair of quorums used to generate $G_{F,S_1}$ intersects in a correct process, thus resulting in a fully connected graph. On the other hand, since $S_2(p1) \cap S_2(p4) \subseteq F$, $G_{F,S_2}$ is not fully connected.
\end{example}
\begin{figure}
\centering
\includegraphics[scale=0.6]{images/ex1_graphs.png}
\caption{Graph structures of Example~\ref{ex:graphs}: $G_{F,S_1}$ and $G_{F,S_2}$ respectively.}
\label{ex1_graphs}
\end{figure}
Before proceeding with the analysis, we recall the following classical definitions:
\begin{definition}[Independent Set]
A set of nodes $I$ is an \emph{independent set} of a graph $G_{F,S}$ if no pair of nodes in $I$ is adjacent, i.e., $\forall p,q \in I: (p,q) \notin E_{F,S}$.
\end{definition}
\begin{definition}[Independence Number]
The \emph{independence number} of a graph $G_{F,S}$ is the size of its largest independent set.
\end{definition}
Within an independent set of $G_{F,S}$, the quorums of each pair of nodes do not intersect in a correct process.
The independence number of $G_{F,S}$ helps us in understanding the level of disagreement that might occur in an execution, as we show in the following:
\begin{theorem}
\label{th:n_conflict}
Let $G_{F,S}$ be the graph generated over a fixed $F \in \mathcal{F}$ and $S \in \mathcal S$.
Let $G_{F,S}$ have an independent set of size $k$.
Then there exists an execution
in which up to $k$ distinct values can be delivered by correct processes.
\end{theorem}
\begin{proof}
Let $r$ be the source.
If $I = \{p_{1},...,p_{k}\}$ is an independent set of $G_{F,S}$ of size $k$,
then $\forall p_i,p_j \in I: S(p_i) \cap S(p_j) \subseteq F$.
By the definition of Local Progress, it exists an execution $\Sigma_i$ such that $part(\Sigma_i)= \{r\} \cup S(p_i)$ and $p_i$ delivers a value $m_i$. It then suffices for $r$ and other faulty processes in $S(p_i)$ to behave exactly as they do within $\Sigma_i$ in order to produce the same result.
Since the system is asynchronous, it is possible that $p_i$ delivers a value before any
correct
process in \textit{part}($\Sigma_i$) receives a message from any $p' \notin \textit{part}(\Sigma_i)$.
In other words, the network behaves as if it was temporarily partitioned.
Now for each $p_{i} \in I$, let $\Sigma_i$ be an execution as described above, we can build $\Sigma$ such that all executions $\Sigma_i$ are subsequences of $\Sigma$, in which no correct process receives any information of conflicting values before $p_{1},...,p_{k}$ deliver $m_{1},...,m_{k}$, respectively.
\end{proof}
\begin{example}
\label{ex:indepedence}
Coming back to Example~\ref{ex:graphs}, we see that the nodes in $G_{F,S_1}$ are fully connected (form a clique), thus resulting in $G_{F,S_1}$ having independence number $1$.
On the other hand, the biggest independent set in $G_{F,S_2}$ is $\{p1,p4\}$, which means $G_{F,S_2}$ has independence number $2$.
In an execution where $F$ is the faulty set and processes first hear from quorums in $S_2$ to deliver a value,
then there is an unavoidable possibility that $p1$ and $p4$ deliver distinct values if $p3$ is the source.
\end{example}
\subsection{Lower bound on \textit{k}}
Given the pair $(\mathcal Q,\mathcal F)$,
we define the family of graphs $\mathcal G_{\mathcal Q,\mathcal F}$ that includes all possible $G_{F,S}$, where $F \in \mathcal{F}$ and $S \in \mathcal S$.
Recall that every such $S \in \mathcal S$ associates each
process to one of its quorums.
\begin{definition}[Inconsistency Number]
Let $\mu:\mathcal G_{\mathcal Q,\mathcal F} \rightarrow N$ map each $G_{F,S} \in \mathcal G_{\mathcal Q,\mathcal F}$ to its independence number.
The \emph{inconsistency number} of $(\mathcal Q,\mathcal F)$ is then $k_{max} = max(\{\mu(G_{F,S})|G_{F,S} \in \mathcal G_{\mathcal Q,\mathcal F}\})$.
\end{definition}
\begin{theorem}
\label{th:allbound}
No algorithm can implement $k$-CB with $k < k_{max}$.
\end{theorem}
\begin{proof}
For a particular $G_{F,S} \in \mathcal G_{\mathcal Q,\mathcal F}$, Theorem~\ref{th:n_conflict} implies that within an independent set $I:|I| = k$, up to $k$ distinct values can be delivered by the correct processes.
As the independence number is the size of the maximum independent set(s) of a graph, by taking the highest independence number in $\mathcal G_{\mathcal Q,\mathcal F}$ we get the worst case scenario.
It is always possible to build an execution where $k_{max}$ processes deliver $k_{max}$ distinct values before any correct process is able to identify the misbehavior.
\end{proof}
\begin{example}
\label{ex:optimal}
Coming back to Example~\ref{ex:graphs} again, if we take $S_3$ such that $S_3(p1) = S_3(p2) = \{p1,p2,p3\}$ and $S_3(p4) = \{p3,p4\}$, we have both $(p1,p4) \not\in E_{F,S_3}$ and $(p2,p4) \not\in E_{F,S_3}$, while $(p1,p2) \in E_{F,S_3}$. The independence number of $G_{F,S_3}$ is 2, which means that despite $G_{F,S_2}$ having more edges then $G_{F,S_3}$, the same number of distinct values can be delivered by correct processes. For $\mathcal{F} = \{\{p3\}\}$, since the quorums of $p1$ and $p2$ always intersect on a correct process, none of the graphs has independence number higher then $G_{F,S_3}$, thus, considering $\mathcal Q$ from Example~\ref{ex:graphs} and $\mathcal{F}$, the optimal $k$ for an algorithm implementing $k$-CB would be 2.
\end{example}
\section{Accountable Algorithm for Relaxed Broadcast}
\label{sec:algo}
In the specification of \textit{k}-CB, we inherently assume the possibility of correct processes disagreeing in the delivered value in the presence of a faulty source, but the maximal number of distinct delivered values is determined by $(\mathcal Q,\mathcal F)$.
In practice, one may need some form of Totality, as in reliable broadcast.
We might want the (live) correct processes to reach some form of agreement on the set of values they deliver.
In our setting, we have to define the Totality property, taking into account the possibility of them delivering different values, in case the source is misbehaving.
Therefore we strengthen the protocol by adding an accountability feature:
once a correct process detects misbehavior of the source, i.e., it finds out that the source signed two different values, it can use the two signatures as a \emph{proof of misbehavior}.
The proof can be then independently verified by a third party.
We model the accusation as an additional output \textit{accuse($mb$)}, where $mb$ is a proof that the source misbehaved.
When a process $p$ produces \textit{accuse($mb$)}, we say that $p$ \emph{accuses the source} (of misbehavior with proof $mb$).
Now, in addition to the properties of \textit{k}-CB, the \textit{k-consistent reliable broadcast} (\textit{k}-CRB) abstraction satisfies:
\begin{itemize}
\item (Weak Totality) If a correct process delivers a value, then every \emph{live} correct process eventually delivers a value or accuses the source.
\item (Accuracy) A correct process $p$ accuses the source only if the source is faulty.
\item (Certitude) If a correct process accuses the source, every correct process eventually does so.
\end{itemize}
We present our \textit{k}-CRB implementation in Algorithm~\ref{alg:1phase}.
Each process maintains local variables \textit{sentecho}, \textit{delivered}, \textit{accused} and \textit{echoes}.
Boolean variables \textit{sentecho}, \textit{delivered} and \textit{accused} indicate whether $p_{i}$ has already sent \textit{ECHO}, delivered a value and accused the source, resp., in the broadcast instance.
Array \textit{echoes} keeps track of \textit{ECHO} messages received from other processes.
The source broadcasts $m$ by sending a \textit{SEND} message to every process in the system.
If a process $p_{i}$ receives either a [\textit{SEND},$m$] or a [\textit{ECHO},$m$] for the first time, $p_{i}$ sends an \textit{ECHO} message to every other processes.
If a received \textit{ECHO} message contains a value $m_2$ that conflicts with a previously received value $m_1$, $p_i$ sends the \textit{ACC} message to every process with the tuple $(m_1,m_2)$ as a proof of misbehavior.
Once $p_i$ receives echoes with $m$ from at least one of its quorum, it delivers $m$.
Once $p_i$ receives an \textit{ACC} message containing a proof of misbehavior, even though $p_i$ has already delivered a value, it also sends \textit{ACC} to every process before accusing the source.
Notice that a correct process only sends \textit{ECHO} for a single value, and delivers a value or accuses the source once.
\begin{algorithm}
\SetAlgoLined
\BlankLine
\textbf{Local Variables:} \\
\textit{sentecho $\leftarrow FALSE$;} $\setminus$$\setminus$Indicate if $p_{i}$ has sent \textit{ECHO} \\
\textit{delivered $\leftarrow FALSE$;} $\setminus$$\setminus$Indicate if $p_{i}$ has delivered a value \\
\textit{accused $\leftarrow FALSE$;} $\setminus$$\setminus$Indicate if $p_{i}$ has accused the source \\
\textit{echoes $\leftarrow [\perp]^{N}$;} $\setminus$$\setminus$Array of received \textit{ECHO} messages from others processes \\
\BlankLine
\textbf{upon invoking broadcast($m$)}: \{ If $p_i$ is the source \}\\
\ \ \ \ \textit{send message [\textit{SEND},$m$] to all $p_{j} \in \Pi$;} \\
\BlankLine
\textbf{upon receiving a message [\textit{SEND},$m$] from $p_{j}$:} \\
\ \ \ \ \textit{\textbf{if}($\neg$\textit{sentecho}):} \\
\ \ \ \ \ \ \ \ \textit{sentecho $\leftarrow TRUE$;} \\
\ \ \ \ \ \ \ \ \textit{send message [\textit{ECHO},$m$] to all $p_{j} \in \Pi$;} \\
\BlankLine
\textbf{upon receiving a message [\textit{ECHO},$m$] from $p_{j}$:} \\
\ \ \ \ \textit{echoes[j] $\leftarrow$ $m$;} \\
\ \ \ \ \textit{\textbf{if}(there exists \textit{echoes}[$k$] $\neq \perp$ such that \textit{echoes}[$k$] $\neq$ \textit{echoes}[j]):} \\
\ \ \ \ \ \ \ \ \textit{$m1$ $\leftarrow$ \textit{echoes}[j];} \\
\ \ \ \ \ \ \ \ \textit{$m2$ $\leftarrow$ \textit{echoes}[k];} \\
\ \ \ \ \ \ \ \ \textit{send message [\textit{ACC},$(m1,m2)$] to all $p_{j} \in \Pi$;} \\
\ \ \ \ \ \ \ \ \textit{accuse $(m1,m2)$;} \\
\ \ \ \ \textit{\textbf{if}($\neg$\textit{sentecho}):} \\
\ \ \ \ \ \ \ \ \textit{sentecho $\leftarrow TRUE$;} \\
\ \ \ \ \ \ \ \ \textit{send message [\textit{ECHO},$m$] to all $p_{j} \in \Pi$;} \\
\BlankLine
\textbf{upon receiving a message [\textit{ACC},$(m1,m2)$] from $p_{j}$:} \\
\ \ \ \ \textit{\textbf{if}($\neg \textit{accused}$)}\\
\ \ \ \ \ \textit{accused $\leftarrow TRUE$;} \\
\ \ \ \ \ \ \textit{send message [\textit{ACC},$(m1,m2)$] to all $p_{j} \in \Pi$;} \\
\ \ \ \ \ \ \textit{accuse $(m1,m2)$;}
\BlankLine
\textbf{upon receiving \textit{ECHO} for $m$ from every $q \in Q_{i}, Q_{i} \in \mathcal Q(p_{i})$:} \\
\ \ \ \ \textit{\textbf{if}($\neg \textit{delivered}$)}\\
\ \ \ \ \ \textit{delivered $\leftarrow TRUE$;} \\
\ \ \ \ \ \textit{deliver $m$;} \\
\BlankLine
\caption{1-Phase Broadcast Algorithm: code for process $p_{i}$}
\label{alg:1phase}
\end{algorithm}
Process $p_i$ delivers a value $m$ after receiving \textit{ECHO} from every process in $Q_i \in \mathcal Q(p_i)$, we say that $p_i$ \emph{uses $Q_i$}.
In our correctness arguments, we fix an execution of Algorithm \ref{alg:1phase} with a faulty set $F \in \mathcal{F}$, and assume that the processes use quorums defined by a fixed map $S \in \mathcal S$.
\begin{lemma}
\label{algo_pairwise}
Let $G_{F,S}$ be the graph generated over $F$ and $S$ with $(p,q) \in E_{F,S}$, if $p$ delivers $m_1$ and $q$ delivers $m_2$, then $m_1 = m_2$.
\end{lemma}
\begin{proof}
Since $p$ delivers $m_1$ using $S(p)$, all processes in $S(p)$ sent \textit{ECHO} with $m_1$ to $p$. Similarly, all processes in $S(q)$ sent \textit{ECHO} with $m_2$ to $q$. Assume that $m_1 \neq m_2$, since $(p,q) \in E_{F,S} \Leftrightarrow S(p) \cap S(q) \not\subseteq F$, some correct process sent \textit{ECHO} with $m_1$ and $m_2$, which is not allowed by the protocol.
\end{proof}
As an immediate consequence of Lemma~\ref{algo_pairwise}, correct processes $p$ and $q$ might deliver distinct values only if $(p,q) \notin E_{F,S}$.
\begin{theorem}
\label{algo_th:n_conflict}
Let $k$ be the independence number of $G_{F,S}$, then $k$ is an upper bound in the number of distinct values that can be delivered by correct processes.
\end{theorem}
\begin{proof}
Lemma~\ref{algo_pairwise} states that if the quorums of correct processes intersect in a correct process, they cannot deliver conflicting values using those quorums. Let $I$ be an independent set in $G_{F,S}$ of size $k$ and assume that more than $k$ distinct values are delivered, then for some $q \notin I, \exists p \in I: (p,q) \in E_{F,S}$, in which $p$ and $q$ deliver distinct values, a contradiction.
\end{proof}
\begin{theorem}
\label{theor:reliable_alg}
Consider a distributed system with trust assumptions $(\mathcal Q,\mathcal F)$. Let
$k_{max}$ be the inconsistency number of $(\mathcal Q,\mathcal F)$.
Then Algorithm~\ref{alg:1phase} implements $k_{max}$-consistent reliable broadcast.
\end{theorem}
\begin{proof}
(Integrity)
Immediate from the algorithm: a process only delivers a value once, and if the source is correct and broadcasts $m$, no process can deliver a value different from $m$.
(Accuracy)
A correct process accuses the source after receiving echoes with distinct values or an accusation from another process.
In both cases, the signature of the source is verified.
Correct processes do not broadcast distinct values, and since a faulty process cannot forge signatures of a correct one, it follows that distinct values can only come from a faulty source.
(Certitude) In both situations in which a correct process accuses misbehavior, it previously sends an \textit{ACC} message to every process in the network containing a pair of distinct values.
The message is then eventually received by every correct process in the network, which accuses the source as well.
(Validity) When a correct process broadcasts $m$, it sends [\textit{SEND},$m$] to every process in the network.
Every correct process eventually receives the message and echoes it to every process.
If a correct process has a live quorum $Q$, it will eventually receive \textit{ECHO} with $m$ from all the processes in $Q$ and deliver the value.
(Weak Totality) A correct process $p$ sends an \textit{ECHO} message to every process after receiving it if $p$ has not previously echoed a value.
Consequently, if some correct process receives an \textit{ECHO} message, every correct process eventually does so.
If $p$ delivers a value, it must have received at least one \textit{ECHO} message,
in which case, every correct process eventually receives and echoes a value.
If a correct process $q$ has a live quorum $Q$, it eventually receives \textit{ECHO} from all processes in $Q$.
Two cases are then possible.
If all of the \textit{ECHO} messages received by $q$ contains the same value, then $q$ delivers it.
Otherwise, $q$ accuses misbehavior.
($k_{max}$-Consistency)
Let $G'_{F,S}$ be the graph whose independence number is $k_{max}$. %
By Theorem~\ref{algo_th:n_conflict}, the number of distinct values that can be delivered by correct processes in a given execution is bounded by $k_{max}$.
As, by definition, $k_{max}$ is the higher independence number of graphs in $\mathcal G_{\mathcal Q,\mathcal F}$, \textit{$k_{max}$-consistency} is ensured.
\end{proof}
An algorithm implementing $k$-CRB satisfies the required properties of $k$-CB, thus, it also implements $k$-CB. From Theorem~\ref{th:allbound}, no algorithm can implement $k$-CB with $k < k_{max}$, therefore, Theorem \ref{theor:reliable_alg}~implies that Algorithm \ref{alg:1phase} implements $k$-CB, and consequently $k$-CRB, with optimal $k$.
\noindent
\textbf{Computing inconsistency parameters.}
A straightforward approach to find the inconsistency number of $(\mathcal Q,\mathcal F)$ consists in computing the independence number of all graphs $G_{F,S} \in \mathcal G_{\mathcal Q,\mathcal F}$.
The problem of finding the largest independent set in a graph (called \textit{maximum independent set}), and consequently its independence number, is the \textit{maximum independent set problem} \cite{tarjan1977finding},
known to be \textit{NP-complete} \cite{miller2013complexity}.
Also, the number of graphs in $\mathcal G_{\mathcal Q,\mathcal F}$ may exponentially grow with the number of processes.
However, as the graphs might have similar structures (for example, the same quorums for some processes may appear in multiple graphs),
in many practical scenarios, we should be able to avoid redundant calculations and reduce the overall computational costs.
\section{Related Work}
\label{sec:related}
Assuming synchronous communication, Damg{\aa}rd et al.~\cite{damgaard2007secure} described protocols implementing broadcast, verifiable secret sharing and multiparty computation in the decentralized trust setting. They introduce the notion of \textit{aggregate adversary structure}~$\mathcal{A}$: each node is assigned a collection of subsets of nodes that the adversary might corrupt at once.
Ripple~\cite{schwartz2014ripple} is arguably the first practical partially synchronous system based on decentralized trust assumptions.
In the Ripple protocol, each participant express its trust assumptions in the form of an \textit{unique node list} (UNL), a subset of nodes of the network. In order to accept transactions, a node needs to "hear" from at least $80\%$ of its UNL, and according to the original white paper \cite{schwartz2014ripple}, assuming that up to $20\%$ of the nodes in an UNL might be Byzantine, the overlap between every pair of UNL's needed to prevent forks was believed to be $\geq 20\%$.
The original protocol description appeared to be sketchy and informal, and later works detailed the functioning of the protocol and helped to clarify under which conditions its \textit{safety} and \textit{liveness} properties hold \cite{armknecht2015ripple,chase2018analysis,mauri2020formal,amores2020security}.
In particular, it has been spotted~\cite{armknecht2015ripple} that its safety properties can be violated (a \emph{fork} can happen) with as little as $20\%$ of UNLs overlap, even if there are no Byzantine nodes.
It then establishes an overlap bound of $>40\%$ to guarantee consistency without Byzantine faults.
In a further analysis, assuming that at most $20\%$ of nodes in the UNLs are Byzantine, \cite{chase2018analysis} suggests an overlap of $>90\%$ in order to prevent forks, but also provide an example in which the liveness of the protocol is violated even with $99\%$ of overlap.
Recently, a formalization of the algorithm was presented in \cite{amores2020security}, and a better analysis of the correctness of the protocol in the light of an \textit{atomic broadcast} abstraction was given by Amores-Cesar et al.~\cite{amores2020security}.
The Stellar consensus protocol~\cite{mazieres2015stellar} introduces the \textit{Federated Byzantine Quorum System} (FBQS).
A quorum $Q$ in the FQBS is a set that includes a \emph{quorum slice} (a trusted subset of nodes) for every node in $Q$.
Correctness of Stellar depends on the individual trust assumptions and are only guaranteed for nodes in the so called \textit{intact set}, which is, informally, a set of nodes trusting the "right guys".
Garc\'ia-P\'erez and Gotsman~\cite{garcia2018federated} formally argue about Stellar consensus, by relating it to Bracha's Broadcast Protocol~\cite{bracha1987asynchronous}, build on top of a FBQS.
The analysis has been later extended~\cite{garcia2019deconstructing} to a variant of state-machine replication protocol that allows \emph{forks}, where
disjoint intact sets may maintain different copies of the system state.
Cachin and Tackmann~\cite{CT19} defined the notion of \textit{Asymmetric Quorum Systems}, based on individual adversary structures.
They introduced a variant of broadcast whose correctness is restricted to a \emph{guild}, a subset of nodes that, similarly to the intact nodes in the Stellar protocol, have the "right" trust assumptions. Executions with a guild also ensure consistency (correct processes do not deliver distinct values). In our approach, we relax the consistency property, allowing for more flexible trust assumptions, while using accountability to ensure correctness for every live correct process.
In the similar vein, Losa et al.~\cite{losa2019stellar}, define the quorum system used by Stellar using the notion of a \textit{Personal Byzantine Quorum System} (PBQS), where every process chooses its quorums with the restriction that if $Q$ is a quorum for a process $p$, then $Q$ includes a quorum for every process $q' \in Q$.
They show that for any quorum-based algorithm (close to what we call an algorithm satisfying the Local Progress property), consensus is not achievable in partially synchronous systems where two processes have quorums not intersecting on a correct process.
The paper also determines the conditions under which a subset of processes can locally maintain safety and liveness, even though the system might not be globally consistent. We use a similar approach in the context of broadcast, and in addition to a relaxed consistency guarantee, we also parameterize the level of disagreement in the network using the individual trust assumptions.
In the context of distributed systems, accountability has been proposed as a mechanism to detect ``observable'' deviations of system nodes from the algorithms they are assigned with~\cite{detection-case,detection-problem,peerreview}.
Recent proposals~\cite{polygraph,rala} focus on \emph{application-specific} accountability that only heads for detecting misbehavior that affects correctness of the problem to be solved, e.g., consensus~\cite{polygraph} or lattice agreement~\cite{rala}.
Our $k$-CRB algorithm generally follows this approach, except that it implements a \emph{relaxed} form of broadcast, but detects violations that affect correctness of the stronger, conventional reliable broadcast~\cite{cachin2011introduction}.
\section{Concluding Remarks}
\label{sec:conclusion}
In this paper, we address a realistic scenario in which correct processes choose their trust assumptions in a purely decentralized way.
The resulting structure of their trust relations may cause inevitable violations of consistency properties of conventional broadcast definitions.
Our goal is to precisely quantify this inconsistency by considering relaxed broadcast definitions: $k$-consistent broadcast and $k$-consistent reliable broadcast.
In case the broadcast source is Byzantine, the abstractions allow correct processes to deliver up to $k$ different values.
We show that $k$, the optimal ``measure of inconsistency'', is the highest independence number over all graphs $G_{F,S}$ in a family $\mathcal G_{\mathcal Q,\mathcal F}$ determined by the given trust assumptions $(\mathcal Q,\mathcal F)$.
We show that this optimal $k$ can be achieved by a \emph{$k$-consistent reliable broadcast} protocol that, in addition to $k$-consistency also provides a form of accountability: if a correct process delivers a value, then every live correct process either delivers some value or detects the source to be Byzantine.
A natural question for the future work is to quantify inconsistency in higher-level abstractions, such as distributed storage or asset-transfer systems~\cite{cons-crypto,astro-dsn} that can be built atop the relaxed broadcast abstractions.
Another interesting direction would be in self-reconfigurable systems~\cite{rala}: since we expect the system to admit disagreement, once a Byzantine process is detected, other participants may want to update their trust assumptions.
It is also extremely appealing to generalize the very notion of a quorum system to \emph{weighted} quorums, where the contribution of a quorum member is proportional to its \emph{stake} in an asset transfer system~\cite{pastro-tr-21}.
This opens a way towards \emph{permissionless} asset transfer systems with relaxed guarantees.
\bibliographystyle{abbrv}
| {'timestamp': '2021-09-20T02:19:48', 'yymm': '2109', 'arxiv_id': '2109.08611', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08611'} | arxiv |
\subsection{Primitive Grasp Dataset}
To leverage the human ability to find gripper configurations belonging to the grasp space, an object dependent primitive grasp dataset is built. A primitive grasp is a handcrafted gripper configuration, with its pose and spread angle human-chosen so that it is collision free and likely to grasp the object. The spread angle is chosen between four discrete values corresponding to main gripper internal layouts: $\theta = 0$, $\theta = \pi/6$, $\theta = \pi/4$, and $\theta = \pi/2$.
In this work, such primitives are gathered on three different objects:
\begin{itemize}
\item a connector bent pipe
\item a pulley
\item a small cinder block
\end{itemize}
Their 3D meshes used in the simulation in their different stable positions are visible on Fig. \ref{fig:object_stable}. Those objects were chosen for their relative complexity and diversity in terms of shapes.
\begin{figure}[htb]
\setlength{\tabcolsep}{0pt}
\renewcommand{\arraystretch}{0}
\centering
\begin{tabular}{>{\centering\arraybackslash}m{1.8cm} c c c}
bent pipe & \raisebox{-0.5\height}{\includegraphics[width=0.25\linewidth, keepaspectratio]{coude1R.png}} &
\raisebox{-0.5\height}{\includegraphics[width=0.25\linewidth, keepaspectratio]{coude2R.png}} &
\\
cinder block & \raisebox{-0.5\height}{\includegraphics[width=0.25\linewidth, keepaspectratio]{parpaing1R.png}} &
\raisebox{-0.5\height}{\includegraphics[width=0.25\linewidth, keepaspectratio]{parpaing2R.png}} &
\raisebox{-0.5\height}{\includegraphics[width=0.25\linewidth, keepaspectratio]{parpaing3R.png}}
\\
pulley & \raisebox{-0.5\height}{\includegraphics[width=0.25\linewidth, keepaspectratio]{poulie1R.png}} &
\raisebox{-0.5\height}{\includegraphics[width=0.25\linewidth, keepaspectratio]{poulie2R.png}} &
\end{tabular}
\caption{The chosen objects and their frame $F_{obj}$ in their different stable positions.}
\label{fig:object_stable}
\end{figure}
A set of primitive gripper configurations is determined for each of those objects for each of their stable position. These primitive gripper configurations can be sorted in different grasp types presented on Fig. \ref{fig:grasp_type}. For each of these grasp type, several variants are manually created.
For each object is gathered the following number of primitive grasps:
\begin{itemize}
\item bent pipe: 145 samples
\item cinder block: 141 samples
\item pulley: 118 samples
\end{itemize}
Around one hour is needed for a human operator to register the primitives for a given object.
\begin{figure}[htb]
\setlength{\tabcolsep}{0pt}
\renewcommand{\arraystretch}{0}
\centering
\begin{tabular}{c c c c c}
\includegraphics[width=0.19\linewidth, keepaspectratio]{prise_coude1.png} & \includegraphics[width=0.19\linewidth, keepaspectratio]{prise_coude2.png} & \includegraphics[width=0.19\linewidth, keepaspectratio]{prise_coude3.png} &
\includegraphics[width=0.19\linewidth, keepaspectratio]{prise_coude4.png} &
\includegraphics[width=0.19\linewidth, keepaspectratio]{prise_coude5.png}
\\
\includegraphics[width=0.19\linewidth, keepaspectratio]{prise_parpaing1.png} &
\includegraphics[width=0.19\linewidth, keepaspectratio]{prise_parpaing2.png} &
\includegraphics[width=0.19\linewidth, keepaspectratio]{prise_parpaing3.png} &
\includegraphics[width=0.19\linewidth, keepaspectratio]{prise_parpaing4.png} &
\includegraphics[width=0.19\linewidth, keepaspectratio]{prise_parpaing5.png}
\\
& \includegraphics[width=0.19\linewidth, keepaspectratio]{prise_poulie1.png} &
\includegraphics[width=0.19\linewidth, keepaspectratio]{prise_poulie2.png} &
\includegraphics[width=0.19\linewidth, keepaspectratio]{prise_poulie3.png} &
\end{tabular}
\caption{Primitive grasp types for the three chosen objects. On the first row the grasp types for the bent pipe, on the second row for the cinder block, and on the third row for the pulley}
\label{fig:grasp_type}
\end{figure}
The dataset stores the eight parameters describing each primitive grasp along with the four parameters of the tabletop plane Cartesian equation in object frame $F_{obj}$. Indeed, many objects have different possible stable positions on the table. This is a critical information to avoid collisions with it. Some grasps may collide with the table in a given stable position, while being suitable for an other stable position.
Expressing the grasp configuration in the object frame is still useful as it allows an invariance to a position change and to a rotation around a vertical axis.
\subsection{Human-initiated Grasp Generator VAE (HGG)}
The goal of the Human-initiated Grasp Generator VAE (HGG) is to infer the correlations existing between the parameters of different grasp primitives to learn a model of the grasp space. Such correlations exist, as primitive grasps are in the grasp space, and this space is a subset of the gripper configuration space. The HGG is able to use those correlations to map the grasp space in its latent space. This model can be used to generate efficiently new configurations that are likely to be in the grasp space.
A distinct HGG is trained on the primitive grasp dataset for each object. Its inputs and outputs are shown in Fig. \ref{fig:archi} along with its global architecture. Before the training, the inputs and outputs data are normalized. This allows a faster training as the network does not have to scale its data by itself. For the gradient descent during the training, a Mean Square Error (MSE) is computed for each gripper parameter. Each of these errors is averaged on each batch. The global loss is computed as the sum of these averaged errors together with the KL divergence loss.
To make sure that the quaternion outputs by the decoder is a unit one, a custom activation function is used to normalize it on the output layer of the decoder.
\subsection{Latent Space Produced with Two Latent Variables}
\begin{figure}[htb]
\setlength{\tabcolsep}{0pt}
\renewcommand{\arraystretch}{0}
\centering
\begin{tabular}{c c c c c}
\includegraphics[width=0.19\linewidth, keepaspectratio]{grasp_-07_07.png} &
\includegraphics[width=0.19\linewidth, keepaspectratio]{grasp_-038_092.png} &
\includegraphics[width=0.19\linewidth, keepaspectratio]{grasp_0_1.png} &
\includegraphics[width=0.19\linewidth, keepaspectratio]{grasp_038_092.png} &
\includegraphics[width=0.19\linewidth, keepaspectratio]{grasp_07_07.png}
\\
\includegraphics[width=0.19\linewidth, keepaspectratio]{grasp_-092_038.png} &
\includegraphics[width=0.19\linewidth, keepaspectratio]{grasp_-035_035.png} &
\includegraphics[width=0.19\linewidth, keepaspectratio]{grasp_0_05.png} &
\includegraphics[width=0.19\linewidth, keepaspectratio]{grasp_035_035.png} &
\includegraphics[width=0.19\linewidth, keepaspectratio]{grasp_092_038.png}
\\
\includegraphics[width=0.19\linewidth, keepaspectratio]{grasp_-1_0.png} &
\includegraphics[width=0.19\linewidth, keepaspectratio]{grasp_-05_0.png} &
\includegraphics[width=0.19\linewidth, keepaspectratio]{grasp_0_0.png} &
\includegraphics[width=0.19\linewidth, keepaspectratio]{grasp_05_0.png} &
\includegraphics[width=0.19\linewidth, keepaspectratio]{grasp_1_0.png}
\\
\includegraphics[width=0.19\linewidth, keepaspectratio]{grasp_-092_-038.png} &
\includegraphics[width=0.19\linewidth, keepaspectratio]{grasp_-035_-035.png} &
\includegraphics[width=0.19\linewidth, keepaspectratio]{grasp_0_-05.png} &
\includegraphics[width=0.19\linewidth, keepaspectratio]{grasp_035_-035.png} &
\includegraphics[width=0.19\linewidth, keepaspectratio]{grasp_092_-038.png}
\\
\includegraphics[width=0.19\linewidth, keepaspectratio]{grasp_-07_-07.png} &
\includegraphics[width=0.19\linewidth, keepaspectratio]{grasp_-038_-092.png} &
\includegraphics[width=0.19\linewidth, keepaspectratio]{grasp_0_-1.png} &
\includegraphics[width=0.19\linewidth, keepaspectratio]{grasp_038_-092.png} &
\includegraphics[width=0.19\linewidth, keepaspectratio]{grasp_07_-07.png}
\end{tabular}
\caption{Gripper configurations generated when visiting a two dimensional latent space. The central image is the point (0, 0) in latent space. The inner and outer image rings around it correspond to points evenly distributed on circles of diameter respectively 0.5 and 1 in latent space. Here, translations along the image plan normal are not visible, which explains some visually almost identical configurations.}
\label{fig:grasp_model}
\end{figure}
The HGG learns to model the grasp space in its latent space. By sampling values in it, one can generate new gripper configurations that are likely to belong to the grasp space. On Fig. \ref{fig:grasp_model} is shown the obtained gripper configurations when visiting a two dimensional latent space for one stable position of the bent pipe. As some configurations may not lead to successful grasps, or may be in collision with the object or the environment, only pre-grasp configuration are shown (that is before closing the fingers), with collisions disabled.
For this stable position, it appears that the latent variable displayed on the horizontal axis on Fig \ref{fig:grasp_model} encodes mainly the direction from which the bent pipe will be grasped: the two rearrangeable fingers on the concave side or on the convex side. The other latent variable seems to encode mainly translations. On the top-right corner appears a configuration corresponding to the first bent pipe primitive grasp type (shown on Fig. \ref{fig:grasp_type}). The rest of the right side configurations correspond to the third grasp type, and the left side configurations to the second grasp type.
\subsection{Simulation Setup}
The three-fingered gripper considered in the following has an underactuated and adaptive behavior that allows its natural adaptation to the object geometry, without the need to carefully control each joint, thus increasing the robustness of the grasp.
This gripper has two joints on each finger and one actuator per finger to control both joints. The second (distal) phalanx starts moving when the applied effort on the finger is above a given force threshold. A fourth actuator allows to control the spread angle $\theta$ between two fingers (see Fig. \ref{fig:gripper_info}).
This gripper is mounted as end effector of a six degrees of freedom industrial robot arm.
The simulation setup described above is implemented with Gazebo simulator \citep{koenig_design_2004}. A picture of this simulated setup is displayed in Fig. \ref{fig:gripper_info}.
\subsection{Problem Statement}
\label{subsec:prob_statement}
An object is placed on a table in the workspace of the considered robotic setup. It is assumed that the object geometry is known, as well as the pose in the scene of its associated frame $F_{obj}$ thanks to exteroceptive vision system such as in \cite{drost_model_2010} for example.
In the following, a grasp configuration is a gripper configuration that is able to grasp the object without colliding with the table. It is defined as follows by eight parameters:
\begin{itemize}
\item the pose of the gripper frame $F_{grip}$,
\[
(x, y, z, q_x, q_y, q_z, q_w) \in \mathbb{R}^{3} \times SO(3)
\]
with the orientation expressed in quaternion convention;
\item the spread angle $\theta$, as shown in Fig. \ref{fig:gripper_info}.
\end{itemize}
The dimensionality of this configuration space is high (seven dimensions), but this allows to fully leverage the grasping ability and kinematic potential of the gripper. Thus, the grasp space is a subset of this gripper configuration space, with an additional constraint that every gripper configuration is able to grasp the object without colliding with the table. The goal is to model and explore this grasp space.
To locate the gripper, a dedicated frame $F_{grip}$ situated between the fingers in front of the palm is used. This frame is displayed in Fig. \ref{fig:gripper_info}. Gripper poses are expressed relatively to the object frame $F_{obj}$, in order to be invariant to object poses.
\begin{figure}[ht!]
\centering
\subfigure[Pose of the frame $F_{grip}$ used to locate the end-effector relatively to $F_{obj}$. \label{subfig:gripper_frame}]{\includegraphics[width=0.632\linewidth, keepaspectratio]{simuR.png}}
\subfigure[Spread angle $\theta$. \label{subfig:gripper_spread}]{\includegraphics[width=0.344\linewidth, keepaspectratio]{spread_angle.png}}
\caption{Gripper frame and spread angle.}
\label{fig:gripper_info}
\end{figure}
\subsection{Variational Autoencoders}
Variational autoencoders (VAE) are a derivative of classic autoencoders. In addition to learning a compressed representation of the training data as a classic autoencoder, a VAE allows to generate consistent data from its latent space reliably.
The goal of a VAE is to infer the latent variables that are behind the training dataset, so that a latent space with fewer dimensions than the original space can be created. Sampling in it will generate a new data distribution that resembles to the training dataset one. In this work, this allows to create a model of the grasp space, from which new gripper configurations can be generated.
In a VAE, among other features, a supplementary term is added in the loss function: the Kullback-Leibler (KL) divergence \citep{kingma_auto_2014}. This term helps the data to be represented as a normal distribution in its latent space, and thus regularizing it.
\section{Introduction}
\input{introduction_short.tex}
\section{Problem Statement \& Framework}
\label{sec:statement}
\input{prob_statement.tex}
\section{Method Description}
\label{sec:method_desc}
\input{method_desc.tex}
\section{HGG Tuning to Model Efficiently the Grasp Space}
\label{sec:vae}
\input{vae_tuning.tex}
\section{Conclusion}
\input{conclusion.tex}
\subsection{Trade-Off Between Reconstruction and Regularity}
One of the distinctive features of a VAE is that its loss function combines a reconstruction cost and a regularization cost, the KL divergence cost. This leads the training process to converge to a trade-off between reconstruction and regularity. The reconstruction is the ability to accurately reproduce on the output the input data. The regularity is the fact that the input data are homogeneously distributed in each latent variable (here, following a normal distribution), and that latent variables are disentangled. A side effect of those constraints is that the network is pushed to use as few latent variables as possible to represent the data. For the HGG, both terms are important: a good reconstruction is needed as it allows to capture faithfully all the primitive data variability, and a good regularity is also needed as it reduces the data distribution sparsity, and thus the risk of generating inconsistent configurations.
In \cite{Higgins_beta_2017}, the authors introduced a coefficient on the KL divergence term that allows to adjust this trade-off. Increasing this coefficient will put higher priority on the KL divergence term, and thus increases the regularity at the expense of the reconstruction. A too high coefficient on this term can push the network to ignore the data variability along a given axis to homogenize the data in its latent variables and disentangle them, leading to poor reconstruction. Conversely, a too low coefficient will allow a very accurate reconstruction, but the latent variables will be more entangled and the data distribution in them will be sparser.
The optimal value of the coefficient depends mainly on the latent space dimension. In \cite{Higgins_beta_2017}, they recommend a value greater than 1, but they use the VAE for image generation, which involve generally a latent space of greater dimension than for the presented use case. For the HGG, a value below 1 is mandatory to keep an acceptable reconstruction loss.
\subsection{Network Size}
To increase reconstruction with less impact on regularity than the KL coefficient, one can increase the network size, that is the number of neurons in the different layers, or the number of layers. Indeed, it increases the number of network trainable parameters, and thus the complexity of the functions that it is able to approximate. However, it increases the computational cost of both the learning phase and the inference phase, and the memory required to store model. Moreover, the more parameters the network has, the more training data it needs for a proper training. For the HGG use case, there are very few training data, which limit the size of the network.
For the architecture presented in Fig. \ref{fig:archi}, a good trade-off between computation cost and general performances is around $30\,000$ parameters for the whole VAE, that is both encoder and decoder. Indeed, the reconstruction starts to improve less significantly beyond this threshold.
\subsection{Grasp Space Dimension \& Latent Space Dimension}
The grasp space is a subset of the gripper configuration space (see subsection \ref{subsec:prob_statement}). Thus, it has at most 7 dimensions, but its true size is a priori unknown. As the goal is to map the grasp space in the HGG latent space, it is important that the number of latent variables used by the HGG among the available ones is at least equal to the grasp space dimension. Otherwise, there will be information loss due to the compression caused by the projection of the grasp space into a smaller space. Although conservative, it is sub-optimal to let the HGG find by itself the required number of latent variables needed to map the grasp space, by letting the latent space dimension be equal to the one of the gripper configuration space. Indeed, even if the KL divergence term in the cost function will push the network to use as few latent variables as possible, increasing the number of available latent variables increases the chances to converge toward a cost function local minimum where the network uses more latent variable than needed. As the used latent space dimension is greater, the data distribution inside it is also sparser, which have the same effect as a too low coefficient on the KL divergence.
Thus, it is useful to know an approximation of the dimension of the grasp space. Here, a dimensional analysis tool has been chosen, the kernel-PCA \citep{Scholkopf_kernel_1999}. Kernel-PCA is an extension of the PCA to non-linear relations. Indeed, the grasp space is probably a submanifold of the gripper configuration space, which probably involves non-linear relations between the parameters of this space.
The kernel-PCA implemented in scikit-learn is used \citep{scikit-learn}. The algorithm is run for each object, taking as input the list of gripper configurations in the primitive grasp dataset. The grasp space dimension is determined as the number of eigenvectors of the centered kernel matrix needed to retrieve 90\% of the information, by looking at their eigenvalues. Indeed, it means that the kernel-PCA can explain 90\% of the data variability with the given number of eigenvectors. The outputted result depend on the object: 3 dimensions for the pulley, and 4 dimensions for the bent pipe and the cinder block.
Therefore, this can serve as an upper bound for the optimal latent space dimension. Indeed, the HGG has a supplementary information: the tabletop Cartesian equation, and may use it to learn a more compact representation than the one found by the kernel-PCA.
\subsection{Overview}
In table \ref{fig:summary} is summarized the influence of the three hyperparameters on the chosen indicators. For this evaluation, trials were conducted with hyperparameter combinations among the following ranges:
\begin{itemize}
\item network size between $12\,000$ and $30\,000$ parameters;
\item latent space dimension between 2 and 6;
\item KL divergence coefficient between $0.0002$ and $0.01$.
\end{itemize}
\begin{table}[htb]
\centering
\caption{Spearman correlation coefficients between the hyperparameters and the indicators.}
\input{summary_table.tex}
\label{fig:summary}
\end{table}
\begin{table}[htb]
\centering
\caption{performances of the HGG for the selected hyperparameters: $30\,000$ network parameters, 3 latent variables (that are all used), and a KL divergence coefficient of $0.0005$. The mean errors are measured on the training data.}
\input{hgg_perf.tex}
\label{fig:hgg_perf}
\end{table}
In table \ref{fig:hgg_perf} are shown the performances corresponding to the set of hyperparameters achieving the best trade-off between the reconstruction and the proportion of generated successful grasps. To avoid arm kinematic reachability issues, as gripper configurations are in object frame, each generated configuration is tested for different object orientations relative to the robot. The main cases of failing grasps are found when transitioning between different grasp types, and with the fifth grasp type of the bent pipe (Fig. \ref{fig:grasp_type}, top right) where one of the bottom finger can collide with the table in the pre-grasp phase for some gripper orientation variations. | {'timestamp': '2021-09-20T02:16:19', 'yymm': '2109', 'arxiv_id': '2109.08504', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08504'} | arxiv |
\section{Introduction}
The age of information metric has been introduced in \cite{Kaul12a} to measure information timeliness in real-time status updating systems and has a wide range of promising applications in emerging time-critical technologies including next-generation holographic communications, autonomous systems, and smart factories. Age of information metric studies lie at the intersection of information, communication, networking, and queueing theory fields \cite{Kosta_Survey, SunSurvey, YatesSurvey}.
The original age metric measures the time passed since the most recent information at the monitor was generated at the source node. This age metric increases linearly in time in the absence of update deliveries at the monitor. When an update is received, the age value drops to the age of the received update. This evolution in time demonstrates the fundamental limitation of the original age metric, which is the assumption that the age at the monitor continues to increase as time passes irrespective of any changes at the source side in the underlying source process. That is, even if the source information does not change and the monitor has the most up-to-date information, as time passes, the original age metric deems monitor's knowledge about the source process \emph{stale}. This may not necessarily be the case in many applications, including content delivery services and surveillance systems. To overcome this inherent challenge, in the age of information literature, several variants of the original age metric have been proposed. A common feature of these recently proposed age variants is the fact that the age of the monitor stays the same until the information at the source changes even if no updates are received at the monitor. Among these are binary freshness metric \cite{cho03, kolobov19a, Bastopcu2021, Bastopcu20e, Kaswan21, Bastopcu21f}, age of synchronization \cite{Zhong18c}, and age of incorrect information \cite{Maatouk20b, Maatouk20a, Kam20a}.
Similar in spirit, recently, a new age metric called \emph{version age} has appeared in the literature \cite{Yates21, Eryilmaz21}. In the version age context, each update at the source is considered a version change so that the version age counts how many versions out-of-date the information at the monitor is, compared to the version at the source. Unlike the original age metric, the version age has discrete steps such that the version age of a monitor increases by one when the source generates a newer version, i.e., fresher information. In between version changes at the source, version age of the monitor stays the same indicating that the monitor still has the most recent information. A predecessor of version age has appeared in \cite{Bastopcu20c}, which considers timely tracking of Poisson counting processes by minimizing the count difference, i.e, version difference, between the process and its estimate.
Recently, reference \cite{Yates21} has used the version age metric to characterize timeliness in memoryless gossip networks composed of $n$ arbitrarily connected nodes. In \cite{Yates21}, the source sends information to the receiver nodes by implementing a Poisson updating mechanism, i.e., with exponential inter-update times at each receiver node. Similar Poisson updating schemes have been investigated in the age literature in the context of social networks \cite{Ioannidis09}, timely tracking \cite{Bastopcu20c, Bastopcu21b}, and timely cache updating \cite{Bastopcu2021, Bastopcu20e, Kaswan21}. In addition to source delivering updates to the receiver nodes, each node in \cite{Yates21} relays their stored version of the source information to their neighboring nodes. Also referred to as \emph{gossiping}, this additional information exchange among the nodes improves the age scaling at the nodes since each node can receive updates from its neighbors as well as from the source node. As a result of this gossiping, \cite{Yates21} shows that the average version age scales as $O(\sqrt{n})$ in a bi-directional ring network and as $O(\log n)$ in a fully connected network, where $n$ is the number of nodes; note that the average version age would scale as $O(n)$ without gossiping, i.e., if the network is disconnected.
There have been significant efforts in the age literature to characterize and improve the average age scaling in large networks considering the classical age metric with possibly many source-destination pairs. Recent works have achieved $O(1)$ scaling in multicast networks \cite{Zhong17a, Zhong18b, Buyukates18, Buyukates18b, Buyukates19} using a centralized transmission scheme administered by the source, and $O(\log n)$ scaling in distributed peer-to-peer communication networks \cite{Buyukates19b, Buyukates21b} using a hierarchical local cooperation scheme.
\begin{figure}[t]
\centerline{\includegraphics[width=0.8\columnwidth]{tiered_network_v21.eps}}
\caption{Tiered network model where blue node at the center represents the source, yellow nodes represent the cluster heads, and green nodes represent the end users. Here, nodes in each cluster form a bi-directional ring network. Other possible network topologies within a cluster are shown in Fig.~\ref{Fig:netw_types}.}
\label{Fig:disconnected}
\end{figure}
Inspired by these, in this work, our aim is to study \emph{version age scaling} in more general gossip network models which exhibit a community structure; see Fig.~\ref{Fig:disconnected}. In our model, there is a single source node that generates updates following a Poisson process. Each such update constitutes a newer version of the underlying information process. The source updates multiple distinct communities regarding the underlying process. In our work, a community represents a set of receiver nodes clustered together which can only interact with each other. Each cluster has a dedicated cluster head, which serves that particular cluster. Akin to base stations in a cellular network, cluster heads act as gateways between the source and the receiver nodes in each cluster. Unlike the model in \cite{Yates21}, the source cannot directly deliver updates to receiver nodes in our model. Instead, source updates need to go through the corresponding cluster head to reach the receiver nodes in each cluster. There can be various degrees of gossip in each cluster, which we model by disconnected, uni-directional ring, bi-directional ring, and fully connected network topologies; see Fig.~\ref{Fig:netw_types}. Based on the underlying connectivity within clusters, we characterize the version age experienced by each node. In doing that, we employ the stochastic hybrid systems (SHS) approach \cite{Teel06, Hespanha07, Yates17a, Yates18b, Dogan20, Moltafet21} to develop recursive formulas that enable us to characterize the version age in arbitrarily connected clustered gossip networks.
\begin{figure}[t]
\centerline{\includegraphics[width=0.8\columnwidth]{network_types_v4.eps}}
\caption{Different network topologies that can be used within each cluster: (a) disconnected, (b) uni-directional ring, (c) bi-directional ring, and (d) fully connected. Fig.~\ref{Fig:disconnected} uses the one in (c).
In this figure, cluster size is $k=6$.}
\label{Fig:netw_types}
\end{figure}
Additional hop constituted by the cluster heads between the source and the end-nodes presents us with opportunities to optimize the average version age scaling by carefully tuning the number of clusters and the cluster size. Specifically, our results indicate that even if the nodes within each community forego gossiping, i.e., disconnected networks within each cluster, we can achieve $O(\sqrt{n})$ scaling as opposed to $O(n)$. In addition, we obtain the same $O(\log n)$ scaling in the case of fully connected communities using fewer connections within clusters than \cite{Yates21}, and further reduce the scaling result in ring networks to $O(n^{\frac{1}{3}})$ from $O(\sqrt{n})$ in \cite{Yates21}.
So far, the cluster heads do not participate in gossiping, i.e., cluster heads among themselves form a disconnected topology. To further improve the version age at the receiver nodes, next, we characterize the average version age and its scaling when the cluster heads form a ring network among themselves and exchange information. In that case, each cluster head uses some of its update rate to relay updates to its neighboring cluster heads while its remaining update rate is used to relay updates to the receiver nodes within its cluster. Thanks to the increased communication among the cluster heads, we can further improve the version age scaling to $O(n^{\frac{1}{3}})$ for disconnected networks within each cluster; to $O(n^{\frac{1}{4}})$ in the case of ring networks within each cluster. For the setup with a ring network in each cluster, we find the version age optimal update rate allocation at each cluster head. Interestingly, in the case of fully connected networks within each cluster, we find that the additional information exchange due to the gossip among the cluster heads does not improve the version age scaling. That is, the version age of an end user still scales as $O(\log n)$ even though cluster heads participate in gossip.
Motivated by the tiered structure in the clustered network model, next, we introduce hierarchy to our clustered network model. In this case, we forego cluster heads, and carefully place clusters of nodes in a hierarchical manner. That is, each node in a particular hierarchy level acts as a cluster head to a distinct cluster of nodes in the next hierarchy level. At the first level of hierarchy, we have a single cluster of $k_1$ nodes, each of which have a single cluster of $k_2$ nodes at the second level, and so on. Within the context of hierarchical clustered gossip networks, we consider a ring network in each cluster and show that the $O(\sqrt{n})$ scaling result of \cite{Yates21} and our cluster head-aided scaling result of $O(n^\frac{1}{3})$ for ring networks can be improved to $O(n^{\frac{1}{2h}})$ without the use of dedicated cluster heads, where $h$ denotes the number of hierarchy levels. For convenience, we provide the summary of all scaling results for version age in Table~\ref{table:results}. Finally, through numerical evaluations, we determine the version-age optimum cluster sizes for varying update rates employed by the source, cluster heads, and the nodes within each cluster.
\begin{table}[t]
\small
\centering
\begin{center}
\begin{tabular}{ | l | c | c | c |}
\hline
& $ \text{disconnected}$ & $\text{ring}$ & $\text{fully connected}$ \\ \hline
$\text{no clustering as in \cite{Yates21}}$
& $O(n)$ & $O(\sqrt{n})$ & $O(\log n)$ \\ \hline
$\text{clustered networks}$
& $O(\sqrt{n})$ & $O(n^{\frac{1}{3}})$ & $O(\log n)$ \\ \hline
$\text{clustered networks with connected cluster heads}$
& $O(n^{\frac{1}{3}})$ & $O(n^{\frac{1}{4}})$ & $O(\log n)$ \\ \hline
$\text{$h$-level hierarchical clustered networks }$
& $-$ & $O(n^{\frac{1}{2h}})$ & $-$ \\ \hline
\end{tabular}
\end{center}
\caption{The summary of the scaling of version age in gossip networks. }
\label{table:results}
\vspace{-0.5cm}
\end{table}
The rest of this paper is organized as follows: In Section~\ref{sect:model}, we present our clustered gossip network model and the version age metric. In Section~\ref{sect:comm_age}, we characterize the average version age in clustered gossip networks considering disconnected, ring and fully connected network topologies in each cluster, and determine the corresponding version age scaling at a particular receiver node. In Section~\ref{sect:conn_ch}, we investigate the version age scaling improvement when the cluster heads are allowed to exchange information among themselves. Section~\ref{sect:hier} introduces the hierarchy concept into the considered clustered gossip network model to further improve the average version age performance and Section~\ref{sect:num_res} finds the optimal number of clusters and cluster sizes through numerical simulations as a function of the update rates at the source, cluster heads and nodes. Finally, we conclude this paper in Section~\ref{sect_discuss_conc} with a summary of the main results along with a discussion of some future directions.
\section{System Model and the Age Metric}\label{sect:model}
We consider a system where a network of $n$ nodes is divided into $m$ clusters, each consisting of $k$ nodes such that $n = m k$ with $k, m \in \mathbb{Z}$; see Fig.~\ref{Fig:disconnected}. Each cluster is served by a distinct cluster head, which takes updates from the source and distributes them across that cluster. The source process is updated as a rate $\lambda_e$ Poisson process. The source has a total update injection rate of $\lambda_s$, which is uniformly distributed across cluster heads such that each cluster head is updated as a rate $\frac{\lambda_s}{m}$ Poisson process. From each cluster head to its corresponding cluster, the total update injection rate is $\lambda_{c}$ and this rate is uniformly allocated across the nodes in that cluster. That is, each node $i$ receives an update from its cluster head as a rate $\frac{\lambda_{c}}{k}$ Poisson process with $i \in \mathcal{N} \triangleq \{1, \ldots, n\}$.
Nodes in each cluster are connected to each other based on a connection graph. We consider varying levels of connectivity among nodes within each cluster. These are disconnected, uni-directional ring, bi-directional ring, and fully connected networks, which are shown in Fig.~\ref{Fig:netw_types} for a cluster of $k=6$ nodes. Updates received from the cluster head associated with each cluster are distributed across that cluster by utilizing the connections between the nodes. A node $i$ updates another node $j$ as a rate $\lambda_{ij}$ Poisson process. Each node in this system has a total update rate of $\lambda$, which is uniformly allocated to its neighboring nodes. That is, in the uni-directional ring, each node updates its neighbor node as a rate $\lambda$ Poisson process, whereas in bi-directional ring, each node has two neighboring nodes, each of which is updated as a rate $\frac{\lambda}{2}$ Poisson process. In the fully connected cluster, each node has $k-1$ neighbors each of which is updated as a rate $\frac{\lambda}{k-1}$ Poisson process. As a result of these local connections within a cluster, a node can receive different versions of the source update from its neighboring nodes in addition to the source updates received via its cluster head.
To model the age at each node, we use the version age metric \cite{Yates21, Eryilmaz21}. We denote the version of the update at the source as $N_s(t)$, at cluster head $c$ as $N_{c}(t)$, with $c \in \mathcal{C} \triangleq \{1, \ldots, m\}$, and at node $i$ as $N_i(t)$, with $i \in \mathcal{N}$, at time $t$. The version age at node $i$ is given by $\Delta_i(t) = N_s(t)- N_i(t)$. Similarly, the version age at cluster head $c$ is $\Delta_{c}(t) = N_{s}(t)- N_c(t)$. When node $i$ has the same version as the source, its version age becomes zero, i.e., $\Delta_i(t) = 0$. When the information at the source is updated, version ages at the cluster heads and the nodes increase by 1, e.g., $\Delta'_{c}(t) =\Delta_{c}(t)+1$. Each node $i$ can get updates either from its cluster head or the other nodes that it is connected to within its cluster. When node $i$ gets an update from its cluster head, its version age becomes
\begin{align}
\Delta'_i(t) = \min\{\Delta_{c}(t),\Delta_i(t)\} = \Delta_{c}(t). \label{clusterhead_update}
\end{align}
Last equality in (\ref{clusterhead_update}) follows since nodes in a cluster receive source updates through their cluster head so that they have either the same version or older versions of the information compared to their cluster head. When node $i$ receives an update from node $j$, its version age becomes
\begin{align}
\Delta'_i(t) = \min\{\Delta_{i}(t),\Delta_j(t)\}. \label{node_update}
\end{align}
That is, node $i$'s version age is updated only if node $j$ has a newer version of the source information. Otherwise, the version age at node $i$ is not updated.
\section{Version Age with Community Structure}\label{sect:comm_age}
In this section, we characterize the limiting version age of each node $i$, denoted by
\begin{align}
\Delta_i = \lim_{t \to \infty} \mathbb{E}[\Delta_i(t)], \quad i \in \{1, \ldots, n\},
\end{align}
considering various network topologies for the clusters. Since the network model in each cluster is identical and within each cluster the network is symmetric for each of the network topologies, age processes $\Delta_i(t)$ of all users are statistically identical. Thus, in the ensuing analysis, we focus on a single cluster $c \in \mathcal{C}$ and find the average version age of a node from that cluster. For this, we follow the construction in \cite{Yates21} and express ${\Delta}_i$ in terms of ${\Delta}_S$, which denotes the average version age of an arbitrary subset $S$ of the nodes in cluster $c$, where
\begin{align}
{\Delta}_S(t) \triangleq \min_{j \in S} \Delta_j (t).
\end{align}
We recall the following definitions from \cite{Yates21}: $\lambda_i(S)$ denotes the total update rate at which a node $i$ from cluster $c$ updates the nodes in set $S$. We have
\begin{align}
\lambda_i (S) = \begin{cases}
\sum_{j \in S} \lambda_{ij}, & i \notin S \\
0, & i \in S.
\end{cases}
\end{align}
Similarly, $\lambda_{c}(S)$ denotes the total update rate of the cluster head of a particular cluster into the set $S$. Finally, set of updating neighbors of a set $S$ in cluster $c$ is
\begin{align}
N_c(S) = \{ i \in \mathcal{N}=\{1,\ldots,n \} : \lambda_i (S) > 0 \}. \label{neighbor_defn}
\end{align}
That is, the set $N_c(S)$ includes all updating neighbors of set $S$ in cluster $c$ excluding the cluster head. The total set of updating neighbors of set $S$ is given by $N(S) = c \cup N_c(S)$.
With these definitions, next, in Theorem~\ref{thm_age_set} below we give the resulting version age in our clustered system model as a specialization of \cite[Theorem~1]{Yates21}.
\begin{theorem}\label{thm_age_set}
When the total network of $n$ nodes is divided into $m$ clusters, each of which consisting of a single cluster head and $k$ nodes with $n = m k$, the average version age of subset $S$ that is composed of nodes within a cluster $c$ is given by
\begin{align}
{\Delta}_S = \frac{\lambda_e + \lambda_{c}(S){\Delta}_{c} + \sum_{i \in N_c(S)} \lambda_i(S) {\Delta}_{S\cup \{i\}} }{\lambda_{c}(S) + \sum_{i \in N_c(S)} \lambda_i(S)},\label{Yates_recursion}
\end{align}
with ${\Delta}_{c} = m\frac{\lambda_e}{\lambda_s}$.
\end{theorem}
\begin{Proof}
Proof of Theorem~\ref{thm_age_set} follows by applying \cite[Theorem~1]{Yates21} to our clustered network model and noting that updates arrive at the nodes through designated cluster heads. For completeness, we show the key steps in the proof below.
In our system, whenever there is an update being forwarded, a state transition occurs. We first present possible state transitions. We use $\mathcal{L}$ to denote the set of possible state transitions. Then, we have
\begin{align}\label{transitions}
\mathcal{L} = \{ (s,s)\} \cup \{ (s,c): c\in \mathcal{C}\} \cup \{(c,i): c \in \mathcal{C}, i \in \mathcal{N}\} \cup \{(i,j): i,j \in \mathcal{N} \},
\end{align}
where the first transition occurs when the source generates a new update, the second set of transitions occur when the source node updates a cluster head $c \in \mathcal{C}$. The third set of transitions occur when a cluster head $c$ updates a node in its cluster and finally the last set of transitions occur when an end user updates another end user from its cluster. In clustered gossip networks, different than \cite{Yates21}, as a result of transition $(i,j)$, the version age of an end user evolves as
\begin{align}\label{age_transitions}
\Delta'_k = \begin{cases}
\Delta_k + 1, & i=j=s, k\in\mathcal{N}, \\
\Delta_c, & i=c, j=k\in\mathcal{N}, \\
\min(\Delta_i, \Delta_j), & i\in\mathcal{N}, j=k\in\mathcal{N},\\
\Delta_k, & \text{otherwise},
\end{cases}
\end{align}
where $\Delta'_k$ is the version age of node $k$ after the transition. In (\ref{age_transitions}), the version age of node $k$ increases by one when the source generates a new update and becomes equal to the version age of its cluster head when node $k$ receives an update from its cluster head as explained in (\ref{clusterhead_update}). When node $k$ receives an update from another node in its cluster, its version age is updated only if the updating node has a newer version of the source information as shown in (\ref{node_update}).
Considering an arbitrary subset $S$ of nodes within a cluster with the version age evolution described in (\ref{age_transitions}), we deduce that after the $(s,s)$ transition, the version age of set $S$ is increased by one. For all other transitions $(i,j)$ with $j \in S$, we have
\begin{align}\label{versionage_update}
\Delta'_S = \min_{k\in S} \Delta'_k = \min_{k \in S\cup\{i\}}\Delta_k = \Delta_{S\cup \{i\}}.
\end{align}
When $i=c$, from (\ref{versionage_update}), we have $\Delta'_S = \min_{k \in S\cup\{i\}}\Delta_k = \Delta_c$. If $j\notin S$, the version age of set $S$ is affected by transition $(i,j)$, i.e., $\Delta'_S = \Delta_S$. Using (\ref{age_transitions}) and (\ref{versionage_update}) and following similar steps as in \cite{Yates21} yields the result.
\end{Proof}
\subsection{Version Age in Clustered Disconnected Networks}\label{Sect:disconn}
Nodes in a cluster are not connected to each other. Thus, the network is a two-hop multicast network, where the first hop is from the source to $m$ cluster heads, and the second hop is from each cluster head to $k$ nodes; combine Fig.~\ref{Fig:disconnected} with Fig.~\ref{Fig:netw_types}(a). Multihop networks have been studied in \cite{Zhong17a, Zhong18b, Buyukates18, Buyukates18b, Buyukates19} considering the classical age metric, where the source keeps sending update packets until they are received by a certain number of nodes at each hop. We do not consider such centralized management of updates, but let the source update the cluster heads as Poisson processes, and let cluster heads forward these packets to the nodes within their clusters as further Poisson processes.
Let $S_1$ denote an arbitrary $1$-node subset of a cluster. Subset $S_1$ is only connected to the cluster head, i.e., $N_c(S_1) = \emptyset$. Using the recursion given in (\ref{Yates_recursion}), we find
\begin{align}
{\Delta}_{S_1} = {\Delta}_{c} + k\frac{\lambda_e}{\lambda_{c}} = m\frac{\lambda_e}{\lambda_s} + k\frac{\lambda_e}{\lambda_{c}},\label{version_age_disconnect}
\end{align}
where ${\Delta}_{S_1}$ denotes the version age of a single node from the cluster. When the network consists of two-hops, version age is additive, in that the first term in (\ref{version_age_disconnect}) corresponds to the first hop and is equal to the version age at the cluster head, whereas the second term in (\ref{version_age_disconnect}) corresponds to the version age at the second hop between the cluster head and a node.
\begin{theorem}\label{corr_disconn}
In a clustered network of disconnected users, the version age of a single user scales as $O(\sqrt{n})$.
\end{theorem}
Theorem~\ref{corr_disconn} follows by selecting $k=\sqrt{n}$ with $m = \frac{n}{k}=\sqrt{n}$ in (\ref{version_age_disconnect}) for fixed $\lambda_e$, $\lambda_s$, $\lambda_c$, which do not depend on $n$. Theorem~\ref{corr_disconn} indicates that when nodes are grouped into $\sqrt{n}$ clusters, an age scaling of $O(\sqrt{n})$ is achievable even though users forego gossiping. With the absence of cluster heads, i.e., when the source is uniformly connected to each of the $n$ users, the version age scaling of each disconnected user would be $O(n)$. By utilizing clusters, we incur an additional hop, but significantly improve the scaling result from $O(n)$ to $O(\sqrt{n})$.
\subsection{Version Age in Clustered Ring Networks} \label{Sect:ring}
Nodes in each cluster form a ring network. We consider two types of ring clusters: uni-directional ring as shown in Fig.~\ref{Fig:netw_types}(b) and bi-directional ring as shown in Fig.~\ref{Fig:netw_types}(c).
First, we consider the uni-directional ring and observe that an arbitrary subset of $j$ adjacent nodes $S_j$ has a single neighbor node that sends updates with rate $\lambda$ for $j \leq k-1$. Each such subset $S_j$ receives updates from the cluster head with a total rate of $j\frac{\lambda_{c}}{k}$. Next, we use the recursion in (\ref{Yates_recursion}) to write
\begin{align}\label{version_age_ring_with_base}
{\Delta}_{S_j} = \frac{\lambda_e+j\frac{\lambda_{c}}{k}{\Delta}_{c}+\lambda {\Delta}_{S_{j+1}}}{j\frac{\lambda_{c}}{k}+\lambda},
\end{align}
for $j \leq k-1$ where ${\Delta}_{c}$ is the version age at the cluster head. We note that when $j=k$ the network becomes a simple two-hop network similar to that of Section~\ref{Sect:disconn} and we find ${\Delta}_{S_k} =m\frac{\lambda_e}{\lambda_s}+\frac{\lambda_e}{\lambda_{c}}$.
Next, we consider the bi-directional ring and observe that an arbitrary subset $S_j$ that consists of any adjacent $j$ nodes has two neighbor nodes, each with an incoming update rate of $\frac{\lambda}{2}$ for $j < k-1$. When $j=k-1$, $S_j$ has a single neighboring node that sends updates with a total rate $2\frac{\lambda}{2}=\lambda$. For $j\leq k-1$, the cluster head sends updates to subset $S_j$ with a total rate of $j\frac{\lambda_{c}}{k}$. With all these, when we apply the recursion in (\ref{Yates_recursion}), we obtain exactly the same formula given in (\ref{version_age_ring_with_base}).
\begin{lemma}\label{corr_ring}
Both uni-directional and bi-directional ring cluster models yield the same version age for a single node when each node in a cluster has a total update rate of $\lambda$.
\end{lemma}
Lemma~\ref{corr_ring} follows from the fact that either type of ring cluster induces the same recursion for an arbitrary subset of any adjacent $j$ nodes within a cluster as long as the total update rate per node $\lambda$ is the same. Thus, in the remainder of this paper, we only consider the bi-directional ring cluster model.
Before focusing on age scaling in a clustered network with a ring topology in each cluster, we revisit the ring network in \cite{Yates21}, and provide a proof of the $1.25 \sqrt{n}$ age scaling result observed therein as a numerical result. We show that the approximate theoretical coefficient is $\sqrt{\frac{\pi}{2}}=1.2533$.
\begin{lemma}\label{yates_ring_proof}
For the ring network model considered in \cite{Yates21}, the version age of a user scales as $\Delta_{S_1} \approx \sqrt{\frac{\pi}{2}}\frac{\lambda_e}{\lambda}\sqrt{n}$.
\end{lemma}
\begin{Proof}
From recursive application of \cite[Eqn.~(17)]{Yates21}, we obtain
\begin{align}\label{yates_age_scaling_exp}
\Delta_{S_1} = \frac{\lambda_e}{\lambda} \left(\sum_{i=1}^{n-1} a^{(n)}_i+a^{(n)}_{n-1}\right),
\end{align}
where $a^{(n)}_i$ is given for $i = 1,\ldots, n-1$ as
\begin{align} \label{defn_a_i}
a^{(n)}_i = \prod_{j=1}^{i} \frac{1}{1+\frac{j}{n}}.
\end{align}
We note that $a^{(n)}_i$ decays fast in $i$, and consider $i=o(n)$,
\begin{align}
\!\!\!\!\!-\log(a^{(n)}_i) = \sum_{j=1}^{i} \log \left(1+\frac{j}{n}\right) \approx \sum_{j=1}^{i} \frac{j}{n} = \frac{i (i+1)}{2n} \approx \frac{i^2}{n} \label{yates_age_scaling_exp2} \!\!
\end{align}
where we used $\log(1+x)\approx x$ for small $x$, and ignored the $i$ term relative to $i^2$. Thus, for small $i$, we have $a^{(n)}_i \approx e^{-\frac{i^2}{2n}}$. For large $i$, $a^{(n)}_i$ converges quickly to zero due to multiplicative terms in $\prod_{j=1}^{i} \frac{1}{1+j/n}$, and this approximation still holds. Thus, we have $\sum_{i=1}^{n-1} a^{(n)}_i \approx \sum_{i=1}^{n-1} e^{-\frac{i^2}{2n}}$. For large $n$, by using Riemann sum approximation with steps $\frac{1}{\sqrt{n}}$, we obtain
\begin{align}\label{integral}
\frac{1}{\sqrt{n}}\sum_{i=1}^{n-1} a^{(n)}_i \approx \frac{1}{\sqrt{n}}\sum_{i=1}^{n-1} e^{-\frac{i^2}{2n}} = \int_{0}^{\infty} e^{-\frac{t^2}{2}} \,dt=\sqrt{\frac{\pi}{2}}.
\end{align}
Thus, we get $\sum_{i=1}^{n-1} a^{(n)}_i \approx\sqrt{\frac{\pi}{2}}\sqrt{n} $. By inserting this in (\ref{yates_age_scaling_exp}), we obtain the age scaling of a user as $\Delta_{S_1} \approx \sqrt{\frac{\pi}{2}}\frac{\lambda_e}{\lambda}\sqrt{n}$.
\end{Proof}
Next, we focus on age scaling in a clustered network with a ring topology in each cluster.
From recursive application of (\ref{version_age_ring_with_base}) along with ${\Delta}_{S_k}$, we obtain
\begin{align}\label{scaling_exact}
\!\!\!\!\Delta_{S_1} =&\frac{\lambda_e}{\lambda}\left(\sum_{i=1}^{k-1} b^{(k)}_i \right)+\Delta_c\left(1-b^{(k)}_{k-1}\right)
+\Delta_{S_k} b^{(k)}_{k-1},
\end{align}
where similar to (\ref{defn_a_i}), $b^{(k)}_i$ is given for $i=1,\ldots, k-1$ as
\begin{align} \label{defn_b_i}
b^{(k)}_i = \prod_{j=1}^{i} \frac{1}{1+\frac{j}{k}\frac{\lambda_c}{\lambda}}.
\end{align}
When $k$ is large, $b^{(k)}_{k-1}$ goes to zero, and $\Delta_{S_1}$ in (\ref{scaling_exact}) becomes
\begin{align} \label{ring_approximated_age_final}
\Delta_{S_1}\approx \frac{\lambda_e}{\lambda} \left(\sum_{i=1}^{k-1} b^{(k)}_i \right)+\Delta_c \!\approx \sqrt{\frac{\pi}{2}}\frac{\lambda_e}{\sqrt{\lambda\lambda_c}}\sqrt{k}+m\frac{\lambda_e}{\lambda_s},
\end{align}
where the second approximation follows as in the proof of Lemma~\ref{yates_ring_proof}. Terms in (\ref{ring_approximated_age_final}) are $O(\sqrt{k})$ and $O(m)$, respectively. In \cite{Yates21}, there is a single cluster, i.e., $m=1$ and $k=n$, and thus, the version age scaling is $O(\sqrt{n})$. In our model, by carefully adjusting the number of clusters and the cluster sizes, we can improve this $O(\sqrt{n})$ scaling result to $O(n^{\frac{1}{3}})$.
\begin{theorem}\label{ring_scaling}
In a clustered network with a ring topology in each cluster, the version age of a single user scales as $O(n^{\frac{1}{3}})$.
\end{theorem}
Theorem~\ref{ring_scaling} follows by selecting $m=n^{\frac{1}{3}}$ with $k=\frac{n}{m}=n^{\frac{2}{3}}$ in (\ref{ring_approximated_age_final}) for fixed $\lambda_e$, $\lambda_s$, $\lambda_c$, $\lambda$, which do not depend on $n$.
\subsection{Version Age in Clustered Fully Connected Networks}\label{Sect:fully}
Nodes in each cluster form a fully connected network where each node is connected to all the other nodes within its cluster with rate $\frac{\lambda}{k-1}$. We find the version age for a subset of $j$ nodes $S_j$ in a cluster. Each such subset $j$ has $k-j$ neighbor nodes in addition to the cluster head associated with their cluster. Using the recursion given in (\ref{Yates_recursion}), we find
\begin{align}\label{version_age_fully_with_base}
{\Delta}_{S_j} = \frac{\lambda_e+{\frac{j\lambda_{c}}{k}{\Delta}_{c}}+\frac{j(k-j)\lambda}{k-1} {\Delta}_{S_{j+1}} }{\frac{j\lambda_{c}}{k}+\frac{j(k-j)\lambda}{k-1}},
\end{align}
for $j \leq k-1$, where ${\Delta}_{c}$ is equal to $m\frac{\lambda_e}{\lambda_s}$. The average version age of the whole cluster is ${\Delta}_{S_k} = \Delta_c + \frac{\lambda_e}{\lambda_c} = m \frac{ \lambda_e}{\lambda_s}+\frac{\lambda_e}{\lambda_{c}}$.
Next, we present bounds for ${\Delta}_{S_1}$.
\begin{lemma}\label{lemma_fully}
When $\lambda_{c}=\lambda$, in a clustered network with fully connected topology in each cluster, the version age of a single node satisfies
\begin{align}\label{version_age_fully_with_base_simp_6}
\frac{(k-1)^2+k}{k^2} \Delta_c+ \frac{\lambda_e}{\lambda}\left(\frac{k-1}{k}\sum_{\ell=1}^{k-1}\frac{1}{\ell}+ \frac{1}{k} \right) \leq {\Delta}_{S_1} \leq \Delta_c + \frac{\lambda_e}{\lambda} \left(\sum_{\ell=1}^{k}\frac{1}{\ell} \right).
\end{align}
\end{lemma}
\begin{Proof}
We use steps similar to those in the proof of \cite[Theorem~2]{Yates21} and also consider the additional hop from the source to the cluster heads. For $\lambda_{c} = \lambda$, we take $j=k-\ell$ and (\ref{version_age_fully_with_base}) becomes
\begin{align}\label{version_age_fully_with_base_simp_1}
{\Delta}_{S_{k-\ell}} = \frac{\frac{1}{k-\ell}\frac{\lambda_e}{\lambda} + \frac{1}{k} \Delta_c + \frac{\ell}{k-1}{\Delta}_{S_{k-\ell+1}} }{\frac{1}{k}+\frac{\ell}{k-1}},
\end{align}
for $\ell \leq k-1$ and ${\Delta}_{S_k} = \Delta_c +\frac{\lambda_e}{\lambda}$, where $\Delta_c$ is the age at the cluster head. Defining $\hat{\Delta}_{S_\ell} \triangleq {\Delta}_{S_{k-\ell+1}}$, we get
\begin{align}\label{version_age_fully_with_base_simp_2}
\hat{\Delta}_{S_{\ell+1}} = \frac{ \frac{1}{k-\ell}\frac{\lambda_e}{\lambda} + \frac{1}{k}\Delta_c + \frac{\ell}{k-1}\hat{\Delta}_{S_\ell} }{\frac{1}{k}+\frac{\ell}{k-1}}.
\end{align}
Next, one can show that $\hat{\Delta}_{S_{\ell+1}}$ satisfies the following
\begin{align}\label{version_age_fully_with_base_simp_3}
\hat{\Delta}_{S_{\ell+1}} \leq \frac{ \frac{1}{k-\ell}\frac{\lambda_e}{\lambda} + \frac{1}{k}\Delta_c +
\frac{\ell}{k}\hat{\Delta}_{S_{\ell}} }{\frac{1}{k}+\frac{\ell}{k}}.
\end{align}
Defining $\tilde{\Delta}_{S_\ell} \triangleq \frac{\ell}{k}\hat{\Delta}_{S_{\ell}}$ and plugging it in (\ref{version_age_fully_with_base_simp_3}), we get
\begin{align}\label{version_age_fully_with_base_simp_4}
\tilde{\Delta}_{S_{\ell+1}} = \frac{\ell+1}{k}\hat{\Delta}_{S_{\ell}} \leq \frac{1}{k-\ell}\frac{\lambda_e}{\lambda} + \frac{1}{k}\Delta_c + \tilde{\Delta}_{S_{\ell}}.
\end{align}
Noting that $\tilde{\Delta}_{S_1} = \frac{\hat{\Delta}_{S_1}}{k} = \frac{{\Delta}_{S_k}}{k} = \frac{1}{k}\left(\Delta_c +\frac{\lambda_e}{\lambda}\right)$, we write
\begin{align}\label{version_age_fully_with_base_simp_5}
\tilde{\Delta}_{S_k} \leq \Delta_c + \frac{\lambda_e}{\lambda} \left(\sum_{\ell=1}^{k}\frac{1}{\ell} \right).
\end{align}
Since $\tilde{\Delta}_{S_k} = \hat{\Delta}_{S_k} = {\Delta}_{S_1}$, (\ref{version_age_fully_with_base_simp_5}) presents an upper bound to the version age of a single node. For the lower bound, we start with (\ref{version_age_fully_with_base_simp_2}) and observe that we have
\begin{align}
\hat{\Delta}_{S_{\ell+1}} \geq \frac{k-1}{\ell+1} \left(\frac{1}{k-\ell}\frac{\lambda_e}{\lambda} + \frac{1}{k}\Delta_c + \frac{\ell}{k-1}\hat{\Delta}_{S_\ell}\right). \label{lowerbound_1}
\end{align}
Defining $\bar{\Delta}_{S_{\ell}} \triangleq \frac{\ell}{k-1}\hat{\Delta}_{S_{\ell}}$ and using it in (\ref{lowerbound_1}) gives
\begin{align}
\bar{\Delta}_{S_{\ell+1}} = \frac{\ell+1}{k-1}\hat{\Delta}_{S_{\ell+1}} \geq \frac{1}{k-\ell}\frac{\lambda_e}{\lambda} + \frac{1}{k}\Delta_c + \bar{\Delta}_{S_\ell}. \label{lowerbound_2}
\end{align}
Starting with the fact that $\bar{\Delta}_{S_1} = \frac{1}{k-1}\hat{\Delta}_{S_1} = \frac{m+1}{k-1} \frac{\lambda_e}{\lambda}$, the recursion in (\ref{lowerbound_2}) yields
\begin{align}
\Delta_{S_1} \geq \frac{(k-1)^2+k}{k^2} \Delta_c+ \frac{\lambda_e}{\lambda}\left(\frac{k-1}{k}\sum_{\ell=1}^{k-1}\frac{1}{\ell}+ \frac{1}{k} \right),
\end{align}
upon noting that $\Delta_{S_1} = \frac{k-1}{k} \bar{\Delta}_{S_k}$, which concludes the proof of the lemma.
\end{Proof}
From (\ref{version_age_fully_with_base_simp_6}), we see that for large $n$ with $\lambda_c = \lambda$, the version age of a single node $\Delta_{S_1}$ satisfies
\begin{align}\label{approximation}
\Delta_{S_1} \approx m\frac{\lambda_e}{\lambda_s} + \frac{\lambda_e}{\lambda}\log k.
\end{align}
\begin{theorem}\label{fully_conn_scaling}
In a clustered network with a fully connected topology in each cluster, the version age of a single user scales as $O(\log{n})$.
\end{theorem}
Theorem~\ref{fully_conn_scaling} follows in multiple different ways. For instance, it follows by selecting $m=1$ and $k =\frac{n}{m}=n$. That is, we have a single fully connected network of $n$ users as in \cite{Yates21}. Theorem~\ref{fully_conn_scaling} also follows by selecting $m=\log n$ and $k=\frac{n}{m}=\frac{n}{\log n}$. That is, we have $\log(n)$ fully connected clusters with $\frac{n}{\log n}$ users in each cluster. Thus, version age obtained under a smaller cluster size with less connections is the same as that obtained when all nodes are connected to each other. In particular, in our model with $m=\log n$, each node has $O(\frac{n}{\log n})$ connections in comparison to $O(n)$ in \cite{Yates21}.
Finally, we note that, a recurring theme in the analysis of clustered networks is the fact that the version age at an end-node $\Delta_{S_1}$ is \emph{almost} additive in the version age at the cluster head $\Delta_c$ as seen in (\ref{version_age_disconnect}), (\ref{scaling_exact}), and (\ref{version_age_fully_with_base_simp_6}). It is \emph{exactly} additive in the case of disconnected clusters in (\ref{version_age_disconnect}).
\section{Version Age with Community Structure Under Connected Cluster Heads}\label{sect:conn_ch}
So far, we have studied the cases in which the cluster heads are disconnected among themselves, and consequently, they do not exchange information with each other. In this section, we model the connectivity among the cluster heads with a bi-directional ring (see Fig.~\ref{Fig:ring_clusterheads}).\footnote{The model studied in Section~\ref{sect:comm_age} corresponds to the case in which the cluster heads form a disconnected topology.} \footnote{In addition to the bi-directional ring topology, one can study the version age considering fully connected cluster heads, which is omitted here to keep the discussion focused.} Thus, in this section, at the first tier, we have a ring network of $m$ cluster heads, each of which is serving its own cluster. Nodes in each cluster form a disconnected, ring, or fully connected network. Our aim in this section, is to analyze the effect of additional information exchange among the cluster heads on the average version age experienced by the end nodes.
When there is no information exchange among the cluster heads, i.e., disconnected cluster heads, each cluster head updates its cluster with a total rate of $\lambda_c$. In the case of information exchange among the cluster heads, a cluster head updates its neighboring cluster heads as a rate $\lambda_{ca}$ Poisson process and updates its cluster with a total rate of $\lambda_{cb}$, where $\lambda_{ca} + \lambda_{cb} = \lambda$. Thus, when the cluster heads are connected, each cluster head receives source information with a larger rate but updates its cluster with a smaller rate.
\begin{figure}[t]
\centerline{\includegraphics[width=0.5\columnwidth]{connected_heads_v3.eps}}
\caption{Tiered network model where blue node represents the source, yellow nodes represent the cluster heads $c_1, \ldots, c_6$, and green nodes represent the end users. Here, cluster heads form a bi-directional ring network with $m=6$. Each cluster is associated with a cluster of $k=6$ nodes. Here, only one such cluster is shown. Nodes in each cluster form a bi-directional ring network. Other possible network topologies within a cluster are shown in Fig.~\ref{Fig:netw_types}.}
\label{Fig:ring_clusterheads}
\end{figure}
The average version age of a subset $S$ that is composed of nodes within a cluster $c$ is still given by (\ref{thm_age_set}) when the cluster heads exchange information in our clustered network topology. This is because when the cluster heads exchange information among themselves, the network topology within a cluster does not change, i.e., the $N_c(S)$ stays the same, and the nodes in a cluster still cannot have a lower version age than their cluster head.
The only change in (\ref{thm_age_set}) compared to Section~\ref{sect:comm_age} is the average version age of a particular cluster head $c$, $\Delta_c$. As shown in Fig.~\ref{Fig:ring_clusterheads}, even though cluster heads are connected to the nodes in their respective clusters, each cluster head can be updated by the source node or its neighboring cluster heads. That is, to find $\Delta_c$, we only need to look at the first tier of the network, which is the ring gossiping network presented in \cite{Yates21}. Thus, using Lemma~\ref{yates_ring_proof} we find the average version age of a single cluster head when the cluster heads form a ring network as
\begin{align}
\Delta_c \approx \sqrt{\frac{\pi}{2}}\frac{\lambda_e}{\sqrt{\lambda_s \lambda_{ca}}}\sqrt{m}. \label{Delta_c_ring}
\end{align}
We note that in (\ref{Delta_c_ring}), we have $\sqrt{\lambda_s \lambda_{ca}}$ in the denominator unlike \cite{Yates21} as $\lambda_s$ and $\lambda_{ca}$ are not necessarily equal in our model. We observe in (\ref{Delta_c_ring}) that a single cluster head's average version age approximately scales as $O(\sqrt{m})$ as opposed to $O(m)$ in Theorem~\ref{thm_age_set} since cluster heads now form a ring network. With that, in what follows, we analyze the average version age scaling for different cluster topologies when the cluster heads form a ring network.
\subsection{Version Age in Clustered Disconnected Networks with Connected Cluster Heads}\label{subsect_a}
The network model in this case is as in Section~\ref{Sect:disconn} except that the cluster heads form a ring network in the first hop. Nodes within a cluster are disconnected, i.e., $N_c(S_1) = \emptyset$.
By invoking Theorem~\ref{thm_age_set}, we use the recursion in (\ref{Yates_recursion}) and find the average version age of a single node as
\begin{align}
\Delta_{S_1} = \Delta_c + k\frac{\lambda_e}{\lambda_{cb}} \approx \sqrt{\frac{\pi}{2}}\frac{\lambda_e}{\sqrt{\lambda_s \lambda_{ca}}}\sqrt{m} + k\frac{\lambda_e}{\lambda_{cb}}, \label{discon_ring_ch}
\end{align}
where the approximation follows from (\ref{Delta_c_ring}).
\begin{theorem}\label{thm_discon_ring_ch}
In a clustered network of disconnected users when the cluster heads form a ring network, the average version age of a single user scales as $O(n^{\frac{1}{3}})$.
\end{theorem}
Theorem~\ref{thm_discon_ring_ch} follows by selecting, $k=n^{\frac{1}{3}}$ with $m = \frac{n}{k} = n^{\frac{2}{3}}$ in (\ref{discon_ring_ch}) for fixed $\lambda_e$, $\lambda_s$, $\lambda_{ca}$ and $\lambda_{cb}$ that do not depend on $n$. Theorem~\ref{thm_discon_ring_ch} implies that even though nodes in clusters do not gossip, by utilizing the information exchange at the cluster head level, the average version age scaling of an end user can be improved to $O(n^{\frac{1}{3}})$ from $O(\sqrt{n})$ in Theorem~\ref{corr_disconn}.
Another interesting observation is the parallelism between (\ref{discon_ring_ch}) and (\ref{ring_approximated_age_final}) due to the \emph{almost} additive structure of the average version age in clustered gossip networks. In the case of (\ref{ring_approximated_age_final}), cluster heads are disconnected and nodes in each cluster form a ring network whereas in the case of (\ref{discon_ring_ch}) the network is reversed, i.e., ring network in cluster heads, disconnected network within clusters. Since, we have $n=mk$, both (\ref{discon_ring_ch}) and (\ref{ring_approximated_age_final}) yield the same $O(n^{\frac{1}{3}})$ average version age scaling at the end users indicating that gossiping equally helps improving the average version age scaling at the end users whether it occurs at the cluster head level or within clusters at the end user level even though possibly newer versions of the source information is exchanged at the cluster head level as cluster heads are directly connected to the source node.
\subsection{Version Age in Clustered Ring Networks with Connected Cluster Heads}\label{sect:conn_ch_ring}
Ring networks are formed both at the cluster head level and within clusters at the end user level. By invoking Theorem~\ref{thm_age_set}, we use the recursion in (\ref{Yates_recursion}) and after following similar steps as in Section~\ref{Sect:ring}, we find
\begin{align}
\Delta_{S_1}\approx \sqrt{\frac{\pi}{2}}\frac{\lambda_e}{\sqrt{\lambda_s \lambda_{ca}}}\sqrt{m} + \sqrt{\frac{\pi}{2}}\frac{\lambda_e}{\sqrt{\lambda\lambda_{cb}}}\sqrt{k}. \label{ring_ring_ch}
\end{align}
We note that (\ref{ring_ring_ch}) is the counterpart of (\ref{ring_approximated_age_final}) where the additional ring network topology at the cluster head level is considered.
\begin{theorem}\label{thm_ring_ring_ch}
In a clustered network with a ring topology in each cluster when the cluster heads form a ring network, the average version age of a single user scales as $O(n^{\frac{1}{4}})$.
\end{theorem}
Theorem~\ref{thm_ring_ring_ch} follows by selecting $m=\sqrt{n}$ with $k = \frac{n}{m} = \sqrt{n}$ in (\ref{ring_ring_ch}) for fixed $\lambda_e$, $\lambda_s$, $\lambda_{ca}$, and $\lambda_{cb}$. Here, we note that, when gossiping is employed both at the cluster head level and at the end user level within clusters through a ring topology, the average version age scaling at the end users is improved from $O(n^{\frac{1}{3}})$ in Theorem~\ref{corr_ring} to $O(n^{\frac{1}{4}})$ in Theorem~\ref{thm_ring_ring_ch}.
Another interesting observation is the fact that since the network topology is symmetric at both levels in this case, and the average version age at the end users is \emph{almost} additive in the average version age at the cluster heads, the average version age scaling optimal $m$ and $k$ values are identical.
We can also note that the selection of the update rates at the cluster heads, i.e., $\lambda_{ca}$ and $\lambda_{cb}$ in (\ref{ring_ring_ch}) is critical. After the optimal selection of $m=k=\sqrt{n}$, next, we optimize update rates at the cluster heads, i.e., $\lambda_{ca}$ and $\lambda_{cb}$, to further minimize the version age in (\ref{ring_ring_ch}). After selecting $m=k=\sqrt{n}$, $\Delta_{S_1}$ in (\ref{ring_ring_ch}) becomes
\begin{align}
\Delta_{S_1}\approx \sqrt{\frac{\pi}{2}} \lambda_e n^{\frac{1}{4}}\left(\frac{1}{\sqrt{\lambda_s \lambda_{ca}}}+ \frac{1}{\sqrt{\lambda\lambda_{cb}}}\right). \label{ring_ring_ch_v2}
\end{align}
The minimization of $\Delta_{S_1}$ in (\ref{ring_ring_ch_v2}) is equivalent to solving the following optimization problem
\begin{align}
\label{problem1}
\min_{\{\lambda_{ca},\lambda_{cb} \}} \quad & \frac{1}{\sqrt{\lambda_s \lambda_{ca}}}+ \frac{1}{\sqrt{\lambda\lambda_{cb}}} \nonumber \\
\mbox{s.t.} \quad & \lambda_{ca}+\lambda_{cb} = \lambda_{c} \nonumber \\
\quad & \lambda_{ca}\geq 0, \quad \lambda_{cb}\geq 0.
\end{align}
We write the Lagrangian for the optimization problem in (\ref{problem1}) as,
\begin{align}
\mathcal{L} =& \frac{1}{\sqrt{\lambda_s \lambda_{ca}}}+ \frac{1}{\sqrt{\lambda\lambda_{cb}}} + \beta (\lambda_{ca}+\lambda_{cb}- \lambda_{c})- \theta_1\lambda_{ca}-\theta_2\lambda_{cb},
\end{align}
where $\theta_1\geq 0$, $\theta_2\geq 0$, and $\beta$ can be anything. We note that the problem in (\ref{problem1}) is jointly convex with respect to $\lambda_{ca}$ and $\lambda_{cb}$. Thus, by analyzing the KKT conditions we can find the optimal solution. We write the KKT conditions as,
\begin{align}
\frac{\partial \mathcal{L}}{\partial \lambda_{ca}} =& -\frac{1}{2 \lambda_s} \lambda_{ca}^{-\frac{3}{2}}+\beta -\theta_1 = 0,\label{KKT2_1} \\
\frac{\partial \mathcal{L}}{\partial \lambda_{cb}} =& -\frac{1}{2 \lambda} \lambda_{cb}^{-\frac{3}{2}}+\beta -\theta_2 = 0.\label{KKT2_2}
\end{align}
Then, by using the KKT conditions in (\ref{KKT2_1}) and (\ref{KKT2_2}), we find the optimal $\lambda_{ca}$ and $\lambda_{cb}$ as
\begin{align}
\lambda_{ca} &= \frac{\lambda_c \lambda^{\frac{1}{3}}}{\lambda^{\frac{1}{3}}+\lambda_s^{\frac{1}{3}}},\label{soln_lambda_c1_fin}\\
\lambda_{cb} &= \frac{\lambda_c \lambda_s^{\frac{1}{3}}}{\lambda^{\frac{1}{3}}+\lambda_s^{\frac{1}{3}}}.\label{soln_lambda_c2_fin}
\end{align}
We observe from (\ref{soln_lambda_c1_fin}) and (\ref{soln_lambda_c2_fin}) that when the cluster heads also form a ring network, it is optimal to choose the update rates among the cluster heads, i.e., $\lambda_{ca}$, proportional to the $\frac{1}{3}$-power of the update rate of the end users, i.e., $\lambda^{\frac{1}{3}}$. Similarly, the total update rate allocated by cluster heads to their own clusters should be proportional to the $\frac{1}{3}$-power of the update rate of the source, i.e., $\lambda_s^{\frac{1}{3}}$.\footnote{Similar optimization problems can be formulated for the clustered disconnected networks in Section~\ref{subsect_a}, and for the clustered fully connected networks in Section~\ref{subsect_c}. In order to avoid repetitive arguments, we skip the update rate optimizations of the cluster heads for these parts and provide the analysis only for the clustered ring networks.}
\subsection{Version Age in Clustered Fully Connected Networks with Connected Cluster Heads}\label{subsect_c}
In this case, nodes within a cluster form a fully connected network whereas each cluster head is only connected to its adjacent neighbors in a ring topology. By invoking Theorem~\ref{thm_age_set}, we use the recursion in (\ref{Yates_recursion}) and after following similar steps as in Section~\ref{Sect:fully}, we find
\begin{align}
\Delta_{S_1} \approx \sqrt{\frac{\pi}{2}}\frac{\lambda_e}{\sqrt{\lambda_s \lambda_{ca}}}\sqrt{m} + \frac{\lambda_e}{\lambda}\log k, \label{approximation_ring_ch}
\end{align}
for large $n$, with $\lambda_{cb} = \lambda$. We note that (\ref{approximation_ring_ch}) is analogous to (\ref{approximation}) when the cluster heads form a ring network.
\begin{theorem} \label{thm_fully_ring_ch}
In a clustered network with a fully connected topology in each cluster when the cluster heads form a ring network, the average version age of a single user scales as $O(\log n)$.
\end{theorem}
Theorem~\ref{thm_fully_ring_ch} follows by noting that since $k=\frac{n}{m}$ we cannot get rid of the $\log n$ term in (\ref{approximation_ring_ch}). Thus, there are multiple $(m,k)$ pairs that result in the same $O(\log n)$ scaling. For example, when $m=1$ and $k = \frac{n}{m}=n$, we obtain $O(\log n)$ scaling. This implies that having a single cluster of $n$ users as in \cite{Yates21}. In addition, selecting $m=\log^2 n$ and $k = \frac{n}{m} = \frac{n}{\log^2 n}$ yields Theorem~\ref{thm_fully_ring_ch} as well, parallel to the discussion after Theorem~\ref{fully_conn_scaling}.
An interesting observation from Theorem~\ref{thm_fully_ring_ch} is the fact that additional communication at the cluster head level does not improve the average version age scaling at the end users. In a similar fashion, one can show that, even if the cluster heads form a fully connected network among themselves while the nodes in each cluster also form a fully connected network, the average version age at the end users scales as $O(\log n)$. This is due to the fact that the number of clusters $m$ (hence the number of cluster heads) and the number of nodes in each cluster $k$ are such that $n=mk$. Since the level of gossip, i.e., the connectivity among the cluster heads and the nodes in each cluster, cannot be increased beyond fully connected networks, one can conclude that the average version age scaling cannot be improved further than $O(\log n)$ in the considered clustered gossip networks.
We note that once the cluster heads exchange information among themselves, essentially, what we end up with is a hierarchical gossip networks, where in the first level of hierarchy we have $m$ cluster heads, and in the second level of hierarchy we have $mk$ end nodes clustered into $m$ clusters of $k$ nodes each. Inspired by this structure, in the next section, we forego cluster heads and study the version age in hierarchical clustered gossip networks.
\begin{figure}[t]
\centerline{\includegraphics[width=0.55\columnwidth]{hierarchical_v3.eps}}
\caption{Two-level hierarchical network model where blue node represents the source and green nodes represent the end users. Here, nodes in each cluster form a bi-directional ring network of $k_1=k_2=6$ nodes. We have a single cluster in the first level and $k_1=6$ clusters in the second level. Here, only one such second level cluster is shown. Other possible network topologies within a cluster are shown in Fig.~\ref{Fig:netw_types}.}
\label{Fig:hierarchy}
\end{figure}
\section{Version Age in Hierarchical Clustered Gossip Networks}\label{sect:hier}
In this section, we consider a hierarchical clustered gossip network, where at the first level of hierarchy there is a single cluster of $k_1$ nodes. Each node in the first level is directly updated by the source node as a rate $\frac{\lambda_s}{k_1}$ Poisson process. Total update rate of each node is $\lambda$. Each node spends $\lambda_a$ portion of this total rate to update its neighbors within the same cluster at the same hierarchical level and spends $\lambda_b$ portion of the total $\lambda$ rate to update its neighbors in the next hierarchical level such that $\lambda_a+\lambda_b=\lambda$. Each node in the first level is associated with a cluster of $k_2$ nodes in the second level. That is, in the second level, we have $k_2$ clusters and a total of $k_1k_2$ nodes. In Fig.~\ref{Fig:hierarchy}, we show the network model for a two hierarchy levels. We note that at the last level of the network, e.g., the second level in the case of Fig.~\ref{Fig:hierarchy}, nodes use all of their update rate $\lambda$ to update their neighbors within the same cluster.
Within the scope of this section, we assume that nodes in each cluster at every hierarchical level form a bi-directional ring network.\footnote{One can consider disconnected or fully connected networks within each cluster at each level as well. In our model, since the average version age under fully connected networks cannot be improved beyond $O(\log n)$ as discussed in Section~\ref{sect:conn_ch} and we want to keep our discussion focused, we limit ourselves with a ring network in each cluster at every level.} Let $h$ denote the number of hierarchy levels in the network. Then, at level $i$, with $i \leq h-1$, each node updates each of its two neighbors at level $i$ as a Poisson process with rate $\frac{\lambda_a}{2}$, whereas it updates each of its $k_{i+1}$ child nodes at level $i+1$ as a rate $\frac{\lambda_b}{k_{i+1}}$ Poisson process. We have a total of $\prod_{j=1}^i k_j$ nodes at level $i$ that are grouped into equal-sized clusters of $k_i$ for $i\geq 2$.
Due to the symmetry in the network model, nodes in each hierarchy level $i$ have statistically identical version age processes $\Delta^{i}_{S_1}$. In what follows, we find the average version age expressions of a single node at each hierarchical level.
\begin{theorem}\label{thm_age_hier}
When the total network of $n$ nodes is grouped into $h$ levels of hierarchical clusters with $k_i$ nodes in each cluster at the $i$th hierarchy level such that $\sum_{i=1}^h\prod_{j=1}^i k_j = n$, the average version age of subset $S$ that is composed of nodes within a cluster $c$ at the $i$th hierarchical level is given by
\begin{align}
{\Delta}^{i}_S = \frac{\lambda_e + \lambda_{i-1}(S){\Delta}^{i-1}_{S_1} + \sum_{j \in N_c(S)} \lambda_j(S) {\Delta}^{i}_{S\cup \{j\}} }{\lambda_{i-1}(S) + \sum_{j \in N_c(S)} \lambda_j(S)},\label{Yates_recursion_hier}
\end{align}
where $\lambda_{i-1}(S)$ denotes the total update rate at which cluster $c$'s parent node in level $i-1$ updates the nodes in set $S$.
\end{theorem}
The proof of Theorem~\ref{thm_age_hier} follows from that of Theorem~\ref{thm_age_set} by noting that the version age of a node in level $i$ cannot be smaller than that of its parent node in level $i-1$. That is, from the perspective of a node in level $i$, its cluster head in the case of Theorem~\ref{thm_age_set} corresponds to its parent node in level $i-1$.
We first present the results for $h=3$ levels of hierarchy to showcase the version age behavior in the hierarchical gossip networks and then generalize our results to $h$ level of hierarchy.\footnote{For $h=2$ hierarchy levels, the resulting average version age expressions are in the same format as those in Section~\ref{sect:conn_ch_ring} and correspondingly yield an $O(n^{\frac{1}{4}})$ scaling at an end user. This is because the cluster heads forming a ring network at the first tier in Section~\ref{sect:conn_ch_ring} can essentially be thought of as the first level of hierarchy in the context of hierarchical clustered gossip networks analyzed in this section.}
\subsection{Version Age for $h=3$ Hierarchy Levels}
In this case, we have a single cluster of $k_1$ nodes in the first level, $k_1$ clusters of $k_2$ nodes each in the second level, and $k_2$ clusters of $k_3$ nodes in each in the third level of hierarchy so that $n = k_1 + k_1k_2 +k_1k_2k_3$. By using the recursion in Theorem~\ref{thm_age_hier} and noting that at the first level of hierarchy we have the ring network model in \cite{Yates21}, we find
\begin{align}
\Delta^{1}_{S_1}&\approx \sqrt{\frac{\pi}{2}}\frac{\lambda_e}{\sqrt{\lambda_s \lambda_a}}\sqrt{k_1}, \label{3hier_eq1} \\
\Delta^{2}_{S_1}&\approx \sqrt{\frac{\pi}{2}}\frac{\lambda_e}{\sqrt{\lambda_s \lambda_a}}\sqrt{k_1} + \sqrt{\frac{\pi}{2}}\frac{\lambda_e}{\sqrt{\lambda_a\lambda_b}}\sqrt{k_2}, \label{3hier_eq2}\\
\Delta^{3}_{S_1}&\approx \sqrt{\frac{\pi}{2}}\frac{\lambda_e}{\sqrt{\lambda_s \lambda_a}}\sqrt{k_1} + \sqrt{\frac{\pi}{2}}\frac{\lambda_e}{\sqrt{\lambda_a\lambda_b}}\sqrt{k_2} + \sqrt{\frac{\pi}{2}}\frac{\lambda_e}{\sqrt{\lambda\lambda_b}}\sqrt{k_3}. \label{3hier_eq3}
\end{align}
\begin{theorem} \label{thm_3hier}
In a hierarchical clustered network with $h=3$ hierarchy levels and a ring network in each cluster, the average version age of a single user scales as $O(n^{\frac{1}{6}})$ at every hierarchy level.
\end{theorem}
Theorem~\ref{thm_3hier} follows by observing that $n =k_1 + k_1k_2 +k_1k_2k_3 = k_1(1+k_2(1+k_3)) \approx k_1k_2k_3$ for large $n$. That is, when the number of nodes in the network gets large, order-wise majority of the nodes are located at the final hierarchy level. From the symmetry of the cluster topologies at each hierarchy level and the additive structure observed in (\ref{3hier_eq1})-(\ref{3hier_eq3}), we select $k_1=k_2=k_3=O(n^{\frac{1}{3}})$, which yields an average version age scaling of $O(n^{\frac{1}{6}})$ for all three hierarchical levels.
We note that taking $n \approx k_1k_2k_3$ is as if we assume all the nodes are located at the last hierarchical level of the network so that the $O(n^{\frac{1}{6}})$ scaling we find in Theorem~\ref{thm_3hier} represents a worst case scenario since nodes located at the first two hierarchy levels surely have smaller average version age than the nodes located at the last level of the hierarchy.
Theorem~\ref{thm_3hier} shows that by implementing a three-level hierarchical clustered gossip network structure, we can improve the average version age of a single end-user in our model compared to $O(n^{\frac{1}{2}})$ in \cite{Yates21}, $O(n^{\frac{1}{3}})$ in Section~\ref{Sect:ring}, and $O(n^{\frac{1}{4}})$ in Section~\ref{sect:conn_ch_ring}. The improvement in Section~\ref{Sect:ring} compared to the model in \cite{Yates21} originates from the use of $m$ cluster heads with smaller ring networks under each cluster head compared to the single ring network of $n$ nodes in \cite{Yates21}. When the cluster heads participate in gossip in Section~\ref{sect:conn_ch_ring}, end users have better average version age scaling due to the additional information exchange at the cluster heads. Finally, in this section, through hierarchical placement of clusters, we obtain the same scaling as in Section~\ref{sect:conn_ch_ring} with $h=2$ levels without getting help from any dedicated cluster heads and further improve the scaling result when we employ $h=3$ hierarchy levels. That is, by carefully placing all $n$ nodes into hierarchical clusters of ring networks, we get the best average version age scaling at an end user compared all these network models discussed so far.\footnote{We note that average version age scaling of an end node is improved through hierarchical clustering at the expense of increased number of connections in the network, which may incur additional operational cost to the service provider. This aspect will be discussed in Section~\ref{sect_discuss_conc}.}
\subsection{Version Age for $h>3$ Hierarchy Levels}
In a hierarchical clustered gossip network with $h$ hierarchy levels and a ring network topology in each cluster at every hierarchy level, the average version age of a single node located in hierarchy level $i$ is
\begin{align}\label{hier_age}
\Delta^{i}_{S_1} = \begin{cases}
\sqrt{\frac{\pi}{2}}\frac{\lambda_e}{\sqrt{\lambda_s \lambda_a}}\sqrt{k_i}, & i=1, \\
\Delta^1_{S_1} + \sqrt{\frac{\pi}{2}}\frac{\lambda_e}{\sqrt{\lambda_a\lambda_b}}\sum_{j=2}^i\sqrt{k_j}, & 1<i<h, \\
\Delta^{i-1}_{S_1} + \sqrt{\frac{\pi}{2}}\frac{\lambda_e}{\sqrt{\lambda\lambda_b}}\sqrt{k_i}, & i=h.
\end{cases}
\end{align}
\begin{theorem} \label{thm_Hhier}
In a hierarchical clustered network with $h$ hierarchy levels and a ring network in each cluster, the average version age of a single user scales as $O(n^{\frac{1}{2h}})$ at every hierarchy level.
\end{theorem}
Theorem~\ref{thm_Hhier} follows by approximating $n \approx \prod_{i=1}^h k_i$ for large $n$ and taking $k_i = n^{\frac{1}{h}}$ for $i \in 1, \ldots, h$.
\section{Numerical Results}\label{sect:num_res}
\begin{figure}[t]
\begin{center}
\subfigure[]{%
\includegraphics[width=0.49\linewidth]{sim1_v2.eps}}
\subfigure[]{%
\includegraphics[width=0.49\linewidth]{sim2_v2.eps}}\\
\subfigure[]{%
\includegraphics[width=0.49\linewidth]{sim3_v2.eps}}
\subfigure[]{%
\includegraphics[width=0.49\linewidth]{sim4_v2.eps}}
\end{center}
\caption{Version age of a node with fully connected, ring, and disconnected cluster models with $n=120$, (a) $\lambda_e =1$, $\lambda_{s} =1$, $\lambda_{c} =1$, and $\lambda =1$, (b) $\lambda_e =1$, $\lambda_{s} =10$, $\lambda_{c} =1$, and $\lambda =1$, (c) $\lambda_e =1$, $\lambda_{s} =10$, $\lambda_{c} =10$, and $\lambda =1$, (d) $\lambda_e =1$, $\lambda_{s} =10$, $\lambda_{c} =1$, and $\lambda =2$. }
\label{Fig:sim_results_all_v2}
\end{figure}
We have seen in Sections~\ref{sect:comm_age}-\ref{sect:hier} that the version age depends on update rates $\lambda_e$, $\lambda_s$, $\lambda_c$, and $\lambda$. In this section, we explore the effects of these rates on the version age via numerical results. In the first four simulations, we consider the model described in Section~\ref{sect:comm_age}.
First, we take $\lambda_e =1$, $\lambda_{s} =1$, $\lambda_{c} =1$, $\lambda =1$, and $n=120$. We plot the version age of a node for the considered cluster models with respect to $k$. We see in Fig.~\ref{Fig:sim_results_all_v2}(a) that for the fully connected cluster model, the version age decreases with $k$ and thus, the version age-optimal cluster size is $k^*=120$, i.e., all $n$ nodes are grouped in a single cluster. In the ring cluster model, the version age is minimized when $k^*=30$. In the disconnected cluster model, the version age is minimized when we have $k^*=10$ (or equivalently $k^*=12$). From these, we deduce that when the topology has less connectivity in a cluster, the optimal cluster size is smaller. Further, a topology with larger connectivity within a cluster achieves a lower version age.
Second, we consider the same setting as in Fig.~\ref{Fig:sim_results_all_v2}(a) but take $\lambda_s =10$ in Fig.~\ref{Fig:sim_results_all_v2}(b). Here, the version age decreases with increasing $k$ at first due to increasing number of connections within a cluster and the increase in the update rate between the source and each cluster head (as the number of clusters decreases with increasing $k$). However, as $k$ continues to increase, the decrease in the update rate from the cluster head to the nodes starts to dominate and the version age increases for all cluster models. In Fig.~\ref{Fig:sim_results_all_v2}(b), we see that the optimal cluster size is $k^*=12$ in fully connected clusters, $k^*=8$ in ring clusters, $k^*=3$ and $k^*=4$ in disconnected clusters.
Third, we increase the update rate of the cluster heads and take $\lambda_{c} =10$. We see in Fig.~\ref{Fig:sim_results_all_v2}(c) that the optimum value of $k$ increases compared to the second case when cluster heads have a larger update rate in all the cluster models. We find $k^*=20$ in fully connected clusters, $k^*=15$ in ring clusters, and $k^*=10$ or $k^*=12$ in disconnected clusters.
Fourth, we study the effect of update rates among the nodes. For this, we take $\lambda_{c} =10$, $\lambda_e =1$, $\lambda_{s} =1$, $\lambda =2$. We see in Fig.~\ref{Fig:sim_results_all_v2}(d) that as the communication rate between the nodes increases, the optimal cluster size increases, and it is equal to $k^*=24$ in fully connected clusters, and $k^*=10$ in ring clusters. As there is no connection between nodes in the case of disconnected clusters, the optimum cluster size remains the same, i.e., $k^*=3$ or $k^*=4$, compared to Fig.~\ref{Fig:sim_results_all_v2}(b).
\begin{figure}[t]
\centerline{\includegraphics[width=0.5\columnwidth]{sim5_fig.eps}}
\caption{Version age of a node with fully connected, ring, and disconnected cluster models with $n=120$, $\lambda_e =1$, $\lambda_{s} =10$, $\lambda_{ca} =4$, $\lambda_{cb} =6$, and $\lambda =1$ when cluster heads form a ring network among themselves.}
\label{Fig:connected_heads}
\end{figure}
\begin{table}[t]
\small
\centering
\begin{center}
\begin{tabular}{ | l | l | l |}
\hline
& $\text{no gossip at cluster heads}$ & $\text{gossiping cluster heads}$ \\ \hline
$\text{disconnected}$ & $(2.2000,10)$ & $(1.5936,4)$ \\ \hline
$\text{ring}$ & $(1.7729,15)$ & $(1.4365,5)$ \\ \hline
$\text{fully connected}$ & $(1.7111,20)$ & $(1.4291,5)$ \\\hline
\end{tabular}
\end{center}
\caption{Comparison of the $(\Delta^*_{S_1}, k^*)$ pairs with (as in Section~\ref{sect:conn_ch}) and without (as in Section~\ref{sect:comm_age}) gossip at the cluster heads. }
\label{table:exp_len}
\vspace{-0.5cm}
\end{table}
Next, we look at the version age when the cluster heads form a ring network as in Section~\ref{sect:conn_ch}. For this simulation, we use the setup of Fig.~\ref{Fig:sim_results_all_v2}(c) and take $\lambda_{ca} = 4$ and $\lambda_{cb}=6$. We see in Fig.~\ref{Fig:connected_heads} for all network types within clusters, i.e., disconnected, ring, and fully connected networks, that version age of a single end node improves when the cluster heads exchange information among themselves. In addition, we observe that with the additional gossip at the cluster heads, the version age optimal cluster size for each case is now smaller. Comparison of the optimal cluster size and the corresponding minimum version age achieved for each type of network is given in Table~\ref{table:exp_len} with and without gossip at the cluster heads. In Table~\ref{table:exp_len}, we observe that the biggest version age improvement is obtained in the case of disconnected clusters, as the additional communication at the cluster heads is more valuable when nodes within clusters are not connected at all.
In our last numerical result, we look at the version age in hierarchical clustered gossip networks as in Section~\ref{sect:hier} with $h=3$ hierarchy levels. Here, we consider the number of nodes $n=120$, and take $\lambda_e = 1$, $\lambda_s=1$, and total update rate of a node as $\lambda=5$. In this simulation, we consider different $(\lambda_a, \lambda_b)$ pairs, and find the optimal cluster sizes at each hierarchical level $k_1$, $k_2$, and $k_3$ that minimize the version age of a node at the last hierarchical level as these nodes experience the highest version age in the network. We note that the selection of the $(\lambda_a, \lambda_b)$ is important. While choosing a large $\lambda_a$ increases the connectivity between the nodes within clusters, and thus can lower the version age of the nodes at the same hierarchical level, it may also increase the version age of the nodes at the higher hierarchical levels. For this reason, among the $(\lambda_a, \lambda_b)$ pairs given in Table~\ref{table:hierarchy}, we see that choosing $\lambda_a = 2$, and $\lambda_b = 3$ achieves the lowest version age with the optimum cluster sizes equal to $k_1=3$, $k_2= 13$, and $k_3= 2$. We also note that when $\lambda_a$ is relatively small, i.e., $\lambda_a=1$, most of the nodes are placed at the third hierarchical level, i.e., out of $n=120$ nodes, $k_1 k_2 k_3 = 78$ nodes are placed at the third hierarchical level whereas $k_1=3$ nodes and $k_1 k_2 = 39$ nodes are placed in the first and the second hierarchical levels, respectively. As we increase the connectivity among the nodes within the same level ($\lambda_a$), we see that the number of nodes at the upper hierarchical levels increases.
\begin{table}[t]
\small
\centering
\begin{center}
\begin{tabular}{ | l | l | l | l | l | l |}
\hline
$\lambda_a$ & $\lambda_b$ & $k_1$ &$k_2$ &$k_3$ &$\Delta_{S_1}^3$ \\ \hline
1 & 4 & 3 & 3 & 12 & 3.7992 \\ \hline
2 & 3 & 3 & 13 & 2 & 3.7239 \\ \hline
3 & 2 & 3 & 13 & 2 & 3.9143 \\ \hline
4 & 1 & 8 & 7 & 1 & 4.3354 \\ \hline
\end{tabular}
\end{center}
\caption{Average version age of a single node at the third hierarchy level, $\Delta_{S_1}^3$, with $h=3$, $n=120$, $\lambda_e =1$, $\lambda_{s} =1$, and $\lambda_a+\lambda_b = 5$. For given $(\lambda_a, \lambda_b)$ pairs, we find the optimum $k_1$, $k_2$, and $k_3$ values that minimize $\Delta_{S_1}^3$. }
\label{table:hierarchy}
\vspace{-0.5cm}
\end{table}
\section{Discussion \& Conclusion}\label{sect_discuss_conc}
We considered a system where there is a single source and $n$ receiver nodes that are grouped into distinct equal-sized clusters. Nodes in each cluster participate in gossiping to relay their stored versions of the source information to their neighbors. We considered four different types of connectivity among the nodes within the same cluster: disconnected, uni-directional ring, bi-directional ring, and fully connected. First, we considered the use of dedicated cluster heads in each cluster that facilitate communication between the source and the receiver nodes. For each of these network models, we found the average version age and its scaling as a function of the network size $n$. In particular, we showed that an average version age scaling of $O(\sqrt{n})$, $O(n^{\frac{1}{3}})$, and $O(\log n)$ is achievable per user in disconnected, ring, and fully connected cluster topologies. We then allowed information exchange among the cluster heads and showed that the version age scaling in the case of disconnected and ring networks in each cluster can be improved to $O(n^{\frac{1}{3}})$ and $O(n^{\frac{1}{4}})$, respectively, when the cluster heads also participate in gossiping through a ring formation. Interestingly, we observed that the increased gossip among the cluster heads does not improve the version age scaling when the nodes in each cluster form a fully connected network. Finally, we implemented a hierarchical clustered gossip structure and showed that per user average version scaling of $O(n^{\frac{1}{2h}})$ is achievable in the case of ring networks in each cluster, where $h$ denotes the number of hierarchy levels, even without the aid of the dedicated cluster heads. We numerically determined the optimum cluster sizes that minimize the version age for varying update rates at the source, cluster heads, and the nodes.
Here, the version age scaling improvement from the model in \cite{Yates21} to our hierarchical clustered gossip network design comes at the expense of increased number of connections at the network. For example, considering a ring network in each cluster, the $O(\sqrt{n})$ scaling result of \cite{Yates21} is obtained by $3n$ connections whereas our cluster head-aided $O(n^{\frac{1}{3}})$ scaling result is achieved as a result of a total $3n + n^{\frac{1}{3}}$ connections in the network. When the cluster heads also form a ring network this number increases to $3n + 3\sqrt{n}$ to achieve an $O(n^{\frac{1}{4}})$ scaling result. Finally, in the case of hierarchical clustered gossip networks with $h$ levels, we have a total of $3\sum_{i=1}^h n^{\frac{i}{h}}$ connections in the network which yield a per node average version age scaling of $O(n^{\frac{1}{2h}})$. Considering the operational cost of each such connection, service providers can design the network structure, i.e., the use of cluster heads, number of hierarchy levels along with the level of connectivity in each cluster, based on the operational budget to obtain the desired level of information freshness at the receiver nodes.
As a future direction, one may study the problem where clusters with different network models are present in a system. One may consider the optimization of the update rates from source to the cluster heads connected to the clusters with different network types.
\bibliographystyle{unsrt}
| {'timestamp': '2021-09-20T02:22:04', 'yymm': '2109', 'arxiv_id': '2109.08669', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08669'} | arxiv |
\section{Introduction}
Similarity-based clustering methods segment the data based on the similarity measure between the data points, such as spectral clustering~\citep{Ng01}, pairwise clustering method~\citep{ShentalZHW03}, K-means~\citep{HartiganW79}, and kernel K-means~\citep{Scholkopf1998-kernal-component-analysis}.
The success of similarity-based clustering highly depends on the underlying pairwise similarity over the data, which in most cases are constructed empirically, e.g. by Gaussian kernel or the K-Nearest-Neighbor (KNN) graph. In this paper, we model data clustering as a multiclass classification problem and seek for the data partition where the associated classifier, trained on cluster labels, can have low generalization error. Therefore, it is natural to formulate data clustering problem as a problem of training unsupervised classifiers: a classifier can be trained upon each candidate partition of the data, and the quality of the data partition can be evaluated by the performance of the trained classifier. Such classifier trained on a hypothetical labeling associated with a data partition is termed an unsupervised classifier.
We present {\em Clustering by Discriminative Similarity (CDS)}, wherein discriminative similarity is derived by the generalization error bound for an unsupervised similarity-based classifier. CDS is based on a novel framework of discriminative clustering by unsupervised classification wherein an unsupervised classifier is learnt from unlabeled data and the preferred hypothetical labeling should minimize the generalization error bound for the learnt classifier. When the popular Support Vector Machines (SVMs) is used in this framework, unsupervised SVM~\citep{XuNLS04} can be deduced. In this paper, a similarity-based classifier motivated by similarity learning~\citep{Balcan08,CortesMR13}, is used as the unsupervised classifier. By generalization analysis via Rademacher complexity, the generalization error bound for the unsupervised similarity-based classifier is expressed as sum of pairwise similarity between the data from different classes. Such pairwise similarity, parameterized by the weights of the unsupervised similarity-based classifier, serves as the discriminative similarity. The term ``discriminative similarity'' emphasizes the fact that the similarity is learnt so as to improve the discriminative capability of a certain classifier such as the aforementioned unsupervised similarity-based classifier.
\begin{figure}[!ht]
\centering
\begin{subfigure}{.48\textwidth}
\centering
\includegraphics[width=0.5\textwidth]{fig/learnable_weights_kernel_similarity.pdf}
\caption{}
\label{fig:adaptive-weights-importance:a}
\end{subfigure}
\begin{subfigure}{.48\textwidth}
\centering
\includegraphics[width=0.5\textwidth]{fig/mpie_s4.jpg}
\caption{}
\label{fig:adaptive-weights-importance:b}
\end{subfigure}
\caption{(a) Illustration of the importance of the adaptive weights $\bfsym \alpha$ in the discriminative similarity. The green dots and black dots are data from two clusters separated by the dashed curve. Kernel similarity with uniform weights, such as that for kernel K-means, would incur large similarity between data (marked with red circles) close to the cluster boundary, although they come from different clusters. The misleading large similarity potentially hurts the clustering performance. The learnable and adaptive weights $\alpha$ help reduce the similarity between data close to cluster boundary by a data-level weighting on the kernel similarity. Bluer pixels represent larger discriminative similarity. (b) Illustration of the discriminative similarity generated by CDSK between facial images of $4$ random people in MPIE Session 4 (MPIE S4), a dataset used for experiments. }
\label{fig:adaptive-weights-importance}
\end{figure}
\subsection{Contributions and Main Results}
Firstly, we present Clustering by Discriminative Similarity (CDS) where discriminative similarity is induced by the generalization error bound for unsupervised similarity-based classifier on unlabeled data. The generalization bound for such similarity-based classifier is of independent interest, which is among the few results of generalization bounds for classification using general similarity functions. When the general similarity function is set to a Positive Semi-Definite (PSD) kernel, the derived discriminative similarity between two data points $\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i$,$\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_j$ is $S_{ij}^{K} = 2(\bfsym \alpha_i + \bfsym \alpha_j - {\lambda}{\bfsym \alpha_i}{\bfsym \alpha_j}){K(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i-\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_j)}$, where $K$ can be an arbitrary PSD kernel and $\bfsym \alpha_i$ is the kernel weight associated with $\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i$. With theoretical and empirical study, we argue that $S_{ij}^{K}$ should be used for data clustering instead of the conventional kernel similarity corresponding to uniform kernel weights. In the case of binary classification, we prove that the derived discriminative similarity $S_{ij}^{K} $ has the same form as the similarity induced by the integrated squared error bound for kernel density classification (Theorem~\ref{theorem::ise}). Such connection suggests that there exists information-theoretic measure which is implicitly equivalent to our CDS framework for unsupervised learning, and our CDS framework is well grounded for learning similarity from unlabeled data.
Secondly, based on our CDS model, we develop a clustering algorithm termed Clustering by Discriminative Similarity via unsupervised Kernel classification (CDSK) in Section~\ref{sec::experiments}. CDSK uses a PSD kernel as the similarity function, and outperforms competing clustering algorithms, including nonparametric discriminative similarity based clustering methods and similarity graph based clustering methods, demonstrating the effectiveness of CDSK.
When the kernel weights $\{\bfsym \alpha_i\}$ are uniform, CDSK is equivalent to kernel K-means~\citep{Scholkopf1998-kernal-component-analysis}. CDSK is more flexible by learning adaptive kernel weights associated with different data points. As illustrated in Figure~\ref{fig:adaptive-weights-importance:a}, the adaptive weights $\bfsym \alpha$ help reduce similarity between data close to cluster boundary, which is difficult for kernel similarity with uniform weights such as that for kernel K-means. Figure~\ref{fig:adaptive-weights-importance:b} illustrates the desirable block-diagonal structure of the proposed discriminative similarity on a dataset used for experiments.
\subsection{Connection to Related Works}
Our CDS model is related to a class of discriminative clustering methods which classify unlabeled data by various measures on discriminative unsupervised classifiers, and the measures include generalization error~\citep{XuNLS04} or the entropy of the posterior distribution of the label~\citep{GomesKP10}. Discriminative clustering methods~\citep{XuNLS04} predict the labels of unlabeled data by minimizing the generalization error bound for the unsupervised classifier with respect to the hypothetical labeling. Unsupervised SVM is proposed in~\citet{XuNLS04} which learns a binary classifier to partition unlabeled data with the maximum margin between different clusters. The theoretical properties of unsupervised SVM are further analyzed in~\citet{Karnin12}. Kernel logistic regression classifier is employed in~\citet{GomesKP10}, and it uses the entropy of the posterior distribution of the class label by the classifier to measure the quality of the hypothetical labeling. CDS model performs discriminative clustering based on a novel unsupervised classification framework by considering similarity-based or kernel classifiers which are important classification methods in the supervised learning literature. In contrasts with kernel similarity with uniform weights, the induced discriminative similarity with learnable weights enhances its capability to represent complex interconnection between data. The generalization analysis for CDS is primarily based on distribution free Rademacher complexity. While~\citet{YangLYWH-discriminative-similarity14} propose nonparametric discriminative similarity for clustering, the nonparametric similarity requires probability density estimation which is difficult for high-dimensional data, and the fixed nonparametric similarity is not adaptive to complicated data distribution.
The paper is organized as follows. We introduce the problem setup in Section~\ref{sec:formulation-of-cds}, i.e. the formulation of Clustering by Discriminative Similarity. We then derive the generalization error bound for the unsupervised similarity-based classifier for CDS in Section~\ref{sec::generalization-bound-similarity} where the proposed discriminative similarity is induced by the error bound. The application of CDS in data clustering is shown in Section~\ref{sec::experiments}. Section~\ref{sec::similarity-kdc} shows that the discriminative similarity can also be induced by kernel density classification if the similarity function is a PSD kernel. Throughout this paper, the term kernel stands for the PSD kernel if no special notes are made.
\newpage
\section{Problem Setup: Formulation of Clustering by Unsupervised Classification}\label{sec:formulation-of-cds}
Given unlabeled data $\{\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_l\}_{l=1}^n \subset \RR^d$, clustering is equivalent to searching for the hypothetical labeling which is optimal in some sense. Each hypothetical labeling corresponds to a candidate data partition. Figure~\ref{fig:hypothetical-labeling} illustrates four binary hypothetical labelings which correspond to four partitions of the data, and the data is divided into two clusters by each hypothetical labeling.
\begin{figure}[h!]
\centering \includegraphics[width=0.8\textwidth]{fig/1NN_labeling.pdf}
\caption{Illustration of binary hypothetical labelings}
\label{fig:hypothetical-labeling}
\end{figure}
The discriminative clustering literature~\citep{XuNLS04,GomesKP10} has demonstrated the potential of multi-class classification for clustering problem. Inspired by the natural connection between clustering and classification, we proposes the framework of Clustering by Unsupervised Classification which models clustering problem as a multi-class classification problem: a classifier is learnt from unlabeled data with a hypothetical labeling, which is associated with a partition of the unlabeled data. The optimal hypothetical labeling is supposed to be the one such that its associated classifier has the minimum generalization error bound. To study the generalization bound for the classifier learnt from the hypothetical labeling, the concept of classification model is needed. Given unlabeled data $\{\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_l\}_{l=1}^n$, a classification model $M_{\cY}$ is constructed for any hypothetical labeling $\cY = \{y_l\}_{l=1}^n$ as follows.
\vspace{0.1in}
\begin{definition}\label{def:classification-model}
The classification model corresponding to the hypothetical labeling $\cY = \{y_l\}_{l=1}^n$ is defined as $M_{\cY}=\left(\cS,F\right)$. $\cS=\{\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_l, y_l\}_{l=1}^n$ are the labeled data by the hypothetical labeling $\cY$, and $\cS$ are assumed to be i.i.d. samples drawn from the some unknown joint distribution $P_{XY}$, where $(X,Y)$ is a random couple, $X
\in \cX \subseteq \RR^d$ represents the data in some domain $\cX$, and $Y \in \left\{ {1,2,...,c} \right\}$ is the class label of $X$, $c$ is the number of classes. $F$ is a classifier trained on $\cS$. The generalization error of the classification model $M_{\cY}$ is defined as the generalization error of the classifier $F$ in $M_{\cY}$.
\end{definition}
\vspace{0.1in}
\textbf{The basic assumption of CDS is that the optimal hypothetical labeling minimizes the generalization error bound for the classification model.} With $f$ being different classifiers, different discriminative clustering models can be derived. When SVMs is used in the above discriminative model, unsupervised SVM~\citep{XuNLS04} is obtained.
In~\citet{Balcan08}, the authors proposes a classification method using general similarity functions. The classification rule measures the similarity of the test data to each class, and then assigns the test data to the class such that the weighed average of the similarity between the test data and the training data belonging to that class is maximized over all the classes. Inspired by this classification method, we now consider using a general symmetric and continuous function $S \colon \cX \times \cX \to [-1,1]$ as the similarity function in our CDS model. We propose the following hypothesis,
\bal\label{eq:hypothesis}
&h_S(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},y) = \sum\limits_{i \colon y_i = y} {\bfsym \alpha_i}{ S(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}, {\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i})}.
\eal%
In the next section, we derive generalization bound for the unsupervised similarity-based classifier based on the above hypothesis, leading to discriminative similarities for data clustering.
\vspace{-0.02in}
\section{Generalization Bound for Similarity-based Classifier}\label{sec::generalization-bound-similarity}
\vspace{-0.02in}
In this section, the generalization error bound for the classification model in Definition~\ref{def:classification-model} with the unsupervised similarity-based classifier is derived as a sum of discriminative similarity between the data from different classes.
\subsection{Generalization Bound}
\label{sec::generalization-bound-main}
The following notations are introduced before our analysis. Let $\bfsym \alpha = [\bfsym \alpha_1,\ldots,\bfsym \alpha_n]^{\top}$ be the nonzero weights that sum up to $1$, $\bfsym \alpha^{(y)}$ be a $n \times 1$ column vector representing the weights belonging to class $y$ such that $\bfsym \alpha_i^{(y)}$ is $\bfsym \alpha_i$ if $y = y_i$, and $0$ otherwise. The margin of the labeled sample $(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},y)$ is defined as $m_{h_S}(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},y) = h_S(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},y) - \textup{argmax}_{y' \neq y} h_S(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},y')$, the sample $(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},y)$ is classified correctly if $m_{h_S}(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},y) \ge 0$.
The general similarity-based classifier $f_S$ predicts the label of the input $\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}$ by $f_S(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X})=\textup{argmax}_{y \in \{1,\ldots,c\}} h_S(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},y)$. We then begin to derive the generalization error bound for $f_S$ using the Rademacher complexity of the function class comprised of all the possible margin functions $m_{h_S}$. The Rademacher complexity~\citep{Bartlett2003,Koltchinskii01} of a function class is defined below:
\begin{definition}\label{def:RC}
Let $\{\sigma_i\}_{i=1}^n$ be $n$ i.i.d. random variables such that $\textup{Pr}[\sigma_i = 1] = \textup{Pr}[\sigma_i = -1] = \frac{1}{2}$. The Rademacher complexity of a function class $\cA$ is defined as
\bal\label{eq:RC}
&\mathfrak{R}} %\usepackage{eufrak(\cA) = {\mathbb{E}}_{\{\sigma_i\},\{\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i\}}\left[\sup_{h \in \cA} {\abth{\frac{1}{n} \sum\limits_{i=1}^n {\sigma_i}{h(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i)} } } \right].
\eal%
\end{definition}
In order to analyze the generalization property of the classification rule using the general similarity function, we first investigate the properties of general similarity function and its relationship to PSD kernels in terms of eigenvalues and eigenfunctions of the associated integral operator. The integral operator $({L_S}f)(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}) = \int {S(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},\bfm t} \def\bT{\bfm T} \def\TT{\mathbb{T})f(\bfm t} \def\bT{\bfm T} \def\TT{\mathbb{T})} d \bfm t} \def\bT{\bfm T} \def\TT{\mathbb{T}$ is well defined. It can be verified that $L_S$ is a compact operator since $S$ is continuous. According to the spectral theorem in operator theory, there exists an orthonormal basis $\{\phi_1,\phi_2,\ldots\}$ of $\cL^2$ which is comprised of the eigenfunctions of $L_S$, where $\cL^2$ is the space of measurable functions which are defined over $\cX$ and square Lebesgue integrable. $\phi_k$ is the eigenfunction of $L_S$ with eigenvalue $\lambda_k$ if ${L_S}{\phi_k} = {\lambda_k}{\phi_k}$. The following lemma shows that under certain assumption on the eigenvalues and eigenfunctions of $L_S$, a general symmetric and continuous similarity can be decomposed into two PSD kernels.
\begin{lemma}{\label{lemma::decompose-similarity}}
Suppose $S \colon \cX \times \cX \to [-1,1]$ is a symmetric continuous function, and $\{\lambda_k\}$ and $\{\phi_k\}$ are the eigenvalues and eigenfunctions of $L_S$ respectively. Suppose $\sum\limits_{k \ge 1} {\lambda_k}|\phi_k(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X})|^2 < C$ for some constant $C > 0$. Then $S(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},\bfm t} \def\bT{\bfm T} \def\TT{\mathbb{T}) = \sum\limits_{k \ge 1} {\lambda_k}{\phi_k(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X})}{\phi_k(\bfm t} \def\bT{\bfm T} \def\TT{\mathbb{T})}$ for any $\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},\bfm t} \def\bT{\bfm T} \def\TT{\mathbb{T} \in \cX$, and it can be decomposed as the difference between two positive semi-definite kernels,
that is, $S(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},\bfm t} \def\bT{\bfm T} \def\TT{\mathbb{T}) = S^{+}(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},\bfm t} \def\bT{\bfm T} \def\TT{\mathbb{T}) - S^{-}(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},\bfm t} \def\bT{\bfm T} \def\TT{\mathbb{T})$, with
\bal \label{eq:S-decompose}
&S^{+}(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},\bfm t} \def\bT{\bfm T} \def\TT{\mathbb{T}) = \sum\limits_{k \colon \lambda_k \ge 0} \lambda_k \phi_k(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}) \phi_k (\bfm t} \def\bT{\bfm T} \def\TT{\mathbb{T}),
\quad S^{-}(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},\bfm t} \def\bT{\bfm T} \def\TT{\mathbb{T}) = \sum\limits_{k:\lambda_k < 0} |\lambda_k| \phi_k(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}) \phi_k (\bfm t} \def\bT{\bfm T} \def\TT{\mathbb{T}).
\eal%
\end{lemma}
\vspace{0.1in}
We now use a regularization term to bound the Rademacher complexity for the classification rule using the general similarity function. Let $\Omega^{+}(\bfsym \alpha) = {\sum\limits_{y=1}^c { {\bfsym \alpha^{(y)}}^{\top} {\bS^{+}} {\bfsym \alpha^{(y)}} } }$ and $\Omega^{-}(\bfsym \alpha) = {\sum\limits_{y=1}^c { {\bfsym \alpha^{(y)}}^{\top} {\bS^{-}} {\bfsym \alpha^{(y)}} } }$ with $[\bS^{+}]_{ij} = S^{+}(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i,\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_j)$ and $[\bS^{-}]_{ij} = S^{-}(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i,\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_j)$. The space $\cH_y$ of all the hypothesis $h_{S}(\cdot,y)$ associated with label $y$ is defined a
\begin{align*
&\cH_{S,y} = \{(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},y) \to \sum\limits_{i \colon y_i = y} {\bfsym \alpha_i}{S(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},{\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i})} \colon \bfsym \alpha \ge \bfm 0} \def\bone{\bfm 1, \bone^{\top}\bfsym \alpha =1,
\Omega^{+}(\bfsym \alpha) \le {B^{+}}^2,\Omega^{-}(\bfsym \alpha) \le {B^{-}}^2\}, 1 \le y \le c,
\end{align*}
with positive number $B^+$ and $B^-$ which bound $\Omega^{+}$ and $\Omega^{-}$ respectively. Let the hypothesis space comprising all possible margin functions be $\cH_S = \{(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},y) \to m_{h_S}(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},y) \colon h_S(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},y) \in \cH_{S,y} \}$. We then present the main result in this section about the generalization error of unsupervised similarity-based classifier $f_S$.
\begin{theorem}\label{theorem::similarity-error}
Given the discriminative model $M_{\cY}= (\cS, f_S)$, suppose $\Omega^{+}(\bfsym \alpha) \le {B^{+}}^2$, $ \Omega^{-}(\bfsym \alpha) \le {B^{-}}^2$, $\sup_{\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X} \in \cX} |S^{+}(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X})| \le R^2$, $\sup_{\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X} \in \cX} |S^{-}(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X})| \le R^2$ for positive constants $B^{+}$, $B^{-}$ and $R$. Then with probability $1-\delta$ over the labeled data $\cS$ with respect to any distribution in $P_{XY}$, under the assumptions of Lemma~\ref{lemma::decompose-similarity}, the generalization error of the general classifier $f_S$ satisfies
\bal\notag
R(f_S) =& \textup{Pr}\left[Y \neq f_S(X)\right]\\\label{eq:similarity-error-theorem}
\le& {\hat R_{n}(f_S)} + \frac{8R(2c-1){c}(B^{+} + B^{-})}{\gamma \sqrt n} + \left(\frac{16c(2c-1)(B^{+}+B^{-})R^2}{\gamma} + 1\right)\sqrt{\frac{\log{\frac{4}{\delta}}}{2n}},
\eal
where ${\hat R_{n}(f_S)} = \frac{1}{n} \sum\limits_{i=1}^n \Phi \Big(\frac{h_S(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i,y_i) - \sum\limits_{y \neq y_i}{h_S(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i,y)}}{\gamma} \Big)$ is the empirical loss of $f_S$ on the labeled data, $\gamma >0$ is a constant and $\Phi$ is defined as $\Phi(x) = \min\set{1,\max\{0,1-x\}}$.
Moreover, if $\gamma \ge c$, the empirical loss ${\hat R_{n}(f_S)}$ i
\bal\label{eq:similarity-error-similarity}
&{\hat R_{n}(f_S)} = 1 - \frac{1}{n\gamma} \sum\limits_{i,j=1}^n {\frac{\bfsym \alpha_i + \bfsym \alpha_j}{2}} {S(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i, {\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_j})} + \frac{1}{n\gamma} \sum\limits_{1 \le i < j \le n}^n 2({\bfsym \alpha_i + \bfsym \alpha_j}){S(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i,\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_j)} {{\rm 1}\kern-0.25em{\rm I}}_{y_i \neq y_j}.
\eal%
\end{theorem}
\begin{remark}
\label{remark::kernel-remark}
Lemma~\ref{lemma::RC-bound-S} in the Appendix shows that the Rademacher complexity of $\cH_S$ is bounded in terms of $B^{+}$ and $B^{-}$, and that is why these two quantities appear on the RHS of (\ref{eq:similarity-error-theorem}). In addition, when $S$ is a Positive Semi-Definite (PSD) kernel $K$, it can be verified that $S^{-} \equiv 0$, $S = S^{+}$.
\end{remark}
\vspace{0.05in}
\begin{remark}
When the decomposition $S = S^{+} - S^{-}$ exists and $S^{+}$, $S^{-}$ are PSD kernels, $S$ is the kernel of some Reproducing Kernel Kre{\u{\i}}n Space (RKKS)~\citep{Mary03-dissertation}. The authors of~\citet{Ong04-non-positive-kernels,Ong16-krein-space} analyze the problem of learning SVM-style classifiers with indefinite kernels from the Kre{\u{\i}}n space. However, their work does not show when and how an indefinite and general similarity function can have PSD decomposition, as well as the generalization analysis for the similarity-based classifier using such general indefinite function as similarity measure. Our analysis deals with these problems in Lemma~\ref{lemma::decompose-similarity} and Theorem~\ref{theorem::similarity-error}. It should be emphasized that our generalization bound is of independent interest in supervised learning, because it is among the few results of generalization bounds using general similarity-based classifier. Section~\ref{sec::significance-bound}
shows that the our bound is a principled result with strong connection to established generalization error bound for Support Vector Machines (SVMs) or Kernel Machines.
\end{remark}
\subsection{Tightness of the Bound}
\label{sec::tightness-of-bound}
Note that the generalization error $\textup{Pr}\left[Y \neq f(X)\right]$ is bounded by ${\hat R_{n}(f)} = \frac{1}{n} \sum\limits_{i=1}^n \Phi \Big(\frac{h_S(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i,y_i) - \sum\limits_{y \neq y_i}{h_S(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i,y)}}{\gamma} \Big)$ in Theorem~\ref{theorem::similarity-error}. The underlying principle behind this bound and all such bounds in the statistical machine learning literature such as~\citet{Bartlett2003} is the following property about empirical process (adjusted using our notations):
\bal\label{eq:empirical-process-inequality}
& \mathfrak{R}} %\usepackage{eufrak(\cH) \le \mathbb{E}_{\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},y} \sup_{h \in \cH} |\mathbb{E}_{\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},y} \hat R_{n}(f) - R_{n}(f) | \le 2\mathfrak{R}} %\usepackage{eufrak(\cH),
\eal%
where $\mathbb{E}_{\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},y}$ indicates expectation with respect to random couple $(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},y) \sim P_{XY}$, and $P_{XY}$ is a joint distribution in a discriminative model $M_{\cY}= (\cS, f)$. (\ref{eq:empirical-process-inequality}) is introduced in the classical properties of empirical process in~\citet{gine1984-limit-theorems-empirical-process}. By Lemma~\ref{lemma::RC-bound} of this paper, with probability at least $1-\delta$ over the data $\{\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i\}_{i=1}^n \overset{\text{i.i.d.}}{\sim} P_{XY}$,
\bal\label{eq:cH-bound}
& \mathfrak{R}} %\usepackage{eufrak(\cH) \le \frac{(2c-1){c}}{\sqrt n}B + {\sqrt 2}{Bc}(2c-1)\sqrt{\frac{\ln{\frac{2}{\delta}}}{2n}} = \cO(\frac{B}{\sqrt{n}})
\eal%
for some constant $B$. It follows from (\ref{eq:empirical-process-inequality}), (\ref{eq:cH-bound}), and concentration inequality (such as McDiarmid's inequality) that for each sufficiently large $n$, with large probability, $\sup_{h \in \cH} |\mathbb{E}_{\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},y} \hat R_{n}(f) - R_{n}(f) |$ is less than $\cO(\frac{B}{\sqrt{n}})$. Therefore, we can bound the expectation of the empirical loss, i.e. $\mathbb{E}_{\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},y} \hat R_{n}(f)$, tightly using the empirical loss $R_{n}(f)$ uniformly over the function space $\cH$.
\subsection{Theoretical Significance of the Bound}\label{sec::significance-bound}
To the best of our knowledge, our generalization error bound (\ref{eq:similarity-error-theorem}) is the first principled result about generalization error bound for general similarity-based classifier with strong connection to the established generalization error bound for Support Vector Machines (SVMs) or Kernel Machines.
We now explain this claim. When the similarity function $S$ is a PSD kernel function, we have $S^{-} \equiv 0, S = S^+$ as explained in Remark~\ref{remark::kernel-remark}. As a reminder, $S$ is the general similarity function used in the similarity-based classification, and $S^+,S^-$ are PSD kernel functions, and it is proved that $S$ can be decomposed by $S = S^+-S^-$ under the mild conditions of Lemma 3.1. It follows that we can set $\Omega^-(\bfsym \alpha) = 0$ and $B^-=0$. Plugging $B^-=0$ in the derived generalization error bound for the general similarity-based classification (\ref{eq:similarity-error-theorem}), we have
\bal\label{eq:similarity-error-theorem-seg1}
{\rm Prob}\left[Y \neq f_S(X)\right] \le {\hat R_{n}(f_S)} + \frac{8R(2c-1){c}B^{+}}{\gamma \sqrt n} + \left(\frac{16c(2c-1)B^{+}R^2}{\gamma} + 1\right)\sqrt{\frac{\log{\frac{4}{\delta}}}{2n}}.
\eal%
According to its definition, $\Omega^{+}(\bfsym \alpha) = {\sum\limits_{y=1}^c { {\bfsym \alpha^{(y)}}^{\top} {\bS} {\bfsym \alpha^{(y)}} } }$ because $\bS = \bS^+$. We define $B \coloneqq B^+$. Because $\Omega^{+}(\bfsym \alpha) \le {B^{+}}^2$ as mentioned in Theorem 3.2, $B$ satisfies ${\sum\limits_{y=1}^c { {\bfsym \alpha^{(y)}}^{\top} {\bS} {\bfsym \alpha^{(y)}} } } \le B^2$. As a result, when $S$ is a PSD kernel function, inequality (\ref{eq:similarity-error-theorem-seg1}) becomes
\bal\label{eq:similarity-error-theorem-seg2}
&{\rm Prob}\left[Y \neq f_S(X)\right] \le {\hat R_{n}(f_S)} + \frac{8R(2c-1){c}B}{\gamma \sqrt n} + \left(\frac{16c(2c-1)R^2 B}{\gamma} + 1\right)\sqrt{\frac{\log{\frac{4}{\delta}}}{2n}},
\eal%
with ${\sum\limits_{y=1}^c { {\bfsym \alpha^{(y)}}^{\top} {\bS} {\bfsym \alpha^{(y)}} } } \le B^2$.
\vspace{0.1in}
Note that the bound (\ref{eq:similarity-error-theorem-seg2}) is in fact the generalization error bound for supervised learning when using $S$ as the similarity function in the similarity-based classification. At the end of this subsection, we provide a lemma proving that ${\sum\limits_{y=1}^c {\bfsym \alpha^{(y)}}^{\top} {\bS} {\bfsym \alpha^{(y)}} } \le B^2 \Rightarrow {\bfsym \alpha}^{\top} {\bS} {\bfsym \alpha} \le cB^2$, where $c$ is the number of classes.
Now we compare the generalization error bound (\ref{eq:similarity-error-theorem-seg2}) to the established generalization error bound for Kernel Machines in~\citet[Theorem 21]{Bartlett2003} for the case that $c=2$ with notations adapted to our analysis. The bound in~\citet[Theorem 21]{Bartlett2003} is for binary classification, which is presented as follows:
\bal\label{eq:kernel-error-ref}
&{\rm Prob}\left[Y \neq f_S(X)\right] \le {\hat R_{n}(f_S)} + \frac{4{\sqrt R}B}{\gamma \sqrt n} + \left( \frac{8}{\gamma} + 1 \right) \sqrt{ \frac{\log 4/\delta}{2n} }, {\bfsym \alpha}^{\top} {\bS} {\bfsym \alpha} \le B^2.
\eal%
Comparing our generalization error bound (2) with $c=2$ to the max-margin generalization error bound (\ref{eq:kernel-error-ref}), it can be easily seen that the two bounds are equivalent up to a constant scaling factor. In fact, our bound (2) is more general which handles multi-class classification.
\vspace{0.1in}
\begin{lemma}\label{lemma::quadritic-bound-lemma}
When $S$ is a PSD kernel, then ${\sum\limits_{y=1}^c {\bfsym \alpha^{(y)}}^{\top} {\bS} {\bfsym \alpha^{(y)}} } \le B^2 \Rightarrow {\bfsym \alpha}^{\top} {\bS} {\bfsym \alpha} \le cB^2$.
\end{lemma}
\begin{proof}
Let $\mathcal H$ be the Reproducing Kernel Hilbert Space associated with the PSD kernel function $S$, and $\mathcal H$ is also called the feature space associated with $\bS$. We use $\langle \cdot,\cdot\rangle_{\mathcal H}$ to denote the inner product in the feature space $\mathcal H$. Then we have $S(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i, \bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_j) = \bS_{ij} = \langle \Phi (\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i), \Phi (\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_j)\rangle_{\mathcal H}$ where $\Phi$ is the feature mapping associated with $\mathcal H$. Because $\bfsym \alpha = \sum\limits_{y=1}^c \bfsym \alpha^{y}$, it can be verified that
$ {\bfsym \alpha}^{\top} {\bS} {\bfsym \alpha} = \sum\limits_{i=1}^n \sum\limits_{j=1}^n \bfsym \alpha_i \bfsym \alpha_j \bS_{ij} = \langle \sum\limits_{i=1}^n \bfsym \alpha_i \Phi (\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i), \sum\limits_{j=1}^n \bfsym \alpha_j \Phi (\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_j) \rangle \le c \sum\limits_{y=1}^c \langle e_y,e_y \rangle_{\mathcal H} $, where $e_y = \sum\limits_{i \colon y_i = y} {\bfsym \alpha}^{y}_i \Phi (\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i)$. It follows that $ {\bfsym \alpha}^{\top} {\bS} {\bfsym \alpha} \le c {\sum\limits_{y=1}^c {\bfsym \alpha^{(y)}}^{\top} {\bS} {\bfsym \alpha^{(y)}} } \le cB^2$.
\end{proof}
\subsection{Clustering by Discriminative Similarity}
\label{sec::CDS-model}
We let
\bal\label{eq:general-similarity}
&S_{ij}^{\rm sim} = 2(\bfsym \alpha_i + \bfsym \alpha_j ){S(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i, \bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_j)}
- 2{\lambda}{\bfsym \alpha_i}{\bfsym \alpha_j}S^{+}(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i, \bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_j) - 2{\lambda}{\bfsym \alpha_i}{\bfsym \alpha_j}S^{-}(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i, \bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_j)
\eal%
be the discriminative similarity between data from different classes, which is induced by the generalization error bound (\ref{eq:similarity-error-theorem}) for the unsupervised general similarity-based classifier $f_S$. Minimizing the bound (\ref{eq:similarity-error-theorem}) motivates us to consider the following problem that minimizes ${\hat R_{n}(f_S)} + \lambda\big(\Omega^{+}(\bfsym \alpha) + \Omega^{-}(\bfsym \alpha)\big)$, i.e.
\bal\label{eq:obj-cds-similarity-discrete}
&\min_{\bfsym \alpha,\cY}
\sum\limits_{1 \le i < j \le n}^n S_{ij}^{\rm sim} {{\rm 1}\kern-0.25em{\rm I}}_{y_i \neq y_j} - \sum\limits_{i,j=1}^n {\frac{\bfsym \alpha_i + \bfsym \alpha_j}{2}} {S(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i,\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_j)} + {\lambda} (\bfsym \alpha^{\top}{\bS^{+}}\bfsym \alpha + \bfsym \alpha^{\top}{\bS^{-}}\bfsym \alpha)
\,\,\, \nonumber \\
& s.t. \,\,\bfsym \alpha \ge \bfm 0} \def\bone{\bfm 1, \bone^{\top}\bfsym \alpha = 1,\cY = \{y_i\}_{i=1}^n,
\eal%
where ${\lambda}>0$ is the weighting parameter for the regularization term $\Omega^{+}(\bfsym \alpha) + \Omega^{-}(\bfsym \alpha)$. Note that we do not set $\lambda$ to $\frac{16c(2c-1)R^2 + 8{\sqrt 2}R(2c-1){c} }{{\sqrt 2}\gamma}$ exactly matching the RHS of (\ref{eq:similarity-error-theorem}), because $\lambda$ controls the weight of the regularization term which bounds the unknown complexity of the function class $\cH_S$. Note that (\ref{eq:obj-cds-similarity-discrete}) encourages the discriminative similarity $S_{ij}^{\rm sim}$ between the data from different classes small. The optimization problem (\ref{eq:obj-cds-similarity-discrete}) forms the formulation of Clustering by Discriminative Similarity (CDS).
\vspace{0.1in}
By Remark~\ref{remark::kernel-remark}, when $S$ is a PSD kernel $K$, $S^{-} \equiv 0$, $S = S^{+}$, $S_{ij}^{\rm sim}$ reduces to the following discriminative similarity for PSD kernels:
\bal\label{eq:kernel-similarity}
&S_{ij}^{K} = 2(\bfsym \alpha_i + \bfsym \alpha_j - {\lambda}{\bfsym \alpha_i}{\bfsym \alpha_j}){K(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i-\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_j)}, 1 \le i,j \le n,
\eal%
and $S_{ij}^{K}$ is the similarity induced by the unsupervised kernel classifier by the kernel $K$.
Without loss of generality, we set $K=K_{\tau}(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}) = \exp(-\frac{\|\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}\|_2^2}{2{\tau^2}})$ which is the isotropic Gaussian kernel with kernel bandwidth $\tau > 0$, and we omit the constant that makes integral of $K$ unit.
When setting the general similarity function to kernel $K_{\tau}$, CDS aims to minimize the error bound for the corresponding unsupervised kernel classifier, which amounts to minimizing the following objective functio
\bal\label{eq:obj-cds-discrete}
&\min_{\bfsym \alpha \in \Lambda,\cY = \{y_i\}_{i=1}^n}
\sum\limits_{1 \le i < j \le n}^n S_{ij}^{K} {{\rm 1}\kern-0.25em{\rm I}}_{y_i \neq y_j} - \sum\limits_{i,j=1}^n {\frac{\bfsym \alpha_i + \bfsym \alpha_j}{2}} {K_{\tau}(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i-\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_j)}
+ {\lambda} \bfsym \alpha^{\top} {\bK} \bfsym \alpha,
\eal%
where $S_{ij}^{K}$ is defined in (\ref{eq:kernel-similarity}) with $K = K_{\tau}$. $\bK \in \RR^{n \times n}$ and $\bK_{ij} = K_{\tau}(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i-\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_j)$. $\lambda$ is tuned such that $S_{ij}^{K} \ge 0$, e.g. $\lambda \le 2$. In Section~\ref{sec::similarity-kdc}, it is shown that the discriminative similarity (\ref{eq:kernel-similarity}) can also be induced from the perspective of kernel density classification by kernel density estimators with nonuniform weights. It supports the theoretical justification for the induced discriminative similarity in this section.
\section{Application to Data Clustering}\label{sec::experiments}
In this section, we propose a novel data clustering method termed Clustering by Discriminative Similarity via unsupervised Kernel classification (CDSK) which is an empirical method inspired by our CDS model when the similarity function is a PSD kernel $K = K_{\tau}$. In accordance with the CDS model in Section~\ref{sec::CDS-model}, CDSK aims to minimize (\ref{eq:obj-cds-discrete}). However, problem (\ref{eq:obj-cds-discrete}) involves minimization with respect to discrete cluster labels $\cY = \{y_i\}$ which is NP-hard. In addition, it potentially results in a trivial solution which puts all the data in a single cluster due to the lack of constraints on the cluster balance. When $\bY$ is a binary matrix where each column is a membership vector for a particular cluster, $\sum\limits_{1 \le i < j \le n}^n S_{ij}^{K} {{\rm 1}\kern-0.25em{\rm I}}_{y_i \neq y_j} = \frac{1}{2}{\rm Tr} (\bY^{\top} \bL^{K} \bY)$. Therefore, (\ref{eq:obj-cds-discrete}) is relaxed in the proposed optimization problem for CDSK below:
\bal\label{eq:obj-cdsk}
&\min_{\bfsym \alpha \in \Lambda, \bY \in \RR^{n \times c }}
\frac{1}{2}{\rm Tr} (\bY^{\top} \bL^{K} \bY) - \sum\limits_{i,j=1}^n {\frac{\bfsym \alpha_i + \bfsym \alpha_j}{2}} {K_{\tau}(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i-\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_j)} + {\lambda} \bfsym \alpha^{\top} {\bK} \bfsym \alpha
\quad s.t. \,\, \bY^{\top} \bD^{K} \bY = \bI_c,
\eal%
where $\Lambda = \{\bfsym \alpha \colon \bfsym \alpha \ge \bfm 0} \def\bone{\bfm 1, \bone^{\top} \bfsym \alpha = 1\}$, $\bS^{K}_{ij} = S_{ij}^{K}$, $\bL^{K} = \bD^{K} - \bS^{K}$ is the graph Laplacian computed with $\bS^{K}$, $\bD^{K}$ is a diagonal matrix with each diagonal element being the sum of the corresponding row of $\bS^{K}$: $[\bD^{K}]_{ii} = \sum\limits_{j=1}^n \bS_{ij}^{K}$, $\bI_c$ is a $c \times c$ identity matrix, $c$ is the number of clusters. The constraint in (\ref{eq:obj-cdsk}) is used to balance the cluster size. This is because minimizing (\ref{eq:obj-cds-discrete}) without any constraint on the cluster size results in a trivial solution where all data points form a single cluster. Inspired by spectral clustering~\citep{Ng01}, the constraint $\bY^{\top} \bD^{K} \bY = \bI_c$ used in CDSK prevents imbalanced data clusters.
\vspace{0.1in}
Problem (\ref{eq:obj-cdsk}) is optimized by coordinate descent. In each iteration of coordinate descent, optimization with respect to $\bY$ is performed with fixed $\bfsym \alpha$, which is exactly the same problem as that of spectral clustering with a solution formed by the smallest $c$ eigenvectors of the normalized graph Laplacian $(\bD^{K})^{-1/2}{\bL^{K}}(\bD^{K})^{-1/2}$; then the optimization with respect to $\bfsym \alpha$ is performed with fixed $\bY$, which is a standard constrained quadratic programming problem. The iteration of coordinate descent proceeds until convergence or the maximum iteration number $M$ is achieved. Each iteration solves two subproblems, (\ref{eq:obj-cdsk-1}) and (\ref{eq:obj-cdsk-2}). The algorithm of CDSK is described in Algorithm~\ref{alg:CDSK}.
\begin{algorithm} [!hbt]
\caption{Clustering by Discriminative Similarity via unsupervised Kernel classification (CDSK)}
\label{alg:CDSK}
\begin{algorithmic}
\State Input:
Unlabeled dataset $\set{\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_l}_{l=1}^n$, parameter $\lambda$, maximum iteration number $M$.
\For{$t \gets 1$ to $M$}
\State With fixed $\bfsym \alpha$, solve
\bal\label{eq:obj-cdsk-1}
&\min_{\bY \in \RR^{n \times c }}
{\rm Tr} (\bY^{\top} \bL^{K} \bY)
\quad s.t. \,\, \bY^{\top} \bD^{K} \bY = \bI_c,
\eal%
\State With fixed $\bY$, solve
\bal\label{eq:obj-cdsk-2}
&\min_{\bfsym \alpha \in \Lambda, }
{\rm Tr} (\bY^{\top} \bL^{K} \bY) - \sum\limits_{i,j=1}^n {\frac{\bfsym \alpha_i + \bfsym \alpha_j}{2}} {K_{\tau}(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i-\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_j)} + {\lambda} \bfsym \alpha^{\top} {\bK} \bfsym \alpha \nonumber \\
&\quad s.t. \,\, \bY^{\top} \bD^{K} \bY = \bI_c,
\eal%
\EndFor
\State Return $\bY$
\end{algorithmic}
\end{algorithm}
The first subproblem (\ref{eq:obj-cdsk-1}) takes $\cO(n^2c)$ steps using truncated Singular Value Decomposition (SVD) by Krylov subspace iterative method. We adopt Sequential Minimal Optimization (SMO) \citep{Platt98-SMO} to solve the second subproblem (\ref{eq:obj-cdsk-2}), which takes roughly $\cO(n^{2.1})$ steps as reported in~\citet{Platt98-SMO}. Therefore, the overall time complexity of CDSK is $\cO(M c n^2 + M n^{2.1})$. Furthermore, Section~\ref{sec::theory-coordinate-descent} in the appendix explains the theoretical properties of the coordinate descent algorithm for problem (\ref{eq:obj-cdsk}).
\vspace{0.1in}
The baseline named SC-NS performs spectral clustering on the nonparametric similarity proposed in~\citet{YangLYWH-discriminative-similarity14}. The baseline named SC-MS first constructs a similarity matrix between data denoted by $\bW$, where $\bW_{ij} = K_{\tau}(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i - \bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_j)$, then optimize the kernel bandwidth $h$ by minimizing $\sum\limits_i \|\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i - \frac{1}{d_i}\sum\limits_j \bW_{ij} \bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_j\|_2$ where $d_i = \sum\limits_j \bW_{ij}$. SC-MS then performs spectral clustering on $\bW$ with the kernel bandwidth $h$ obtained from the optimization.
\vspace{0.1in}
To demonstrate the advantage of the proposed parametric discriminative similarity, we first compare CDSK to clustering methods based on nonparametric similarity in the first part of the experiments, including spectral clustering with similarity matrix set by Gaussian kernel (SCK), spectral clustering with similarity matrix set by a manifold-based similarity learning method (SC-MS)~\citep{KarasuyamaM13}, and spectral clustering with similarity matrix set by the nonparametric discriminative similarity (SC-NS) in~\citet{YangLYWH-discriminative-similarity14}. In SC-MS, Gaussian kernel is used as data similarity, and the parameters of the diagonal covariance matrix is optimized so as to minimize the data reconstruction error term. SC-NS minimizes nonparametric kernel similarity between data across different clusters, which is the same objective as that of kernel K-means~\citep{Scholkopf1998-kernal-component-analysis}, so its performance is the same as kernel K-means.
\vspace{0.1in}
We conduct experiments on the ORL and Yale face datasets, UCI Ionosphere dataset, the MNIST handwritten digits dataset and the Georgia Face dataset. The ORL face dataset has face images of $40$ people and there are $10$ images for each person, while the Yale face dataset has face images of $15$ people with $11$ images for each person. The Ionosphere data contains $351$ points of dimensionality $34$. The MNIST handwritten digits database has a total number of $70000$ samples of dimensionality $1024$ for digits from $0$ to $9$. The digits are normalized and centered in a fixed-size image. For MNIST dataset, we randomly select $500$ samples for each digit to obtain a subset of MNIST data consisting of $5000$ samples. The random sampling is performed for $10$ times and the average clustering performance is recorded. The Georgia Face dataset contains images of $50$ people, and each person is represented by $15$ color images with cluttered~background.
\vspace{0.1in}
\begin{table}[!hbt]
\centering
\caption{Clustering results on various datasets with comparison to methods based on nonparametric similarity}
\resizebox{1\linewidth}{!}{
\begin{tabular}{|c|c|c|c|c|c|c|c|}
\hline
Methods
&Measure & ORL &Yale &Ionosphere &Georgia Face &MNIST \\\hline
\multirow{2}{*}{SCK} &AC &0.6325 &0.4606 &0.6667 &0.4987 &0.4922 \\ \cline{2-7}
&NMI &0.7820 &0.5182 &0.0692 &0.6856 &0.4755 \\ \hline
\multirow{2}{*}{SC-MS} &AC &0.6075 &0.4788 &0.6553 &0.5218 &0.5135 \\ \cline{2-7}
&NMI &0.7840 &\textbf{0.5619} &0.0544 &0.7066 &0.4926 \\ \hline
\multirow{2}{*}{SC-NS} &AC &0.6275 &0.4667 &0.6667 &0.5032 &0.5174\\ \cline{2-7}
&NMI &0.7804 &0.5225 &0.0692 &0.6978 &0.5083 \\ \hline
\multirow{2}{*}{CDSK} &AC &\textbf{0.7100} $\pm$ 0.0039 &\textbf{0.4848} $\pm$ 0.0028 &\textbf{0.6838} $\pm$ 0.0040 &\textbf{0.5432} $\pm$ 0.0126 &\textbf{0.5280} $\pm$ 0.0474 \\ \cline{2-7}
&NMI &\textbf{0.8325} $\pm$ 0.0065 &0.5449 $\pm$ 0.0079 &\textbf{0.1029} $\pm$ 0.0085 &\textbf{0.7475} $\pm$ 0.0493 &\textbf{0.5179} $\pm$ 0.0836 \\ \hline
\end{tabular}
}
\label{table:results}\vspace{0.15in}
\end{table}
The results of different clustering methods are shown in Table~\ref{table:results} with accuracy (AC) and normalized mutual information (NMI)~\citep{Zheng04} as the performance measures. Except for SC-MS, the kernel bandwidth in all methods is set as the variance of the pairwise Euclidean distance between the data.
$\lambda$ is a hyperparameter which is chosen from $\{0.05,0.1,0.2,0.3,0.4,0.5\}$ in our experiments. We empirically find that $\lambda=0.1$ renders the best clustering accuracy on MNIST dataset, and this choice of $\lambda$ generalizes well to all the other datasets throughout all the experiments in this section. Suppose the optimization of CDSK comprises $M$ iterations of coordinate descent, then the overall time complexity of CDSK is $\cO(M c n^2 + M n^{2.1})$. $M$ is set to $20$ throughout all the experiments. For clustering methods involving random operations, the average performance over $10$ runs is reported.
\begin{table}[!hbt]
\centering
\caption{ Clustering results on CMU PIE, CMU Multi-PIE which contains the facial images captured in four sessions (S$1$ to S$4$) and UMIST face dataset. $c$ in the left column is the cluster number, i.e. the first $c$ clusters of the entire data are used for clustering.}
\resizebox{1\linewidth}{!}{
\begin{tabular}{|c|c|c|c|c|c|c|c|}
\hline
\begin{tabular}{c}CMU PIE \\ \hline
\# Clusters \end{tabular}
&Measure & Kernel K-means & SC &$\ell^{1}$-Graph &SMCE &Lap-$\ell^{1}$-Graph &CDSK \\\hline
\multirow{2}{*}{c = 20} &AC &0.1327 &0.1288 &0.2435 &0.2321 &0.3212 &\textbf{0.3606} $\pm$ 0.0295\\ \cline{2-8}
&NMI &0.1220 &0.1342 &0.2895 &0.2942 &0.4007 &\textbf{0.4876} $\pm$ 0.0459\\ \hline
\multirow{2}{*}{c = 40} &AC &0.1054 &0.0867 &0.2443 &0.1752 &0.3412 &\textbf{0.3555} $\pm$ 0.0878\\ \cline{2-8}
&NMI &0.1534 &0.1422 &0.3344 &0.2976 &0.4789 &\textbf{0.4834} $\pm$ 0.0724\\ \hline
\multirow{2}{*}{c = 68} &AC &0.0829 &0.0718 &0.2318 &0.1603 &0.3012 &\textbf{0.3190 }$\pm$ 0.0892 \\ \cline{2-8}
&NMI &0.1865 &0.1760 &0.3378 &0.3406 &\textbf{0.5121} &{0.4993} $\pm$ 0.0784 \\ \hline
MPIE &Measure & Kernel K-means & SC &$\ell^{1}$-Graph &SMCE &Lap-$\ell^{1}$-Graph &CDSK \\\hline
\multirow{2}{*}{MPIE S$1$}
&AC &0.1167 &0.1309 &0.5892 &0.1721 &0.5892 &\textbf{0.6582}$\pm$ 0.0172 \\ \cline{2-8}
&NMI &0.5021 &0.5289 &0.7653 &0.5514 &0.7750 &\textbf{0.8540}$\pm$ 0.0172 \\ \hline
\multirow{2}{*}{MPIE S$2$}
&AC &0.1330 &0.1437 &0.6994 &0.1898 &0.6994 &\textbf{0.7226}$\pm$ 0.0349 \\ \cline{2-8}
&NMI &0.4847 &0.5145 &0.8149 &0.5293 &0.8149 &\textbf{0.8826}$\pm$ 0.0230 \\ \hline
\multirow{2}{*}{MPIE S$3$}
&AC &0.1322 &0.1441 &0.6316 &0.1856 &0.6316 &\textbf{0.6753}$\pm$ 0.0128 \\ \cline{2-8}
&NMI &0.4837 &0.5150 &0.7858 &0.5155 &0.7858 &\textbf{0.8657}$\pm$ 0.0391 \\ \hline
\multirow{2}{*}{MPIE S$4$}
&AC &0.1313 &0.1469 &0.6803 &0.1823 &0.6803 &\textbf{0.7260}$\pm$ 0.0109 \\ \cline{2-8}
&NMI &0.4876 &0.5251 &0.8063 &0.5294 &0.8063 &\textbf{0.8926}$\pm$ 0.0314 \\ \hline
\begin{tabular}{c}UMIST Face \\ \hline
\# Clusters \end{tabular}
&Measure & Kernel K-means & SC &$\ell^{1}$-Graph &SMCE &Lap-$\ell^{1}$-Graph &CDSK \\\hline
\multirow{2}{*}{c = 12} &AC &0.4478 &0.4655 &0.5195 &0.4955 &0.5706 &\textbf{0.6246}$\pm$ 0.0059 \\ \cline{2-8}
&NMI &0.6121 &0.6049 &0.6086 &0.6445 &0.6994 &\textbf{0.7244}$\pm$ 0.0125 \\ \hline
\multirow{2}{*}{c = 20} &AC &0.4216 &0.4174 &0.4417 &0.4452 &0.4991 &\textbf{0.6765}$\pm$ 0.0331 \\ \cline{2-8}
&NMI &0.6377 &0.6095 &0.6489 &0.6641 &0.6893 &\textbf{0.7982}$\pm$ 0.0212 \\ \hline
\end{tabular}
}
\label{table:cmupie-multipie-umist}
\end{table}
\vspace{0.1in}
In the second part of the experiments, we compare CDSK to other competing similarity graph based clustering methods with the same parameter setting as that for the first part, including $\ell^{1}$-Graph~\citep{YanW09}, Laplacian regularized $\ell^{1}$-Graph (Lap-$\ell^{1}$-Graph)~\citep{YangWYWCH14-Laplacian-l1graph} and Sparse Manifold Clustering and Embedding (SMCE)~\citep{ElhamifarV11}. CDSK is also compared to Kernel K-means and spectral clustering (SC)~\citep{Ng01}. The comparison is performed on the CMU PIE face dataset, the CMU Multi-PIE (MPIE) dataset and the UMIST face dataset. CMU PIE face data contains $11554$ cropped face images of size $32 \times 32$ for $68$ persons, and there are around $170$ facial images for each person under different illumination and expressions. CMU Multi-PIE (MPIE) data~\citep{GrossMultiPIE} contains $8916$ facial images captured in four sessions. The UMIST face dataset is comprised of $575$ images of size $112 \times 92$ for $20$ people. The clustering results on these three datasets are shown in Table~\ref{table:cmupie-multipie-umist}. It can be observed that CDSK delivers better performance than the competing similarity graph based clustering methods, thanks to the adaptive weights in its kernel similarity. Moreover, in order to investigate the parameter sensitivity of CDSK with respect to $\lambda$, we vary $\lambda$ and illustrate the results of CDSK on the UMIST face dataset in Figure~\ref{fig:umist-lambda}. The performance of CDSK is noticeably better than other competing algorithms over a relatively large range of $\lambda$.
\begin{figure*}[t]
\begin{center}
\includegraphics[width=3.4in]{fig/ac_lambda_umist.pdf}
\includegraphics[width=2.95in]{fig/nmi_lambda_umist.pdf}
\caption{Clustering performance of CDSK with different values of $\lambda$ on the UMIST Face Data. Left: Accuracy; Right: NMI}
\label{fig:umist-lambda}
\end{center}
\end{figure*}
\newpage\clearpage
\section{Connection to Kernel Density Classification}\label{sec::similarity-kdc}
In this section, we show that the discriminative similarity (\ref{eq:kernel-similarity}) can also be induced from kernel density classification with varying weights on the data, and binary classification is considered in this section. For any classification model $M_{\cY}= (\cS, f)$ with hypothetical labeling $\cY$ and the labeled data $\cS = \{\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i,y_i\}_{i=1}^n$, suppose the joint distribution $P_{XY}$ over $\cX \times \{1,2\}$ has probabilistic density function $p(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},y)$. Let $P_X$ be the induced marginal distribution over the data with probabilistic density function $p(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X})$. Robust kernel density estimation methods~\citep{GirolamiH03,KimS08,MahapatruniG11,KimS12} suggest the following kernel density estimator where the kernel contributions of different data points are reflected by different nonnegative weights that sum up to $1$:\vspace{-0.15in}
\bal\label{eq:nonuniform-kde}
&\hat p(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}) ={\tau_0} \sum\limits_{i=1}^n {\bfsym \alpha_i}{K_{\tau}(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X} - {\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i})}, \bone^{\top} \bfsym \alpha = 1, \bfsym \alpha \ge 0,
\eal%
where $\tau_0 = \frac{1}{({2{\pi}})^{d/2}{h^d}}$. Based on (\ref{eq:nonuniform-kde}), it is straightforward to obtain the following kernel density estimator of the density function $p(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},y)$:
\bal\label{eq:nonuniform-kde-xy}
&\hat p(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},y) ={\tau_0} \sum\limits_{i:y_i = y} {\bfsym \alpha_i}{K_{\tau}(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X} - {\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i})}.
\eal%
Kernel density classifier is learnt from the labeled data $\cS$ and constructed by kernel density estimators (\ref{eq:nonuniform-kde-xy}). Kernel density classifier resembles the Bayes classifier, and it classifies the test data $\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}$ based on the conditional label distribution $P(Y|X=\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X})$, or equivalently, $\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}$ is assigned to class $1$ if $\hat p(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},1)- \hat p(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},2) \ge 0$, otherwise it is assigned to class $2$. Intuitively, it is preferred that the decision function $\hat r(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},\bfsym \alpha) = \hat p(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},1)- \hat p(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},2)$ is close to the true Bayes decision function $r = p(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},1)- p(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},2)$. \citet{GirolamiH03,KimS08} propose to use Integrated Squared Error (ISE) as the metric to measure the distance between the kernel density estimators and their true counterparts, and the oracle inequality is obtained that relates the performance of the $L_2$ classifier in~\citet{KimS08} to the best possible performance of kernel density classifier in the same category. ISE is adopted in our analysis of kernel density classification, and the ISE between the decision function $\hat r$ and the true Bayes decision function $r$ is defined as
\bal\label{eq:ise-def}
&{\rm ISE} (\hat r,r) = \|\hat r - r\|_{\cL_2}^2 = \int_{\RR^d} {(\hat r - r)^2} dx.
\eal%
The upper bound for the ISE ${\rm ISE} (r,\hat r)$ also induces discriminative similarity between the data from different classes, which is presented in the following theorem.
\vspace{0.1in}
\begin{theorem}\label{theorem::ise}
Let $n_1 = \sum\limits_{i=1} {\rm 1}\kern-0.25em{\rm I}_{y_i=1}$ and $n_2 = \sum\limits_{i=1} {\rm 1}\kern-0.25em{\rm I}_{y_i=2}$. With probability at least $1-2{n_2}\exp\big(-2(n-1)\varepsilon^2\big)-2{n}\exp\big(-2n\varepsilon^2\big)$ over the labeled data $\cS$, the ISE between the decision function $\hat r(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X},\bfsym \alpha)$ and the true Bayes decision function~$r(\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X})$~satisfie
\bal\label{eq:ise-theorem}
& {\rm ISE} (\hat r,r) \le \frac{\tau_0}{n} {\hat {\rm ISE}} (\hat r,r) + {\tau_1} K(\bfsym \alpha) + 2{\tau_0}\Big(\frac{1}{n-1}+\varepsilon\Big),
\eal%
where
\bal\label{eq:hat-ise}
&{\hat {\rm ISE}}(\hat r,r) = 4 {\sum\limits_{1 \le i < j \le n}(\bfsym \alpha_i+\bfsym \alpha_j) K_{\tau} (\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i - \bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_j) {{\rm 1}\kern-0.25em{\rm I}}_{y_i \neq y_j} } - {\sum\limits_{i,j = 1}^ n (\bfsym \alpha_i+\bfsym \alpha_j) K_{\tau} (\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i - \bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_j) },
\eal%
\bal\label{eq:reg-ise}
&K(\bfsym \alpha) = {\bfsym \alpha}^{\top} (\bK_{{\sqrt 2}h}){\bfsym \alpha} -
4\sum\limits_{1 \le i < j \le n} {\bfsym \alpha_i}{\bfsym \alpha_j} K_{{\sqrt 2}h} (\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i - \bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_j) {{\rm 1}\kern-0.25em{\rm I}}_{y_i \neq y_j},
\eal%
and $\bK_{{\sqrt 2}h}$ is the gram matrix evaluated on the data $\{\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i\}_{i=1}^n$ with the kernel $K_{{\sqrt 2}h}$.
\end{theorem}
Let $\lambda_1 > 0$ be a weighting parameter, then the cost function ${\hat {\rm ISE}} + \lambda_1 K(\bfsym \alpha)$, designed according to the empirical term ${\rm ISE} (\hat r,r)$ and the regularization term $K(\bfsym \alpha)$ in the ISE error bound (\ref{eq:ise-theorem}), can be expressed as
\begin{align*}
&{\hat {\rm ISE}} + {\lambda_1} K(\bfsym \alpha) \le {\sum\limits_{1 \le i < j \le n} S_{ij}^{\rm ise} {{\rm 1}\kern-0.25em{\rm I}}_{y_i \neq y_j} } - {\sum\limits_{i,j = 1}^ n (\bfsym \alpha_i+\bfsym \alpha_j) K_{\tau} (\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i - \bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_j) } + {\lambda_1}{\bfsym \alpha}^{\top} \bK_{{\sqrt 2}h}{\bfsym \alpha},
\end{align*}
where the first term is comprised of sum of similarity between data from different classes with similarity $S_{ij}^{\rm ise} = 4(\bfsym \alpha_i+\bfsym \alpha_j - {\lambda_1}{\bfsym \alpha_i}{\bfsym \alpha_j} )K_{\tau} (\bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_i - \bfm x} \def\bX{\bfm X} \def\XX{\mathbb{X}_j)$, and $S_{ij}^{\rm ise}$ is the discriminative similarity induced by the ISE bound for kernel density classification. Note that $S_{ij}^{\rm ise}$ has the same form as the discriminative similarity $S_{ij}^{K}$ (\ref{eq:kernel-similarity}) induced by our CDS model, up to a scaling constant and the choice of the balancing parameter $\lambda$.
\section{Conclusion}\label{sec::conclusion}
We propose a new clustering framework termed Clustering by Discriminative Similarity (CDS). CDS searches for the optimal partition of the data where the associated unsupervised classifier has minimum generalization error bound. Under this framework, discriminative similarity is induced by the generalization error bound for unsupervised similarity-based classifier, and CDS minimizes discriminative similarity between different clusters. The learnable weights in the induced discriminative similarity allow for adaptive similarity accommodating the local variation of the data. It is also proved that the discriminative similarity can be induced from kernel density classification. Based on CDS, we propose a new clustering method, CDS via unsupervised kernel classification (CDSK), and demonstrate its effectiveness in data clustering.
\newpage
\noindent\textbf{\large Appendix}
| {'timestamp': '2021-09-20T02:22:09', 'yymm': '2109', 'arxiv_id': '2109.08675', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08675'} | arxiv |
\section{Introduction}
Hierarchical text classification (HTC), where text labels are predicted within a hierarchical structure, is a challenging task that has not yet received due attention within the field of multi-label classification. HTC methods have been extensively applied in industry domains, e.g., news article classification \cite{AB2/GZC6PL_2008}, product classification in E-commerce \cite{Yu2018MultilevelDL}, bidding strategy in paid search marketing \cite{agrawal2013multi}.
\begin{figure}[t]
\centering
\includegraphics[width=0.95\columnwidth]{label_hierarchy.pdf}
\caption{(a): the static labeling process is uniform and simultaneous for all labels in the label hierarchy. (b): the dynamic labeling process where the lower-level labels depend on the upper-level labels. (c): the dynamic labeling process focuses on ancestor labels already generated on the current path. “Music” label is determined by “Arts” and “Features”, while “Football” label is ruled by “Sports”, “News”.}
\label{label hierarchy}
\end{figure}
In HTC tasks, labels at lower-level are inevitably sparse due to the hierarchical structure. Many studies \citep{hayete2005gotrees,barbedo2006automatic,xiao2007hierarchical,johnson-zhang-2015-effective} completely or partially neglect such hierarchical structure and fail to accurately predict those lower-level labels, achieving low Macro-F1 score. Existing studies \cite{8933476,wu-etal-2019-learning-learn} have proved that introducing structure information can boost the predictive power on low-level labels and thus improve the overall task performance. A number of studies \citep{cesa2006hierarchical,shimura-etal-2018-hft,pmlr-v80-wehrmann18a,banerjee-etal-2019-hierarchical} propose to construct multi-level classifiers that are trained independently and predicted sequentially, where only local maximum is achieved and propagation of error negatively impacts model prediction. Some studies design an end-to-end model that introduces various strategies (such as Tree-LSTM/GCN \cite{zhou-etal-2020-hierarchy}, graph-CNN \cite{10.1145/3178876.3186005} and hierarchical fine-tuning based CNN \cite{shimura-etal-2018-hft}) to encode the overall hierarchy information (as depicted in Figure \ref{label hierarchy} (a)) and predict all labels simultaneously and independently with sigmoid function, where label dependency across different levels (as depicted in Figure \ref{label hierarchy} (b)) is not captured in a more principled way and unnecessary noises are introduced. Although one recent study \cite{mao-etal-2019-hierarchical} develops label-dependent models with reinforcement learning, it still fails to address label dependency within each path (as depicted in Figure \ref{label hierarchy} (c)) and fails to fully integrate labels and text information.
This paper seeks to close the gap by proposing the PAMM-HiA-T5. We are not only the first to capture lower-level label dependency on upper-level ones with generation model, but also the first to identify hierarchical dependency within the specific path. In each step of prediction phase, our model predicts next label based on the text sequence and labels previously generated on current path. As illustrated in Figure \ref{label hierarchy}(c), our model sequentially predicts “Features”, “News”, “Arts”, “Sports”, “Music”, “Football” labels. In the process where label “Music” is generated, our model pays more attention on “Features” and “Arts” labels on its own path instead of “News” and “Sports” labels on another path.
Our PAMM-HiA-T5 method follows a two-step design.
\textbf{Hierarchy-aware T5 (HiA-T5)}, a variant of T5 that is fully aware of the level dependency. We firstly use Breadth-First Search (BFS) to flatten hierarchical labels into multi-level sequential label structure, transforming the hierarchy to sequence. T5 model is applied to map the text sequence to label sequence, where the text sequence and upper-level labels generated earlier are then integrated in order to determine the next label. As such, we are able to fully exploit label dependency across different levels.
\textbf{Path-adaptive mask mechanism (PAMM)}, a mechanism to exploit the label correlation within each path and eliminate the noise of other paths. We propose the path-adaptive mask mechanism to separate the sources of noises from different paths. Regularization is introduced in the training phase to encourage the model to pay more attention to ancestor labels on current path while penalizing those on other paths, according to both the text sequence and labels generated.
This study makes the following major contributions:
\begin{itemize}
\item We propose a novel HiA-T5 model, a multi-level sequential label generative model to exploit label dependency across different levels. The mapping relationship between text sequence and label sequence is examined in each step of prediction.
\item We propose an original PAMM to identify the label’s path information, separating the sources of noises from different paths to further improve prediction accuracy.
\item Experiments on various datasets show that our PAMM-HiA-T5 model achieves significantly and consistently better performance than state-of-the-art models. Boosting Micro-F1 score by $2.29\%$ and achieving substantial $4.68\%$ improvement in Macro-F1 score, we establish new state-of-art results on RCV1-V2. The ablation studies show that the improvements mainly come from our innovative approach instead of T5.
\end{itemize}
\section{Related Work}
Hierarchical text classification (HTC) is a critical task with numerous applications \cite{qu2012evaluation,agrawal2013multi,zhang2019higitclass,peng2016deepmesh}. By methods of hierarchical information modeling, HTC approaches can be categorized into flat, local and global approaches \citep{silla2011survey}.
Flat approaches \citep{hayete2005gotrees,barbedo2006automatic,xiao2007hierarchical,johnson-zhang-2015-effective} completely or partially ignore the label hierarchy and each label is independently predicted. Some of them simply ignore the invaluable hierarchical information and achieve poor performance. Some others predict leaf nodes first and then mechanically add their ancestor labels, which is only applicable where different paths in the label hierarchy share the same length.
Local approaches \citep{koller1997hierarchically,cesa2006hierarchical,shimura-etal-2018-hft,pmlr-v80-wehrmann18a,banerjee-etal-2019-hierarchical} construct multiple local classifiers so that the misclassification at a certain level is propagated downwards the hierarchy, easily leading to the exposure of bias \citep{silla2011survey}. Specifically, \citet{10.1145/1089815.1089821} proposes a top-down variant of SVM for HTC. \citet{10.1145/3178876.3186005} uses deep graph convolutional neural networks with hierarchical regularization. \citet{pmlr-v80-wehrmann18a} utilizes a multi-label neural network architecture with local and global optimization. To address the lower-level labels sparsity problem, \citet{shimura-etal-2018-hft} takes advantage of a CNN-based model with the fine-tuning method. \citet{banerjee-etal-2019-hierarchical} proposes to transfer the parameters of parent classifiers to initialize child classifiers for HTC task.
Global approaches \cite{10.1145/2487575.2487644,mao-etal-2019-hierarchical,wu-etal-2019-learning-learn,zhou-etal-2020-hierarchy,8933476}, where the entire structural information is encoded and all labels are simultaneously predicted, has become recent mainstream due to its better performance. \citet{10.1145/2487575.2487644} utilizes regularization to modify the SVM. Neural network architectures are also applied in global approaches. \citet{mao-etal-2019-hierarchical} handles HTC task with reinforcement-learning-based label assignment method. \citet{wu-etal-2019-learning-learn} uses meta-learning to model the label interaction for multi-label classification. \citet{zhou-etal-2020-hierarchy} utilizes the Bi-TreeLSTM and GCN to model hierarchical relationship and makes flat predictions for hierarchical labels. \citet{8933476} combines CNN, RNN, GCN, and CapsNet to model hierarchical labels. Although recent researchers have managed to introduce hierarchical information in different fashions, most of them still regard flat multi-label classification as the backbone of HTC where all labels are predicted simultaneously and independently. Their exploitation of hierarchical structure is far from insufficient.
\section{Problem Definition}
For HTC, we define the overall label hierarchy as a tree-like structure, denoted by $T=(L,E)$, where $L=\{l_1,l_2,\ldots,l_K\}$ refers to the set of all label nodes in the corpus and $K$ is the total number of them. $E$ refers to the set of edges indicating the nodes' parent-child relations. Formally, we denote text objects as $\mathcal{X}=\{X_1,X_2,\ldots,X_N\}$ and their labels as $\mathcal{L} =\{L_1, L_2,\ldots,L_N\}$.
Each text object is represented by a text sequence $X_i=[x_1,x_2,\ldots,x_J]$, where $x_j$ is a word and $J$ is the number of words in the text object. Meanwhile, each text object $X_i$ is mapped to a original label set $L_i=\{l_1,l_2,\ldots,l_k,1\leq k< K\}$ that contains multiple labels. We then define a set of special symbols $S=\{\_,/,EOS\}$ to identify special hierarchical relationships in the hierarchy.
All labels $L$ in the corpus constitute the overall label hierarchy $T$. The original label set $L_i=\{l_1,l_2,\ldots,l_k,0\leq k< K\}$ of any text object $X_i$ constitute an partial label hierarchy $T_i$ and $T_i\subset T$. We aim to train a model to predict corresponding label set $L_i$ for each text object $X_i$, where the label set $L_i$ are constrained by the hierarchy $T_i$.
\section{Background}
The T5 model consists of an encoder-decoder architecture, which mainly includes the Multi-head Attention Mechanism, the Feed-Forward Network and so on \cite{JMLR:v21:20-074}, as depicted in the Figure \ref{T5 structure}.
\begin{figure}[htbp]
\centering
\includegraphics[width=0.95\columnwidth]{T5.pdf}
\caption{Structure of T5. Following each Multi-head Attention sublayer and Feed-Forward sublayer, there are a series of dropout, residual connection and layer normalization. These parts are omitted in the figure and the following formulas for simplicity’s sake.}
\label{T5 structure}
\end{figure}
Attention is calculated as:
\begin{equation}
Attention(Q,K,V)=Score(Q,K)V
\end{equation}
\begin{equation}
Score(Q,K)=softmax(\frac{QK^T}{\sqrt{d_k}})\label{eq2}
\end{equation}
where $Q,K,V\in\mathbb{R}^{n\times d_{model}}$ and the length of sequence is $n$. The attention score matrix $Score\in\mathbb{R}^{n\times n}$ is applied to the matrix $V$ to calculate the weighted sum and obtain the final attention result. The results upon independently executing attention mechanism on $H$ heads are concatenated to get Multi-head Attention.
\begin{equation}
MultiHead(Q,K,V)=Concat(head_1,\ldots,head_h)W^O
\end{equation}
\begin{equation}
head_i=Attention(QW_i^Q,KW_i^K,VW_i^V)
\end{equation}
where the projections matrices $W_i^Q,W_i^k,W_i^v\in\mathbb{R}^{d_{model}\times d_{head}}$ and $W^O\in\mathbb{R}^{d_{model}\times d_{model}}$ are learnable parameters. $d_{head}$ is the dimension of each head and $d_{model}=H\times d_{head}$.
The Feed-Forward Network consists of two linear transformations with a nonlinear activation function in between.
\begin{equation}
FFN(x) = max(0,xW_1+b_1)W_2+b_2
\end{equation}
T5 encoder is composed of a stack of ``encoder blocks'' and we define the number of blocks as $B$. Each block contains a self-attention sublayer and a feed-forward sublayer. The input sequence of encoder is mapped to the embedding $Q_{encoder},K_{encoder},V_{encoder}\in\mathbb{R}^{n\times d_{model}}$, which are then passed into the encoder.
\begin{equation}
\begin{aligned}
&Block_{Encoder}(Q_{encoder},K_{encoder},V_{encoder})\\=&FFN(MultiHead(Q_{encoder},K_{encoder},V_{encoder}))
\end{aligned}
\end{equation}
\begin{equation}
\begin{aligned}
&Encoder(Q_{encoder},K_{encoder},V_{encoder})\\=&stack(Block_{Encoder}(Q_{encoder},K_{encoder},V_{encoder}))
\end{aligned}
\end{equation}
The structure of the decoder looks similar to that of the encoder, except that it has an additional encoder-decoder attention sublayer that attends to the output of the encoder stack, following each casual self-attention sublayer. In the end, we obtain the decoder output denoted as $O_{decoder}$.
\begin{equation}
\begin{aligned}
&Block_{Decoder}(Q_{decoder},K_{decoder},V_{decoder},O_{encoder})\\& =FFN(MultiHead(MultiHead(Q_{decoder},K_{decoder},\\& \quad ~ V_{decoder}),O_{encoder},O_{encoder}))
\end{aligned}
\end{equation}
\begin{equation}
\begin{aligned}
&Decoder(Q_{decoder},K_{decoder},V_{decoder},O_{encoder})\\&=stack(Block_{Decoder}(Q_{decoder},K_{decoder},V_{decoder},\\& \quad ~ O_{encoder}))
\end{aligned}
\end{equation}
\section{Hierarchy-Aware T5 with Path-Adaptive Mask Mechanism}
As depicted in Figure \ref{overall structure}, we propose a PAMM-HiA-T5 model for HTC: a \textbf{Hi}erarchy-\textbf{A}ware \textbf{T5} model with \textbf{P}ath-\textbf{A}daptive \textbf{M}ask \textbf{M}echanism. PAMM-HiA-T5 consisits of the HiA-T5 for level-dependent label generation and the PAMM for path-specific label generation.
\begin{figure*}[t]
\centering
\includegraphics[width=0.9\textwidth]{overall_structure.pdf}
\caption{The overall structure of PAMM-HiA-T5. PAMM-HiA-T5 consists of a HiA-T5 and a PAMM. The dataflows of one decoder layer are illustrated in the yellow dashed box.}
\label{overall structure}
\end{figure*}
\subsection{Hierarchy-Aware T5}
\paragraph{Level-dependent HiA-T5}
The major shortcoming of previous HTC methods is the inadequate application of hierarchy information. In contrast, HiA-T5 exploits label dependency across different levels of the hierarchy with Breadth-First Search (BFS) and multi-head attention mechanism.
HiA-T5 firstly explore the label hierarchy $T_i$ with Breadth-First Search \cite{cormen2001introduction} to flatten the label set $L_i=\{l_1,l_2,l_3,l_4,l_5\}$ into multi-level sequential label $ML_i=[l_1,\_,l_3,/,l_2,\_,l_4,/,l_5,EOS]$, transforming the hierarchy to multi-level label sequence, as illustrated in Figure \ref{bfs2mask} (a). In this process, ‘\_’ between labels denotes intra-level relationship, while ‘/’ signifies inter-level relationship.
\begin{figure}[htbp]
\centering
\includegraphics[width=0.95\columnwidth]{bfs2mask.pdf}
\caption{(a): The label hierarchical structure is explored in Breadth-First Search (blue dash line). (b): path-adaptive mask matrix makes the $ith$ output element use current input element and all its ancestors.}
\label{bfs2mask}
\end{figure}
On one hand, the text sequence $X_i=[x_1,x_2,\ldots,x_J]$ is mapped to embedding sequence $Q_{text},K_{text},V_{text}\in\mathbb{R}^{n\times d_{model}}$, which are then passed into T5 encoder:
\begin{equation}
O_{text}=Encoder(Q_{text},K_{text},V_{text})
\end{equation}
The output encoder representation for semantic features of varied granularities is $O_{text}$.
On the other hand, the multi-level label sequence $ML_i=[l_1,\_,l_3,/,l_2,\_,l_4,/,l_5,EOS]$ is mapped to embeddings sequence $Q_{label},K_{label},V_{label}\in\mathbb{R}^{n\times d_{model}}$, which are passed into T5 decoder together:
\begin{equation}
O_{hierarchy}=Decoder(Q_{label},K_{label},V_{label},O_{text})
\end{equation}
Specifically, HiA-T5 fully explores the label dependency across different levels through the self-attention mechanism. With the help of the intra-level separator '\_' and the inter-level separator '/', the causal decoder self-attention mechanism fully excavates the intra-level parallel and mutually exclusive relationship, as well as the inter-level dependent and appurtenant relationship. The output representation of the decoder causal self-attention mechanism incorporating level dependency information is $A_{label}=MultiHead(Q_{label},K_{label},V_{label})$.
So far, we have obtained the text representation $O_{text}$ highlighting the semantic features of texts with different granularities and the label representation $A_{label}$ incorporating label dependency across different levels. The output representation of the encoder-decoder attention mechanism integrating these two is $A_{cross}=MultiHead(A_{label},O_{text},O_{text})$, which is a sufficient crossover information for following prediction.
\paragraph{Loss of HiA-T5}
We have obtained the final decoder block output of HiA-T5 $O_{hierarchy}$, which fully integrates the label hierarchy information and the text semantic information of different granularities. Then $O_{hierarchy}$ is passed into a fully connected layer with a softmax output, which is also the final result of HiA-T5 denoted as $Pred$. $Pred$ is the result of $n$ timesteps and $Pred\in\mathbb{R}^{n\times K}$.
\begin{equation}
\begin{aligned}
Pred=softmax(O_{hierarchy}W_3+b_3)
\end{aligned}
\end{equation}
where $W_3\in\mathbb{R}^{d_{model}\times K},b_3\in\mathbb{R}^{K}$. In addition, any multi-level label sequence $ML_i$ is transformed into $Truth\in\mathbb{R}^{n\times K}$, which is composed of one-hot vectors corresponding to all labels. Therefore, the cross-entropy loss of HIA-T5 expressed is as follows:
\begin{equation}
\begin{aligned}
Loss_{HiA-T5}=crossentropy(Truth,Pred)
\end{aligned}
\end{equation}
\subsection{Path-Adaptive Mask Mechanism}
PAMM is the regularization designed in the training phase to encourage the model to pay more attention to ancestor labels on current path while penalizing those on other paths. We first obtain the path-adaptive mask matrix containing hierarchy information. Then path-adaptive mask loss is obtained according to operations on the path-adaptive mask matrix and the causal attention score matrix.
\paragraph{Path-Adaptive Mask Matrix}
Now the text sequence $X_i=[x_1,x_2,\ldots,x_J]$ is taken as input, which is fed into HiA-T5 for training, and its corresponding multi-level label sequence $ML_i$ is taken as output.
According to the T5 structure of Figure \ref{T5 structure}, the sequence $ML_i$ is first passed into causal attention sub-layer of decoder. Within this sub-layer, and according to formula (\ref{eq2}), we get causal attention score matrix $Score$ corresponding to the sequence $ML_i$, as depicted in Figure \ref{attention score} (a).
\begin{figure}[htbp]
\centering
\includegraphics[width=0.95\columnwidth]{attention_score.pdf}
\caption{(a): Causal attention score matrix $Score$. The input and output of the causal self-attention mechanism are denoted as $I$ and $O$ respectively. $Score=\left\{s_{i,j}\right\}\in\mathbb{R}^{n\times n}$. Each element $s_{i,j}$ at row $i$ and column $j$ represents the weight at which the self-attention mechanism attends to input element $j$ at output timestep $i$. The gray cell indicates the corresponding attention score $s_{i,j}=0$. (b): Element-wise product result of $Score$ and $M$.}
\label{attention score}
\end{figure}
Then we define the path-adaptive dynamic mask matrix $M$, which can mask different parts of the label sequence at different decoding timestep $i$. The matrix $M$ is obtained from the hierarchical structure of the label sequence corresponding to each text object. Specifically, the shape of the matrix $M$ is same as the causal attention score matrix $Score$. Mask matrix $M$ is also a lower triangular matrix and $M=\{m_{i,j}\}\in\mathbb{R}^{n\times n}$, which is only composed of 0 or 1 as shown below.
$
M=\begin{bmatrix}
m_{1,1} & & & & 0\\
m_{2,1} & m_{2,2} & \\
\vdots & \vdots & \ddots & \ddots\\
m_{n,1} & m_{n,2} & \cdots & m_{n,n-1} & m_{n,n}\\
\end{bmatrix}
$
$I_i$ represents the input of the attention mechanism at the timestep $i$, and $I_i \in L\cup S$. If $I_i\in L$, we define $ancestor(I_i)$ as label $I_i$'s ancestor labels and the special symbol immediately following it.
Then we define the following formula to fill the matrix $M$ based on the parent-child relationship contained in each path of label hierarchy. The $i$-th input timestep of the causal attention mechanism corresponds to the $i$-th row of matrix $M$, which contains $i$ elements: $m_{i,1},m_{i,2},\ldots,m_{i,i}$. In the $i$-th row of matrix $M$, inputs $I_1,I_2,\ldots,I_i$ of different timesteps corresponds to elements $m_{i,1},m_{i,2},\ldots,m_{i,i}$ respectively.
Note that, in the $i$-th ($1\leq i\leq n$) row of the matrix $M$, we first determine the value of the diagonal element $m_{i,i}$, then determine the other elements $m_{i,j}(1\leq j<i)$ before $m_{i,i}$, and the formula is as follows:
\begin{equation}
\resizebox{\linewidth}{!}{$
m_{i,j}=\left\{
\begin{array}{rl}\displaystyle
1 & {\{I_i\in L, I_j\in ancestor(I_i), 1\leq j<i\}}\\\displaystyle
& \cup{\{I_i\in S, j=i-1\}}\\\displaystyle
& \cup{\{I_i\in S, I_j\in ancestor(I_{i-1}), 1\leq j<i\}}\\\displaystyle
0 & {else}
\end{array} \right.$}
\end{equation}
\paragraph{Path-Adaptive Mask Loss}
With text sequence and labels previously generated in hand, we now introduce regularization and apply the path-adaptive dynamic mask matrix $M$, such that HiA-T5 decoder learns the weight of the attention matrix and pays more attention on the label’s current path.
Having obtained the multi-level label sequence $ML_i$ of a certain training sample, we use it as the input of causal self-attention of HiA-T5's decoder. According to the definition above, we get its path-adaptive mask matrix $M$, as depicted in Figure \ref{bfs2mask} (b). Furthermore, we get a new attention score matrix $Score_{new}$ as depicted in Figure \ref{attention score} (b) by multiplying attention score matrix $Score$ and the mask matrix $M$ element-wise:
\begin{equation}
Score_{new} = Score\odot M=softmax(\frac{QK^T}{\sqrt{d_k}})\odot M
\end{equation}
We define $C$ as the index set of $ancestor(I_i)$. At any decoding timestep $i$, our goal is to make the sum of the attention scores $\sum_{j\in C}s_{i,j}$ of current path's labels as close to $1$ as possible. Corresponding to attention scores matrix $Score_{new}$ of decoder's causal attention, that is, to make the sum of elements of each row in the matrix close to $1$ as much as possible. According to the definition section, suppose $Score$ is the causal attention score matrix corresponding to the $h$-th head of $b$-th decoder ``blocks'', where $1\leq h\leq H,1\leq b\leq B$. The path-adaptive mask loss is defined as:
\begin{equation}
\begin{aligned}
Loss_{PAMM}=\sum_{b=1}^{B}(\frac{\sum_{h=1}^{H}(\sum_{i=1}^{n}(1-\sum_{j\in C}s_{i,j}))}{H})
\end{aligned}
\end{equation}
Therefore, the loss generated by the path adaptive mask mechanism is added to the loss of HiA-T5 as total loss for training. The total loss function $Loss$ is obtained as below, where $\rho$ is the coefficient of path-adaptive mask loss item.
\begin{equation}
\begin{aligned}
Loss=&Loss_{HiA-T5}+\rho Loss_{PAMM}
\end{aligned}
\end{equation}
\section{Experiments}
\subsection{Experiment Setup}
\paragraph{Datasets}
We conduct extensive experiments on three public datasets, including RCV1-V2 \cite{lewis2004rcv1}, NYTimes(NYT) \cite{AB2/GZC6PL_2008} and Web-of-Science(WOS) \cite{kowsari2017hdltex}. RCV1-V2 and NYT are both news categorization dataset while WOS is about scientific literature categorization. Labels of these datasets are organized into a tree-like structure. Relevant information of datasets is summarized in Table \ref{tab1} and Table \ref{tab_level}.
We split RCV1-V2 in the benchmark dataset split manner and take a small portion of the training set as validation set. For NYT and WOS, we randomly split data into training, validation and test sets.
\begin{table}[h]
\centering
\resizebox{\columnwidth}{!}{
\begin{tabular}{cccccccc}
\hline
Dataset & $\left| L \right|$ & Depth & Avg($\left| L_i \right|$) & Max($\left| L_i \right|$) & Train & Val & Test\\
\hline
RCV1 & 103 & 4 & 3.24 & 17 & 20833 & 2316 & 781265\\
NYT & 166 & 8 & 7.6 & 38 & 23345 & 5834 & 7292\\
WOS & 141 & 2 & 2.0 & 2 & 30070 & 7518 & 9397\\
\hline
\end{tabular}}
\caption{Statistical analysis of datasets: $\left| L_i \right|$ is the number of all labels in the hierarchy. Depth denotes the maximum level of the label hierarchy. Avg($\left| L_i \right|$) and Max($\left| L_i \right|$) denote average and maximum number of labels in each sample.}
\label{tab1}
\end{table}
\begin{table}[h]
\centering
\resizebox{\columnwidth}{!}{
\begin{tabular}{ccccccccc}
\hline
Dataset & level1 & level2 & level3 & level4 & level5 & level6 & level7 & level8\\
\hline
RCV1 & 236334 & 20523 & 11850 & 23211 & - & - & - & - \\
NYT & 15161 & 2923 & 1160 & 842 & 1066 & 925 & 992 & 1460\\
WOS & 6712 & 351 & - & - & - & - & - & -\\
\hline
\end{tabular}}
\caption{Statistics of the average number of each label’s occurrence at each level: $level_i$ denotes the level in the label hierarchy. In general, lower-level labels are more sparse.}
\label{tab_level}
\end{table}
\paragraph{Evaluation Metrics}
We use standard evaluation metrics, including \textbf{Micro-F1} and \textbf{Macro-F1} \cite{10.1145/2487575.2487644,10.1145/3178876.3186005,10.1145/3357384.3357885}, to measure the performance of all HTC methods. Micro-F1 equally weights all samples, while Macro-F1 gives equal weight to each label. As such, Micro-F1 gives more weight to frequent labels, while Macro-F1 equally weights all labels and is more sensitive to lower-level labels which are hard to predict. As shown in Table \ref{tab_level}, the labels of most samples are screwed towards upper levels, in which case Macro-F1 is more sensitive to scattered lower-level labels.
\paragraph{Experimental Settings}
The backbone pre-trained model we adopt is T5-base \cite{JMLR:v21:20-074}. T5-base contains a total of about 220M parameters, including 12 layers of transformer, and each layer has 768 hidden dimensions, 3072 intermediate sizes and 12 attention heads. T5 is fine-tuned on relevant datasets before we perform following experiments. For the reproducibility of results, we set random seeds before experiments. Tokenizer from T5 is utilized to preprocess the text. For T5, the maximum length of token inputs of encoder is set as $300$, and the maximum length of token outputs of decoder is set as $60$. When the T5 model is fine-tuned, Adam optimizer is employed in a mini-batch size of $10$ with learning rate $3\times10^{-4}$, and model converges after 3 epochs. The search range of coefficient $\rho$ is \{0.1,1,10,100,200\}, and we set it to $100$ according results of validation set. The model with the best performance on the validation set is selected for evaluating the test set. In the inference phase, greedy search is adopted. The experiments are conducted on GeForce RTX 2080 Ti GPU and CentOS with Pytorch Lightning framework.
\subsection{Performance Comparison}
Experimental results on RCV1-V2 benchmark dataset are shown in Table \ref{tab2}, and our proposed PAMM-HIA-T5 outperforms all state-of-the-art results of flat, local and global approaches by a large margin, both in Micro-F1 and Macro-F1. This demonstrates the strong power of PAMM-HiA-T5 in solving HTC problems. PAMM-HIA-T5 achieve the performance of $86.25\%$ Micro-F1 score and $68.03\%$ Macro-F1 score, which outperforms state-of-the-art model by $4.68\%$ of Macro-F1 and $2.29\%$ of Micro-F1 on RCV1-V2. The greater improvement on Macro-F1 shows that PAMM-HiA-T5 has greater capability in predicting sparse lower-level labels, which results from the fact that our model utilizes the knowledge of upper-level labels in predicting lower-level ones by modeling hierarchical dependency. It can be shown from Table \ref{tab_level} that the samples’ labels are unevenly distributed across levels. The labels of most samples are screwed towards upper levels. As level grows, sample labels become more sparse. This explains the reason why our model achieves greater boost in Macro-F1 than Micro-F1.
Experiment results on WOS and NYT datasets are shown in Table \ref{tab3}, and we obtain consistent conclusion as from RCV1-V2: the level-dependency modeling and the path-adaptive mask mechanism bring significant performance improvement. On NYT dataset, we obtain the best performance of $77.89\%$ Micro-F1 and $65.13\%$ Macro-F1, improving Micro-F1 by $2.92\%$ and Macro-F1 by $4.30\%$ compared with the result reported in latest state-of-the-art HTC approach \cite{zhou-etal-2020-hierarchy}. On WOS dataset, we still outperform the result reported in latest state-of-the-art HTC approach \cite{zhou-etal-2020-hierarchy}, although the improvement is minor due to its simple hierarchical structure and fewer lower-level labels.
\begin{table}[h]
\centering
\resizebox{\columnwidth}{!}{
\begin{tabular}{clcc}
\cmidrule[1pt]{2-4} &\textbf{Model} & Micro-F1 & Macro-F1\\
\cmidrule{2-4} \multirow{5}{*}{\rotatebox{90}{Flat}}
&Leaf-SVM* & $69.05$ & $32.95$\\
&SVM & $81.60$ & $60.70$\\
&HAN** & $75.30$ & $40.60$\\
&TextCNN** & $76.60$ & $43.00$\\
&bow-CNN** & $82.70$ & $44.70$\\
\cmidrule{2-4} \multirow{5}{*}{\rotatebox{90}{Local}}
&TD-SVM** \cite{10.1145/1089815.1089821} & $80.10$ & $50.70$\\
&HR-DGCNN-3 \cite{10.1145/3178876.3186005} & $76.18$ & $43.34$\\
&HMCN \cite{pmlr-v80-wehrmann18a} & $80.80$ & $54.60$\\
&HFT(M) \cite{shimura-etal-2018-hft} & $80.29$ & $51.40$\\
&Htrans \cite{banerjee-etal-2019-hierarchical} & $80.51$ & $58.49$\\
\cmidrule{2-4} \multirow{5}{*}{\rotatebox{90}{Global}}
&HR-SVM*\tablefootnote{The results of HR-SVM reported in \cite{10.1145/2487575.2487644} are not comparable because they use a different hierarchy with 137 labels.} \cite{10.1145/2487575.2487644} & $72.75$ & $38.58$\\
&SGM\tablefootnote{The result is reproduced with benchmark split upon the released project of SGM by \cite{zhou-etal-2020-hierarchy}.} \cite{yang-etal-2018-sgm} & $77.30$ & $47.49$\\
&HE-AGCRCNN \cite{8933476} & $77.80$ & $51.30$\\
&HiLAP-RL \cite{mao-etal-2019-hierarchical} & $83.30$ & $60.10$\\
&HiAGM \cite{zhou-etal-2020-hierarchy} & $83.96$ & $63.35$\\
&\textbf{PAMM-HiA-T5} & $\mathbf{86.25}$ & $\mathbf{68.03}$\\
\cmidrule[1pt]{2-4}
\end{tabular}}
\caption{Performance comparison on RCV1-V2. $*$ denotes the results reported in \cite{10.1145/3178876.3186005} and $**$ denotes the results reported in \cite{mao-etal-2019-hierarchical} on the similar dataset split. In this table, SVM \cite{noble2006support} implements standard multi-label classification in a way of one-vs-the-rest(OVR). Leaf-SVM predicts leaf nodes first and then mechanically add their ancestor labels. TextCNN \cite{kim-2014-convolutional}, HAN \cite{yang-etal-2016-hierarchical} and bow-CNN \cite{johnson-zhang-2015-effective} are modified as flat baselines for HTC by \cite{mao-etal-2019-hierarchical}. This is the case for Table \ref{tab3} too.}
\label{tab2}
\end{table}
\begin{table}[!h]
\centering
\resizebox{\columnwidth}{!}{
\begin{tabular}{lcccc}
\toprule \multirow{2}{*} { \textbf{Model} } & \multicolumn{2}{c} { NYT } & \multicolumn{2}{c} { WOS } \\
\cmidrule(r){2-3}\cmidrule(r){4-5}
& Micro-F1 & Macro-F1 & Micro-F1 & Macro-F1 \\
\midrule
SVM* & $72.40$ & $37.10$ & $-$ & $-$ \\
TextCNN* & $69.50$ & $39.50$ & $-$ & $-$ \\
HAN* & $62.80$ & $22.80$ & $-$ & $-$ \\
bow-CNN* & $72.90$ & $33.40$ & $-$ & $-$ \\
TD-SVM* \cite{10.1145/1089815.1089821} & $73.70$ & $43.70$ & $-$ & $-$ \\
HMCN* \cite{pmlr-v80-wehrmann18a} & $72.20$ & $47.40$ & $-$ & $-$ \\
HiLAP* \cite{mao-etal-2019-hierarchical} & $74.60$ & $51.60$ & $-$ & $-$ \\
HiAGM \cite{zhou-etal-2020-hierarchy} & $74.97$ & $60.83$ & $85.82$ & $80.28$ \\
\midrule
\textbf{PAMM-HiA-T5} & $\mathbf{77.89}$ & $\mathbf{65.13}$ & $\mathbf{90.36}$ & $\mathbf{81.64}$ \\
\bottomrule
\end{tabular}}
\caption{Performance comparison on the NYT and WOS datasets. We focus on the most competitive methods which achieved the latest state-of-art results, that is \cite{mao-etal-2019-hierarchical} and \cite{zhou-etal-2020-hierarchy}. For fair comparison, NYT and WOS datasets are selected and splited in exactly the same way as \cite{zhou-etal-2020-hierarchy} does. And $*$ denotes the results reported in \cite{mao-etal-2019-hierarchical} on the similar dataset split.}
\label{tab3}
\end{table}
\subsection{Performance Analysis}
\begin{table}[t]
\centering
\begin{tabular}{lcc}
\hline
Method & Micro-F1 & Macro-F1\\
\hline
T5 & $84.93$ & $62.31$ \\
HiA-T5 & $85.99$ & $65.16$ \\
PAMM-HiA-T5 & $86.25$ & $68.03$ \\
\hline
\end{tabular}
\caption{Ablation study of PAMM-HiA-T5. Note that original T5 neither model the hierarchical structure information nor capture the hierarchial dependencies. It takes HTC as a generic multi-label classification task to generate unordered label sets corresponding to the text.}
\label{tab4}
\end{table}
\paragraph{Ablation Study on Level Dependency Modeling}
We compare the performance of HiA-T5 with the original T5 model, shown in the first two rows of Table \ref{tab4}. It is evident that HiA-T5 greatly outperforms the T5 both in Micro-F1 and Macro-F1, and the improvement in Macro-F1 is greater than that in Micro-F1. This result illustrates the effectiveness of capturing level dependency by introducing upper-level label knowledge to assist lower-level label prediction.
Our ablation studies show that the improvements are mainly due to the strategy and the mechanism we proposed rather than the T5 itself. Experiments on RCV1-V2 show that PAMM-HiA-T5 outperforms the sota model by $4.68\%$ in Macro-F1 and $2.29\%$ in Micro-F1. But T5 only contributes $0.97\%$ of the growth in Micro-F1, and it doesn't even exceed the sota model in Macro-F1.
In addition, Figure \ref{level statistics} demonstrates that the gap between HiA-T5 and T5 gets bigger as the level deepens. This illustrates that as the level grows, label prediction becomes more and more difficult, and the introduction of upper-level label knowledge by HiA-T5 becomes more and more valuable.
\begin{figure}[!h]
\centering
\includegraphics[width=0.9\columnwidth]{level_statistics}
\caption{Level-based Macro-F1 score on RCV1-V2.}
\label{level statistics}
\end{figure}
\paragraph{Ablation Study on Path-adaptive Mask Mechanism}
We compare the performance of PAMM-HiA-T5 with the HiA-T5, and the ablation results are shown in the last two rows of Table \ref{tab4}. PAMM-HiA-T5 improves Macro-F1 by $2.87\%$ and Micro-F1 by $0.26\%$ compared with HiA-T5. This indicates that PAMM significantly improves the performance of HiA-T5 in more challenging multi-path scenarios by capturing precise path dependencies. With the assistance of PAMM, PAMM-HiA-T5 further improves the overall performance of HTC task especially in Macro-F1 by exploiting label dependency within each path and eliminating the noise from other paths.
As shown in Figure \ref{heat map}, the heat map of the causal self-attention score in PAMM-HiA-T5's encoder proves the effectiveness of PAMM, where the attention score is mainly distributed on the path of the label current being decoded.
\begin{figure}[htbp]
\centering
\includegraphics[width=0.7\columnwidth]{heat_map}
\caption{Causal self-attention score's heat map corresponding to a random sample. We use symbols instead of original labels for ease of display. Note that the score of each label is the average of its tokens' attention score for a cleaner view.}
\label{heat map}
\end{figure}
\paragraph{Analysis of Label Consistency}
Label inconsistency, where one label is predicted positive but its ancestors are not, is a serious problem in many HTC approaches, due to the fact that they focus on flat multi-label classification and make independent predictions for all labels. It is worth mentioning that PAMM-HIA-T5 has outstanding classification performance while maintaining an ultra-low label inconsistency rate of $0.31\%$, as shown in Table \ref{inconsistency rate}. This is because PAMM-HiA-T5 fully leverages the constraints of upper-level labels generated earlier to predict the most accurate lower-level labels.
\begin{table}[htbp]
\centering
\resizebox{.95\columnwidth}{!}{
\begin{tabular}{cccc}
\hline
SVM & TextCNN & HMCN & \textbf{PAMM-HiA-T5}\\
\hline
$4.83\%$ & $3.74\%$ & $3.84\%$ & $\boldsymbol{0.31\%}$\\
\hline
\end{tabular}}
\caption{Comparison of label inconsistency. The label inconsistency is calculated as the ratio of predictions with inconsistent labels. The results of SVM, TextCNN, and HMCN are reported in \citep{mao-etal-2019-hierarchical}.}
\label{inconsistency rate}
\end{table}
\section{Conclusion}
This paper aims to improve HTC task performance by exhaustively exploring level and path dependency within the hierarchical structure. We have devised an innovative PAMM-HiA-T5 methodology in order to capture lower-level label dependency on upper-level ones with generation model and to identify hierarchical dependency within the specific path. In the first place, we generate a multi-level sequential label structure to exploit level-dependency with Breadth-First Search (BFS) and T5 model. To further capture label dependency within each path, we then propose an original path-adaptive mask mechanism (PAMM) to identify the label’s path information, eliminating sources of noises from other paths. Comprehensive experiments on three benchmark datasets show that our novel PAMM-HiA-T5 model establishes new state-of-the-art results, achieving significant Macro-F1 improvement by $4.68\%$ and Micro-F1 improvement by $2.29\%$. The ablation studies show that the improvements mainly come from our original approach instead of T5.
| {'timestamp': '2021-09-20T02:19:13', 'yymm': '2109', 'arxiv_id': '2109.08585', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08585'} | arxiv |
\section*{Acknowledgements}
We would like to thank Arunkumar Byravan, Dushyant Rao, Abbas Abdolmaleki, Yuval Tassa and Nathan Lambert for the discussions and feedback during the conception and execution of this project.
We would also like to thank Andrea Huber for facilitating all organisational aspects of this collaboration.
\section*{Author Contributions}
\textbf{Oliver Groth} developed and implemented the SelMo model, conducted the curiosity experiments, studied related work on self-motivated reinforcement learning and wrote the paper.
\textbf{Markus Wulfmeier} advised during the implementation and experimentation phase and helped writing the paper.
\textbf{Giulia Vezzani} conducted the RHPO experiments and created the experiment evaluation plots.
\textbf{Vibhavari Dasagi} assisted in compiling related work and provided feedback on the method and discussion section.
\textbf{Tim Hertweck} provided technical support during the implementation and experimentation phase and created the supplementary videos.
\textbf{Roland Hafner} conducted the SAC-X baseline experiments and provided support in setting up the JACO and OP3 environments.
\textbf{Nicolas Heess} provided feedback on the experimental results and during writing and revision of the paper.
\textbf{Martin Riedmiller} conceived the idea of self-motivated skill learning, provided conceptual feedback and supervised the project.
\bibliographystyle{abbrvnat}
\setlength{\bibsep}{5pt}
\setlength{\bibhang}{0pt}
\section{Simulation Environments}
\label{sec:exp-domains}
In this section we provide details about the two robotic simulation domains used in our experiments.
\begin{figure}[h!]
\begin{center}
\centerline{\includegraphics{figures/selmo-domains-jaco.pdf}}
\caption{The JACO manipulation environment. The 6 DoF robot arm with a 3 DoF gripper can interact with multiple same-sized cubes in its workspace.}
\label{fig:env-jaco}
\end{center}
\vskip -0.2in
\end{figure}
\begin{table}[h!]
\caption{State and action space semantics of JACO environment.}
\label{tab:jaco-state}
\vskip 0.15in
\begin{center}
\begin{small}
\begin{tabular}{lr}
\toprule
\textsc{Feature} & \textsc{Dimension} \\
\midrule
\texttt{arm/joints\_pos} & $6$ \\
\texttt{arm/joints\_vel} & $6$ \\
\texttt{arm/hand/finger\_joints\_pos} & $3$ \\
\texttt{arm/hand/finger\_joints\_vel} & $3$ \\
\texttt{arm/hand/fingertip\_sensors} & $3$ \\
\texttt{arm/hand/pinch\_site\_pos} & $3$ \\
\textbf{proprioception} & $\sum = 24$ \\
\midrule
\texttt{O<i>/rel\_pos\_wrt\_tcp} & $3$ \\
\texttt{O<i>/pos} & $3$ \\
\texttt{O<i>/orientation} & $4$ \\
\texttt{O<i>/linvel} & $3$ \\
\texttt{O<i>/angvel} & $3$ \\
\texttt{O<i>/proptype} & $5$ \\
\texttt{O<i>/dimensions} & $3$ \\
\textbf{perception per object <i>} & $\sum = 24$ \\
\midrule
\texttt{arm} & $6$ \\
\texttt{hand} & $3$ \\
\textbf{action space} & $\sum = ~9$ \\
\bottomrule
\end{tabular}
\end{small}
\end{center}
\vskip -0.1in
\end{table}
\subsection{JACO Manipulation Environment}
This environment is designed to study manipulation tasks like object lifting and stacking with a robotic arm (cf. \cref{fig:env-jaco}).
The state observation space consists of 72 dimensions: 24 features are used to represent the robot's proprioception as well as the state of each object.
The action space spans 9 dimensions: 6 concerning the arm and 3 concerning the three-point gripper.
A detailed description of the environment is provided in \cref{tab:jaco-state}.
Interactions with the two objects (\texttt{O1} = red cube, \texttt{O2} = blue cube) are evaluated using the sparse reward functions \texttt{reach\_\{red,blue\}} and \texttt{lift\_\{red,blue\}}.
Each episode in this environment lasts 20 seconds or 400 control timesteps.
\begin{figure}[h!]
\begin{center}
\centerline{\includegraphics{figures/selmo-domains-op3.pdf}}
\caption{The OP3 locomotion environment. The 20 DoF humanoid robot can walk around on a plane. The episode terminates early, if the OP3 is about to fall over.}
\label{fig:env-op3}
\end{center}
\vskip -0.2in
\end{figure}
\begin{table}[h!]
\caption{State and action space semantics of OP3 environment.}
\label{tab:op3-state}
\vskip 0.15in
\begin{center}
\begin{small}
\begin{tabular}{lr}
\toprule
\textsc{Feature} & \textsc{Dimension} \\
\midrule
\texttt{walker/joints/pos} & $20$ \\
\texttt{walker/imu/linear\_acc} & $3$ \\
\texttt{walker/imu/angular\_vel} & $3$ \\
\texttt{walker/imu/gravity} & $3$ \\
\texttt{scaled/action\_filter/state} & $20$ \\
\textbf{proprioception} & $\sum = 49$ \\
\midrule
\texttt{head\_\{pan,tilt\}} & $2$ \\
\texttt{\{l,r\}\_ankle\_\{pitch,roll\}} & $4$ \\
\texttt{\{l,r\}\_elbow} & $2$ \\
\texttt{\{l,r\}\_hip\_\{pitch,roll,yaw\}} & $6$ \\
\texttt{\{l,r\}\_knee} & $2$ \\
\texttt{\{l,r\}\_shoulder\_\{pitch,roll\}} & $4$ \\
\textbf{action space} & $\sum = 20$ \\
\bottomrule
\end{tabular}
\end{small}
\end{center}
\vskip -0.1in
\end{table}
\subsection{OP3 Locomotion Environment}
This environment is designed to study locomotion with a humanoid robot (cf. \cref{fig:env-op3}).
The state observation consists of 49 proprioceptive features.
The 20-dimensional action space controls the orientations of the robot's head, ankle, elbow, hip, knee and shoulder.
Actions passed to the robot are smoothed with an exponential filter to reduce motion jerk.
A detailed description of the environment is provided in \cref{tab:op3-state}.
The robot always spawns in a standing, upright position.
Locomotion is evaluated by the dense reward functions \texttt{walk\_\{forward,backward\}} for forward and backward walking gaits respectively.
Each episode in this environment lasts 10 seconds or 200 control timesteps.
If the robot's hip angle deviates more than $15^\circ$ from an upright orientation, the simulation terminates early effectively preventing the robot from falling over.
\section{Model and Training Details}
\label{sec:exp-hparams}
Across all experiments with the SelMo architecture, we consistently use the following hyper-parameters and model architectures.
Each SelMo experiment is run with a single actor for $N = 1e5$ episodes.
\paragraph{World Model $f_{dyn}$}
The world model is implemented as a \emph{multi-layer perceptron} (MLP) with the following layer sizes and activation functions:
\texttt{[FC(256), elu($\cdot$), FC(256), elu($\cdot$), FC(size\_state)]}
For each environment, \texttt{size\_state} is the sum of the dimensions for proprioception and perception (cf.~\cref{sec:exp-domains}).
The world model is optimised using Adam~\citep{kingma2014adam} with a learning rate of $\eta_\mathcal{M} = 3e-4$.
\paragraph{Policy}
Both policy $\pi$ and critic $Q$ are implemented as two independent MLPs with the following layer sizes and activation functions:
\begin{itemize}
\item $Q$: \texttt{[tanh($\cdot$), FC(512), elu($\cdot$), FC(512), elu($\cdot$), FC(256), FC(1)]}
\item $\pi$: \texttt{[FC(256), elu($\cdot$), FC(256), elu($\cdot$), FC(128), FC(size\_action)]}
\end{itemize}
The \texttt{size\_action} is different for each environment (cf.~\cref{sec:exp-domains}).
The policy is optimised using Adam~\citep{kingma2014adam} with a learning rate of $\eta_\pi = 3e-4$.
The reward scale is set to $\eta_r = 10.0$ across all experiments.
\paragraph{Replays}
The replays $D_\mathcal{M}$ and $D_\pi$ store trajectories with a length of $T = 50$ transitions.
The buffer sizes used are $|D_\mathcal{M}| = |D_\pi| = 5e4$ and each trajectory in the buffers can be sampled at most $n_{max} = m_{max} = 32$ times (cf.~\cref{sec:method}).
The batch size of samples drawn from the replays is set to $B = 64$.
\section{Conclusion}
In this paper we have studied the emerging behaviour when optimising an exploration policy for a curiosity objective derived from a forward-predictive world model.
To this end, we have presented SelMo, a curiosity-based, off-policy exploration method and applied it in two continuous control domains: a simulated robotic arm and humanoid robot.
We have observed that complex behaviour emerges in both settings and provided a baseline for the utilisation of this self-discovered behaviour in a modular downstream learning scenario.
Despite the remaining technical challenges, we believe that the automatic identification and retention of useful emerging behaviour from curious exploration is a fruitful avenue of future investigation in unsupervised reinforcement learning.
\section{Discussion}
Our experiments have shown that complex manipulation and locomotion behaviour such as grasping, lifting, balancing, sitting and leaping emerges completely unsupervised in an off-policy curiosity learning setup on a 9 DoF robot arm and a 20 DoF humanoid.
This observation supports our hypothesis that self-discovered behaviour can provide a valuable skill repertoire for the learning of new downstream tasks.
We add further evidence to this hypothesis by utilising randomly selected policy snapshots from a curiosity training as auxiliary skills in a modular learning setup and show that they provide a learning scaffold commensurate with hand-designed auxiliary reward functions for the respective tasks.
This suggests that curiosity-based exploration should be treated as an independent aspect of a learning system as opposed to a mere bonus reward or policy pre-training phase.
In this study, we provide a baseline for harnessing self-discovered behaviour by randomly sampling policy snapshots and treating them as fixed skills in a modular learning setup.
However, more sophisticated techniques for identification, retention and utilisation of behaviour in curious exploration settings are conceivable and will be briefly touched upon in this discussion section.
\paragraph{Identification of Emerging Behaviour}
As we have shown in~\cref{sec:exp-emergence}, complex behaviour can emerge in an unsupervised way when optimising a policy for a curiosity objective.
However, it is revealed in \cref{fig:timeline-quantitative-jaco} and \cref{fig:timeline-quantitative-op3} that pre-conceived reward functions are only able to capture a fraction of the emergent behaviour like reaching and lifting of individual objects or basic walking gaits.
More involved behaviours are not covered by basic reward functions and implementing reward functions to identify a broad set of behaviour a priori does not scale well with the unsupervised nature of curiosity learning.
Diversity-based approaches~\citep{eysenbach2018diayn,sharma2019dads,sharma2020emergent} address this challenge via a latent `skill space' which modulates the policy network to capture different modes of operation like jumping and walking.
The temporal and hierarchical abstraction provided by the latent vector also facilitates planning over the skill space.
However, the identification of particularly useful skills worth retaining and comparatively useless skills which could be overwritten is still an open question, especially in never-ending learning settings where a curiosity-driven exploration keeps discovering new behaviours or revisiting old ones.
\paragraph{Retention and Utilisation of Self-Discovered Behaviour}
Closely related to the question of behaviour identification is the question of its retention and utilisation.
In our setup we have treated snapshots of the same curiosity policy as different skills as they represent different behaviour over time.
Using a latent skill space as an arbiter for different behaviours in the same policy network~\citep{eysenbach2018diayn,sharma2019dads} has also been shown to work effectively as this formulation also enables planning over the learned space of skills.
However, \cite{lynch2020lfp} have also demonstrated the utility of raw \emph{play data} in the training of versatile goal-conditioned policies which would position the curiosity-driven exploration as a data collector for a downstream policy distillation instead of a re-usable behaviour in itself.
Lastly, \cite{riedmiller2018sacx} and \cite{hertweck2020ssi} have shown the benefits of curricula of reward functions for the learning of complex manipulation tasks which opens another avenue for the utilisation of curiosity-based learning:
Instead of using frozen snapshots of the policy as a repertoire of skills one could also treat different versions of the world model as a set of distinct reward functions to encourage the optimisation for diverse behaviour during learning of new downstream tasks.
\section{Experiments}
This section is split in two parts.
First, we report our analysis of the emergence of behaviours when optimising only for a curiosity reward in \cref{sec:exp-emergence}.
Second, we present an empirical utilisation of self-discovered behaviour for accelerated learning of new downstream tasks in \cref{sec:exp-utilisation}.
For details regarding the simulation domains and model hyper-parameters, we refer the reader to \cref{sec:exp-domains} and \cref{sec:exp-hparams} respectively.
\subsection{Emergence of Behaviour}
\label{sec:exp-emergence}
We start our investigation with an analysis of the behaviour which emerges in our two simulated domains as depicted in~\cref{fig:timeline-qualitative}.
The JACO domain features a 9 DoF robotic arm and two cubes; the OP3 domain features a 20 DoF humanoid robot.
For this experiment, we run the SelMo learning loop (cf.~\cref{fig:method-diagram}) with a single actor for 100K episodes on each of the environments.
During training, the agent solely optimises its curiosity objective which is defined by~\cref{eq:reward-curiosity}.
The visual inspection of the experiments reveal that in both cases, diverse sets of human-interpretable behaviour emerge consistently and are exhibited by the agent for extended periods of time before the ever-changing curiosity reward function shifts the learning towards a new behaviour.
Below, we describe the observed behaviours in each domain in greater detail.
\begin{figure*}[t]
\vskip 0.2in
\begin{center}
\centerline{\includegraphics[width=\textwidth]{figures/MPG-curiosity-REACH-sigma-1_5.png}}
\centerline{\includegraphics[width=\textwidth]{figures/MPG-curiosity-LIFT-sigma-1_5.png}}
\caption{
Manipulation task evaluation in the JACO environment over the lifetime of one experiment while the agent is only trained on the curiosity objective (cf.~\cref{eq:reward-curiosity}).
A snapshot of the curiosity policy is saved every 100 episodes and evaluated on reaching and lifting the red and blue cubes respectively.
Mean and standard deviation are plotted over 20 evaluation runs per policy snapshot and the plot is smoothed with an exponential filter of $\sigma=1.5$.
}
\label{fig:timeline-quantitative-jaco}
\end{center}
\vskip -0.2in
\end{figure*}
\subsubsection*{Emergent Manipulation Behaviour on JACO}
A qualitative example timeline of emerging behaviours on the JACO arm is depicted in \cref{fig:timeline-qualitative} (top) and supplemented by a plot evaluating reaching and lifting behaviour during the run in \cref{fig:timeline-quantitative-jaco}.
We find that the agent is very quickly driven towards both cubes with equal attention and starts interacting with them by pushing them around.
Soon thereafter, it discovers that pushing them up the slanted walls of the bin facilitates picking them up before it stably latches onto a mode in which it prefers manipulating the red cube over the blue one after approximately 15K episodes.
This also coincides with a first period of sustained lifting of the red cube.
We hypothesise that the discovery of lifting said cube reinforces the interaction with it as it opens up a new dimension along which model prediction error can be rewarded: the height of the object.
After about 25K episodes, it has learned to pick up an object reliably even without the help of the slopes.
After approximately 40K episodes, the curiosity objective pushes the agent to deliberately take objects outside of the workspace and perform pick-and-place operations which move a cube over a long distance but at a lower height.
Interestingly, the policy does not degenerate into extreme behaviours like spinning motions which have been observed in related work~\citep{sekar2020planning_to_explore} but stays focused on the objects and keeps exploring their physical properties.
For instance, at around 70K episodes, the policy investigates the stability of cube poses in a targeted way by balancing them on their edges and corners.
Finally, after about 80K episodes, it starts exploring the possibilities of moving both cubes simultaneously.
\begin{figure*}[t]
\begin{center}
\centerline{\includegraphics[width=\textwidth]{figures/LPG-curiosity-WALK-sigma-1_5.png}}
\caption{
Task evaluation in the OP3 environment over the lifetime of one experiment while the agent is only trained on the curiosity objective (cf.~\cref{eq:reward-curiosity}).
A snapshot of the curiosity policy is saved every 100 episodes and evaluated on locomotion (\texttt{walk\_\{forward,backward\}}) tasks.
Mean and standard deviation are plotted over 20 evaluation runs per policy snapshot and the plot is smoothed with an exponential filter of $\sigma=1.5$.
}
\label{fig:timeline-quantitative-op3}
\end{center}
\vskip -0.2in
\end{figure*}
\subsubsection*{Emergent Locomotion Behaviour on OP3}
Similar to the JACO arm, we present a timeline of emerging behaviour on the OP3 in \cref{fig:timeline-qualitative} (bottom) and a corresponding evaluation of locomotion behaviour in \cref{fig:timeline-quantitative-op3}.
Unsurprisingly, the agent spends roughly the first 2K episodes -- indicated by the steep rise in walking rewards -- just on learning a sense of balance because an episode is terminated early when the torso constraint (cf.~\cref{sec:exp-domains}) is violated and the agent is about to fall.
This also corresponds to maximising the experienced episode length because this increases the chances of further increasing the accumulated reward.
This finding is in line with earlier work~\citep{pathak2017curiosity} which has shown that the avoidance of a `death' event is a natural by-product of curiosity-driven learning with a positive reward and favourably shapes the emerging policy.
Once the agent has learned to stay upright, it slowly starts to develop basic locomotion in the form of stumbling forwards and backwards with only small foot lifting heights which is also reflected in minor oscillations during the evaluation of the walking rewards in \cref{fig:timeline-quantitative-op3}.
Interestingly, after around 30K episodes, the agent has discovered to swing its arms to take bigger steps.
This is most impressively first demonstrated after nearly 40K episodes when the agent balances on one foot while stretching out the other leg using its arms for counterbalancing moves.
Using the arms also opens new avenues for exploration.
Approximately 40K episodes into training, the agent has learned to catch itself when falling backwards.
This leads to the discovery of a sit-down behaviour which does not violate the environment's torso constraints.
After the agent has explored various `ground exercises' it switches back to walking gaits at around 55K episodes.
Then, the whole body movement has become considerably more nimble and its movement repertoire now features quick turns, stumbling reflexes and even safe backward leaps.
After about 70K episodes the agent starts revisiting earlier behaviour, e.g. the balancing skill, but keeps adding variations to it like knee-bending or stretching.
\subsection{Utilisation of Emergent Behaviour}
\label{sec:exp-utilisation}
As we have discussed in the previous section, the constantly evolving curiosity policy develops behaviours which correspond to the solution of concrete tasks (cf.~\cref{fig:timeline-quantitative-jaco},~\cref{fig:timeline-quantitative-op3}).
In order to retain those diverse behaviours to accelerate the learning of new tasks, we have devised the following experiment:
Assuming that the curiosity policies exhibit undirected yet versatile exploratory behaviour, we investigate how well they could serve as auxiliary skills in a modular learning setup of a downstream task.
We employ \emph{Regularized Hierarchical Policy Optimization} (RHPO)~\citep{wulfmeier2019rhpo} as this framework allows us to compose multiple policies in a hierarchical manner.
In each environment, we define a downstream target task which we are interested in learning and provide five policy snapshots from a SelMo experiment as auxiliary exploration skills.
During the SelMo experiment, we optimise solely for the curiosity objective and save a snapshot of the curiosity policy every 100 episodes.
The RHPO experiment subsequently samples SelMo policy snapshots and utilises the behaviour exhibited by them to assist the exploration for the desired downstream task.
For this experiment, we refer again to the JACO environment where we define the target task to be \texttt{lift\_red}.
While the policy for the target task is randomly initialised, the auxiliary policies are randomly sampled from the SelMo snapshots and kept fixed during the entire RHPO training.
We differentiate between three different phases from which the SelMo snapshots are chosen: \texttt{early} comprises of snapshots which have been trained on up to 10K episodes, \texttt{mid} snapshots are from the interval between 10K and 20K episodes and \texttt{late} snapshots are sampled between 20K and 30K training episodes.
In~\cref{fig:rhpo-learning} we compare the learning progress of the downstream task with the sampled SelMo auxiliary skills against a baseline featuring hand-designed task curricula in an SAC-X framework~\citep{riedmiller2018sacx}.
In the case of the JACO environment, the agent is given a curriculum of reward functions which help to \texttt{reach} and \texttt{move} the \texttt{red} cube.
\begin{figure*}[t]
\begin{center}
\centerline{\includegraphics[width=\textwidth]{figures/MPG-skills-LIFT_O1-sigma-1_5.png}}
\caption{
Learning curves for hierarchical skill learning of \texttt{lift\_red} using SelMo auxiliary policies in the JACO environment.
The SAC-X baseline uses auxiliary reward functions \texttt{\{reach,move\}\_red}.
Each RHPO run uses five randomly sampled SelMo policies from the respective intervals as auxiliary skills (cf.~\cref{sec:exp-utilisation}).
Mean and standard deviation are plotted for five random seeds for each model and the plot is smoothed with an exponential filter of $\sigma=1.5$.
}
\label{fig:rhpo-learning}
\end{center}
\vskip -0.2in
\end{figure*}
In the case of \texttt{lift\_red} on JACO, we find that SelMo auxiliaries from the \texttt{mid} and \texttt{late} exploration periods give the learning of the lifting policy a significant boost which is commensurate with a tuned SAC-X baseline featuring multiple auxiliary rewards which have been hand-designed to facilitate the learning of \texttt{lift\_red}.
This result is in line with the performance observed in \cref{fig:timeline-quantitative-jaco} where the curiosity-based policy has developed a sustained lifting behaviour between 20K and 35K episodes.
Consequently, snapshot auxiliaries sampled from that range are particularly useful when a targeted lifting policy is to be learned.
This experiment shows that even a simple behaviour retention strategy like policy snapshotting can already provide clear benefits for downstream learning of new tasks.
The self-discovered behaviours from a curiosity training phase afford a task learning scaffold which can be commensurate with a specifically designed set of auxiliary reward functions.
This is a promising result suggesting that independent curious exploration could be used in lieu of human-engineered task curricula in complex manipulation scenarios.
\section{Introduction}
Intrinsic motivation~\citep{schmidhuber1991curiosity_boredom,oudeyer2007intrinsic_motivation,oudeyer2009intrinsic,baranes2009riac,schmidhuber2010formal_creativity} can be a powerful concept to endow an agent with an automated mechanism to continuously explore its environment in the absence of task information.
One common way to implement intrinsic motivation is to train a predictive model alongside the agent's policy and use the model's prediction error as a reward signal for the agent encouraging the exploration of previously unfamiliar transitions in the environment - a method also known as \emph{curiosity learning}~\citep{pathak2017curiosity}.
Curiosity-esque reward schemes have been used in different ways to facilitate exploration in sparse tasks~\citep{houthooft2016vime,burda2018rnd} or pre-train policy networks before fine-tuning them on difficult downstream tasks~\citep{sekar2020planning_to_explore}.
In environments where the main task objective is highly correlated with thorough exploration, curiosity-based approaches have also been shown to solve the main task without any additional reward signal~\citep{burda2018curiosity_study}.
However, in environments with multiple possible tasks -- e.g. in manipulation scenarios where objects could be interacted with or re-arranged in different ways -- not only the final behaviour of a curious exploration run might be of interest, but intermediate behaviours can correlate with solutions to different tasks.
Naturally, the constantly changing curiosity objective leads to the emergence of diverse behaviours during training -- much akin to the learning process of infants which develop useful skills by playing~\citep{haber2018emergence}.
Yet, only a fraction of this diversity is ultimately retained in a downstream, task-specific policy -- which might also be biased towards exploration as a side-effect -- or it is even completely overwritten after fine-tuning.
This problem of \emph{catastrophic forgetting}~\citep{mccloskey1989catastrophic} is well-known for any neural network which operates under a shifting data distribution.
However, the intermediate behaviours which emerge and disappear \emph{during} learning based on curiosity can be of relevance for different tasks of interest.
If we were able to extract and leverage emergent behaviour, we could turn the process of exploration from a service for task-driven reinforcement learning into a rich continual learning setup in its own right~\citep{hadsell2020embracing}.
\begin{figure*}[t]
\vskip -0.2in
\begin{center}
\centerline{\includegraphics[width=\textwidth]{figures/selmo-timeline-jaco.pdf}}
\centerline{\includegraphics[width=\textwidth]{figures/selmo-timeline-op3.pdf}}
\caption{
Two example timelines depicting the emergence of behaviour while pursuing a curiosity objective on a 9-DoF JACO arm (top) and on a 20-DoF OP3 humanoid robot (bottom).
Each timeline represents the evolution of behaviour from a single random seed on a single simulated actor.
At each point in time, the agent exhibits a single behaviour which slowly evolves over time as the curiosity objective changes.
A detailed description of the emergent behaviour in this experiment is provided in~\cref{sec:exp-emergence} and corresponding quantitative results are shown in~\cref{fig:timeline-quantitative-jaco,fig:timeline-quantitative-op3}.
The corresponding videos can be found at: \url{https://deepmind.com/research/publications/2021/Is-Curiosity-All-You-Need-On-the-Utility-of-Emergent-Behaviours-from-Curious-Exploration}.
}
\label{fig:timeline-qualitative}
\end{center}
\vskip -0.2in
\end{figure*}
Despite technical challenges, the discovery of self-induced curricula of skills holds a tantalising prospect for an agent's ability to solve broad sets of long-horizon tasks when it is able to draw upon potentially useful skills.
For instance, a robotic arm which has already discovered how to reach, grasp and lift objects in its workspace has a much easier time exploring and learning a policy to stack objects later on, if it recombined its previously acquired skills.
Recent works~\citep{riedmiller2018sacx,hertweck2020ssi,wulfmeier2020representation} have studied the influence of specific tasks across a spectrum of manual engineering effort like in the stacking example on the learning success of complex manipulation policies.
A curiosity-based approach could further reduce the effort of designing a curriculum of tasks and reward functions with a set of self-discovered skills.
In this paper, we study behaviour which emerges based on a curiosity objective in two continuous control settings: manipulation and locomotion.
In contrast to prior work in this domain, we implement curiosity-based exploration in an off-policy learning setting which improves upon on-policy implementations in terms of data-efficiency and presumably increases the diversity of emerging behaviours.
Furthermore, we look at the utilisation of the self-discovered behaviour for learning new downstream tasks.
In particular, we find that even a na\"ive baseline which treats snapshots of a curiosity policy as fixed exploration skills in a hierarchical learning setup can perform commensurately with a hand-designed curriculum learning setup.
Our findings suggest that the identification and exploitation of self-discovered behaviours can be a fruitful avenue for future work in the learning of complex robotics tasks.
In summary, we make the following two contributions:
First, we introduce \emph{SelMo}, an off-policy realisation of a self-motivated, curiosity-based method for exploration which is applied to two robotic manipulation and locomotion domains in simulation.
We show that even in those complex, 3D environments, meaningful and diverse behaviour emerges solely based on the optimisation of the curiosity objective.
Second, we propose to extend the focus in the application of curiosity learning towards the identification and retention of emerging intermediate behaviours and support this conjecture with a baseline experiment which uses self-discovered behaviours as auxiliary skills in a hierarchical reinforcement learning setup.
\section{Method}
\label{sec:method}
In this section, we present SelMo -- a self-motivated exploration method which optimises a curiosity objective in an off-policy fashion.
Our system is designed around two key components: A forward dynamics model $f_{dyn} \colon S \times A \mapsto S$ which aims to approximate the state transition function of the environment and a policy $\pi(a_t \vert s_t)$ which aims to take transitions in the environment for which the prediction error of $f_{dyn}$ is high.
Given potentially different requirements for the dynamics model and the exploration policy, the implementation builds on two separate learning processes.
We have decided to implement the system in this distributed way to more easily realise the data labeling process and have convenient control over learning rate and data flow parameters.
However, other implementations which fuse both learning processes and data buffers are also conceivable.
Crucially, our setup deviates from recent on-policy approaches for curiosity-based rewards in two important aspects:
First, we optimise in an off-policy fashion based on a diverse set of experienced transitions in the environment.
In this way, the policy is encouraged to to cover a broader spectrum of exploration avenues as the learning evolves.
Second, we employ an approximate but efficient data labelling strategy which only assigns curiosity rewards to trajectories when they are used to update the dynamics model, but refrain from relabeling all trajectories in the policy replay after every model update.
We provide a general overview over the whole system in \cref{fig:method-diagram} and explain each component in detail in the paragraphs below.
\paragraph{Model Replay}
The fixed-size model replay buffer $D_\mathcal{M}$ stores trajectories $\tau^k = \left[ (s^k_0, a^k_0, s^k_1), \dots, (s^k_{T-1}, a^k_{T-1}, s^k_T) \right]$ collected by the actor in the environment.
The values of all environment transitions $(s_t, a_t, s_{t+1})$ are normalised in the range $\left[-1, 1\right]$.
Batches of training data for the world model are sampled uniformly from this buffer as $\mathcal{B}_\mathcal{M} := \{\tau^1, \dots, \tau^B\} \sim \mathcal{U}(D_\mathcal{M})$.
In order to preserve a diverse sampling of environment transitions during the whole learning process, each trajectory in $D_\mathcal{M}$ can be sampled at most $n_{max}$ times.
Additionally, old trajectories in the buffer are replaced by new ones at random when the buffer size limit is exceeded.
\paragraph{World Model}
We describe the environment in which the agent operates as $\mathcal{E} = (S, A, P)$ with state and action spaces $S$ and $A$ as well as a state transition function $s_{t+1} = P(s_t, a_t)$ over discrete time steps which describes the environment's \emph{transition dynamics}.
The world model is a forward-predictive model $f_{dyn} \colon S \times A \mapsto S$ which approximates the environment's transition dynamics as:
\begin{equation}
\hat{s}_{t+1} = f_{dyn}(s_t, a_t; \theta)
\label{eq:world_model}
\end{equation}
In our case, \cref{eq:world_model} is implemented as a two-layer MLP with parameters $\theta$.
Besides estimating the transition dynamics from observed data, the world model plays a crucial role in assigning the reward for each observed transition $(s_t, a_t, s_{t+1})$.
When a transition is evaluated by the world model, the assigned reward is scaled by the model's current prediction error.
\begin{equation}
r^{(j)}(s_t, a_t, s_{t+1}) = \tanh(\eta_r * (f_{dyn}^{(j)}(s_t, a_t) - s_{t+1})^2)
\label{eq:reward-curiosity}
\end{equation}
The `state' of the world model is indicated by the number of gradient updates $j$ which have been performed on it so far.
We scale the reward via a hyper-parameter $\eta_r$ and pass it through a $\tanh$ to keep it bounded for the downstream policy learning procedure.
When a new batch of data $\mathcal{B}$ is sampled from the model replay, the world model performs two operations.
First, it labels each $\tau \in \mathcal{B}$ by assigning curiosity rewards $r^C$ according to \cref{eq:reward-curiosity}.
Second, it performs one gradient update $\theta^{(j+1)} \leftarrow \theta^{(j)} + \eta_\mathcal{M} \partial \mathcal{L}_{dyn}^{(j)}(\mathcal{B}) / \partial \theta^{(j)}$ by minimising its prediction loss:
\begin{equation}
\mathcal{L}_{dyn}^{(j)}(\mathcal{B}) = \sum_{\tau \in \mathcal{B}} \sum_{(s_t, a_t, s_{t+1}) \in \tau}(f_{dyn}^{(j)}(s_t, a_t) - s_{t+1})^2
\label{eq:loss-world_model}
\end{equation}
After one world model update, the relabeled batch of trajectories $\tilde{\mathcal{B}}$ is stored in the policy replay buffer $D_\pi$.
\paragraph{Policy Replay}
The fixed-size policy replay $D_\pi$ stores tuples $(\tau^j, r^j)$ representing trajectories which have been labeled with curiosity rewards by the world model.
This off-policy setup provides the policy learner with a diverse training set to optimise for useful exploration actions \emph{globally} and not only in the vicinity of the most recent experience.
During policy learning, data batches are sampled uniformly from this buffer as $\mathcal{B}_\pi := \{(\tau^1, r^1), \dots, (\tau^B, r^B)\} \sim \mathcal{U}(D_\pi)$.
Similar to the model replay, each tuple can be sampled up to $m_{max}$ times to increase the utilisation of each data point during policy learning.
However, the removal strategy of the policy replay is $FIFO$ to ensure that trajectories with the most outdated curiosity rewards get replaced first to reflect the change in the world model, albeit with a certain delay.
\paragraph{Policy}
The \emph{Markov Decision Process} (MDP) which is induced by this setup can be written as:
$\mathcal{M}^{(j)} = (S, A, P, r^{(j)})$.
Since the world model $f_{dyn}^{(j)}$ changes with every gradient update, the reward function $r^{(j)}$ changes continuously.
Consequently, the reward varies with the model training timesteps $j$ and the policy $\pi$ is required to keep adapting.
The policy replay $D_\pi$ is filled by the world model's training loop. It contains data of the most recent $\kappa = \vert D_\pi \vert / \vert \mathcal{B} \vert$ versions of the MDP.
Hence, the resulting policy is optimising for a mixture of MDPs $\{(S,A,P,r^{(\iota)} \mid \iota \in [j-\kappa, \dots, j]\}$.
Policy and critic network are implemented as two separate MLPs.
The policy is optimised off-policy using MPO~\citep{abdolmaleki2018mpo} and a separate learning rate $\eta_\pi$.
\section{Related Work}
The utilisation of forward modelling error as reward signal has been implemented in deterministic and probabilistic settings~\citep{shelhamer2016loss_is_reward,achiam2017surprise} and is commonly known as \emph{curiosity learning}.
The error reward signal encourages the exploration of unfamiliar parts of the state-action space which are not yet well-predictable.
\cite{pathak2017curiosity} derive the curiosity reward from an inverse dynamics model which is simultaneously less prone to be confused by unpredictable elements of the environment (cf. \emph{white-noise problem}~\citep{schmidhuber2010formal_creativity}).
\cite{burda2018rnd} use a randomly initialised projection from observation into latent space and the predictor driving the learning process is tasked with learning this projection.
\cite{huang2019penalty_surprise} use the error of a predictive model of penalties in dexterous manipulation and find that the additional intrinsically motivated exploration helps in the development of gentle grasping policies.
Curiosity learning can also be seen through an information theoretic lens using an information gain objective like in \cite{still2012it_curiosity_rl} or \cite{houthooft2016vime}.
Lastly, the \emph{disagreement} between an ensemble of forward models~\citep{pathak2019disagreement} can also be treated as a proxy for model uncertainty and exploited as a reward signal.
In addition to serving as a reward generator, the predictors can also be used for targeted exploration.
\cite{lowrey2018plan} and \cite{sekar2020planning_to_explore} employ world models to deliberately explore in regions where the expected prediction error is high \emph{a priori} - as opposed to realising that something surprising has been observed \emph{a posteriori} like in standard curiosity approaches.
Besides curiosity learning, the literature features an extensive body of work on structured exploration methods in reinforcement learning.
Classical methods like count-based exploration schemes have been revisited in continuous settings, e.g. in~\cite{bellemare2016unifying} changes in state density estimations are used as exploration bonus rewards.
Another line of work revolves around the central notion of \emph{empowerment}~\citep{klyubin2005empowerment} which aims to find new behaviours which are increasingly controllable by the agent~\citep{mohamed2015variational,gregor2016variational}.
The \emph{estimation of model learning progress} has also been discussed as a reward signal for exploration but this approach is much harder to implement as it relies on a measure of model improvement~\citep{lopes2012exploration}.
Closely related to model-improvement-based exploration is the idea of \emph{PowerPlay}~\citep{schmidhuber2013powerplay} which describes an inductive task proposal scheme equipping the agent with a mechanism which infers the current frontier of soluble tasks and inductively creates a novel task which can be solved by employing the agent's current knowledge.
However, this exploration scheme has mostly remained conceptual so far with experiments limited to simple pattern recognition tasks~\citep{srivastava2013first_powerplay}.
Related to PowerPlay's idea of task proposition but supposedly more tractable is the concept of \emph{self-play}~\citep{sukhbaatar2017selfplay_curriculum}.
In this paradigm, two agents play a competitive game where one player is rewarded for inventing a behaviour which the other agent cannot imitate.
This approach has recently led to the emergence of highly complex object manipulation behaviour on a simulated robotic arm~\citep{openai2021asymmetric_selfplay}.
The importance of diverse interactions with the environment -- similar to the playful behaviour exhibited by children -- has been stressed in recent works in reinforcement learning, e.g. in~\cite{haber2018emergence} or \cite{lynch2020lfp}.
Such intrinsically motivated exploration has been shown to lead to the discovery of diverse behaviour and re-usable skills as a natural `by-product' of interacting with the environment~\citep{singh2005intrinsically}.
Several recent works have identified the \emph{diversity of behaviour} as a central objective to optimise for during unsupervised exploration~\citep{eysenbach2018diayn,sharma2019dads}.
\cite{sharma2020emergent} have extended this line of work and also showed that the acquired latent `skill space' can be leveraged in model-predictive control fashion for goal-conditioned navigation on a real-world quadruped.
Our work builds upon the curiosity learning approach utilising the forward prediction error of a dynamics model as a reward signal.
However, in contrast to typical curiosity setups~\citep{burda2018curiosity_study} which are optimised \emph{on-policy} we employ an \emph{off-policy} method to train the agent.
Our method is also set apart from prior art with regards to the utilisation of self-discovered behaviour.
Instead of using \emph{model-predictive control}~\citep{sharma2020emergent}, we leverage emergent behaviour directly by employing policy snapshots as modular skills in a mixture policy~\citep{wulfmeier2019rhpo,wulfmeier2021data}.
| {'timestamp': '2021-09-20T02:19:40', 'yymm': '2109', 'arxiv_id': '2109.08603', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08603'} | arxiv |
\section{Introduction}
\label{sec:introduction}
Federated learning (FL) \citep{mcmahan2017communication} is a machine learning paradigm where multiple entities (or users) collaborate in training a machine learning model under the coordination of a central server or a service provider. In this setting, only some statistics relevant to the model's training are shared with the central server, and the user's raw data is always stored on their device and never leaves it.
In many applications of interest, the data is distributed across many users, is large compared to the model's size, and is privacy-sensitive. Therefore, this decentralized setting is attractive since (i) it is amenable to parallelizing the computation across multiple devices (which can easily be accommodated on such devices with modern, fast, processors) and (ii) it is not dependent on a central dataset, which could be susceptible to privacy leaks via re-identification attacks~\citep{sweeney2000simple}.
The statistics transmitted to the central server contain less information than the raw data by the data processing inequality, and therefore reduce the risk of privacy leaks. However, there exist determined enough adversaries that can extract delicate information from these updates or the model itself. For example, even in the extreme case where an adversary only has access to queries of the model (or ``black-box" access), they can discover the identity of users present in the training data for a generic task~\citep{shokri2017membership} or even reconstruct the faces used to train a face recognition system~\citep{fredrikson2015model}.
Therefore, in order to provide guarantees of privacy to users, it is customary to ensure that the training of the model is differentially private, see e.g. \citep{bhowmick2018protection,mcmahan2018general,mcmahan2018learning,truex2019hybrid,granqvist2020improving}. Differential privacy (DP)~\citep{dwork2006calibrating, dwork2014algorithmic} is a strong privacy standard for algorithms that operate on data. More precisely, DP guarantees that the probability of obtaining a model using all the users' data is close to the probability of obtaining that same model if any one of the users does not participate in the training. Hence, DP limits the amount of information that any attacker (regardless of their compute power or access to auxiliary information) may obtain about any user's identity after observing the model.
Deep learning models have seen great success in a wide range of applications such as image classification, speech recognition, or natural language processing~\citep{he2015delving, amodei2016deep, xue2021mt5}. For this reason, they are usually the model of choice for FL~\citep{mcmahan2017communication}. In fact, DL models have been successfully trained with differentially private FL (or PFL) for tasks like next word prediction or speaker verification~\citep{mcmahan2017communication, granqvist2020improving}. Nonetheless, these models are susceptible to perpetuate societal biases existing in the data~\citep{caliskan2017semantics} or to discriminate against certain groups even when the data is balanced~\citep{buolamwini2018gender}. Moreover, when the training is differentially private~\citep{abadi2016deep}, degradation in the performance of these models disproportionately impacts under-represented groups~\citep{bagdasaryan2019differential}. More specifically, the accuracy of the model on minority groups is deteriorated to a larger extent than the accuracy for the majority groups.
In the realm of federated learning, there has been some research studying how to achieve individual fairness, i.e.\ that the performance of the model is similar among devices~\citep{hu2020fedmgda+,huang2020fairness, li2019fair,li2021ditto}. However, this notion of fairness falls short in terms of protecting users from under-represented groups falling foul of disproportionate treatment. For example, ~\citep[Section~3.6]{castelnovo2021zoo} shows that a model that performs well on the majority of the users will have a good score on individual fairness metrics, even if all the users suffering from bad performance belong to the same group. Conversely, there is little work proposing solutions to enforce group fairness, i.e.\ that the performance is similar among users from different groups. The current work in this area~\citep{du2021fairness} is devoted to a specific measure of fairness (demographic parity) when using logistic regression models. Moreover, all such prior work focuses on non-private federated learning, and therefore do not consider the adverse affects that differential privacy has on the models trained with PFL.
On the other hand, work studying the trade-offs between privacy and group fairness proposes solutions that are either limited to simple models such as linear logistic regression~\citep{ding2020differentially}, require an oracle~\citep{cummings2019compatibility}, scale poorly for large hypothesis classes~\citep{jagielski2019differentially}, or only offer privacy protection for the variable determining the group~\citep{tran2021differentially, rodriguez2020variational}. Furthermore, in the aforementioned work, the central learning paradigm is the only one considered, and the techniques are not directly adaptable to federated learning.
For all the above reasons, in this paper, we propose an algorithm to train deep learning models with private federated learning while enforcing group fairness. We pose the problem as an optimization problem with fairness constraints and extend the modified method of differential multipliers (MMDM)~\citep{platt1987constrained} to solve such a problem with FL and DP. Hence, the resulting algorithm (i) is applicable to any model that can be learned using stochastic gradient descent (SGD) or any of its variants, (ii) can be tailored to enforce the majority of the group fairness metrics, (iii) can consider any number of attributes determining the groups, and (iv) can consider both classification and regression tasks.
The paper is structured as follows: in \Cref{sec:background} we review the background on differential privacy, private federated learning, the MMDM algorithm, and group fairness; in \Cref{sec:fpfl} we present out approach for fair private federated learning; in \Cref{sec:results} we describe our experimental results; and in \Cref{sec:conclusions} we conclude with a summary and interpretation of our findings.
\section{Background}
\label{sec:background}
In this section we review several aspects on the theory of differential privacy, private federated learning, the MMDM algorithm, and group fairness that will be necessary to develop and understand the proposed algorithm.
\subsection{Differential Privacy}
\label{subsec:dp}
In this subsection, we start describing the definition of privacy that we will adopt, differential privacy (DP)~\citep{dwork2006calibrating,dwork2014algorithmic}. Then, we describe some of the details and properties of this standard that are useful to understand the proposed algorithm.
Differential privacy formalizes the maximum amount of information that an ``almighty" adversary can obtain from the release of private data. This private data can be anything, from an obfuscated version of the users' data samples themselves to a noisy function of that data. Formally, the definition of DP establishes a bound on how different the distribution of a randomized function of the data can be if a user's contribution is included or not in such data.
\begin{definition}[($\varepsilon,\delta$)-Differential Privacy]
A randomized function $f: \mathcal{D} \to \mathcal{R}$ satisfies $(\varepsilon,\delta)$-DP if for any two adjacent datasets $d,d' \in \mathcal{D}$ and for any subset of outputs $R \in \mathcal{R}$ it holds that
\begin{equation}
\ensuremath{\mathbb{P}}\big[ f(d) \in R \big] \leq e^\varepsilon \ensuremath{\mathbb{P}}\big[ f(d') \in R \big] + \delta.
\end{equation}
\end{definition}
Two datasets $d$ and $d'$ are said to be adjacent if dataset $d'$ can be formed by adding or removing all data associated with a user from $d$.
An alternative definition to differential privacy is given in~\citep{mironov2017renyi}, where the dissimilarity of the distributions is measured using the R\'enyi divergence~\citep{renyi1961measures}. This definition is attractive since it enjoys similar properties to the original definition, and gives a more efficient privacy analysis of certain iterative algorithms such as differentially private SGD (DP-SGD)~\citep{abadi2016deep,wang2019subsampled}, even for the same $(\epsilon, \delta)$-DP budget.
\begin{definition}[($\alpha,\varepsilon)$-RDP]
A randomized function $f: \mathcal{D} \to \mathcal{R}$ satisfies $\varepsilon$-R\'enyi differential privacy of order $\alpha$, or $(\alpha,\varepsilon)$-RDP, if for any two adjacent datasets $d,d' \in \mathcal{D}$
it holds that
\begin{equation}
D_\alpha \Big( \ensuremath{\mathbb{P}}\big[ f(d) \big] \big\lVert \ensuremath{\mathbb{P}}\big[ f(d') \big] \Big) \leq \varepsilon,
\end{equation}
where $D_\alpha(\cdot \mid\mid \cdot)$ is the R\'enyi divergence of order $\alpha$.
\end{definition}
A common way to privatize some statistics $\phi(d)$ of the data $d$ is to obfuscate them with Gaussian noise. Namely, instead of directly releasing $\phi(d)$ one instead releases $f(d)$, where
\begin{equation}
f(d) = \phi(d) + \mathcal{N}\big(0, \Delta_\phi^2 \sigma^2)
\end{equation}
and $\Delta_\phi = \max_{d,d' \in \mathcal{D}} \lVert \phi(d) - \phi(d') \rVert_2$ is the $\ell_2$ sensitivity of the statistic. This is known as the Gaussian mechanism~\citep{dwork2014algorithmic} and it is $(\alpha, \alpha/(2 \Delta_\phi^2 \sigma^2))$-RDP for any $\alpha > 1$~\citep{mironov2017renyi}.
Differential privacy, in either of the two mentioned forms, enjoys several desirable properties for a privacy definition. Among those, we highlight three (in terms of RDP) that are important for the privacy guarantees of the presented algorithm:
\begin{itemize}
\item \emph{Post-processing:} Consider two functions $f: \mathcal{D} \to \mathcal{R}$ and $g: \mathcal{R} \to \mathcal{R'}$. If $f$ is $(\alpha,\varepsilon)$-RDP, then $g \circ f$ is also $(\alpha,\varepsilon)$-RDP. That is, no amount of post-processing can reduce the privacy guarantees provided by the function $f$~\citep{mironov2017renyi}.
\item \emph{Adaptive Composition:} Consider two functions $f: \mathcal{D} \to \mathcal{R}$ and $g: \mathcal{D} \times \mathcal{R} \to \mathcal{R'}$. Consider also a function defined as $h(d) = g(d,f(d))$, where $d \in \mathcal{D}$. If $f$ is $(\alpha, \varepsilon_f)$-RDP, and for all $r$, $g(\cdot, r)$ is $(\alpha, \varepsilon_g)$-RDP, then $h$ is $(\alpha, \varepsilon_f + \varepsilon_g)$-RDP. That is, the privacy guarantees of a function $f$ degrade gracefully when its realization is used by another function $g$~\citep{mironov2017renyi}.
\item \emph{Sub-sampling privacy amplification:} Consider an $(\alpha, \varepsilon_f)$-RDP function $f: \mathcal{D} \to \mathcal{R}$ where $\alpha \geq 2$. Now consider the function $g(d)$ defined as applying $f$ to a random sub-sample (without replacement) of fixed length of $d \in \mathcal{D}$. Then $g$ is $(\alpha, \varepsilon_g)$ with $\varepsilon_g \leq \varepsilon_f$. That is, the privacy guarantees of a function $f$ are amplified by applying that function to a random sub-sample of the dataset~\citep{wang2019subsampled}.
\end{itemize}
\subsection{Private Federated Learning}
\label{subsec:pfl}
The federated learning setting focuses on learning a model that minimizes the expected value of a loss function $\ell$ using a dataset $d = (\bm{z}_1, \bm{z}_2, \ldots, \bm{z}_n) \in \mathcal{D}$ of $n$ samples distributed across $K$ users.
This paper will consider models parametrized by a fixed number of parameters $\bm{w} \in \ensuremath{\mathbb{R}}^p$ and differentiable loss functions $\ell$, which includes neural networks.
Since the distribution of the data samples $Z$ is unknown and each user $k$ is the only owner of their private dataset $d^k$, the goal of FL is to find the parameters $\bm{w}^\star$ that minimize the loss function across the samples of the users. That is, to solve
\begin{equation}
\bm{w}^\star = \arg \min_{\bm{w} \in \ensuremath{\mathbb{R}}^p} \frac{1}{n} \sum_{k=1}^K L(d^k,\bm{w}),
\end{equation}
where $L(d^k, \bm{w}) := \sum_{\bm{z} \in d^k} \ell(\bm{z},\bm{w})$.
This way, the parameters $\bm{w}$ can be learned with an approximation of SGD. \citet{mcmahan2017communication}~suggests that the central server iteratively samples $m$ users; they compute and send back to the server an approximation of $\eta \nabla_{\bm{w}} L(d^k,\bm{w})$, where $\eta$ is the learning rate; and finally the server updates the parameters as dictated by gradient descent $\bm{w} \gets \bm{w} - \frac{1}{n} \sum_{k} \eta \nabla_{\bm{w}} L(d^k,\bm{w})$.
If the users send back the exact gradient the algorithm is known as \texttt{FederatedSGD}.
A generalisation of this, \texttt{FederatedAveraging}, involves users running several local epochs of mini-batch SGD and sending up the difference.
However, the method in this paper relies on an additional term in the loss function, so it will extend \texttt{FederatedSGD}.
The above algorithm can be modified so it becomes diferentially private by following the structure of the differentially private SGD algorithm~\citep{abadi2016deep,wang2019subsampled}. This modification consists of clipping (i.e.\ restricting the sensitivity to a pre-defined clipping bound $C$) and applying the Gaussian mechanism to each user's gradient approximation before they are used to update the parameters~\citep{mcmahan2018general,mcmahan2018learning}. Then, the adaptive composition and sub-sampling privacy amplification properties of DP ensure that the whole algorithm is differentially private.
In this architecture, where clients contribute statistics to a server which updates a model, differential privacy can be used in its local or central forms.
In local DP~\citep{dwork2014algorithmic}, the statistics are obfuscated before leaving the device.
However, models trained with local DP often suffer from low utility~\citep{granqvist2020improving}.
Instead, this paper will assume $(\epsilon, \delta)$-central DP.
This can involve trust in the server that updates the model, or a trusted third party separated from the model, which is how differential privacy was originally formulated.
In some cases, like \texttt{FederatedSGD}, all the server needs to know is a sum over client contributions.
In this case, the trusted third party can be replaced by multi-party computation~\citep{goryczka2015comprehensive}, such as secure aggregation~\citep{bonawitz2017practical}.
\subsection{The Modified Method of Differential Multipliers}
\label{subsec:mmdm}
Ultimately, our objective is to find a parametric model that minimizes a differentiable loss function while respecting some fairness constraints. Therefore, in this section we review an algorithm for constrained differential optimization, the modified method of differential multipliers (MMDM)~\citep{platt1987constrained}.
This algorithm tries to find a solution to the following constrained optimization problem:
\begin{equation}
\bm{w}^\star = \Bigg \lbrace
\begin{aligned}
\arg \min_{\bm{w} \in \ensuremath{\mathbb{R}}^p} \quad &\phi(\bm{w}) \\
\textnormal{s.t.} \qquad & \bm{g}(\bm{w}) = \bm{0}
\end{aligned} \ ,
\tag{P1}
\label{eq:constrained_optimization}
\end{equation}
where $\phi: \ensuremath{\mathbb{R}}^p \to \ensuremath{\mathbb{R}}$ is the function to minimize, $\bm{g}(\bm{w}) = (g_1(\bm{w}), g_2(\bm{w}), \ldots, g_r(\bm{w}))$ is the concatenation of $r$ constraint functions, and $\lbrace \bm{w} \in \ensuremath{\mathbb{R}}^p : \bm{g}(\bm{w}) = 0 \rbrace$ is the solution subspace.
The algorithm consists of solving the following set of differential equations resulting from the Lagrangian of \eqref{eq:constrained_optimization} with an additional quadratic penalty $c \bm{g}(w)^2$ using gradient descent/ascent. This results in the following iterative update algorithm
\begin{equation}
\left\lbrace
\begin{aligned}
\bm{\lambda} &\gets \bm{\lambda} + \gamma \bm{g}(\bm{w}) \\
\bm{w} &\gets \bm{w} - \eta \Big(\nabla_{\bm{w}} \phi(\bm{w}) + \bm{\lambda}^T \nabla_{\bm{w}} \bm{g}(\bm{w}) + c \bm{g}(\bm{w})^T \nabla_{\bm{w}} \bm{g}(\bm{w}) \Big)
\end{aligned} \right. \ ,
\label{eq:mmdm_updates}
\end{equation}
where $\bm{\lambda} \in \ensuremath{\mathbb{R}}^r$ is a Lagrange (or dual) multiplier, $c \in \ensuremath{\mathbb{R}}_+$ is a damping parameter, $\eta$ is the learning rate of the model parameters and $\gamma$ is the learning rate of the Lagrange multiplier.
Intuitively, these sets of updates gradually fulfill~\eqref{eq:constrained_optimization}. The parameter updates against $\nabla_{\bm{w}} \phi(\bm{w})$ enforce the function minimization and the parameter updates against $\nabla_{\bm{w}} \bm{g}(\bm{w})$ enforce the constraints' satisfaction. Then, the multiplier $\bm{\lambda}$ and the multiplicative factor $c \bm{g}(\bm{w})$ control how strongly the constraints' violations are penalized in the parameters' update.
A desirable property of MMDM is that for small enough learning rates $\eta, \gamma$ and large enough damping parameter $c$, there is a region comprising the surroundings of each constrained minimum such that if the parameters' initialization is in that region and the parameters remain bounded, then the algorithm converges to a constrained minimum \citep{platt1987constrained}. Intuitively, this condition comes from the fact that the term $c\bm{g}(\bm{w}) \nabla_{\bm{w}} \bm{g}(\bm{w})$ enforces a quadratic shape on the optimization search space on the neighbourhood of the solution subspace, and this local behavior is stronger the larger the damping parameter $c$. Therefore, if the parameters' initialization is in this locally quadratic region, then the algorithm is guaranteed to converge to the minimum.
\subsection{Group Fairness}
\label{subsec:group_fariness}
In this subsection, we mathematically formalize what \emph{group fairness} means. To simplify the exposition, we describe this notion in the central setting, i.e.\ where the data is not distributed across users.
Let us consider a dataset $d = (\bm{z}_1, \bm{z}_2, \ldots, \bm{z}_n)$ of $n$ instances, where each instance $\bm{z}_i$ belongs to a group $a_i \in \mathcal{A}$. Group fairness considers how differently a model treats the instances belonging to each group.
Many fairness metrics can be written in terms of the similarity of the expected value of a function of interest $f$ of the model evaluated on the general population $d$ with that on the population of each group $d_a = \lbrace (\bm{x}_i,y_i,a_i) \in d: a_i = a \rbrace$~\citep{agarwal2018reductions, fioretto2020lagrangian}.
That is, if we consider a supervised learning problem, where $\bm{z}_i = (\bm{x}_i, \bm{y}_i, a_i)$ and where the output of the model is an approximation $\hat{\bm{y}}_i$ of $\bm{y}_i$, we say a model is fair if
\begin{equation}
\ensuremath{\mathbb{E}}[ f(\bm{X},\bm{Y},\hat{\bm{Y}}) \mid A = a ] = \ensuremath{\mathbb{E}}[ f(\bm{X},\bm{Y},\hat{\bm{Y}}) ]
\label{eq:basic_fairness_expression}
\end{equation}
for all $a \in \ensuremath{\mathcal{A}}$.
Most of the group fairness literature focuses on the case of binary classifiers, i.e.\ $\hat{y}_i \in \lbrace 0, 1 \rbrace$, and on the binary group case, i.e.\ $\ensuremath{\mathcal{A}} = \lbrace 0, 1 \rbrace$. However, many of the fairness metrics can be extended to general output spaces $\ensuremath{\mathcal{Y}}$ and categorical groups $\ensuremath{\mathcal{A}}$. It is common that the function $f$ is the indicator function $\ensuremath{\mathbbm{1}}$ of some logical relationship between the random variables, thus turning~\eqref{eq:basic_fairness_expression} to an equality between probabilities. As an example, we describe two common fairness metrics that will be used later in the paper. For a comprehensive survey of different fairness metrics and their inter-relationships, please refer to~\citep{verma2018fairness, castelnovo2021zoo}.
\begin{enumerate}
\item \emph{False negative rate (FNR) parity (or equal opportunity)~\citep{hardt2016equality}}: This fairness metric is designed for binary classification and binary groups. It was originally defined as equal true positive rate between the groups, which is equivalent to an equal FNR between each group and the overall population. That is, if we let $f(\bm{X},Y,\hat{Y}) = \ensuremath{\mathbb{E}}[ \ensuremath{\mathbbm{1}}(\hat{Y}=0) \mid Y=1]$ then~\eqref{eq:basic_fairness_expression} reduces to
\begin{equation}
\ensuremath{\mathbb{P}}[ \hat{Y} = 0 \mid Y=1, A=a ] = \ensuremath{\mathbb{P}}[\hat{Y} = 0 \mid Y=1]
\end{equation}
for all $a \in \ensuremath{\mathcal{A}}$.
This is usually a good metric when the target variable $Y$ is something positive such as being granted a loan or being hired for a job, since we want to minimize the group disparity of misclassification among the individuals that deserved such a loan or such a job~\citep{hardt2016equality, castelnovo2021zoo}.
\item \emph{Accuracy parity (or overall misclassification rate)~\citep{zafar2017fairness}}: This fairness metric is also designed for binary classification and binary groups. Nonetheless, it applies well to general tasks and categorical groups. Similarly to the previous metric, if we let $f(\bm{X},Y,\hat{Y}) = \ensuremath{\mathbbm{1}}(\hat{Y}=Y)$ then~\eqref{eq:basic_fairness_expression} reduces to
\begin{equation}
\ensuremath{\mathbb{P}}[ \hat{Y} = Y \mid A=a ] = \ensuremath{\mathbb{P}}[\hat{Y} = Y]
\end{equation}
for all $a \in \ensuremath{\mathcal{A}}$.
This is usually a good metric when there is not a clear positive or negative semantic meaning to the target variable, and also when this variable is not binary.
\end{enumerate}
\section{An Algorithm for Fair and Private Federated Learning (FPFL)}
\label{sec:fpfl}
In this section we describe the proposed algorithm to enforce fairness in PFL of parametric models learned with SGD. First, we describe an adaptation of the MMDM algorithm to enforce fairness in standard central learning. Then, we extend that algorithm to PFL.
\subsection{Adapting the MMDM Algorithm to Enforce Fairness}
\label{subsec:mmdm_fairness}
Consider a dataset $d = (\bm{z}_1, \bm{z}_2, \ldots, \bm{z}_n)$ of $n$ instances, where each instance $\bm{z}_i$ belongs to a group $a_i \in \ensuremath{\mathcal{A}}$. Consider also a supervised learning setting where $\bm{z}_i = (\bm{x}_i, y_i, a_i)$, the output of the model $\hat{y}_i$ is an approximation of $y_i$, and the model is parametrized by the parameters $\bm{w} \in \ensuremath{\mathbb{R}}^p$. Finally, we consider we have no information about the distribution of the variables $(\bm{X},Y,A)$ aside from the available samples.
We concern ourselves with the task of finding the model's parameters $\bm{w}^\star$ that minimize a loss function $\ell$ across the data samples while enforcing a measure of fairness on the model. That is, to solve
\begin{equation}
\bm{w}^\star = \left \lbrace
\begin{aligned}
\arg \min_{\bm{w} \in \ensuremath{\mathbb{R}}^p} \quad &\frac{L(d,\bm{w})}{n}\\
\textnormal{s.t.} \qquad & \Big| \frac{F(d',\bm{w})}{n'} - \frac{F(d'_a, \bm{w})}{n'_a} \Big| \leq \alpha, \textnormal{ for all } a \in \ensuremath{\mathcal{A}}
\end{aligned} \right. ,
\tag{P2}
\label{eq:mmdm_central}
\end{equation}
where $F(d',\bm{w}) := \sum_{\bm{z} \in d'} f(\bm{z},\bm{w})$, $d'$ is a subset of $d$ that varies among different fairness metrics, $n'$ is the number of samples in $d'$, $d'_a$ is the set of samples in $d'$ such that $a_i = a$, $n'_a$ is the number of samples in $d'_a$, $f$ is the function employed for the fairness metric definition, and $\alpha$ is a tolerance threshold. The subset $d'$ is chosen based on the function $f$ used for the fairness metric: if the fairness function does not involve any conditional expectation (e.g.\ accuracy parity), then $d' = d$; if, on the other hand, the subset involves a conditional expectation, then the $d'$ is the subset of $d$ where that condition holds, e.g.\ when the fairness metric is FNR parity $d' = \lbrace (\bm{x}, y, a) \in d : y = 1 \rbrace$.
Note how the expected values of the fairness constraints in~\eqref{eq:basic_fairness_expression} are substituted with empirical averages in~\eqref{eq:mmdm_central}. Also, note that the constraints are not strict, meaning that there is a tolerance $\alpha$ for how much the function $f$ can vary between certain groups and the overall population. The reason for this choice is twofold:
\begin{enumerate}
\item It facilitates the training since the solution subspace is larger.
\item It is known that some fairness metrics, such as FNR parity, are incompatible with DP and non-trivial accuracy. However, if the fairness metric is relaxed, fairness, accuracy, and privacy can coexist~\citep{jagielski2019differentially, cummings2019compatibility}.
\end{enumerate}
This way, we may re-write~\eqref{eq:mmdm_central} in the form of~\eqref{eq:constrained_optimization} to solve the problem with MMDM. To do so we let $\phi(\bm{w}) = L(d,\bm{w}) / n$ and $\bm{g}(\bm{w}) = (g_0(\bm{w}), g_1(\bm{w}), \ldots, g_{|\ensuremath{\mathcal{A}}|-1}(\bm{w}))$, where
\begin{equation}
g_a(\bm{w}) =
\left \lbrace
\begin{array}{ll}
h_a(\bm{w}) & \textnormal{ if } h_a(\bm{w}) \geq 0 \\
0 & \textnormal{ otherwise}
\end{array}
\right.
\end{equation}
and $h_a(\bm{w}):= \Big| \frac{F(d',\bm{w})}{n'} - \frac{F(d'_a,\bm{w})}{n'_a} \Big| - \alpha$. Therefore, the parameters are updated according to
\begin{equation}
\left\lbrace
\begin{aligned}
\bm{\lambda} &\gets \bm{\lambda} + \gamma \bm{g}(\bm{w}) \\
\bm{w} &\gets \bm{w} - \eta \big(\nicefrac{1}{n}\nabla_{\bm{w}} L(d,\bm{w}) + \bm{\lambda}^T \nabla_{\bm{w}} \bm{g}(\bm{w}) + c \bm{g}(\bm{w})^T \nabla_{\bm{w}} \bm{g}(\bm{w}) \big)
\end{aligned} \right. ,
\label{eq:mmdm_updates_fairness}
\end{equation}
where we note that $\nabla_{\bm{w}} \bm{g}(\bm{w}) = (\nabla_{\bm{w}} g_0(\bm{w}), \nabla_{\bm{w}} g_1(\bm{w}), \ldots, \nabla_{\bm{w}} g_{|\ensuremath{\mathcal{A}}|-1}(\bm{w}))$ and
\begin{equation}
\nabla_{\bm{w}} g_a(\bm{w}) =
\left \lbrace
\begin{array}{ll}
\textnormal{sign} \Big( \frac{F(d',\bm{w})}{n'} - \frac{F(d'_a,\bm{w})}{n'_a} \Big) \Big( \frac{\nabla_{\bm{w}} F(d',\bm{w})}{n'} - \frac{\nabla_{\bm{w}} F(d'_a,\bm{w})}{n'_a} \Big) & \textnormal{ if } h_a(\bm{w}) \geq 0 \\
0 & \textnormal{ otherwise}
\end{array}
\right. .
\label{eq:gradient_abs_value}
\end{equation}
Now, the fairness-enforcing problem~\eqref{eq:mmdm_central} can be solved with gradient descent/ascent or mini-batch stochastic gradient descent/ascent, where instead of the full dataset $d$, $d'$, and $d'_a$, one considers batches $b$, $b'$, and $b'_a$ (or subsets) of that dataset. Moreover, it can be learned with DP adapting the DP-SGD algorithm from~\citep{abadi2016deep}, where a clipping bound and Gaussian noise is included in both the network parameters' and multipliers' individual updates. Nonetheless, there are a series of caveats of doing so:
\begin{itemize}
\item The batch size $|b'|$ should be large enough to, on average, have enough samples of each group $a \in \ensuremath{\mathcal{A}}$ so that the difference
\begin{equation}
\frac{F(b',\bm{w})}{|b'|} - \frac{F(b'_a,\bm{w})}{|b'_a|}
\end{equation}
is well estimated.
\item In many situations of interest such as when we want to enforce FNR parity or accuracy parity, the function $f$ employed for the fairness metric is not differentiable and thus $\nabla_{\bm{w}} F(d',\bm{w})$ does not exist. To solve this issue, we resort to estimate the gradient $\nabla_{\bm{w}} F(d',\bm{w})$ using a differentiable estimation of the function aggregate $F(d',\bm{w})$. For instance:
\begin{itemize}
\item Enforcing FNR parity on a neural network $\psi_{\bm{w}}$ (with a Sigmoid output activation function) in a binary classification task.
We note that given an input $\bm{x}_i$, the raw output of the network $\psi_{\bm{w}}(\bm{x}_i)$ is an estimate of the probability that $\hat{y}_i = 1$. Hence, the function aggregate can be estimated as
\begin{equation}
\frac{1}{n'} F(d',\bm{w}) \approx \frac{1}{n'} \sum_{\bm{x}_i \in d'} (1 - \psi_{\bm{w}}(\bm{x}_i)) \approx \ensuremath{\mathbb{P}}[\hat{Y} = 0 | Y = 1].
\end{equation}
\item Enforcing accuracy parity on a neural network $\psi_{\bm{w}}$ (with softmax output activation function) in a multi-class classification task. We note that given an input $\bm{x}_i$, the raw $j_{\textnormal{th}}$ output of the network $\psi_{\bm{w}}(\bm{x}_i)_j$ is an estimate of the probability that $\hat{y}_{i} = j$. Hence, the function aggregate can be estimated as \begin{equation}
\frac{1}{n'} F(d',\bm{w}) \approx \frac{1}{n'}\sum_{\bm{x}_i \in d'} \bm{\psi}_{\bm{w}}(\bm{x}_i)^T \bm{y}_i \approx \ensuremath{\mathbb{P}}[\hat{Y} = Y],
\end{equation}
where $\bm{y}_i$ the one-hot encoding vector of $y_i$.
\end{itemize}
\end{itemize}
Finally, we conclude this subsection noting the similarities and differences of this work and~\citep{tran2021differentially}. Even though their algorithm is derived from first principles on Lagrangian duality, their resulting algorithm is equivalent to an application of the basic method of differential multipliers (BMDM) to solve a problem equivalent to~\eqref{eq:mmdm_central} when $\alpha = 0$. Nonetheless, the two algorithms differ in three main aspects:
\begin{enumerate}
\item The difference between BMDM and MMDM: BMDM is equivalent to MMDM when $c=0$, that is, when the effect of making the neighbourhood of the solution subspace quadratic is not present. Moreover, the guarantee of achieving a local minimum that respects the constraints does not hold for $c=0$ unless the problem is simple (e.g.\ quadratic programming).
\item How they deal with impossibilities in the goal of achieving perfect fairness together with privacy and accuracy. In~\citep{tran2021differentially}, the authors include a limit $\bm{\lambda}^\textnormal{max}$ to the Lagrange multiplier to avoid floating point errors and reaching trivial solutions, which in our case is taken care by the tolerance $\alpha$, which, in contrast to $\bm{\lambda}^\textnormal{max}$, is an interpretable parameter.
\item In this paper we consider the exact expression for the gradient $\nabla_{\bm{w}} \Big| \frac{F(d',\bm{w})}{n'} - \frac{F(d'_a,\bm{w})}{n'_a} \Big|$, see~\eqref{eq:gradient_abs_value}, while in \citep{tran2021differentially} the authors employ the following approximation
\begin{equation}
\Big| \frac{\nabla_{\bm{w}} F(d',\bm{w})}{n'} - \frac{\nabla_{\bm{w}} F(d'_a,\bm{w})}{n'_a} \Big|,
\end{equation}
where the sign of the difference is ignored.
\end{enumerate}
In the next subsection, we extend the algorithm to PFL, which introduces two new differences with~\citep{tran2021differentially}. Firstly, the privacy guarantees will be provided for the individuals, and not only to the group to which they belong; and secondly, the algorithm will be tailored to federated learning.
\subsection{Extending the Algorithm to Private Federated Learning}
\label{subsec:mmdm_fpfl}
In the federated learning setting we now consider that the dataset $d$ is distributed across $K$ users such that each user maintains a local dataset $d^k$ with $n^k$ samples. Nonetheless, as in the central setting, the task is to find the model's parameters $\bm{w}^\star$ that minimize the loss function across the data samples of the users while enforcing a measure of fairness to the model. That is, to solve~\eqref{eq:mmdm_central}.
To achieve this goal, we might first combine the ideas from \texttt{FederatedSGD}~\citep{mcmahan2017communication} and the previous section to extend the developed adaptation of MMDM to FL.
In order to perform the model updates dictated by~\eqref{eq:mmdm_updates_fairness}, the central server requires the following statistics:
\begin{equation}
\nabla_{\bm{w}} L(d,\bm{w}) ;\enskip F(d',\bm{w}) ;\enskip \big[ F(d'_a, \bm{w}) \big]_{a \in \ensuremath{\mathcal{A}}} ;\enskip \nabla_{\bm{w}} F(d',\bm{w}) ;\enskip \big[ \nabla_{\bm{w}} F(d'_a, \bm{w}) \big]_{a \in \ensuremath{\mathcal{A}}} ;\enskip n' ;\enskip \big[ n'_a \big]_{a \in \ensuremath{\mathcal{A}}}.
\end{equation}
However, some of these statistics can be obtained from the others, namely $F(d',\bm{w}) = \sum_{a \in \ensuremath{\mathcal{A}}} F(d'_a, \bm{w})$, $\nabla_{\bm{w}} F(d',\bm{w}) = \sum_{a \in \ensuremath{\mathcal{A}}} \nabla_{\bm{w}} F(d'_a, \bm{w})$, and $n' = \sum_{a \in \ensuremath{\mathcal{A}}} n'_a$. Moreover, as mentioned in the previous section, one might use a sufficiently large batch $b$ of the data instead of the full dataset for each update. Therefore, we consider an iterative algorithm where, at each iteration, the central server samples $m$ users $S$ that report a vector with the sufficient statistics for the update, that is
\begin{equation}
\bm{v}^k = \Big[ \nabla_{\bm{w}} L(d^k,\bm{w}), \big[ F({d^k}'_a, \bm{w}) \big]_{a \in \ensuremath{\mathcal{A}}}, \big[ \nabla_{\bm{w}} F({d^k}'_a, \bm{w}) \big]_{a \in \ensuremath{\mathcal{A}}}, \big[ {n^k}'_a \big]_{a \in \ensuremath{\mathcal{A}}} \Big].
\end{equation}
This way, if we define the batch $b$ as the sum of the $m$ users' local datasets $b := \sum_{k \in S} d^k$ and the batch $b'$ analogously, then the aggregation of each user's vectors results in
\begin{equation}
\bm{v} = \sum_{k \in S} \bm{v}^k = \Big[ \nabla_{\bm{w}} L(b,\bm{w}), \big[ F({b}'_a, \bm{w}) \big]_{a \in \ensuremath{\mathcal{A}}}, \big[ \nabla_{\bm{w}} F({b}'_a, \bm{w}) \big]_{a \in \ensuremath{\mathcal{A}}}, \big[ |b'_a| \big]_{a \in \ensuremath{\mathcal{A}}} \Big],
\end{equation}
which contains all the sufficient statistics for the parameters' update.
Finally, the resulting algorithm, termed Fair PFL or \texttt{FPFL} and described in~\Cref{algo:fpfl}, inspired by the ideas from~\citep{mcmahan2018learning,truex2019hybrid,granqvist2020improving,bonawitz2017practical} guarantees the users' privacy as follows:
\begin{enumerate}
\item It makes sure that the aggregation of the users' sent vectors is done securely by a trusted third party, e.g.\ with secure aggregation~\citep{bonawitz2017practical}.
\item It clips the vectors $\bm{v}^k$ with a clipping bound $C$ to restrict their $\ell_2$ sensitivity, i.e.\ replace $\bm{v}^k$ by $\bm{v}^k \cdot \min \lbrace 1, C / \lVert \bm{v}^k \rVert_2 \rbrace$. Then, it ensures $(\epsilon, \delta)$-DP by adding Gaussian noise with variance $C^2 \sigma^2$ to the clipped vector. The parameter $\sigma$ is calculated according to the refined moments accountant privacy analysis from \citep{wang2019subsampled}, taking into account the number of iterations (or communication rounds) $T$ the algorithm will be run, the number of users (or cohort size) $m$ that are used per iteration, the total number of users (or population size) $K$, and the privacy parameters $\epsilon$ and $\delta$.
Note that even if it later performs several post processing computations to extract the relevant information from the vector $\bm{v}$ and update the Lagrangian $\bm{\lambda}$ and the parameters $\bm{w}$, the privacy guarantees do not change thanks to the post-processing property of DP.
\end{enumerate}
\begin{algorithm}
\caption{\texttt{FPFL}. The $K$ users are indexed by $k$, $m$ is the cohort size, $T$ is the number of iterations, $C$ is the clipping bound, and ($\varepsilon, \delta$) are the DP parameters.}
\label{algo:fpfl}
\SetAlgoLined
\SetKwProg{Fn}{}{:}{}
\Fn{\textnormal{\textbf{Server Executes}}}{
$\bm{w}_0, \bm{\lambda}_0 \gets \textnormal{InitializeParameters}()$
$\sigma \gets \textnormal{CalculateNoiseScale}(K,m,\varepsilon, \delta,T)$
\For{$\textnormal{each iteration}$ $t = 1, 2, \ldots, T$}{
$S_t \gets $ (random set of $m$ users)
$\bm{v}_{t} \gets \textnormal{SecureAggregation}(\bm{w}_{t-1},S_{t},C, \sigma)$
$\bm{\lambda}_t \gets \textnormal{UpdateMultiplier}(\bm{v}_t, \bm{w}_{t-1})$
$\bm{w}_{t} \gets \textnormal{UpdateParameters}(\bm{v}_t,\bm{\lambda}_t)$
}
}
\BlankLine
\Fn(\tcc*[h]{run by a trusted third party}){\textnormal{\textbf{SecureAggregation}}$(\bm{w}, S, C, \sigma)$ }{
\For{$\textnormal{each user } k \textnormal{ in } S$}{
$\bm{v}^k \gets \textnormal{UserStatistics}(k, \bm{w})$
$\bm{v}^k \gets \bm{v}^k \cdot \min \Big \lbrace 1, \frac{C}{\lVert \bm{v}^k \rVert_2} \Big \rbrace$
}
$\bm{v} \gets \sum_{k \in S} \bm{v}^k + \ensuremath{\mathcal{N}}\big(0, C^2 \cdot \sigma^2\big)$
\Return $\bm{v}$ to server
}
\BlankLine
\Fn(\tcc*[h]{run on the user's device}){\textnormal{\textbf{UserStatistics}}$(k,\bm{w})$ }{
$\bm{v} \gets \Big[ \nabla_{\bm{w}} L(\bm{w}, d^k), \big[F(\bm{w}, {d'}^k_a) \big]_{a \in \ensuremath{\mathcal{A}}},\big[ \nabla_{\bm{w}} F(\bm{w}, {d'}^k_a)\big]_{a \in \ensuremath{\mathcal{A}}}, \big[ {n'}^k_a \big]_{a \in \ensuremath{\mathcal{A}}}\Big]$
\Return $\bm{v}$ to trusted third party
}
\end{algorithm}
\subsubsection{Local updates and batch size}
\label{subsubsec:why_sgd_not_avg}
The proposed algorithm extends the MMDM algorithm from \Cref{subsec:mmdm_fairness} to FL adapting \texttt{FederatedSGD}, where each user uses all their data, computes the necessary statistics for a model update, and sends them to the third-party.
A natural question could be why is not \texttt{FederatedAveraging} adapted instead.
That is, to perform several stochastic gradient descent/ascent updates of the model's parameters $\bm{w}$ and the Lagrange multipliers $\bm{\lambda}$, and send the difference of the updated and the original version, i.e.\ to send the vector $\bm{v}^k := [\bm{w}^k-\bm{w}, \bm{\lambda}^k - \bm{\lambda}]$.
This way, the size of the communicated vector would be reduced from $(|\ensuremath{\mathcal{A}}|+1)p + 2 |\ensuremath{\mathcal{A}}|$ to just $p+|\ensuremath{\mathcal{A}}|$ and a larger part of the computation would be done locally, increasing the convergence speed. Moreover, the clipping bound could be reduced, thus decreasing the noise necessary for the DP guarantees.
Unfortunately, for the proposed MMDM algorithm, this option could lead to catastrophic effects. Imagine for instance a situation where each user only has data points belonging to one group, say $a = 0$ or $a = 1$. Then in their local dataset the general population is equivalent to the population of their group and thus $F({d^k}', \bm{w}) = F({d^k_a}', \bm{w})$, implying that locally $\bm{g}(\bm{w}) = 0$. Therefore, the Lagrange multipliers will never be locally updated and the weights updates will be equivalent to those updates without considering the fairness constraints. That is, using this approach one would (i) recover the same algorithm than standard PFL and (ii) communicate a vector of size $p + |\ensuremath{\mathcal{A}}|$ instead of size $p$.
Another question is if one could use the algorithm as described in~\Cref{subsec:mmdm_fpfl} but using only a fraction of the users' data in each update, i.e.\ using a batch $b^k$ of their local dataset $d^k$. The answer to this is that this is possible. Nonetheless, (i) it is convenient to delegate as much computation to the user as possible and (ii) it is desirable to use as much users' data as possible to have a good approximation of the performance metrics $F(d'_a,\bm{w})$, which are needed to enforce fairness.
\section{Experimental Results}
\label{sec:results}
We study the performance of the algorithm in two different classification tasks. The first task is a binary classification based on some demographic data from the publicly available Adult dataset~\citep{Dua:2019}. The fairness metric considered for this task is FNR parity. The second task is a multi-class classification where there are three different attributes. This task uses a modification of the publicly available FEMNIST dataset~\citep{caldas2018leaf} and the fairness metric considered is accuracy parity.
For the first task we first compare the performance of the MMDM algorithm to vanilla SGD centrally. After that, for both tasks, we confirm how \texttt{FederatedSGD} deteriorates the performance of the model for the under-represented classes when clipping and noise (DP) are introduced. Finally, we demonstrate how \texttt{FPFL} can, under the appropriate circumstances, level the performance of the model across the groups without largely decreasing the overall performance of the model. In all our experiments, the fairness metrics are defined as the maximum difference between the value of a measure of performance on the general testing data and the value of that performance measure for each of the groups described by the sensitive attribute.
\subsection{Results on the Adult dataset}
\label{subsec:adult_results}
\paragraph{Adult dataset, from the UCI Machine Learning Repository~\citep{Dua:2019}.} This dataset consists of 32,561 training and 16,281 testing samples of demographic data from the US census. Each datapoint contains various demographic attributes.
Though the particular task, predicting individuals' salary ranges, is not itself of interest, this dataset serves as a proxy for tasks with inequalities in the data.
A reason this dataset is often used in the literature on ML fairness is that the fraction of individuals in the higher salary range is 30\% for the men and only 10\% for the women.
The experiments in this paper will aim to stop this imbalance from entering into the model by balancing the false negative rate~\citep{castelnovo2021zoo}.
\paragraph{Federated Adult dataset.} To generate a version of the Adult dataset suitable for federated learning, it must be partitioned into individual contributions.
In the experiments, differential privacy will be guaranteed per contribution.
In this paper, the number of datapoints per contribution is Poisson-distributed with mean of~2.
\paragraph{Privacy and fairness parameters.} For all our experiments, we considered the privacy parameters $\epsilon=2$ and $\delta = 1/K \approx 5 \cdot 10^{-5}$ and the fairness tolerance $\alpha = 0.02$.
\paragraph{Data pre-processing.} The 7 categorical variables where one-hot encoded and the 6 numerical variables where normalized with the training mean and variance. There is an underlying assumption that these means and variances can be learned at a low privacy cost. Hence, to be precise, the private models are $(\epsilon_0 + 2, 5 \cdot 10^{-5})$-DP, where $\epsilon_0$ is a small constant representing the privacy budget for learning said parameters for the normalization.
\paragraph{Models considered.} We experimented with two different fully connected networks. The first network, from now on the shallow network, has one hidden layer with 10 hidden units and a ReLU activation function. The second network, henceforth the deep network, has three hidden layers with 16, 8, and 8 hidden units respectively and all with ReLU activation functions. Both networks ended with a fully connected layer to a final output unit with a Sigmoid activation function.
\paragraph{Hyperparameters.} For all the experiments, the learning rate was $\eta = 0.1$ for the network parameters and $\gamma = 0.01$ for the Lagrange multipliers. The damping parameter was $c = 2$. The batch size for the experiments learned centrally was $n_{\textnormal{batch}}=400$ and the cohort sized studied for the federated experiments were $m = 200$ and $m = 1000$. Finally, the clipping bounds for the shallow and the deep networks were, respectively and depending if the training algorithm was PFL or \texttt{FPFL}, $C = 1.3$ or $C = 2$ and $C = 2$ or $C = 2.4$. These hyper-parameters where not selected with a private hyper-parameter search and were just set as an exemplary configuration. If one desires to find the best hyper-parameters, one can do so at an additional privacy budget cost following e.g.~\citep[Appendix~D]{abadi2016deep}.
\vspace{1em}
We start our experiments comparing the performance and fairness of the models trained with vanilla SGD and the MMDM adaptation. We trained the shallow and deep networks with these algorithms, where we tried to enforce FNR parity with a tolerance $\alpha = 0.02$. The results after 1,000 iterations are displayed in \Cref{tab:peformance_adult_central}, where we also consider the gap in other common measures of fairness such as the equalized odds, the demographic parity, or the predictive parity, see e.g.~\citep{castelnovo2021zoo}.
The MMDM algorithm reduces the FNR gap from 7\% to the targeted 2\% for both the shallow and deep networks, while reducing the accuracy of the model by less than 0.5\%, thus succeeding in its objective.
Similarly, the gap in the equalized odds, which is a stronger fairness notion than the FNR parity, also decreases from around 7\% to 3\%. Moreover, the demographic parity gap, which considers the probability of predicting one or the other target class, also improves. In terms of predictive parity, which uses the precision as the performance function, the MMDM algorithm did not improve the parity among groups.
\begin{table}[ht]
\centering
\caption{Performance of a deep and a shallow network on the Adult dataset when trained with SGD and the MMDM algorithm. The fairness metric considered for MMDM is FNR parity and the tolerance is $\alpha=0.02$.}
\label{tab:peformance_adult_central}
\begin{tabular}{l l |c c c c c}
\toprule
\textbf{Model} & \textbf{Algorithm} & \textbf{Accuracy} & \textbf{FNR gap} & \textbf{EO gap} & \textbf{DemP gap} & \textbf{PP gap} \\
\midrule
Deep & SGD & 0.858 & 0.070 & 0.070 & 0.117 & 0.006 \\
Shallow & SGD & 0.857 & 0.071 & 0.071 & 0.113 & 0.016 \\
Deep & MMDM & 0.854 & 0.020 & 0.026 & 0.087 & 0.074 \\
Shallow & MMDM & 0.855 & 0.019 & 0.029 & 0.092 & 0.044 \\
\bottomrule
\end{tabular}
\end{table}
The second experiment is to study how clipping and DP deprecates the performance for the under-represented groups, thus increasing the fairness gap on the different fairness metrics. For that, we trained the same shallow and deep networks with \texttt{FederatedSGD} and versions of this algorithm where only clipping was performed and where both clipping and DP where included. They were trained with a cohort size of $m=200$ for $T=1,000$ iterations and the model with best training cohort accuracy was selected. The results are displayed in \Cref{tab:peformance_adult_federated}. First, we note how the performance and fairness of the deep network does not change much when going from the central to the federated setting. The shallow network, on the other hand, becomes less fair under all the metrics considered. The introduction of clipping largely increases the unfairness of the models reaching more than a 16\% gap in FNR. The addition of DP does not have a larger effect on the unfairness of the models. These observations are in line with~\citep{bagdasaryan2019differential}, where they note that the under-represented groups usually have the higher loss gradients and thus clipping affects them more than the majority groups.
After that, we repeated the above experiment with \texttt{FPFL}. However, we noted that \texttt{FPFL} converged to a solution faster than \texttt{FederatedSGD}, and thus the models were trained for only $T=250$ iterations. Here the model with the best training cohort accuracy that respected the fairness condition on the training cohort data was selected.
Note that the fairness condition is evaluated with the noisy statistics of the cohort users recovered from the aggregation done by the third party, so a model may be deemed as fair while slightly violating the desired constraints. The results are also included in \Cref{tab:peformance_adult_federated} to aid the comparison. We note how, similarly to the central case, models trained with \texttt{FPFL} achieve to enforce the fairness constraints while keeping a similar accuracy. Then, clipping does not seem to affect largely the performance of \texttt{FPFL} since it compensates the gradient loss clipping with the fairness enforcement. Finally, the addition of noise to guarantee DP is not a concern to the shallow network but it deteriorates the performance of the deep network. This is largely due to the fact that the noise is large enough so that sign of the constraints' gradient, see~\eqref{eq:gradient_abs_value}, is sometimes mistaken.
Finally, we repeat the experiments with PFL and \texttt{FPFL} with a larger cohort size, $m = 1,000$, to see if a smaller relative noise would aid the training with PFL or with \texttt{FPFL}. The results with PFL were almost identical, with similar levels of accuracy and unfairness. On the other hand, the larger signal-to-DP noise ratio helped the models trained with \texttt{FPFL} to keep models with the desired levels of FNR gap and lower unfairness measured with any other metric. Moreover, the accuracy of the models, that now work better for the under-represented group, is in fact slightly higher than for the models trained with PFL.
\begin{table}[ht]
\centering
\caption{Performance of a deep and a shallow network on the Adult dataset when trained with different algorithms: \texttt{FederatedSGD} without privacy, with norm clipping, and with DP, denoted as FL, FL + Clip, and PFL respectively; and \texttt{FPFL} without privacy nor norm clipping, with norm clipping only, and with DP, denoted as FFL, FFL + Clip, and FPFL respectively. The fairness metric considered for \texttt{FPFL} is FNR parity and the tolerance is $\alpha=0.02$.}
\label{tab:peformance_adult_federated}
\begin{tabular}{l l |c c c c c}
\toprule
\textbf{Model} & \textbf{Algorithm} & \textbf{Accuracy} & \textbf{FNR gap} & \textbf{EO gap} & \textbf{DemP gap} & \textbf{PP gap} \\
\midrule
\multicolumn{7}{c}{$m = 200$} \\
\midrule
Deep & FL & 0.853 & 0.078 & 0.078 & 0.125 & 0.015 \\
Shallow & FL & 0.851 & 0.121 & 0.121 & 0.122 & 0.036 \\
Deep & FFL & 0.854 & 0.001 & 0.030 & 0.093 & 0.048 \\
Shallow & FFL & 0.855 & 0.036 & 0.039 & 0.108 & 0.033 \\
\midrule
Deep & FL + Clip & 0.848 & 0.160 & 0.160 & 0.131 & 0.056 \\
Shallow & FL + Clip & 0.844 & 0.169 & 0.169 & 0.129 & 0.051 \\
Deep & FFL + Clip & 0.852 & 0.008 & 0.023 & 0.081 & 0.031 \\
Shallow & FFL + Clip & 0.853 & 0.018 & 0.029 & 0.090 & 0.016 \\
\midrule
Deep & PFL & 0.849 & 0.123 & 0.123 & 0.126 & 0.057 \\
Shallow & PFL & 0.844 & 0.167 & 0.167 & 0.129 & 0.530 \\
Deep & FPFL & 0.804 & 0.079 & 0.080 & 0.045 & 0.092 \\
Shallow & FPFL & 0.840 & 0.001 & 0.028 & 0.080 & 0.020 \\
\midrule
\multicolumn{7}{c}{$m = 1000$} \\
\midrule
Deep & PFL & 0.847 & 0.167 & 0.167 & 0.132 & 0.043 \\
Shallow & PFL & 0.847 & 0.148 & 0.148 & 0.126 & 0.041\\
Deep & FPFL & 0.848 & 0.027 & 0.027 & 0.080 & 0.026 \\
Shallow & FPFL & 0.851 & 0.001 & 0.027 & 0.087 & 0.002 \\
\bottomrule
\end{tabular}
\end{table}
\subsection{Results on the modified FEMNIST dataset}
\label{subsec:femnist_results}
\paragraph{FEMNIST dataset~\citep{caldas2018leaf}.} This dataset is an adaptation of the Extended MNIST dataset~\citep{cohen2017emnist}, which collects more than 800,000 samples of digits and letters distributed across 3,550 users. The task considered is to predict which of the 10 digits or 26 letters (upper or lower case) is depicted in the image, so it is a multi-class classification with 62 possible classes.
\paragraph{Unfair FEMNIST dataset.} We considered the FEMNIST dataset with only the digit samples. This restriction consists of 3,383 users spanning 343,099 training and 39,606 testing samples. The task now is to predict which of the 10 digits is depicted in the image, so it is a multi-class classification with 10 possible classes. Since the dataset does not contain clear sensitive groups, we artificially create three classes (see \cref{fig:sample_mnist_classes}):
\begin{itemize}
\item Users that write with a black pen in a white sheet. These users represent the first (lexicographical) 45\% of the users, i.e.\ $\lfloor 0.45 \cdot 3,383\rfloor = 1,522$ users. These users contain 146,554 (42.7\%) training and 16,689 (42.1\%) testing samples.
The images belonging to this group are unchanged.
\item Users that write with a blue pen in a white sheet. These users represent the second (lexicographical) 45\% of the users, i.e.\ 1,522 users as well. These users contain 159,902 (46.6\%) training and 18,672 (47.1\%) testing samples.
The images belonging to this group are modified making sure that the digit strokes are blue instead of black.
\item Users that write with white chalk in a blackboard. These users represent the last remaining 10\% of the users, i.e.\ 339 users. These users contain 36,643 (10.7\%) training and 4,245 (10.7\%) testing samples.
The images belonging to this group are modified making sure that the digit strokes are white and the background is black. Moreover, to make the task more unfair, we simulated the blurry effect that chalk leaves in a blackboard. With this purpose, we added Gaussian blurred noise to the image, and then we blended them with further Gaussian blur. To be precise, if $x$ is the image normalized to $[0,1]$, the blackboard effect is the following.
\begin{equation}
x \gets (x + \xi \circledast \kappa_2) \circledast \kappa_1,
\end{equation}
where $\xi_1 \sim \mathcal{N}(0,I)$ is Gaussian noise of the size of the image, $\kappa_1$ and $\kappa_2$ are Gaussian kernels\footnote{We used the Gaussian filter implementation from SciPy~\citep{2020SciPy-NMeth}.} with standard deviation 1 and 2, respectively, and $\circledast$ represents the convolution operation. Moreover, the images are rotated 90 degrees, simulating how the pictures were taken with the device in horizontal mode due to the usual shape of the blackboards.
\end{itemize}
\begin{figure}[t]
\centering
\includegraphics{example_mnist.pdf}
\caption{Example of samples from the Unfair FEMNIST dataset. Top row: samples of black pen on a white sheet digits. Middle row: samples of the blue pen on a white sheet digits. Bottom row: samples of the white chalk on a blackboard digits.}
\label{fig:sample_mnist_classes}
\end{figure}
\paragraph{Privacy and fairness parameters.} For all our experiments, we considered the privacy parameters $\epsilon = 2$ and $\delta = 1/K \approx 2.5 \cdot 10^{-4}$. However, for the last experiment, we consider the hypothetical scenario where we had a larger number of users $K \gets 1000K$ and $K \gets 1,000 K$, thus decreasing the privacy parameter to $\delta \gets \delta / 100$ and $\delta \gets \delta / 1,000$ and reducing the added noise in the analysis from~\citep{wang2019subsampled}.
\paragraph{Model considered.} We experimented with a network with 2 convolution layers with kernel of size $5 \times 5$, stride of 2, ReLU activation function, and 32 and 64 filters respectively. These layers are followed by a fully connected layer with 100 hidden units and a ReLU activation function, and a fully connected output layer with 10 hidden units and a Softmax activation function. From now on, this model will be referred as the convolutional network.
\paragraph{Hyperparameters.} For all the experiments the learning rate was $\eta = 0.1$ for the network parameters and $\gamma = 0.05$ for the Lagrange multipliers. The damping parameter was $c = 20$. Note that we set a larger damping parameter to increase the strength to which we want to enforce the constraints, given that the task is harder than before. The cohort sizes considered were $m = 100$ and $m = 2,000$. Finally, the clipping bound for the convolutional network was $C = 250$ if the training algorithm was PFL and $C = 350$ if it was \texttt{FPFL}. As previously, these hyper-parameters where not selected with a private hyper-parameter search and were just set as an exemplary configuration. If one desires to find the best hyper-parameters, one can do so at an additional privacy budget cost following e.g.~\citep[Appendix~D]{abadi2016deep}.
We start our experiments confirming again the hypothesis and findings from~\citep{bagdasaryan2019differential} stating that clipping and DP disproportionately affect under-represented groups. For that, we trained a convolutional network with \texttt{FederatedSGD} and versions of this algorithm where only clipping was performed and where both clipping and DP where included. They were trained with a cohort size of $m=100$ for $T=2,000$ iterations and the model with best training cohort accuracy was selected. The results are displayed in \Cref{tab:peformance_mnist_federated}. Similarly to before, we see how clipping increases the accuracy gap from 13\% to almost 17\%. In this case, since the number of users $K$ is small, the necessary DP noise standard deviation is large compared to the users' sent statistics norm, and thus both the accuracy and the accuracy gap are severely affected by the addition of DP. Namely, the accuracy drops from more than 94\% with clipping to 80.7\% when DP is also included, and the accuracy gap increases until more than 40\%.
\begin{table}[t]
\centering
\caption{Performance of a deep and a shallow network on the Adult dataset when trained with different algorithms: \texttt{FederatedSGD} without privacy, with norm clipping, and with DP, denoted as FL, FL + Clip, and PFL respectively; and \texttt{FPFL} without privacy nor norm clipping, with norm clipping only, and with DP, denoted as FFL, FFL + Clip, and FPFL respectively. The fairness metric considered for \texttt{FPFL} is accuracy parity and the tolerance is $\alpha=0.04$.}
\label{tab:peformance_mnist_federated}
\begin{tabular}{l c | c c}
\toprule
\textbf{Algorithm} & \textbf{Population} & \textbf{Accuracy} & \textbf{Accuracy gap} \\
\midrule
\multicolumn{4}{c}{$m = 100$} \\
\midrule
FL & $K$ & 0.960 & 0.134 \\
FFL & $K$ & 0.950 & 0.047\\
\midrule
FL + Clip & $K$ & 0.946 & 0.166 \\
FFL + Clip & $K$ & 0.954 & 0.053 \\
\midrule
PFL & $K$ & 0.807 & 0.409 \\
FPFL & $K$ & 0.093 & 0.015 \\
\midrule
\multicolumn{4}{c}{$m = 2,000$} \\
\midrule
PFL & $100 K$ & 0.951 & 0.157 \\
FPFL & $100 K$ & 0.903 & 0.074 \\
PFL & $1,000 K$ & 0.951 & 0.153 \\
FPFL & $1,000 K$ & 0.927 & 0.073 \\
\bottomrule
\end{tabular}
\end{table}
The second experiment tests if \texttt{FPFL} can remedy the unfairness without deteriorating too much the accuracy. We trained the same convolutional network for also $T=2,000$ iterations and the model with the best training cohort accuracy that respected the fairness condition on the training cohort data was selected. We see how, when DP noise is not included, \texttt{FPFL} manages to reduce the accuracy gap with respect to \texttt{FederatedSGD} by around 9\% while keeping the accuracy within 1\%. We note how, as before, clipping does not affect largely the ability of \texttt{FPFL} to enforce fairness. However, note that since the data is more non-iid than before (i.e.\ there are more differences between the distribution of each user and the general data distribution) the models that are deemed fair in the training cohort may not be as fair in the general population, and now we see a larger gap between the desired tolerance $\alpha = 0.04$ and the obtained accuracy gap from \texttt{FPFL} without noise (0.047 and 0.053 without and with clipping).
When DP is included, the noise is too big for \texttt{FPFL} to function properly and many times the sign of the constraints' gradient, see~\eqref{eq:gradient_abs_value}, is flipped. Note that in the estimation of the performance function, i.e.\ $F(d_a,\bm{w}) / n_a$, both the numerator and denominator are obtained from a noisy vector, thus increasing the variance of the estimation and being more sensitive to noise than the estimators for \texttt{FederatedSGD}.
For this reason, we considered the scenario where the number of users was 100 and 1,000 times larger, i.e.\ $K = 338,300$ and $K = 3,383,000$, which is a conservative assumption for federated learning settings~\citep{apple_privacy_scale}. Then, we repeated the experiment with DP \texttt{FederatedSGD} and \texttt{FPFL} where the DP noise was calculated assuming this larger number of users and where we increased the cohort size to $m=2,000$. In this scenario, DP \texttt{FederatedSGD} maintained an accuracy gap of more than 15\% while \texttt{FPFL} reduced this gap to less than a half in both cases. Nonetheless, the accuracy was slightly more deteriorated than before, with a reduction of around 5\% and 2\% with respect to DP \texttt{FederatedSGD} when the hypothetical population was increased by 100 and 1,000, respectively.
\section{Conclusions}
\label{sec:conclusions}
In this paper, we studied and proposed a solution for the often overlooked problem of group fairness in private federated learning. For this purpose, we adapt the modified method of multipliers (MMDM)~\citep{platt1987constrained} to empirical loss minimization with fairness constraints, which in itself serves as an algorithm for enforcing fairness in central learning. Then, we extend this algorithm to private federated learning.
Through experiments in the Adult~\citep{Dua:2019} and a modified version of the FEMNIST~\citep{caldas2018leaf} datasets, we first corroborate previous knowledge that DP disproportionately affects the performance to under-represented groups~\citep{bagdasaryan2019differential}, with the further observation that this is true for many different fairness metrics, and not only for accuracy parity. Moreover, we demonstrate how the proposed \texttt{FPFL} algorithm is able to remedy this unfairness even in the presence of DP.
\paragraph{Limitations.} The \texttt{FPFL} algorithm is more sensitive to DP noise than other algorithms for PFL. In our experiments, this usually requires either to increase the cohort size or to ensure that enough users take part on the model's training. Nonetheless, for the present experiments, the number of users required is still lower (more than an order of magnitude) than the usual amount of users available in professional federated learning settings~\citep{apple_privacy_scale}.
\section{Acknowledgments}
The authors would like to thank Kamal Benkiran and \'Aine Cahill for their helpful discussions.
\bibliographystyle{abbrvnat}
| {'timestamp': '2021-09-20T02:19:41', 'yymm': '2109', 'arxiv_id': '2109.08604', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08604'} | arxiv |
\section{Introduction}
Fair division refers to the problem of distributing a set of resources among a set of agents in such a way that everyone is ``happy'' with the overall allocation. Capturing this ``happiness'' can be elusive,
as it may be determined by complicated underlying social dynamics; however, two well-motivated (and mathematically conducive) interpretations are those of \emph{envy-freeness} \citep{GS58,Foley67,Varian74} and \emph{proportionality} \citep{Steinhaus49}. When an allocation is envy-free, each agent values the set of resources that she receives at least as much as the set of any other agent, while when an allocation is proportional, each agent receives at least $1/n$ of her total value for all the goods, assuming there are $n$ agents.
Since the first mathematically formal treatment of fair division by Banach, Knaster and Steinhaus \citep{Steinhaus49}, the multifaceted questions that arise for the different variants of the problem have been studied in a diverse group of fields, including mathematics, economics, and political science. As many of these questions are inherently algorithmic, fair division questions, especially the ones related to the existence, computation, and approximation of different fairness notions have been very actively studied by computer scientists during the last two decades (see, e.g., \citep{Procaccia16-survey,BCM16-survey,Markakis17-survey} for surveys of recent results).
In the standard discrete fair division setting that we study here, the resources are indivisible goods and the agents have additive valuation functions over them. Typically, there is also the additional assumption that all the goods need to be allocated. This discrete setting poses a significant conceptual challenge, as the classic notions of fairness originally introduced for \emph{divisible} goods, such as envy-freeness and proportionality, are impossible to satisfy. The example that illustrates this situation needs only two agents and just one positively valued good. Whoever does not receive the good will not consider the result to be either envy-free or proportional. However, this should not necessarily be considered an \emph{unfair} outcome, as it is done out of necessity, not malice: the only other (deterministic) option would be to deprive both agents of the good, which seems wasteful. To define what is \emph{fair} in this context, a number of weaker fairness notions have been proposed. Among the most prevalent of those are \textit{envy-freeness up to one good} (\ensuremath{\textrm{\MakeUppercase{ef}1}}\xspace), \textit{envy-freeness up to any good} (\ensuremath{\textrm{\MakeUppercase{efx}}}\xspace), and \textit{maximin share fairness} (\ensuremath{\textrm{\MakeUppercase{mms}}}\xspace).
The notions of \ensuremath{\textrm{\MakeUppercase{ef}1}}\xspace and \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace were introduced by \citet{LMMS04,Budish11}, and \citet{GourvesMT14,CaragiannisKMPS19} respectively, and they can be seen as additive relaxations of envy-freeness. Both of them are based on the following rationale: an agent may envy another agent but only by the value of the most (for \ensuremath{\textrm{\MakeUppercase{ef}1}}\xspace) or the least (for \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace) desirable good in the other agent's bundle. It is straightforward that \ensuremath{\textrm{\MakeUppercase{ef}1}}\xspace is weaker than \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace, and indeed this is reflected to the known results for the two notions.
The concept of the \textit{maximin share} of an agent was introduced by \citet{Budish11}
as a relaxation to the proportionality benchmark. The corresponding fairness notion, \textit{maximin share fairness}, requires that each agent receives the maximum value that this agent would obtain if she was allowed to partition the goods into $n$ bundles and then take the worst of them (see Section \ref{sec:prelims} for a more detailed description and a formal definition).
From an algorithmic point of view,
there are many results regarding the existence and the computation of these notions (see our Related Work).
Here, however, we are interested in exploring the problem from a game theoretic perspective. In particular, we assume that the agents are \textit{strategic}, which means that it is possible for an agent to intentionally misreport her values for (some of) the goods in order to end up with a bundle of higher total value.
We see this as a very natural direction, as it captures what may happen in practice in many real-life scenarios where fair division solutions can be applied, e.g., in a divorce settlement.
It should be noted here that, in accordance to the existing literature on truthful allocation mechanisms \cite{EhlersK03, KlausM02, Papai00, Papai01, ABM16, ABCM17, CKKK09},
we assume there are \textit{no monetary transfers}. Therefore, a \textit{mechanism} in our setting is just an algorithm that takes as input the, possibly misreported, values that the agents declare. The existence of \textit{truthful} mechanisms, i.e., mechanisms where no agent ever has an incentive to lie, was studied in the same setting by \citet{ABCM17} who showed that, even for two agents, truthfulness and fairness are incompatible by providing impossibility results for several fairness notions.
As a consequence, the next natural question to ask is:
\begin{myquote}{0.44in}
\emph{Is it possible to have non-truthful mechanisms that have equilibria which define \emph{fair} allocations?}
\end{myquote}
So, our main quest is to investigate whether there exist mechanisms that have \textit{pure Nash equilibria} for every instance and each allocation corresponding to an equilibrium provides fairness guarantees with respect to the \textit{true} valuation functions of the agents.
The stability notion of a pure Nash equilibrium, on which we focus here, describes a state where each agent plays a deterministic strategy (namely, reports her value for each good) and no agent can attain higher value by deviating to a different strategy.
\subsection{Our Contributions}
To the best of our knowledge, our work is the first to consider the above question.
The results we provide are mostly positive, as we show that the class of mechanisms that are implementable in polynomial time, have pure Nash equilibria for every instance, and provide some fairness guarantee at the allocations they produce in their equilibria is non-empty.
Specifically, in Section \ref{sec:RR}, we study a mechanism adaptation of the Round-Robin algorithm which is known to produce \ensuremath{\textrm{\MakeUppercase{ef}1}}\xspace allocations in the non-strategic setting \citep{CaragiannisKMPS19}. Also, under some mild assumptions which we show that can be lifted, \citet{GW17} showed that the Round-Robin mechanism always has pure Nash equilibria.
Further, in Section \ref{sec:PR}, we consider the stronger fairness notion of \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace. We focus on the case of two agents and study a mechanism adaptation of the algorithm of \citet{PR18}, Mod-Cut\&Choose, which is known to always produce \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace allocations in the non-strategic setting.
Our main contributions can be summarized as follows:
\begin{itemize}[itemsep=2pt,topsep=6pt]
\item Round-Robin has pure Nash equilibria for every instance and these equilibria induce allocations that are always \ensuremath{\textrm{\MakeUppercase{ef}1}}\xspace with respect to the underlying true values (Theorems \ref{thm:main_theorem_for_n} and \ref{thm:general_bluff}). That is, Round-Robin retains its fairness properties at its equilibria, even when the input is given by strategic agents!
To show this, we combine well-known properties of Round-Robin with a novel recursive construction of ``nicely structured'' bid profiles.
We consider this as the main technical result of our paper.
%
\item Mod-Cut\&Choose has pure Nash equilibria for every instance with two agents and these equilibria induce allocations that are always \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace and \ensuremath{\textrm{\MakeUppercase{mms}}}\xspace with respect to the underlying true values (Theorem \ref{thm:mms+efx_PNE}). Notice that for the case of two agents \ensuremath{\textrm{\MakeUppercase{mms}}}\xspace allocations are always \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace allocations, i.e., \ensuremath{\textrm{\MakeUppercase{mms}}}\xspace fairness is stronger. It should be also noted that in the non-strategic setting the allocations returned by Mod-Cut\&Choose are not necessarily \ensuremath{\textrm{\MakeUppercase{mms}}}\xspace! (see discussion before Proposition \ref{prop:best-response-hard}).
%
\item We generalize a weaker version of the latter. All mechanisms that have pure Nash equilibria for every instance with two agents and these equilibria induce allocations that are always \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace provide stronger \ensuremath{\textrm{\MakeUppercase{mms}}}\xspace guarantees in these allocations than generic \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace allocations do (Theorems \ref{thm:4EFX=MMS} and \ref{thm:NEFX_APMMS}). This provides a very interesting separation between the strategic and non-strategic settings.
\end{itemize}
\subsection {Further Related Work}
The non-strategic version of the problem of fairly allocating goods to additive agents has been studied extensively. We provide a summary of indicative results mostly for the notions that we consider. In particular, \ensuremath{\textrm{\MakeUppercase{ef}1}}\xspace allocations always exist and can be computed in polynomial time \cite{LMMS04,Markakis17-survey,CaragiannisKMPS19}.
For the stronger notion of \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace, the picture is not that clear. It is known that such allocations always exist when there are $2$ or $3$ agents \cite{CaragiannisKMPS19, GourvesMT14, ChaGM20}, and in the former case they can be efficiently computed using Mod-Cut\&Choose \cite{PR18}. The existence of complete \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace allocations for $4$ or more agents remains one of the most intriguing open problems in fair division.
There are, however, positive results for any number of agents if the valuation functions are restricted \cite{ABFHV21,Mahara20,GargM21}, if it is allowed to discard some of the goods \citep{CaragiannisGH19,ChaudhuryKMS20,ChaudhuryGMMM21,BCFF21}, or if one considers approximate \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace allocations \citep{ANM2019}.
Finally, regarding the notion of \ensuremath{\textrm{\MakeUppercase{mms}}}\xspace, allocations that provide this guarantee always exist when there are only $2$ agents, although computing them is an NP-hard problem \citep{Woeginger97}. Even worse, for three or more agents, such allocations do not always exist \citep{KurokawaPW18}.
However, there are algorithms that run in polynomial time and produce constant factor approximation guarantees \citep{KurokawaPW18,AMNS17,BarmanK20,GHSSY21,GargMT19}, with $\frac{3}{4}+\frac{1}{12n}$ being the current state of the art \cite{GargT20}.
The works of \citet{CKKK09} and \citet{ABM16, ABCM17} are very relevant to ours in the sense that they all studied the exact same strategic discrete fair division setting. As we mentioned earlier, though, their focus was different as they were only interested in truthful mechanisms. \citet{ABCM17} provided strong impossibility results in this direction: for instances with two agents, no truthful mechanism can consistently produce \ensuremath{\textrm{\MakeUppercase{ef}1}}\xspace (and thus \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace) allocations when there are more than $4$ goods, while the best possible approximation with respect to \ensuremath{\textrm{\MakeUppercase{mms}}}\xspace declines linearly with the number of goods.
\citet{GW17} studied the existence of pure Nash equilibria of Round-Robin and showed that when no agent values any two goods equally, there always exists a pure Nash equilibrium. In addition, they provided a linear time algorithm that computes the preference rankings (i.e., the orderings of the goods that correspond to the reported values) that leads to this equilibrium, thus giving a constructive solution.
\citet{AzizBLM17} showed that computing best responses for Round-Robin, and for \emph{sequential mechanisms} more generally, is NP-hard, fixing an error in the work of \citet{BouveretL14} on the same topic.
We conclude by pointing out that in contrast to the case of indivisible goods, the problem of fairly allocating a set of divisible goods to a set of strategic agents has been repeatedly studied. For some indicative papers in this line of work, we refer the reader to \cite{ColeGG13,ChenLPP13,BranzeiCKP16,BeiCHTW17,BranzeiGM17} and references therein.
\section{Preliminaries}\label{sec:prelims}
We consider the problem of allocating a set of indivisible goods to a set of agents in a fair manner under the presence of incentives.
For $a\in \mathbb{N}$ we use $[a]$ to denote the set $\{1, 2, \ldots, a\}$.
An instance to our problem is an ordered triple $(N, M, \mathbf{v})$, where $N = [n]$ is a set of $n$ agents, $M = \{g_1,\ldots, g_m\}$ is a set of $m$ goods, and $\mathbf{v} = (v_1,\ldots, v_n)$ is a vector of the agents' additive valuation functions. In particular, each agent $i$ has a non-negative value $v_{i}(\{g\})$ (or simply $v_{i}(g)$)
for each good $g\in M$, and for every $S, T \subseteq M$ with $S\cap T= \emptyset$ we have $v_i(S\cup T) = v_i(S)+ v_i(T)$. Equivalently, the value of an agent is simply the sum of the values of the goods that she got.
We assume there is no free disposal, which means that all the goods must be allocated. Thus, an allocation $(A_1,\ldots,A_n)$, where $A_i$ is the \emph{bundle} of agent $i$, is a partition of $M$.
It is often useful
to refer to the order of preference an agent has over the goods. We say that a valuation function $v_i$ \emph{induces a preference ranking} $\succeq_i$ if $g\succeq_i g' \Leftrightarrow v_i(g) \ge v_i(g')$ for all $g,g'\in M$. We use $\succ_i$ if the corresponding preference ranking is \emph{strict}, i.e., when $g\succeq_i g' \,\wedge\, g'\succeq_i g \,\Rightarrow\, g=g'$, for all $g,g'\in M$.
\subsection{Fairness Notions}\label{subsec:fairness}
There is a significant number of different notions one can use to determine which allocations are ``fair''. The most prominent such notions are \emph{envy-freeness} (\ensuremath{\textrm{\MakeUppercase{ef}}}\xspace) \cite{GS58,Foley67,Varian74} and \emph{proportionality} (\ensuremath{\textrm{\MakeUppercase{prop}}}\xspace) \cite{Steinhaus49}, and, in the discrete setting we study here, their relaxations, namely \emph{envy-freeness up to one good} (\ensuremath{\textrm{\MakeUppercase{ef}1}}\xspace) \cite{Budish11}, \emph{envy-freeness up to any good} (\ensuremath{\textrm{\MakeUppercase{efx}}}\xspace) \cite{CaragiannisKMPS19}, and \emph{maximin share fairness} (\ensuremath{\textrm{\MakeUppercase{mms}}}\xspace) \cite{Budish11}. Particularly for additive valuation functions, we have that $\ensuremath{\textrm{\MakeUppercase{ef}}}\xspace \Rightarrow \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace \Rightarrow \ensuremath{\textrm{\MakeUppercase{ef}1}}\xspace$ and $\ensuremath{\textrm{\MakeUppercase{ef}}}\xspace \Rightarrow \ensuremath{\textrm{\MakeUppercase{prop}}}\xspace \Rightarrow \ensuremath{\textrm{\MakeUppercase{mms}}}\xspace$, where $X \Rightarrow Y$ means that any allocation that satisfies fairness criterion $X$ always satisfies fairness criterion $Y$ as well.
\begin{defn}\label{def:EF-EFX}
An allocation $(A_1,\ldots,A_n)$ is
\begin{itemize}[itemsep=2pt,topsep=6pt]
\item \textit{envy-free} (\ensuremath{\textrm{\MakeUppercase{ef}}}\xspace), if for every $i, j\in N$, $v_i(A_i) \geq v_i(A_j)$. \label{def:EF}
\item \textit{envy-free up to one good} (\ensuremath{\textrm{\MakeUppercase{ef}1}}\xspace), if for every pair of agents $i, j\in N$, with $A_j\neq\emptyset$, there exists a good $g\in A_j$, such that
$v_i(A_i) \geq v_i(A_j\setminus \{g\})$. \label{def:efo}
\item \textit{envy-free up to any good} (\ensuremath{\textrm{\MakeUppercase{efx}}}\xspace), if for every pair $i, j\in N$, with $A_j\neq\emptyset$ and every good $g\in A_j$ with $v_i(g)>0$, it holds that $v_i(A_i) \geq v_i(A_j\setminus \{g\})$. \label{def:EFX}
\end{itemize}
\end{defn}
While these notions rely on comparisons among the agents, proportionality focuses on everyone receiving at least a $1/n$ fraction of the total value.
\begin{defn}\label{def:prop}
An allocation $(A_1,\ldots,A_n)$ is \textit{proportional} (\ensuremath{\textrm{\MakeUppercase{prop}}}\xspace), if for every $i\in N$, $v_i(A_i) \geq {v_i(M)}/{n}$.
\end{defn}
In the same direction, but adjusted for indivisible goods, a number of fairness notions have been based on the notion of \emph{maximin shares} \cite{Budish11}.
Imagine that agent $i$ is asked to partition the goods into $n$ bundles, under the condition that she will receive the worst bundle among those. If the resources were divisible, then she would clearly split everything evenly into $n$ bundles of value ${v_i(M)}/{n}$ each, thus capturing the benchmark required for proportionality. However, now that the goods are indivisible, agent $i$ would like to create a partition maximizing the minimum value of a bundle. This value is her maximin share.
\begin{defn}\label{def:mmshare}
Given a subset $S\subseteq M$ of goods, the $n$-\textit{maximin share} of agent $i$ with respect to $S$ is
\[ \ensuremath{\boldsymbol{\mu}}\xspace_i(n, S) = \displaystyle\max_{\mathcal{A}\in\Pi_n(S)} \min_{A_j\in \mathcal{A}} v_i(A_j)\,,\]
where $\Pi_n(S)$ is the set of all partitions of $S$ into $n$ bundles.
\end{defn}
From the definition and the preceding discussion, we have that $n\cdot \ensuremath{\boldsymbol{\mu}}\xspace_i(n, S)\le v_i(S)$.
When $S=M$, we call $\ensuremath{\boldsymbol{\mu}}\xspace_i(n, M)$ the \textit{maximin share} of agent $i$ and denote it by $\ensuremath{\boldsymbol{\mu}}\xspace_i$ as long as it is clear what $n$ and $M$ are.
\begin{defn}
\label{def:MMS}
An allocation
$\mathcal{A} = (A_1,\ldots,A_n) $ is called an \textit{$\alpha$-maximin share fair} ($\alpha$-\ensuremath{\textrm{\MakeUppercase{mms}}}\xspace) allocation if $v_i(A_i)\geq \alpha\cdot \ensuremath{\boldsymbol{\mu}}\xspace_i\,$, for every $i\in N$. When $\alpha=1$ we just say that $\mathcal{A}$ is an \ensuremath{\textrm{\MakeUppercase{mms}}}\xspace allocation.
\end{defn}
Besides \ensuremath{\textrm{\MakeUppercase{mms}}}\xspace, there exist other fairness criteria based on the notion of maximin shares, like \emph{pairwise maximin share fairness} (\ensuremath{\textrm{\MakeUppercase{pmms}}}\xspace) \cite{CaragiannisKMPS19} and \emph{groupwise maximin share fairness} (\ensuremath{\textrm{\MakeUppercase{gmms}}}\xspace) \cite{BBMN18}. While we are not going into more details about them, it should be noted that $\ensuremath{\textrm{\MakeUppercase{pmms}}}\xspace\Rightarrow \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace$ \cite{CaragiannisKMPS19} and that for $n=2$, \ensuremath{\textrm{\MakeUppercase{mms}}}\xspace, \ensuremath{\textrm{\MakeUppercase{pmms}}}\xspace, and \ensuremath{\textrm{\MakeUppercase{gmms}}}\xspace coincide. In particular, we need the following result of \citet{CaragiannisKMPS19}.
\begin{theorem}[Follows from Theorem 4.6 of \cite{CaragiannisKMPS19}]\label{thm:mms_to_efx_n=2}
For $\,n = 2$, any \ensuremath{\textrm{\MakeUppercase{mms}}}\xspace allocation is also an \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace allocation.
\end{theorem}
In addition to the implications mentioned so far, one can consider how the approximate versions of \ensuremath{\textrm{\MakeUppercase{ef}1}}\xspace, \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace and \ensuremath{\textrm{\MakeUppercase{mms}}}\xspace relate to each other (see \cite{ABM18}). Here we need the following result about the worst case \ensuremath{\textrm{\MakeUppercase{mms}}}\xspace guarantee of an \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace allocation for the case of two agents.
\begin{theorem}[Follows from Proposition 3.3 of \cite{ABM18}]\label{thm:efx_to_mms_n=2}
For $\,n = 2$, any \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace allocation is also a $\frac{2}{3}$-\ensuremath{\textrm{\MakeUppercase{mms}}}\xspace allocation.
This guarantee is tight, in the sense that for every $\delta>0$ there exists an \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace allocation that is not a $\big(\frac{2}{3} +\delta\big)$-\ensuremath{\textrm{\MakeUppercase{mms}}}\xspace allocation, for any $m\ge 4$.
\end{theorem}
\subsection{Mechanisms and Equilibria}\label{subsec:mecanisms}
We are interested in \emph{mechanisms} that produce allocations with fairness guarantees. In our setting, where there are \textit{no payments}, an allocation mechanism $\mathcal{M}$ is essentially just an algorithm that takes its input from the agents and allocates all the goods to them. We use this distinction in terminology to highlight that this reported input may differ from the actual valuation functions. In particular, we assume that each agent $i$ reports a \emph{bid vector} $\bm{b}_i = (b_{i1}, b_{i2}, \ldots, b_{im})$, where $b_{ij}\ge 0$ is the value agent $i$ claims to have for good $g_j\in M$. A mechanism $\mathcal{M}$ takes as input a \emph{bid profile} $\mathbf{b} = (\bm{b}_1, \bm{b}_2, \ldots, \bm{b}_n)$ of bid vectors and outputs an allocation $\mathcal{M}(\mathbf{b})$.
In our setting we assume that the agents are \emph{strategic}, i.e., an agent may misreport her true values if this results to a better allocation from her point of view. Hence, in general, $\bm{b}_i \neq (v_{i}(g_1), v_{i}(g_2), \ldots, v_{i}(g_m))$. While $\bm{b}_i$ is defined as a vector, for a generic good $h\in M$ it is often convenient to use the function notation $\bm{b}_i(h)$ to denote the bid value ${b}_{i\ell}$, where $\ell$ is such that $h=g_{\ell}$; extending this we may write $\bm{b}_i(S)$ for $\sum_{h\in S} \bm{b}_i(h)$.
Like above, we say that a bid vector $\bm{b}_i$ induces a preference ranking $\succeq_i$ if $g\succeq_i g' \Leftrightarrow \bm{b}_i(g) \ge \bm{b}_i(g')$ for all $g,g'\in M$, and use $\succ_i$ for strict rankings.
We focus on the fairness guarantees of the (pure) equilibria of the mechanisms we study. As is common, given a profile $\mathbf{b} = (\bm{b}_1, \ldots, \bm{b}_n)$, we write
$\mathbf{b}_{-i}$ to denote $(\bm{b}_1, \ldots, \bm{b}_{i-1}, \allowbreak \bm{b}_{i+1}, \ldots, \bm{b}_n)$ and, given a bid vector $\bm{b}'_{i}$, we use
$(\bm{b}'_i, \mathbf{b}_{-i})$ to denote the profile $(\bm{b}_1, \ldots, \bm{b}_{i-1}, \allowbreak \bm{b}'_{i}, \allowbreak \bm{b}_{i+1}, \ldots, \bm{b}_n)$. For the next definition we abuse the notation slightly: given an allocation $\mathcal{A} = (A_1,\ldots,A_n)$, we write $v_i(\mathcal{A})$ to denote $v_i({A}_i)$.
\begin{defn}
Let $\mathcal{M}$ be an allocation mechanism and consider a profile
$\mathbf{b} = (\bm{b}_1, \ldots, \bm{b}_n)$. We say that $\bm{b}_{i}$ is a \emph{best response} to $\mathbf{b}_{-i}$ if for every $\bm{b}'_{i}\in \mathbb{R}^m_{\ge 0}$, we have $v_i(\mathcal{M}(\bm{b}'_i, \mathbf{b}_{-i}))\le v_i(\mathcal{M}(\mathbf{b}))$.
The profile $\mathbf{b}$ is a \emph{pure Nash equilibrium} (PNE) if, for each $i\in N$, $\bm{b}_{i}$ is a best response to $\mathbf{b}_{-i}$.
\end{defn}
When $\mathbf{b}$ is a PNE and the allocation $\mathcal{M}(\mathbf{b})$ has a fairness guarantee, e.g., $\mathcal{M}(\mathbf{b})$ is \ensuremath{\textrm{\MakeUppercase{ef}1}}\xspace, we will atribute the same guarantee to the profile itself, i.e., we will say that $\mathbf{b}$ is \ensuremath{\textrm{\MakeUppercase{ef}1}}\xspace.
\begin{rem}
The mechanisms we consider in this work run in polynomial time. However there are computational complexity questions that go beyond the mechanisms themselves. For instance, how does an agent compute a best response or how do all the agents reach an equilibrium?
While we consider such questions interesting directions for future work, we do not study them here and we only focus on the fairness properties of PNE. It should be noted, however, that such problems are typically hard. For instance, computing a best response for Round-Robin is NP-hard in general \citep{AzizBLM17} (although for fixed $n$ it can be done in polynomial time \citep{XiaoL20}), and we show that the same is true for
Mod-Cut\&Choose
(Proposition \ref{prop:best-response-hard}).
\end{rem}
\begin{rem}
An easy observation on the main question of this work is that \emph{any} PNE of \emph{any} $\alpha$-approxi\-ma\-tion mechanism for computing \ensuremath{\textrm{\MakeUppercase{mms}}}\xspace allocations is an $\alpha$-\ensuremath{\textrm{\MakeUppercase{mms}}}\xspace allocation. Indeed, this is true, not only for \ensuremath{\textrm{\MakeUppercase{mms}}}\xspace but for any fairness notion that depends on agents achieving specific value benchmarks that depend on their own valuation function, e.g., it is also true for \ensuremath{\textrm{\MakeUppercase{prop}}}\xspace. While this is definitely interesting to note, nothing is known on the existence of PNE of any constant factor approxi\-ma\-tion algorithm for computing \ensuremath{\textrm{\MakeUppercase{mms}}}\xspace allocations in the literature. Even for a very simple $1/2$-approximation algorithm that only slightly differs from Round-Robin \cite{AMNS17}, showing that PNE always exist seems very challenging. Clearly, an existence result for any such algorithm \citep{KurokawaPW18,AMNS17,BarmanK20,GHSSY21,GargMT19,GargT20} would imply an analogue of Theorem \ref{thm:main_theorem_for_n} for appro\-xi\-mate \ensuremath{\textrm{\MakeUppercase{mms}}}\xspace. We see this as another promising direction in line with the research agenda we initiate here.
\end{rem}
\section{Fairness of Nash Equilibria of Round-Robin}\label{sec:RR}
In this section we focus on one of the simplest and most well-studied allocation algorithms, Round-Robin, a draft algorithm where the agents take turns and in each turn the active agent receives her most preferred available (i.e., unallocated) good. Below we state Round-Robin as a mechanism (Mechanism \ref{alg:MRR}) that takes as input a bid profile rather than the valuation functions of the agents.
In its full generality, Round-Robin should also take a permutation $N$ as an input to determine the priority of the agents. Here, for the sake of presentation, we assume that the agents in each \emph{round} (lines \ref{line:rr3}--\ref{line:rr6}) are always considered according to their ``name'', i.e., agent 1 is considered first, agent 2 second, and so on.
This is without loss of generality, as it only requires renaming the agents accordingly.
\begin{algorithm}[ht]
\caption{Round-Robin$(\bm{b}_1, \ldots, \bm{b}_n)$ \hfill\small{ // For $i\in N$, $\bm{b}_i = (b_{i1}, \ldots, b_{im})$ is the bid of agent $i$.}}
\begin{algorithmic}[1]
\State $S=M$\textbf{;} $(A_1,\dots,A_n) = (\emptyset,\ldots,\emptyset)$\textbf{;} $k = \lceil m/n\rceil$
\For{$r = 1, \dots, k$} \Comment{Each value of $r$ determines the corresponding \emph{round}.}
\For{$i = 1, \dots, n$} \label{line:rr3}
\State $g = \arg\max_{h \in S}\bm{b}_i(h)$
\Comment{Break ties lexicographically (hence we use {\footnotesize ``$=$''} instead of the correct {\footnotesize ``$\in$''}).}
\State $A_i = A_{i} \cup \{g\}$ \Comment{The current agent receives (what appears to be) her favorite available good.}
\State $S = S\setminus \{g\}$ \Comment{The good is no longer available.}\label{line:rr6} \vspace{-2pt}
\EndFor
\EndFor
\State
\Return {$\mathcal{A}=(A_1,\dots,A_n)$}
\end{algorithmic}
\label{alg:MRR}
\end{algorithm}
While it is long known that truth-telling is generally not a PNE in sequential allocation mechanisms (a special case of which is Round-Robin) \cite{KohlerC71}, we present here a minimal example that illustrates the mechanics of manipulation.
Let $N=\{1, 2\}$ and $M=\{a,b,c\}$ with the valuation functions being as shown in the table on the left.
The circles show the allocation returned by Round-Robin when the agents bid their true values, while the superscripts indicate in which order were the goods assigned. Given that agent 2 is not particularly interested to good $a$, agent 1 can manipulate the mechanism into giving her $\{a,b\}$ instead $\{a,c\}$ by claiming that these are her top goods as in the table on the right.
\[\begin{array}{c c c c}
& a & b & c \\
v_1: &\circled{6}^1 & 5 & \circled{4}^3 \\
v_2: & 4 & \circled{6}^2 & 5
\end{array}
\qquad\qquad\qquad
\begin{array}{c c c c}
& a & b & c \\
\bm{b}_1: &\circled{5}^3 & \circled{6}^1 & 4 \\
v_2: & 4 & 6 & \circled{5}^2
\end{array}
\]
Thus, bidding according to $v_1, v_2$ is not a PNE. The example is minimal, in the sense that with just $1$ agent or less than $3$ goods truth-telling is a PNE of Round-Robin almost trivially.
Before moving to the main technical part of this section,
we discuss some assumptions that again are without loss of generality, and give an easy proof for the case of two agents.
As we have mentioned in the Introduction, it is known that, as an algorithm, Round-Robin outputs \ensuremath{\textrm{\MakeUppercase{ef}1}}\xspace allocations when all agents have additive valuation functions \cite{Markakis17-survey,CaragiannisKMPS19}. Also Round-Robin as a mechanism is known to have PNE for any instance where \textit{no agent values two goods exactly the same}, and at least some such equilibria (namely, the ones consistent with the so-called \emph{bluff profile}) are easy to compute \cite{GW17}.
From a technical point of view, this assumption that all the valuation functions induce strict preference rankings is convenient, as it greatly reduces the number of corner cases one has to deal with.
However, as we show in Theorem \ref{thm:general_bluff} in Appendix \ref{app:strict-vs-ties}, the result of \citet{GW17} extends to general additive valuation functions.
On a different but related note, we assume, for the remainder of this section, that all the bid vectors induce strict preference rankings (but not necessarily consistent with the preference rankings induced by the corresponding valuation functions).
This is without loss of generality, because even if a bid vector contains some bids that are equal to each other, a strict preference ranking is imposed by the lexicographic tie-breaking of the mechanism itself. So, formally, when we abuse the notation and write $g\succ_i h$ we mean that either $\bm{b}_i(g) > \bm{b}_i(h)$, or $\bm{b}_i(g) = \bm{b}_i(h)$ and $g$ has a lower index than $h$ in the standard naming of goods as $g_1, g_2, \ldots, g_m$.
Next we show that for only two agents all PNE of Round-Robin are \ensuremath{\textrm{\MakeUppercase{ef}1}}\xspace with respect to the real valuation functions. To appreciate this easy result, one should compare it to the involved general proof of Theorem \ref{thm:main_theorem_for_n} in the next section, the full complexity of which seems to be necessary even for $n=3$. The straightforward but crucial observation that makes things work here is that envy-freeness and proportionality are equivalent when there are only two agents.
\begin{theorem}\label{thm:main_theorem_for_2}
For any fair division instance $\mathcal{I}=(\{1,2\},M,\mathbf{v})$, every PNE of the Round-Robin mechanism is \ensuremath{\textrm{\MakeUppercase{ef}1}}\xspace with respect to the valuation functions $v_1,v_2$.
\end{theorem}
\begin{proof}
Suppose towards a contradiction that this is not the case. That is, there exists a PNE $\mathbf{b} = (\bm{b}_{1}, \bm{b}_{2})$ such that in the allocation $(A_1, A_2)$ returned by Round-Robin$(\mathbf{b})$ at least one of the agents envies the other, even after removing the most valuable good from her bundle. We will examine each agent separately.
If agent 1 does not see the allocation as \ensuremath{\textrm{\MakeUppercase{ef}1}}\xspace, then this means that she does not see it as \ensuremath{\textrm{\MakeUppercase{ef}}}\xspace either.
Since envy-freeness and proportionality are equivalent for $n=2$, we get that $v_1(A_1) < v_1(M)/2$.
It is known that, no matter what others bid, if the agent with the highest priority (here agent 1) reports her true values to Round-Robin, the resulting allocation is \ensuremath{\textrm{\MakeUppercase{ef}}}\xspace from her perspective (see, e.g., the proof of Theorem 12.2 in \cite{Markakis17-survey}).
So, if $(A'_1, A'_2)$ is the allocation after agent 1 deviates to her true values, it is \ensuremath{\textrm{\MakeUppercase{ef}}}\xspace from the point of view of the agent 1, which in turn implies that
$v_1(A'_1) \ge v_1(M)/2> v_1(A_1)$. This contradicts the fact that $\mathbf{b}$ is a PNE.
If agent 2 does not see the allocation as \ensuremath{\textrm{\MakeUppercase{ef}1}}\xspace, then let $h_1$ be the good that agent 1 takes during the first round of round-robin, and $g^*\in \arg\max_{h \in A_1}v_2(h)$ be the highest valued good in $A_1$ according to agent 2. Since agent 2 does not consider $(A_1, A_2)$ to be \ensuremath{\textrm{\MakeUppercase{ef}1}}\xspace, we have that $v_2(A_2)<v_2(A_1\setminus\{g^*\}) \leq v_2(A_1\setminus\{h_1\})$.
This implies that the partition $(A_1\setminus \{h_1\}, A_2)$ of $M\setminus \{h_1\}$ is not an \ensuremath{\textrm{\MakeUppercase{ef}}}\xspace allocation with respect to agent 2. Now we may use a similar argument as in the previous case. First, since envy-freeness and proportionality are equivalent when $n=2$, we get that $v_2(A_2)< {v_2(M\setminus \{h_1\})}/{2}$. Then suppose agent 2 deviates to reporting her true values and let $(A'_1, A'_2)$ be the resulting allocation. Notice that the allocation of good $h_1$ is not affected by the deviation; it is still given to agent 1 during the first step of Round-Robin. From that point forward, the execution of the mechanism would be exactly the same as it would be if the input was the restrictions of $\bm{b}_{1}, v_2$ on $M\setminus \{h_1\}$ and agent 2 had higher priority than agent 1. The latter would result in an \ensuremath{\textrm{\MakeUppercase{ef}}}\xspace allocation with respect to agent 2 and, in particular, to the allocation $(A'_1\setminus \{h_1\}, A'_2)$. That is, we have $v_2(A'_2)\ge {v_2(A'_1\setminus \{h_1\})}$ and, therefore, $v_2(A_2)\ge {v_2(M\setminus \{h_1\})}/{2} > v_2(A_2)$. Like before, this contradicts the fact that $\mathbf{b}$ is a PNE.
\end{proof}
Moving to the case of general $n \ge 3$, the above simple argument no longer works. When an agent $i$ does not consider an allocation \ensuremath{\textrm{\MakeUppercase{ef}1}}\xspace because of an agent $i'$, this does not imply that $i$ got value less than ${1}/{n}$ of her value for the reduced bundle $M\setminus \{g^*\}$, where $g^*$ is her best good in $A_{i'}$. The reason for this is that $\ensuremath{\textrm{\MakeUppercase{prop}}}\xspace\not\Rightarrow \ensuremath{\textrm{\MakeUppercase{ef}}}\xspace$
anymore.
\subsection{Nash Equilibria of Round-Robin for Any Number of Agents}\label{subsec:RRn}
Here we state and prove the main result of our work.
Despite its proof being rather involved, the intuition behind it is simple.
On one hand, whenever an agent bids truthfully, she sees the resulting allocation as being \ensuremath{\textrm{\MakeUppercase{ef}1}}\xspace. On the other hand, no matter what an agent bids, we show it is possible to ``replace'' her with an imaginary version of herself who does not affect the allocation, and not only bids truthfully, but she considers the bundles of the allocation to be as valuable as the original agent thought they were.
The rather elaborate formal argument relies on the recursive construction of auxiliary valuation functions and bids, and on the fact that small changes in a single preference ranking minimally change the ``history'' of available goods during the execution of the mechanism.
\begin{theorem}\label{thm:main_theorem_for_n}
For any fair division instance $\mathcal{I}=(N,M,\mathbf{v})$, every PNE
of the Round-Robin mechanism
is \ensuremath{\textrm{\MakeUppercase{ef}1}}\xspace with respect to the valuation functions $v_1,\ldots,v_n$.
\end{theorem}
As we will see shortly, proving Theorem \ref{thm:main_theorem_for_n} reduces to showing that the agent who ``picks first'' in the Round-Robin mechanism views the final allocation as envy-free, as long as she bids a best response to other agents' bids.
While Theorem \ref{thm:best_response} sounds very much like the standard statement about the value of the first agent in the algorithmic setting, its proof relies on a technical lemma that carefully builds a ``nice'' instance which is equivalent, in some sense, to the original. Recall that we have assumed that the agents' priority is indicated by their indices.
\begin{theorem}\label{thm:best_response}
For any fair division instance $\mathcal{I}=(N,M,\mathbf{v})$, if the reported bid vector $\bm{b}_1$ of agent 1 is a best response to the (fixed) bid vectors $\bm{b}_2, \ldots, \bm{b}_n$ of all other players, then agent 1 does not envy (with respect to $v_1$) any bundle in the allocation outputted by Round-Robin$(\bm{b}_1, \ldots, \bm{b}_n)$.
\end{theorem}
Note that since we are interested in PNE, it is always the case that each agent's bid is a best response to other agents' bids. As mentioned above, Theorem \ref{thm:best_response} is essentially a corollary to Lemma \ref{lem:main_lemma}. The lemma shows the existence of an alternative version of agent 1 who is truthful, her presence does not affect the original allocation, and, as long as the allocation is the same, she shares the same values with the original agent 1. While its proof is rather involved, the high level idea is that we recursively construct a sequence of bids and valuation functions, each pair of which preserves the original allocation and the view of agent 1 for it, while being closer to being truthful. To achieve this we occasionally move value between the goods originally allocated to agent 1 and update the bid accordingly.
\begin{lemma}\label{lem:main_lemma}
Suppose that the valuation function $v_1$ induces a strict preference ranking on the
goods, i.e., for any
$g,h\in M$, $v_1(g) = v_1(h) \Rightarrow g=h$.
Let $\,\mathbf{b} = (\bm{b}_1, \bm{b}_2, \ldots, \bm{b}_n)$ be such that $\,\bm{b}_1$ is a best response of agent 1 to $\mathbf{b}_{-i} = (\bm{b}_2, \ldots, \bm{b}_n)$. Then there exists
a valuation function $v_1^*$ with the following properties:
\begin{itemize}[itemsep=2pt,topsep=6pt]
\item If $\,\bm{b}_1^*= (v_{1}^*(g_1), v_{1}^*(g_2), \ldots, v_{1}^*(g_m))$, i.e., $\bm{b}_1^*$ is the truthful bid for $v_1^*$, then Round-Robin$(\mathbf{b})$ and Round-Robin$(\bm{b}_1^*, \mathbf{b}_{-1})$ produce the same allocation $(A_1,\dots,A_n)$.
\item $v_1^*(A_1)=v_1(A_1)$.
\item For every good $g\subseteq M\setminus A_1$, it holds that $v_1^*(g)=v_1(g)$.
\end{itemize}
\end{lemma}
For the sake of presentation, we defer the proof of the lemma to the end of this section
(as it needs an additional technical lemma that is itself quite long)
and move to the proofs of Theorems \ref{thm:main_theorem_for_n} and \ref{thm:best_response}. In fact, given Lemma \ref{lem:main_lemma}, the two theorems are not hard to prove.
\begin{proof}[Proof of Theorem \ref{thm:best_response}]
Consider an arbitrary instance $\mathcal{I}=(N,M,\mathbf{v})$ and assume that the input of Round-Robin is $\,\mathbf{b} = (\bm{b}_1, \bm{b}_2, \ldots, \bm{b}_n)$, where $\bm{b}_1$ is a best response of agent 1 to $\mathbf{b}_{-i} = (\bm{b}_2, \ldots, \bm{b}_n)$ according to her valuation function $v_1$. Let $(A_1, \dots,A_n)$ be the output of Round-Robin$(\mathbf{b})$.
In order to apply Lemma \ref{lem:main_lemma}, we need $v_1$ to induce a strict preference ranking over the
goods.
For the sake of presentation, we assume here that this is indeed the case, and we treat the general case formally in Appendix \ref{app:strict-vs-ties}.
So, we now consider the hypothetical scenario implied by Lemma \ref{lem:main_lemma} in this case: keeping agents 2 through $n$ fixed, suppose that the valuation function of agent 1 is the function $v_1^*$ given by the lemma, and her bid $\bm{b}_1^*$ is the truthful bid for $v_1^*$. The first part of Lemma \ref{lem:main_lemma} guarantees that the output of Round-Robin$(\bm{b}_1^*, \mathbf{b}_{-i})$ remains $(A_1,\dots,A_n)$.
It is known that, no matter what others bid, if the agent with the highest priority (here agent 1 with $v^*_1$) reports her true values to Round-Robin, the resulting allocation is \ensuremath{\textrm{\MakeUppercase{ef}}}\xspace from her perspective (see, e.g., the proof of Theorem 12.2 in \cite{Markakis17-survey}).
In our hypothetical scenario this is the case for agent 1 and it translates into having $v_1^*(A_1)\ge v_1^*(A_i)$ for all $i \in N$. Then the second and third parts of the lemma imply that $v_1(A_1)\ge v_1(A_i)$ for all $i \in N$, i.e., agent 1 does not envy any bundle in the original instance.
\end{proof}
Having shown Theorem \ref{thm:best_response}, the proof of Theorem \ref{thm:main_theorem_for_n} is of similar flavour to the proof on Round-Robin producing \ensuremath{\textrm{\MakeUppercase{ef}1}}\xspace allocations in the non-strategic setting \cite{Markakis17-survey}.
\begin{proof}[Proof of Theorem \ref{thm:main_theorem_for_n}]
Let $\mathbf{b} = (\bm{b}_1, \bm{b}_2, \ldots, \bm{b}_n)$ be a PNE of the Round-Robin mechanism for the instance $\mathcal{I}$. By Theorem \ref{thm:best_response}, it is clear that the allocation returned by Round-Robin$(\mathbf{b})$ is \ensuremath{\textrm{\MakeUppercase{ef}}}\xspace, and hence \ensuremath{\textrm{\MakeUppercase{ef}1}}\xspace, from the point of view of agent 1. We fix an agent $\ell$, where $\ell \ge 2$.
For $i\in [\ell -1]$, let $h_i$ be the good that agent $i$ \textit{claims to be} her favourite among the goods that are available when it is her turn in the first round, i.e.,
$h_i= \argmax_{h\in M\setminus\{h_1\ldots,h_{i-1}\}}{b_{i}(h)}$.
Right before agent $\ell$ is first assigned a good, all goods in $H = \{h_1, \ldots, h_{\ell - 1}\}$ have already been allocated. We are going to consider the instance $\mathcal{I'}=(N',M',\mathbf{v}')$ in which all goods in $H$ are missing. That is, $N'=N$, $M' = M\setminus H$, and $\mathbf{v}' = (v'_1, \ldots, v'_n)$ where $v'_i = v_i|_{M'}$, for $i\in [n]$, is the restriction of the function $v_i$ on $M'$. Similarly define $\bm{b}'_i = \bm{b}_i|_{M'}$, for $i\in [n]$, the restrictions of the bids to the available goods, and $\,\mathbf{b}' = (\bm{b}'_1, \ldots, \bm{b}'_n)$. Finally, we consider the version of Round-Robin, call it Round-Robin$_{\ell}$, that starts with agent $\ell$ and then follows the indices in increasing order.
We claim that for Round-Robin$_{\ell}$ the bid $\bm{b}'_{\ell}$ is a best response for agent $\ell$ assuming that the restricted bid vectors of all the other agents are fixed. To see this, notice that for any $\bm{c}_{\ell} = (c_{\ell 1}, c_{\ell 2}, \ldots, c_{\ell m})$, the bundles given to agent $\ell$ by Round-Robin$(\bm{c}_{\ell}, \mathbf{b}_{-\ell})$ and Round-Robin$_{\ell}(\bm{c}_{\ell}|_{M'}, \mathbf{b}'_{-\ell})$ are the same! In fact, the execution of Round-Robin$_{\ell}(\bm{c}_{\ell}|_{M'}, \mathbf{b}'_{-\ell})$ is identical to the execution of Round-Robin$(\bm{c}_{\ell}, \mathbf{b}_{-\ell})$ from its $\ell$th step onward. So, if $\bm{b}'_{\ell}$ was not a best response in the restricted instance, then there would be a profitable deviation for agent $\ell$, say $\bm{b}^*_{\ell}$, so that $\ell$ would prefer her bundle in Round-Robin$_{\ell}(\bm{b}^*_{\ell}, \mathbf{b}'_{-\ell})$ to her bundle in Round-Robin$_{\ell}(\mathbf{b}')$. This would imply that any extension of $\bm{b}^*_{\ell}$ to a bid vector for all goods in $M$ (by arbitrarily assigning numbers to goods in $H$) would be a profitable deviation for agent $\ell$ in the profile $\mathbf{b}$ for Round-Robin, contradicting the fact that $\mathbf{b}$ is a PNE.
Now we may apply Theorem \ref{thm:best_response} for Round-Robin$_{\ell}$ (where agent $\ell$ plays the role of agent 1 of the theorem's statement) for instance $\mathcal{I'}$ and bid profile $\mathbf{b}'$. The theorem implies that agent $\ell$ does not envy any bundle in the allocation $(A_1, \dots,A_n)$ outputted by Round-Robin$_{\ell}(\mathbf{b}')$, i.e., $v'_{\ell}(A_\ell) \ge v'_{\ell}(A_i)$, for all $i\in [n]$. Using the observation made above about the execution of Round-Robin$_{\ell}(\mathbf{b}')$ being identical to the execution of Round-Robin$(\mathbf{b})$ after $\ell-1$ goods have been allocated, we have that Round-Robin$(\mathbf{b})$ returns the allocation $(A_1\cup\{h_1\}, \dots,A_{\ell -1}\cup\{h_{\ell -1}\}, A_{\ell}, \ldots, A_n)$. So, for any $i<\ell$ we have
$v_{\ell}(A_\ell) = v'_{\ell}(A_\ell) \ge v'_{\ell}(A_i) = v_{\ell}(A_i) = v_{\ell}(A_i \cup\{h_i\}) - v_{\ell}(h_i)$,
while for $i>\ell$ we simply have
$v_{\ell}(A_\ell) = v'_{\ell}(A_\ell) \ge v'_{\ell}(A_i) = v_{\ell}(A_i)$.
Thus, the allocation returned by Round-Robin$(\mathbf{b})$ is \ensuremath{\textrm{\MakeUppercase{ef}1}}\xspace from the point of view of agent $\ell$.
\end{proof}
Before we move on to the proof of Lemma \ref{lem:main_lemma}, we state another technical lemma.
Suppose an agent changes her bid so that in her preference ranking a single good is moved down the ranking, and then---keeping everything else fixed---we run Round-Robin on the new instance. Surprisingly, Lemma \ref{lem:swap} states that, in any step, the set of available goods
differs by at most one good from the corresponding set in the original run of Round-Robin. To formalize this, we need some additional notation and terminology.
\begin{defn}
Let $\succ$ and $\succ'$ be two strict preference rankings on $M$ and $\{q_1, q_2, \ldots, q_m\}$ be a renaming of the goods according to $\succ$, i.e., $q_1 \succ q_2 \succ \ldots \succ q_m$. We say that $\succ$ and $\succ'$ are \emph{within a partial slide of each other}
if there exist $x,y \in [m]$, $x<y$, such that
\[q_1 \succ' \ldots \succ' q_{x-1} \succ' q_{x+1} \succ' \ldots \succ' q_{y} \succ' q_x \succ' q_{y+1} \succ' \ldots \succ'q_m\,.\]
\end{defn}
Also, given a profile $\mathbf{b} = (\bm{b}_1, \ldots, \bm{b}_n)$, let $M_t(\mathbf{b})$ denote the set of available goods right after $t-1$ goods have been allocated in a run of Round-Robin$(\mathbf{b})$.
\begin{lemma}\label{lem:swap}
Let $\mathbf{b} = (\bm{b}_1, \ldots, \bm{b}_n)$ and $\mathbf{b}' = (\bm{b}'_i,\mathbf{b}_{-i})$ be two profiles such that the corresponding induced preference rankings $\succ_i$ and $\succ'_i$ of agent $i$ are within a partial slide of each other. Then $|M_t(\mathbf{b}) \setminus M_t(\mathbf{b}')| = |M_t(\mathbf{b}') \setminus M_t(\mathbf{b})| \le 1$ for all $t\in [m+1]$.
\end{lemma}
\begin{proof}
\noindent Clearly, for $t\le i$ we have $M_t(\mathbf{b}) = M_t(\mathbf{b}')$ as the runs of Round-Robin$(\mathbf{b})$ and Round-Robin$(\mathbf{b}')$ are identical at least up to the allocation of the first $i-1$ goods. We are going to prove the statement by induction on $t$ using this observation as our base case. Assume that for some $t\ge i$, $|M_t(\mathbf{b}) \setminus M_t(\mathbf{b}')| = |M_t(\mathbf{b}') \setminus M_t(\mathbf{b})| \le 1$. Up to this point, $t-1$ goods have been allocated already. Let $j$ be the next agent to get a good and let $g$ (resp.~$g'$) be this good in Round-Robin$(\mathbf{b})$ (resp.~in Round-Robin$(\mathbf{b}')$).\medskip
\noindent\ul{\emph{Case 1} ($M_t(\mathbf{b}) = M_t(\mathbf{b}')$).} No matter who $j$ is and what $g$ and $g'$ are, it is straightforward to see that either $M_{t+1}(\mathbf{b}) \setminus M_{t+1}(\mathbf{b}') = M_{t+1}(\mathbf{b}') \setminus M_{t+1}(\mathbf{b}) = \emptyset$ (when $g=g'$), or $M_{t+1}(\mathbf{b}) \setminus M_{t+1}(\mathbf{b}') = \{g'\}$ and $M_{t+1}(\mathbf{b}') \setminus M_{t+1}(\mathbf{b}) = \{g\}$ (when $g\neq g'$). Thus, $|M_{t+1}(\mathbf{b}) \setminus M_{t+1}(\mathbf{b}')| = |M_{t+1}(\mathbf{b}') \setminus M_{t+1}(\mathbf{b})| \le 1$. \medskip
Before we move to Case 2, it is important to take a better look on how can we move away from Case 1 for the very first time. That is, we want to focus on the first time step $t_*$ when $g\neq g'$, if such a $t_*$ exists for the specific profiles. Notice that this cannot happen if $j\neq i$ at this point. Indeed, if it was $j\neq i$, since $M_{\ell}(\mathbf{b}) = M_{\ell}(\mathbf{b}')$ for all $\ell\in [t_*]$ and the induced preference ranking of $j$ in this case is the same in both $\mathbf{b}$ and $\mathbf{b}'$, we have that the two runs of Round-Robin should make the same choice for $j$ in the time step $t_*$; that would contradict the choice of $t_*$ itself. So, after the same $t_*-1$ goods have been allocated by Round-Robin$(\mathbf{b})$ and Round-Robin$(\mathbf{b}')$, agent $i$ is about to be given $g$ and $g'$ respectively in the two runs from the set $M_{t_*} = M_{t_*}(\mathbf{b}) = M_{t_*}(\mathbf{b}')$ of available goods. We claim that these two goods cannot be arbitrary.
In particular, let $s\in M$ be the good that goes from a better position in $\succ_i$ to a worse position in $\succ'_i$. We are going to show that $g=s$.
Recall that $g$ is the best good in $M_{t_*}$ with respect to $\succ_i$; similarly for $g'$ and $\succ'_i$.
First, notice that $\succ_i$ and $\succ'_i$ are identical on $M_{t_*} \setminus \{s\}$ and, thus, for $g$ and $g'$ to be distinct at least one of them must be $s$.
Since $g\neq g'$, either $g=s$ or $g'=s$ but not both. Assume for a contradiction that $g'=s$ and $g=x\neq s$. Since $s\in M_{t_*}$, it is available to both.
The fact that $x\neq s$ implies that $x\succ_i s$. However, this also mean $x\succ'_i s$ which, given the availability of $x$, contradicts the choice of $g'$.
We conclude that $g=s$ and $g'\neq s$.
This observation will be crucial for showing that the last subcase of Case 2 below cannot happen.
\medskip
\noindent\ul{\emph{Case 2} ($M_t(\mathbf{b}) \setminus M_t(\mathbf{b}') = \{h\}$ and $M_t(\mathbf{b}') \setminus M_t(\mathbf{b}) = \{h'\}$).}
If $g=h$ and $g'=h'$, then we immediately get $M_{t+1}(\mathbf{b}) = M_{t+1}(\mathbf{b}')$. Moreover, if $g=h$ and $g'\neq h'$, then we have that
\[M_{t+1}(\mathbf{b}) \setminus M_{t+1}(\mathbf{b}') = (M_t(\mathbf{b}) \setminus \{h\}) \setminus (M_t(\mathbf{b}') \setminus \{g'\})= ((M_t(\mathbf{b}) \setminus M_t(\mathbf{b}')) \setminus \{h\})\cup \{g'\} = \{g'\}\,,\]
where the second equality holds because $g'\in M_t(\mathbf{b}) \cap M_t(\mathbf{b}')$ in this case, and
\[M_{t+1}(\mathbf{b}') \setminus M_{t+1}(\mathbf{b}) = (M_t(\mathbf{b}') \setminus \{g'\}) \setminus (M_t(\mathbf{b}) \setminus \{h\})= M_t(\mathbf{b}') \setminus M_t(\mathbf{b}) = \{h'\}\,,\]
where here the second equality holds because $g'\in M_t(\mathbf{b})$ and $h\notin M_t(\mathbf{b}')$. The subcase where $g\neq h$ and $g'= h'$ is symmetric and we similarly get
\[M_{t+1}(\mathbf{b}) \setminus M_{t+1}(\mathbf{b}') = \{h\} \text{\ \ \ \ and\ \ \ \ } M_{t+1}(\mathbf{b}') \setminus M_{t+1}(\mathbf{b}) = \{g\}\,.\]
It remains to deal with the subcase where $g\neq h$ and $g'\neq h'$. If $g=g'$, then we immediately get $M_{t+1}(\mathbf{b}) \setminus M_{t+1}(\mathbf{b}') = M_t(\mathbf{b}) \setminus M_t(\mathbf{b}') = \{h\}$ and $M_{t+1}(\mathbf{b}') \setminus M_{t+1}(\mathbf{b}) = M_t(\mathbf{b}') \setminus M_t(\mathbf{b}) = \{h'\}$. So, we may assume that $h\neq g \neq g'\neq h'$. We are going to show that this cannot actually happen, as it would lead to a contradiction. Notice that $h\neq g \neq g'\neq h'$ implies $g, g' \in M_t(\mathbf{b}) \cap M_t(\mathbf{b}')$. If agent $j$ is different than agent $i$, this would mean that $g \succ_j g'$ and $g' \succ_j g$ because of the corresponding choices of the algorithm when the input is $\mathbf{b}$ and $\mathbf{b}'$ respectively (recall that the bid, and thus the induced preference ranking, of $j$ is the same in both profiles); that would be a contradiction. Therefore, it must be the case that $j = i$.
Since we are in Case 2, a scenario leading to Case 2 for the first time (as described after Case 1) must have already happened. Consequently, $s$ is not available at this point in $M_t(\mathbf{b})$ and hence $s\notin M_t(\mathbf{b}) \cap M_t(\mathbf{b}')$. This means that $\{g, g'\} \subseteq M\setminus\{s\}$ and, therefore, $g$ and $g'$ have the same ordering in both preference rankings of agent $i$. That is, $g \succ_i g'$ implies $g \succ'_i g'$, contradicting the optimality of $g'$ in $M_t(\mathbf{b}')$ with respect to $\succ'_i$.
\medskip
We conclude that in any possible case, $|M_{t+1}(\mathbf{b}) \setminus M_{t+1}(\mathbf{b}')| = |M_{t+1}(\mathbf{b}') \setminus M_{t+1}(\mathbf{b})| \le 1$. This concludes the induction.
\end{proof}
We are now ready to prove Lemma \ref{lem:main_lemma}. As it was noted before the lemma's statement, we will occasionally move value among the goods allocated to agent 1. This is when Lemma \ref{lem:swap} is crucial. It allows us to guarantee that there is sufficient value for satisfying all the desired properties of the intermediate valuation functions we define.
\begin{proof}[Proof of Lemma \ref{lem:main_lemma}]
Recall that $k = \lceil m/n\rceil$, i.e., we have $k$ total rounds.
Let $\succ_1$ be the preference ranking induced by $\bm{b}_1$ and consider all the goods according to this ranking: $h_1 \succ_1 h_2 \succ_1 \ldots \succ_1 h_m$. Let $n_1 = 1 <n_2 <\dots< n_k$ be the indices in this ordering of the goods assigned to agent 1 by Round-Robin$(\mathbf{b})$, i.e., in round $r$ agent 1 receives good $h_{n_r}$. This means that $A_1=\{h_{n_1}, \ldots, h_{n_{k}}\}$.
We will recursively construct $v_1^*$ from $v_1$, over the rounds of Round-Robin. In particular, we are going to define a sequence of intermediate bid vectors $\bm{b}^r_1$ and valuation functions $v^r_1$, one for each round $r$ starting from the last round $k$, so that $v_1^* = v_1^1$ and $\bm{b}^*_1 = \bm{b}^1_1$. For defining each $\bm{b}^r_1$ we typically use a number of auxiliary bid vectors to break down and better present the construction.
Also, for any round $r$, we are going to maintain that
\begin{enumerate}[itemsep=2pt,topsep=6pt]
\item[(i)] $v_1^r(A_1)=v_1(A_1)$.
\item[(ii)] $v_1^r(g)=v_1(g)$, for any $g\subseteq M\setminus A_1$.
\item[(iii)] $\bm{b}^r_1$ is \emph{truthful from round $r$} with respect to $v^r_1$, meaning that for every good that is no better than $h_{n_r}$, according to the preference ranking $\succ^r_1$ induced by $\bm{b}^r_1$, we have that its bid matches its value; formally, $g\nsucc^r_1 h_{n_r} \Rightarrow \bm{b}^r_1(g) = v^r_1(g)$.
\item[(iv)] The preference ranking ${\succ}^r_1$ (induced by ${\bm{b}}^r_1$) is identical to ${\succ}_1$ (induced by ${\bm{b}}_1$) up to good $h_{n_{r-1}}$.
\item[(v)] $\min_{g, h\in M,\, g\neq h}|v^{r}_1(g)-v^{r}_1(h)|>0$.
\end{enumerate}
Let us focus on round $k$, i.e., the last round. Let $\lambda$ be the most valuable (according to $v_1$) available good at the very beginning of the round. It is easy to see that $h_{n_k} = \lambda$; if not, then by increasing her bid for $\lambda$ to be slightly above her bid for $h_{n_k}$ agent 1 would end up with the bundle $\{h_{n_1}, \ldots, h_{n_{k-1}}, \lambda\}$ which is a strict improvement over $A_1$ and would contradict the fact that $\bm{b}_1$ is a best response of agent 1.
We construct the auxiliary bid $\bar{\bm{b}}^k_1$ by ``moving up'' in $\succ_1$ every good that is more valuable than $\lambda$ but comes after it in $\succ_1$. Formally, $\lambda \succ_1 g \,\wedge\, v_1(g)> v_1(\lambda) \Rightarrow \bm{b}_1(h_{n_k}) < \bar{\bm{b}}^k_1(g) < \bm{b}_1(h_{n_k -1})$, where these bids are chosen arbitrarily, as long as they are distinct from each other.
Note that this small modification does not affect the allocation at all. Indeed, every good the bid of which was improved is still worse than $h_{n_k -1}$ in the preference ranking $\bar{\succ}^k_1$ induced by $\bar{\bm{b}}^k_1$, so no decision in rounds $1,\ldots,k-1$ is affected and, by the definition of $\lambda$, these goods were not actually available for agent 1 in the beginning of round $k$, so the decisions in round $k$ are not affected either.
Next we define ${\bm{b}}^k_1$ by replacing the bids with the actual values for every good that is no better than $h_{n_k}$ in $\bar{\succ}^k_1$,
as well as by scaling the bids of all other goods to remain larger than $\bm{b}^k_1(h_{n_k})$, if necessary.
While the latter can be done in several ways, we can simply multiply bids by $\bm{b}^k_1(h_{n_k})/ \bar{\bm{b}}^k_1(h_{n_k})$. Formally, ${\bm{b}}^k_1$ is defined by
\[ g \not\!\!{\bar{\succ}}^k_1 \, h_{n_k} \Rightarrow \bm{b}^k_1(g) = v_1(g)
\text{\ \ \ \ and\ \ \ \ } g \,\,\bar{\succ}^k_1 \,h_{n_k} \Rightarrow \bm{b}^k_1(g) = \bar{\bm{b}}^k_1(g)\cdot \bm{b}^k_1(h_{n_k}) / \bar{\bm{b}}^k_1(h_{n_k})\,.\]
Note that the preference ranking ${\succ}^k_1$ induced by ${\bm{b}}^k_1$ is identical to $\bar{\succ}^k_1$ up to good $h_{n_k - 1}$, and that $\lambda$ is the good with the highest bid in ${\bm{b}}^k_1$ among the goods that are available in the last round.
Hence, Round-Robin$(\bm{b}_1^k, \mathbf{b}_{-1})$ still produces the allocation $(A_1,\dots,A_n)$.
Also, recall that $\bar{\succ}^k_1$ is identical to ${\succ}_1$ up to good $h_{n_k - 1}$ and, thus, up to at least good $h_{n_{k-1}}$, implying that ${\succ}^k_1$ satisfies property (iv) above.
Finally, by setting $v^k_1 = v_1$, it is clear that $\bm{b}^k_1$ is truthful from round $k$ with respect to $v^k_1$, but also that $\min_{g, h\in M, g\neq h}|v^{k}_1(g)-v^{k}_1(h)|>0$, $v_1^k(A_1)=v_1(A_1)$, and $v_1^k(g)=v_1(g)$, for all $g\subseteq M\setminus A_1$.
\medskip
Moving to an arbitrary round $r< k$ we are going to follow a similar, albeit a bit more complicated, approach, where now it will be necessary to move value among the goods of $A_1$.
So, assume that $\bm{b}^{r+1}_1$ and $v^{r+1}_1$ have already been constructed and have the desired properties (i)--(v) mentioned above, and let $\succ^{r+1}_1$ be the preference ranking induced by $\bm{b}^{r+1}_1$.
Consider the execution of Round-Robin$(\bm{b}_1^{r+1}, \mathbf{b}_{-1})$.
For $i\ge r$, let $\lambda_i$ be the most valuable available good with respect to $v^{r+1}_1$ at the very beginning of round $i$ and $\ell_i$ be the most valuable good with respect to $v^{r+1}_1$ (or equivalently with respect to $v_1$ as $\ell_i\in M\setminus A_1$) that is allocated to some \emph{other} agent during round $i$.
By property (iii) of $\bm{b}^{r+1}_1$ and $v^{r+1}_1$ we know that in future rounds agent 1 will have $\lambda_{r+1}=h_{n_{r+1}}, \lambda_{r+2} = h_{n_{r+2}}, \ldots, \lambda_{k} = h_{n_{k}}$ allocated to her. By property (iv) of $\bm{b}^{r+1}_1$ we further know that in the current round agent 1 is going to get good $h_{n_r}$. Unlike what happened for round $k$, however, here $h_{n_r}$ may be different from $\lambda_r$. We will
consider two cases depending on this.
First, though, similarly to what we did before, we define the auxiliary bid $\bar{\bar{\bm{b}}}^r_1$ by setting $\bm{b}^{r+1}_1(h_{n_r}) \allowbreak < \allowbreak \bar{\bar{\bm{b}}}^r_1(g) < \allowbreak \bm{b}^{r+1}_1(h_{n_r -1})$ for all goods $g$ such that $h_{n_r} \succ^{r+1}_1 g$ and $v^{r+1}_1(g)> v_1(\lambda_r)$; these $\bar{\bar{\bm{b}}}^r_1$ entries are arbitrary, as long as they satisfy the inequalities and are distinct from each other.
By now it should be clear that moving from $\bm{b}^{r+1}_1$ to $\bar{\bar{\bm{b}}}^r_1$ does not affect the allocation since every good that had its bid improved is still worse than $h_{n_r -1}$ in the preference ranking $\ \bar{\bar{\!\!\!\succ}}^r_1$ induced by $\bar{\bar{\bm{b}}}^r_1$
and, by the definition of $\lambda_r$, these goods were already not available in the beginning of round $r$.
That is, Round-Robin$\big(\bar{\bar{\bm{b}}}_1^r, \mathbf{b}_{-1}\big)$ returns $(A_1,\dots,A_n)$. \medskip
\noindent\ul{\emph{Case 1} ($h_{n_r} = \lambda_r$).} This case is similar to what we did for round $k$. We go straight from $\bar{\bar{\bm{b}}}^r_1$ to ${\bm{b}}^r_1$ by replacing the bids with the corresponding $v^{r+1}_1$ values for all goods that are no better than $h_{n_r}$ in $\ \bar{\bar{\!\!\!\succ}}^r_1$,
and by scaling the bids of all other goods to remain larger than $v^{r+1}_1(\lambda_{r})=\bm{b}^r_1(\lambda_{r})=\bm{b}^r_1(h_{n_r})$. Formally, we have
\[ g \not{\bar{\bar{\!\!\!\succ}}}^r_1 \, h_{n_r} \Rightarrow \bm{b}^r_1(g) = v^{r+1}_1(g) \text{\ \ \ \ and\ \ \ \ } g\ {\ \bar{\bar{\!\!\!\succ}}}^r_1 \,h_{n_r} \Rightarrow \bm{b}^r_1(g) = \bar{\bar{\bm{b}}}^r_1(g)\cdot v^{r+1}_1(\lambda_{r}) / \bar{\bar{\bm{b}}}^r_1(h_{n_r})\,.\]
The preference ranking ${\succ}^r_1$ induced by ${\bm{b}}^r_1$ is identical to $\ {\bar{\bar{\!\!\!\succ}}}^r_1$ up to good $h_{n_r}$, so Round-Robin$(\bm{b}_1^r, \mathbf{b}_{-1})$ up to the beginning of round $r$ still allocates $\{h_{n_1}, \ldots, h_{n_{r-1}}\}$ to agent 1 in that order. Also, from good $h_{n_r}$ onward, ${\succ}^r_1$ is defined in such a way that the best available good in the beginning of round $i\ge r$ with respect to ${\succ}^r_1$ is $h_{n_i}$. Therefore, the final bundle for agent 1 is still $A_1$ and the overall allocation is still $(A_1,\dots,A_n)$ as $\mathbf{b}_{-1}$ is fixed and goods in $A_1$ are allocated in the exact same order.
Moreover, recall that ${\ \bar{\bar{\!\!\!\succ}}}^r_1$ is identical to ${\succ}_1$ up to good $h_{n_{r-1}}$ (in fact, up to good $h_{n_r - 1}$), implying that ${\succ}^r_1$ satisfies property (iv).
Given that no changes to values were necessary and that we made the relevant (for rounds $r, \ldots, k$) entries of ${\bm{b}}^r_1$ equal to the corresponding $v^{r+1}_1$ values, we may set $v^r_1 = v^{r+1}_1$ to get that $\bm{b}^r_1$ is truthful from round $r$ with respect to $v^r_1$, but also that $\min_{g, h\in M, g\neq h}|v^{r}_1(g)-v^{r}_1(h)|>0$, $v_1^r(A_1)=v_1(A_1)$, and $v_1^r(g)=v_1(g)$, for all $g\subseteq M\setminus A_1$. \medskip
\noindent\ul{\emph{Case 2} ($h_{n_r} \neq \lambda_r$).} Here we are going to move value from goods $\lambda_{r+1}, \lambda_{r+2}, \ldots, \lambda_{k}$ to $h_{n_{r}}$ while defining $v^{r}_1$.
The main idea is that we would like $h_{n_r}$ to become the most valuable available good at the beginning of round $r$ with respect to $v^r_1$, although this is not the case for $v^{r+1}_1$ as $v^{r+1}_1(h_{n_r})<v^{r+1}_1(\lambda_r)$. The constraints we need to satisfy make this task rather tricky: properties (i) and (ii) must hold, so value can only be transferred between goods of $A_1$, but this should happen in a way that ensures that in future rounds the goods given to agent 1 remain $h_{n_{r+1}}, \ldots, h_{n_{k}}$ in that order.
We begin with a rather benign modification of $\bar{\bar{\bm{b}}}^r_1$, which is almost identical to what we did in Case 1, except that we do not update the bid of $h_{n_r}$ with its $v^{r+1}_1$ value. We do this to make sure that $h_{n_r}$ still seems like the most attractive good of round $r$ and the overall allocation remains the same. Specifically, we define the auxiliary bid ${\bar{\bm{b}}}^r_1$ by
\begin{equation}\label{eq:b-bar}
h_{n_r}\ \,{\bar{\bar{\!\!\!\succ}}}^r_1 \ g \Rightarrow \bar{\bm{b}}^r_1(g) = v^{r+1}_1(g) \text{\ \ \ \ and\ \ \ \ } h_{n_r} \not{\bar{\bar{\!\!\!\succ}}}^r_1 \ g \Rightarrow \bar{\bm{b}}^r_1(g) = \bar{\bar{\bm{b}}}^r_1(g)\cdot (v^{r+1}_1(\lambda_{r}) + \delta/2) / \bar{\bar{\bm{b}}}^r_1(h_{n_r})\,,
\end{equation}
where $\delta = \min_{g, h\in M, g\neq h}|v^{r+1}_1(g)-v^{r+1}_1(h)|>0$.
It is easy to check that Round-Robin$(\bar{\bm{b}}_1^r, \mathbf{b}_{-1})$ returns $(A_1,\dots,A_n)$.
Indeed, the preference ranking $\bar{{\succ}}^r_1$ induced by $\bar{\bm{b}}^r_1$ is identical to $\ {\bar{\bar{\!\!\!\succ}}}^r_1$ up to good $h_{n_r}$, so agent 1 receives $h_{n_1}, \ldots, h_{n_{r}}$ in the first $r$ rounds, while any bid that was higher than $v^{r+1}_1(h_{n_{r+1}})$ and has been updated to its $v^{r+1}_1$ value is not available at the beginning of round $r+1$ anyway. The latter is true, because otherwise such a good would have been chosen by Round-Robin$(\bar{\bm{b}}_1^r, \mathbf{b}_{-1})$ and Round-Robin$({\bm{b}}_1^r, \mathbf{b}_{-1})$ instead of $h_{n_{r+1}}$.
Having ${\bar{\bm{b}}}^r_1$ as a point of reference, we now take a closer look to what happens if, starting at round $r$, agent 1 would receive her goods according to $v^{r+1}_1$. Note that this would be the same as just changing ${\bar{\bm{b}}}^r_1(h_{n_r})$ to $v^{r+1}_1(h_{n_r})$. We call this new auxiliary bid $\hat{\bm{b}}^r_1$; note that this is the first time we introduce a bid that \textit{does not} preserve the original allocation.
Similarly to our definition of the $\lambda_i$s, we consider the execution of Round-Robin$(\hat{\bm{b}}^r_1, \mathbf{b}_{-1})$ and define $\hat{\lambda}_i$ to be the most valuable available good with respect to $v^{r+1}_1$ at the very beginning of round $i$, for $i\ge r$.
While we know that $\hat{\lambda}_r = \lambda_r$, in general we have no reason to expect that $\hat{\lambda}_r$ and $\lambda_r$ are the same.
Actually, the fact that $\bm{b}_1$---and thus $\bar{\bar{\bm{b}}}^r_1$---is a best response, combined with $h_{n_r} \neq \lambda_r$, imply that
\begin{equation}\label{eq:sum_of_lambdas}
v^{r+1}_1(h_{n_r}) + \sum_{i= r+1}^{k} v^{r+1}_1(\lambda_i) > \sum_{i= r}^{k} v^{r+1}_1(\hat{\lambda}_i) \,.
\end{equation}
Coming back to the challenge of moving value from $v^{r+1}_1(\lambda_{r+1}), \ldots, v^{r+1}_1(\lambda_{k})$ to $v^{r+1}_1(h_{n_{r}})$ (and equally so from $\hat{\bm{b}}^{r+1}_1(\lambda_{r+1}), \ldots, \hat{\bm{b}}^{r+1}_1(\lambda_{k})$ to $\hat{\bm{b}}^{r+1}_1(h_{n_{r}})$), we want to make sure that enough value can be moved to eventually get $v^{r+1}_1(h_{n_{r}})$ slightly above $v^{r+1}_1(\lambda_{r})$ while each $h_{n_{i}}$ maintains more value than any other available good in round $i>r$. Notice that the preference rankings $\bar{{\succ}}^r_1$ and $\hat{{\succ}}^r_1$, induced by ${\bar{\bm{b}}}^r_1$ and ${\hat{\bm{b}}}^r_1$ respectively, are within by a partial slide from each other! Indeed, $h_{n_{r}}$ is moved to a worst position in $\hat{{\succ}}^r_1$ compared to $\bar{{\succ}}^r_1$, but otherwise the two preference rankings are the same.
Besides the easy observation that Round-Robin$(\hat{\bm{b}}^r_1, \mathbf{b}_{-1})$ and Round-Robin$(\bar{\bm{b}}^r_1, \mathbf{b}_{-1})$ run identically for $i-1$ rounds,
this also means that Lemma \ref{lem:swap} applies.
That is, we have that
in each round $i$ of Round-Robin$(\hat{\bm{b}}^r_1, \mathbf{b}_{-1})$, for $i\ge r$, there is at most one good that is unavailable despite being available in round $i$ of Round-Robin$(\bar{\bm{b}}^r_1, \mathbf{b}_{-1})$. In particular, in round $i$ of Round-Robin$(\hat{\bm{b}}^r_1, \mathbf{b}_{-1})$, for $i\ge r$, at least two goods from $\{h_{n_i}, h_{n_{i+1}}, \ell_i\}$ are available, where conventionally we define $h_{n_{k+1}}$ to be the second best available good at the beginning of round $k$ in Round-Robin$(\bar{\bm{b}}^r_1, \mathbf{b}_{-1})$;
recall that $\ell_i$ is the most valuable good with respect to $v^{r+1}_1$ that is allocated to some agent other than $1$ during round $i$.
By the definition of the $\hat{\lambda}_i$s, this observation implies
\[ v^{r+1}_1(\hat{\lambda}_i) \geq \max\big\{v^{r+1}_1(h_{n_{i+1}}), v^{r+1}_1(\ell_i)\big\}, \text{\ \ for all\ \ } r<i\leq k \,.\]
Given that $\bar{\bm{b}}^r_1$
trivially remains truthful from round $r+1$ with respect to $v^{r+1}_1$, the above maximum captures what is the mechanism's view of the second best good for agent 1 in round $i$ \emph{after} $\lambda_i$, for $i>r$, when the input is $(\bar{\bm{b}}^r_1, \mathbf{b}_{-1})$.
Plugging this bound into inequality \eqref{eq:sum_of_lambdas} along with $\hat{\lambda}_r = \lambda_r$, and rearranging the terms of round $r$, it yields
\[ \sum_{i= r+1}^{k} \big( v^{r+1}_1(\lambda_i) - \max\big\{v^{r+1}_1(h_{n_{i+1}}), v^{r+1}_1(\ell_i)\big\} \big) = v^{r+1}_1({\lambda}_r) - v^{r+1}_1(h_{n_r}) + \varepsilon \,,\]
for some $\varepsilon > 0$. We also define $\varepsilon_i = v^{r+1}_1(\lambda_i) - \max\big\{v^{r+1}_1(h_{n_{i+1}}), v^{r+1}_1(\ell_i)\big\} \big)$ for $i>r$.
\smallskip
We can now define $v^{r}_1$ by appropriately changing some of the values of $v^{r+1}_1$:
\begin{itemize}[itemsep=2pt,topsep=6pt]
\item For each $r+1\le i \leq k$, we set $v_1^{r}(h_{n_{i}})=\max\big\{v^{r+1}_1(h_{n_{i+1}}), v^{r+1}_1(\ell_i)\big\} \big) + \alpha\cdot\varepsilon_i$.
\item We also set $v_1^{r}(h_{n_{r}})=v_1^{r+1}(\lambda_{r}) + \varepsilon - \alpha\sum_{i=r+1}^{k}\varepsilon_i$, where $\alpha$ is chosen so that $\varepsilon - \alpha\sum_{i=r+1}^{k}\varepsilon_i = \min\{\varepsilon, \delta\}/3$; recall that $\delta = \min_{g, h\in M, g\neq h}|v^{r+1}_1(g)-v^{r+1}_1(h)|$. (Choosing such an $\alpha$ is always possible as $f(\alpha) = \varepsilon - \alpha\sum_{i=r+1}^{k}\varepsilon_i$ with $\alpha\in(0,1)$ is a continuous function with values in the interval $(v^{r+1}_1(h_{n_r})-v^{r+1}_1({\lambda}_r), \varepsilon)$.)
\item For any other good $g$, we set $v_1^{r}(g)=v_1^{r+1}(g)$.
\end{itemize}
We also define $\bm{b}^{r}_1$ from ${\bar{\bm{b}}}^r_1$ by replacing the bids with the corresponding $v^{r}_1$ values for all goods that are no better than $h_{n_r}$ in ${\bar{\succ}}^r_1$, i.e, we have
\[ g\, \not{\!\!{\bar{\succ}}}^r_1 \, h_{n_r} \Rightarrow \bm{b}^r_1(g) = v^{r}_1(g) \text{\ \ \ \ and\ \ \ \ } g\,\, {{\bar{\succ}}}^r_1 \,\,h_{n_r} \Rightarrow \bm{b}^r_1(g) = {\bar{\bm{b}}}^r_1(g)\,.\]
By this point, it should be straightforward to verify properties (i)-(iv). For (v), notice that any $\alpha$ giving $\varepsilon - \alpha\sum_{i=r+1}^{k}\varepsilon_i \in (0,\min\{\varepsilon, \delta\}/2)$ would work for consistently defining $\bm{b}^{r}_1$. If the above definition of $v^{r}_1$ happens to give one of the finitely many values already in the range of $v^{r+1}_1$, then we may change $\alpha$ slightly to make all of the newly introduced values unique.
\end{proof}
\section{Towards EFX Equilibria: The Case of Two Agents}\label{sec:PR}
As we saw, Round-Robin has PNE for every instance, and the corresponding allocations are always \ensuremath{\textrm{\MakeUppercase{ef}1}}\xspace. The natural next question is \textit{can we have a similar guarantee for a stronger fairness notion?} In particular, we want to explore whether an analogous result is possible when we consider envy-freeness up to \textit{any} good. When the agents are not strategic, it is known that \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace allocations exist when we have at most $3$ agents \cite{CaragiannisKMPS19, ChaGM20}. It should be noted that for the case of $3$ agents no polynomial time algorithm is known, and it is unclear whether the constructive procedure of \citet{ChaGM20} has any PNE. For $n\ge 4$, the existence of \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace allocations remains a major open problem. Therefore, we turn our attention to the case of two agents.
\subsection{A Mechanism with EFX Nash Equilibria}\label{sec:MEFXEQ}
A polynomial-time algorithm that outputs \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace allocations when we have two agents is given by Plaut and Roughgarden \cite{PR18}. This is a \emph{cut-and-choose} algorithm where the cut (lines \ref{line:pr3}--\ref{line:pr5}) is produced using a variant of the \textit{envy-cycle-elimination} algorithm of Lipton et al.~\cite{LMMS04} on two copies of agent 1, and then agent 2 ``chooses'' the best bundle among the two (line \ref{line:pr6}). We state it as mechanism Mod-Cut\&Choose below (recall the notation $\bm{b}_i(S)$ for $\sum_{h\in S} \bm{b}_i(h)$). We should point out that this mechanism is not truthful, since there is no truthful mechanism for two agents that produces \ensuremath{\textrm{\MakeUppercase{ef}1}}\xspace (or \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace for that matter) allocations for more than four goods \cite{ABCM17}. Interestingly, we show that although not truthful, Mod-Cut\&Choose always has at least one PNE for any instance, while all its equilibria are \ensuremath{\textrm{\MakeUppercase{mms}}}\xspace and, by Theorem \ref{thm:mms_to_efx_n=2}, \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace.
\begin{algorithm}[ht]
\caption{Mod-Cut\&Choose$(\bm{b}_1, \bm{b}_2)$ \hfill\small{ // For $i\in \{1,2\}$, $\bm{b}_i = (b_{i1}, \ldots, b_{im})$ is the bid of agent $i$.}}
\begin{algorithmic}[1]
\State $(E_1, E_2) = (\emptyset,\emptyset)$
\State $(h_1, h_2, \ldots, h_m)$ is $M$ sorted in decreasing order with respect to $v_1$\Comment{Break ties lexicographically.}
\For{$i = 1, \dots, m$} \label{line:pr3}
\State $j = \argmin_{k\in [2]} \bm{b}_1(E_k)$ \Comment{Identify the worst bundle according to $\bm{b}_1$; break ties in favor of $E_1$.}\vspace{2pt}\label{line:pr4}
\State $E_j = E_j \cup \{h_i\}$ \Comment{Add the next good to that bundle.}\label{line:pr5}
\EndFor
\State $\ell = \argmax_{k\in [2]} \bm{b}_2(E_k)$ \Comment{Identify the best bundle according to $\bm{b}_2$; break ties in favor of $E_1$.}\vspace{2pt} \label{line:pr6}
\State
\Return {$\mathcal{A}=(M\setminus E_{\ell}, E_{\ell})$} \Comment{Give this bundle to agent 2 and the remaining bundle to agent 1.}
\end{algorithmic}
\label{alg:Cut+Choose}
\end{algorithm}
By Theorem \ref{thm:efx_to_mms_n=2}, there is no reason to expect that the mechanism would guarantee more than $2\ensuremath{\boldsymbol{\mu}}\xspace_i / 3$ to each agent. Indeed, seen as an algorithm, it does not always produce \ensuremath{\textrm{\MakeUppercase{mms}}}\xspace allocations unless $\mathrm{P} = \mathrm{NP}$!
To see this, first notice that when the agents are identical, that would mean that we can run the algorithm to exactly find their maximin share. This is equivalent to having an oracle for the classic PARTITION problem.
As the algorithm's running time is polynomial, that would imply that $\mathrm{P}=\mathrm{NP}$. The same simple argument shows that it is NP-hard to compute a best response bid vector for agent 1.
\begin{proposition}\label{prop:best-response-hard}
Computing a best response $\bm{b}_1$ of agent 1 for Mod-Cut\&Choose, given $\bm{b}_2$, is $\mathrm{NP}$-hard.
\end{proposition}
We begin with the following lemma on the ``cut'' part of Mod-Cut\&Choose, stating that agent 1 may create any desirable partition of the goods (up to the ordering of the two sets).
This is a necessary component of the proof of the main result of this section.
\begin{lemma}\label{lem:ECE}
Let $(X_1, X_2)$ be a partition of $M$. Agent 1, by bidding accordingly, can force Mod-Cut\&Choose to construct $E_1, E_2$ in lines \ref{line:pr3}--\ref{line:pr5}, such that $\{E_1, E_2\} = \{X_1, X_2\}$.
\end{lemma}
\begin{proof}
We consider different cases depending on the cardinality of the sets $X_1, X_2$. Each case describes a bid that agent 1 can report in order to create the desired partition $(X_1, X_2)$ or its permutation $(X_2, X_1)$. Note that only the first case is relevant when $m=1$, and only the first two cases are relevant when $2\le m\leq 3$.
\medskip
\noindent\ul{\emph{Case 1} (one set has all the goods).}
Agent 1 declares zero value for all the goods. According to these values, $j$ in line \ref{line:pr4} is always $1$, so every good goes to $E_1$, and we have the desired partition.
\medskip
\noindent\ul{\emph{Case 2} (one set has $m-1$ goods).}
Agent 1 declares value $1$ for the good that is contained in the set with cardinality $1$, and for every good that is contained in the set with cardinality $m-1$ she declares a value equal to $\frac{1}{m-1}$. The first good is added in $E_1$, so $E_2$ is going to get chosen next. Actually, according to these values, $E_2$ must get all the remaining goods. Thus, the desired partition is produced.
\medskip
\noindent\ul{\emph{Case 3} (the two sets have cardinalities $k \geq 2$ and $m-k \geq 2$).}
Agent 1 declares a value of $1$ for one of the goods that are contained in the set with cardinality $k$. For every good that is contained in the set with cardinality $m-k$ she declares a value equal to $\frac{1+\varepsilon}{m-k}$, where $0< \varepsilon <\frac{1}{m-k-1}$. Finally, for the rest of the goods that are contained in the set with cardinality $k$ she declares a value of $\frac{\varepsilon}{k-1}$. $E_1$ gets the first good, so it appears to be more valuable than $E_2$. According to these values, $E_2$ ceases to appear to be the worst of the two when it gets every good of the set with cardinality $m-k$. This is the point where $E_1$ becomes worse than $E_2$, and continues to be worse until it contains every good of the set of cardinality $k$. Thus, again, the desired partition is produced.
\end{proof}
In particular, agent 1 can force the mechanism to construct $E_1, E_2$, such that $\min\{v_1(E_1), v_1(E_2)\} = \ensuremath{\boldsymbol{\mu}}\xspace_1$. Such a pair $(E_1, E_2)$ is called a \textit{$\ensuremath{\boldsymbol{\mu}}\xspace_1$-\,partition}. At least one $\ensuremath{\boldsymbol{\mu}}\xspace_1$-\,partition exists, by the definition of $\ensuremath{\boldsymbol{\mu}}\xspace_1$.
\begin{cor}\label{cor:ECEMMS}
Agent 1 can force Mod-Cut\&Choose to construct a $\ensuremath{\boldsymbol{\mu}}\xspace_1$-\,partition in lines \ref{line:pr3}--\ref{line:pr5}.
\end{cor}
We can now proceed to the main theorem of this section on the existence and fairness properties of the PNE of Mod-Cut\&Choose.
\begin{theorem}\label{thm:mms+efx_PNE}
For any instance $\mathcal{I}=(\{1,2\},M,\mathbf{v})$, the Mod-Cut\&Choose mechanism has at least one PNE. Moreover, every PNE of the mechanism is \ensuremath{\textrm{\MakeUppercase{mms}}}\xspace and \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace with respect to the valuation functions $v_1,v_2$.
\end{theorem}
\begin{proof}
Given a partition $\mathcal{X} = (X_1,X_2)$ we are going to slightly abuse the notation---as we do in our pseudocode---and consider $\argmin_{X\in\mathcal{X}} v_2(X)$ to be a single set in $\mathcal{X}$ rather than a subset of $\{X_1,X_2\}$. To do so, we assume that ties are broken in favor of the highest indexed set (here $X_2$) and tie-breaking is applied by the $\argmin$ operator.
We will define a profile $(\bm{b}_1,\bm{b}_2)$ and show that it is a PNE.
First, let $\bm{b}_2 = (v_2(g_1), v_2(g_2), \ldots, v_2(g_m))$ be the truthful bid of agent 2. Next $\bm{b}_1$ is the bid vector (as defined within the proof of Lemma \ref{lem:ECE}) that results in Mod-Cut\&Choose constructing a partition in
\[\argmax_{\mathcal{X} \in \Pi_2(M)} v_1 \big( \argmax_{X\in\mathcal{X}} v_2(X) \big) \,.\]
To see that there exists such $\bm{b}_1$, notice that the set $\Pi_2(M)$ of all possible partitions is finite, and , by Lemma \ref{lem:ECE}, every possible partition can be produced by Mod-Cut\&Choose given the appropriate bid vector of agent 1. So, agent 1 forces the partition that maximizes, according to $v_1$, the value of the least desirable bundle according to $v_2$.
Now it is easy to see that given the bidding strategy of agent 2, i.e., playing truthfully, there is no deviation for agent 1 that is profitable (by definition). Moreover, agent 2 gets the best of the two bundles according to her valuation function (regardless of the partition, truth telling is a dominant strategy for her), thus there is no profitable deviation for her either. Therefore, $(\bm{b}_1,\bm{b}_2)$ is a PNE for $\mathcal{I}$.
Regarding the second part of the statement, suppose for a contradiction that there is a PNE $\mathbf{b}$, where an agent $i$ does not achieve her $\ensuremath{\boldsymbol{\mu}}\xspace_i$ in the allocation returned by Mod-Cut\&Choose$(\mathbf{b})$. If this agent is agent 1, then according to Corollary \ref{cor:ECEMMS}, there is a bid vector $\bm{b}'_1$ she can report, so that the algorithm will produce a $\ensuremath{\boldsymbol{\mu}}\xspace_1$-\,partition. By deviating to $\bm{b}'_1$, regardless of the set given to agent 2, agent 1 will end up with a bundle she values at least $\ensuremath{\boldsymbol{\mu}}\xspace_1$. As this would be a strict improvement over what she currently gets, it would contradict the fact that $\mathbf{b}$ is a PNE. So, it must be the case where agent 2 gets a bundle she values strictly less than $\ensuremath{\boldsymbol{\mu}}\xspace_2$. Notice that, regardless of the partition which Mod-Cut\&Choose to constructs in lines \ref{line:pr3}--\ref{line:pr5}, by declaring her truthful bid, agent 2 gets a bundle of value at least $v_2(M)/2$. By Definition \ref{def:mmshare}, it is immediate to see that this value is at least $\ensuremath{\boldsymbol{\mu}}\xspace_2$, i.e., deviating to her truthful bid is a strict improvement over what she currently gets by Mod-Cut\&Choose$(\mathbf{b})$, which is a contradiction.
It remains to show that the allocation returned by Mod-Cut\&Choose$(\mathbf{b})$ is also \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace. However, since here $n=2$, this directly follows from Theorem \ref{thm:mms_to_efx_n=2}.
\end{proof}
\subsection{The Enhanced Fairness of EFX Nash Equilibria} \label{sec:efx_to_mms_on_pne}
As it was discussed before Proposition \ref{prop:best-response-hard}, it is surprising that the \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace equilibria of Mod-Cut\&Choose impose stronger fairness guarantees compared to generic \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace allocations or even \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace allocations produced by Mod-Cut\&Choose itself in the non-strategic setting.
In this section we explore whether something similar holds for \textit{every} mechanism with \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace equilibria. Specifically, we consider the (obviously non-empty) class of mechanisms
that have PNE for every instance and these equilibria always lead to \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace allocations. Our goal is to determine if these allocations have better fairness guarantees (with respect to the underlying true valuation functions) than \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace allocations in general. To this end, we start by examining instances of two agents and $4$ goods and we prove that for every mechanism of this class, all allocations at a PNE are \ensuremath{\textrm{\MakeUppercase{mms}}}\xspace allocations. The reason we start from this restricted set of instances is that it already provides a clear separation with the non-strategic setting. Recall from Theorem \ref{thm:efx_to_mms_n=2} that there are instances with just $4$ goods where an \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace allocation may not be a $\big(\frac{2}{3} +\delta\big)$-\ensuremath{\textrm{\MakeUppercase{mms}}}\xspace allocation, for any $\delta>0$.
We begin by showing the following lemma which regards some very simple cases of such instances, and then we proceed to the proof of the statement.
\begin{lemma}\label{lem:3EFX=MMS}
Consider an instance with $2$ agents and $4$ goods. If agent $i\in[2]$ has positive value for three or less goods, then in every allocation which is \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace from her point of view, agent $i$ has value at least $\ensuremath{\boldsymbol{\mu}}\xspace_i$.
\end{lemma}
\begin{proof}
Suppose agent $i$ has positive value for at most three goods. The statement is trivial when there is \textit{at most one} positively valued good as in this case $\ensuremath{\boldsymbol{\mu}}\xspace_i = 0$ and agent $i$ always gets $\ensuremath{\boldsymbol{\mu}}\xspace_i$ no matter the bundle that she gets. When she has a positive value for \textit{two} goods, in order to consider the allocation as \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace she must get at least one of them. In this case she also achieves her $\ensuremath{\boldsymbol{\mu}}\xspace_i$ as it is equal to the smaller of the two positive values. Finally, suppose agent $i$ has positive value for \textit{three} goods. Notice that $\ensuremath{\boldsymbol{\mu}}\xspace_i$ in this case is either equal to the largest of the three values or to the sum of the two smallest values; whichever is smaller. So, if agent $i$ gets two goods, then she always derives a value of at least gets $\ensuremath{\boldsymbol{\mu}}\xspace_i$. If she gets just one good, then this good must have the highest value, otherwise the she would not consider the allocation as \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace. So, in this case too, she gets value at least $\ensuremath{\boldsymbol{\mu}}\xspace_i$.
\end{proof}
We are now ready for the general result.
\begin{theorem}\label{thm:4EFX=MMS}
Let $\mathcal{M}$ be a mechanism that has PNE for any instance
$(\{1,2\},M,(v_1, v_2))$ with $|M|=4$,
and all these equilibria lead to \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace allocations with respect to $v_1, v_2$. Then each such \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace allocation is also an \ensuremath{\textrm{\MakeUppercase{mms}}}\xspace allocation.
\end{theorem}
\begin{proof}
Suppose for contradiction that this is not the case. This means that there exists a valuation instance $\mathbf{v}=(v_1, v_2)$, for which there is a PNE $\mathbf{b}=(\bm{b}_1, \bm{b}_2)$ that produces an \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace allocation $(A_1, A_2)$, where, without loss of generality, $v_1(A_1)<\ensuremath{\boldsymbol{\mu}}\xspace_1$. Rename, if necessary, the goods to $\{h_1, h_2, h_3, h_4\}$, so that $v_1(h_1)\geq v_1(h_2) \geq v_1(h_3)\geq v_1(h_4)$. Finally, notice that from Lemma \ref{lem:3EFX=MMS} we know that $v_1(h_j)>0$ for any $j \in \{1, 2, 3, 4\}$. Before we proceed, we let $(B_1, B_2)$ to be a $\ensuremath{\boldsymbol{\mu}}\xspace_1$-\,partition of agent 1.
\medskip
\noindent\ul{\emph{Case 1:} $|A_1|=1$.} Since $(A_1, A_2)$ is \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace and all the goods have positive value for agent 1 according to $v_1$, it is easy to see that $\{h_1\}=A_1$. Moreover, the value of $h_1$ is at least as much as the value of any set of cardinality $2$ that contains goods from $\{h_2, h_3, h_4\}$. Since $v_1(h_1)<\ensuremath{\boldsymbol{\mu}}\xspace_1$ and $h_1$ is the highest valued good, we get $|B_1|=|B_2|=2$. This implies that good $h_1$ needs to be placed with another good to reach the \ensuremath{\textrm{\MakeUppercase{mms}}}\xspace value. However, this means that either $B_1$ or $B_2$ must contain two goods from $\{h_2, h_3, h_4\}$ and provides a value of at least $\ensuremath{\boldsymbol{\mu}}\xspace_1$. This is not possible as $h_1$ has at least as much value as any set of cardinality $2$ that contains goods from $\{h_2, h_3, h_4\}$ and $v_1(h_1)<\ensuremath{\boldsymbol{\mu}}\xspace_1$. Thus, if $|A_1|=1$, then $v_1(A_1)\geq \ensuremath{\boldsymbol{\mu}}\xspace_1$.
\medskip
\noindent\ul{\emph{Case 2:} $|A_1|=3$ or $|A_1|=4$.} In both cases it is easy to see that agent 1 achieves a value of at least $ \ensuremath{\boldsymbol{\mu}}\xspace_1$.
\medskip
\noindent\ul{\emph{Case 3:} $|A_1|=2$, where $A_1=\{h_1, h_2\}$, or $A_1=\{h_1, h_3\}$}. Notice that these bundles achieve at least the proportional value of agent 1, so in this case she gets a value of at least $\ensuremath{\boldsymbol{\mu}}\xspace_1$.
\medskip
\noindent\ul{\emph{Case 4:} $|A_1|=2$, where $A_1=\{h_1, h_4\}$}. Initially notice that $|B_1|\neq 1$ and $|B_1|\neq 3$, as the opposite would imply that $v_1(g_1)\geq \ensuremath{\boldsymbol{\mu}}\xspace_i \Rightarrow v_1(A_1) > \ensuremath{\boldsymbol{\mu}}\xspace_1$, a contradiction. Thus, we get that $|B_1|=|B_2|=2$. Since by assumption $v_1(\{h_1, h_4\})<\ensuremath{\boldsymbol{\mu}}\xspace_1$, we have that good $h_1$ must be placed with either good $h_2$, or good $h_3$ in a $\ensuremath{\boldsymbol{\mu}}\xspace_1$-\,partition of agent 1. So, a $\ensuremath{\boldsymbol{\mu}}\xspace_1$-\,partition can be either $(\{h_1, h_2\}, \{h_3, h_4\})$, or $(\{h_1, h_3\}, \{h_2, h_4\})$. However, $v_1(\{h_3, h_4\})\leq v_1(\{h_1, h_4\})<\ensuremath{\boldsymbol{\mu}}\xspace_1$ and $v_1(\{h_2, h_4\})\leq v_1(\{h_1, h_4\})<\ensuremath{\boldsymbol{\mu}}\xspace_1$. A contradiction.
\medskip
\noindent\ul{\emph{Case 5:} $|A_1|=2$, where $A_1=\{h_2, h_3\}$}. Initially notice that since $(A_1, A_2)$ is an \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace allocation, we have that $v_1(A_1)\geq v_1(h_1)$. This implies that in a $\ensuremath{\boldsymbol{\mu}}\xspace_1$-\,partition of agent 1., one of the sets has cardinality 1, and the maximum possible value that this set can have is $v_1(h_1)\leq v_1(A_1)< \ensuremath{\boldsymbol{\mu}}\xspace_1$, a contradiction. Thus, we get that $|B_1|=|B_2|=2$. Since by assumption $v_1(\{h_2, h_3\})<\ensuremath{\boldsymbol{\mu}}\xspace_1$, we have that good $h_2$ must be placed with either good $h_1$ in a $\ensuremath{\boldsymbol{\mu}}\xspace_1$-\,partition of agent 1. So, we conclude that a $\ensuremath{\boldsymbol{\mu}}\xspace_1$-\,partition is $(\{h_1, h_2\}, \{h_3, h_4\})$. However, $v_1(\{h_3, h_4\})\leq v_1(\{h_2, h_3\})<\ensuremath{\boldsymbol{\mu}}\xspace_1$. A contradiction.
\medskip
\noindent\ul{\emph{Case 6:} $|A_1|=2$, where $A_1=\{h_2, h_4\}$, or $A_1=\{h_3, h_4\}$}. Notice that so far we have not use the fact that $\mathbf{b}=(\bm{b}_1, \bm{b}_2)$ is a PNE under the valuation instance $ \mathbf{v}=(v_1, v_2)$. However, we need this property for these two last cases. Consider a different valuation profile $\mathbf{v}^*=(v^*, v^*)$, where the agents have identical values over the goods. The valuation instance is defined as follows:
\[
v^*(h_j)= \left\{
\begin{array}{lll}
1.2 & j=1 \\
1 &j \in \{2,3\} \\
\varepsilon & j=4 \\
\end{array}
\right.
\]
where $0<\varepsilon<0.2$. It is easy to see that for this valuation instance there are only two \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace allocations, i.e., $(\{h_1, h_4\},\{h_2, h_3\})$ and its symmetric $(\{h_2, h_3\}, \{h_1, h_4\})$. According to our assumption, there must be a bid vector $\mathbf{ b}^*=(\bm{b}^*_1, \bm{b}^*_2)$ that is a PNE for this valuation instance, and since we require the PNE to be also EFX, it must produce one of these allocations as they are the only ones that are \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace. Moreover, observe that the value that agent 2 derives in these allocations is $2$ and $1.2+\varepsilon < 1.4$ respectively.
For now assume that $\bm{b}_1 \neq \bm{b}^*_1$ and $\bm{b}_2 \neq \bm{b}^*_2$. Recall that $\mathbf{ b}=(\bm{b}_1, \bm{b}_2)$ is by assumption a PNE under valuation instance $\mathbf{ v}=(v_1, v_2)$, and in addition, $v_1(h_j)>0$ for every $j\in \{1,2,3,4\}$. Let us now examine what each agent can get if agent 1 deviates to $\mathbf{ b}'=(\bm{b}^*_1, \bm{b}_2)$:
\begin{itemize}
\item In case the bundle of agent 1 contains just one good, then agent 2 gets a bundle of cardinality $3$. This contradicts the fact that $\mathbf{ b}^*=(\bm{b}^*_1, \bm{b}^*_2)$ is a PNE under valuation instance $\mathbf{ v}^*=(v^*, v^*)$, as any such set gives agent 2 a value that is strictly higher than $2$.
\item In case the bundle of agent 1 has cardinality 3, this contradicts the fact that $\mathbf{ b}=(\bm{b}_1, \bm{b}_2)$ is a PNE under valuation instance $\mathbf {v}=(v_1, v_2)$, as the least valuable such set is $\{h_2, h_3, h_4\}$ and it has strictly higher value than $v_1(A_1)$, since $v_1(h_j)>0$ for every $j\in \{1,2,3,4\}$.
\item In case the bundle of agent 1 is one of the following:$\{h_1, h_2\}$, $\{h_1, h_3\}$, $\{h_1, h_4\}$, $\{h_2, h_3\}$, then this implies that $A_1$ has a value equal to the value of one of these bundles. By using the same arguments as in Cases 3, 4, 5, we can show that $v_1(A_1)\geq\ensuremath{\boldsymbol{\mu}}\xspace_1$, a contradiction.
\item In case the bundle of agent 1 is one of the following: $\{h_2, h_4\}$, $\{h_3, h_4\}$, then agent 2 gets either $\{h_1, h_2\}$ or $\{h_1, h_3\}$. This contradicts the fact that $\mathbf{ b}^*=(\bm{b}^*_1, \bm{b}^*_2)$ is a PNE under valuation instance $\mathbf{ v}^*=(v^*, v^*)$, as any such set gives agent 2 a value that is strictly higher than $2$.
\end{itemize}
The remaining corner cases are straightforward to deal with. To begin with, it is not possible to have $\bm{b}_1 = \bm{b}^*_1$ and $\bm{b}_2 = \bm{b}^*_2$, as the produced allocations from these bid profiles are different.
Next, assume that $\bm{b}_1= \bm{b}^*_1$ and $\bm{b}_2 \neq \bm{b}^*_2$.
This directly contradicts the fact that $(\bm{b}^*_1, \bm{b}^*_2)$ is a PNE under $\mathbf{ v}^*=(v^*, v^*)$.
To see this, start from $(\bm{b}^*_1, \bm{b}^*_2)$ and let agent 2 to deviate to $\bm{b}_2$. She gets set $A_2$ which is either $\{h_1, h_2\}$ or $\{h_1, h_3\}$ and achieves a value $2.2>2$.
Finally, assume that $\bm{b}_1\neq \bm{b}^*_1$ and $\bm{b}_2 = \bm{b}^*_2$.
Start from $(\bm{b}_1, \bm{b}_2)$ and let agent 1 to deviate to $\bm{b}^*_1$. She gets either set $\{h_1, h_4\}$, or set $\{h_2, h_3\}$, both of which provide her with a value of at least $v_1(A_1)$. In case this value is strictly higher than $v_1(A_1)$, then this directly contradicts the fact that $(\bm{b}_1, \bm{b}_2)$ is a PNE under $ \mathbf{ v}=(v_1, v_2)$. Finally, if this value is equal to $v_1(A_1)$, by using the same arguments as in cases 4, 5, we can show that $v_1(A_1)\geq\ensuremath{\boldsymbol{\mu}}\xspace_1$, a contradiction.
Since every possible case leads to a contradiction, we conclude that every allocation that corresponds to a PNE of a mechanism in the class of interest, guarantees to each agent her maximin share.
\end{proof}
The proof of Theorem \ref{thm:4EFX=MMS}
relies on extensive case analysis, where in each case assuming that the allocation is \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace but not \ensuremath{\textrm{\MakeUppercase{mms}}}\xspace eventually contradicts the fact that the current profile is a PNE. When we consider instances with $5$ or more goods, this approach is not fruitful anymore. The reason for that is not solely the increased number of cases one has to handle, but rather the fact that now some of the cases do not seem to lead to a contradiction at all.
Although we suspect that the theorem is no longer true for more than $4$ goods, we are able prove a somewhat weaker property that still separates the \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace allocations in PNE from generic \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace allocations in the non-strategic setting.
In particular, for general mechanisms that have PNE for every instance and these equilibria are always \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace, we show that the corresponding allocations always guarantee an approximation to \ensuremath{\textrm{\MakeUppercase{mms}}}\xspace that is \textit{strictly better} than $2/3$.
\begin{theorem}\label{thm:NEFX_APMMS}
Let $\mathcal{M}$ be a mechanism that has PNE for any instance $(\{1,2\},M,(v_1, v_2))$, and all these equilibria lead to \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace allocations with respect to $v_1, v_2$. Then each such \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace allocation is also an $\alpha$-\ensuremath{\textrm{\MakeUppercase{mms}}}\xspace allocation for some $\alpha> 2/3$.
\end{theorem}
\begin{proof}
Suppose for a contradiction that this is not the case. This means that there exists such a mechanism $\mathcal{M}$ and an instance $(\{1,2\},M,(v_1,v_2))$, for which there is a PNE $\mathbf{b}=(\bm{b}_1, \bm{b}_2)$ that results in an \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace allocation $\mathcal{A} = (A_1, A_2)$, where $v_i(A_i)\le2\ensuremath{\boldsymbol{\mu}}\xspace_i /3$ for at least one $i\in [2]$. Without loss of generality, assume $v_1(A_1)\le2\ensuremath{\boldsymbol{\mu}}\xspace_1 /3$ and notice that this means that $v_1(A_1) = 2\ensuremath{\boldsymbol{\mu}}\xspace_i /3$, as $v_1(A_1)$ cannot be smaller than $2\ensuremath{\boldsymbol{\mu}}\xspace_i /3$, by Theorem \ref{thm:efx_to_mms_n=2}.
This implies that $v_1(A_2)\geq 4\ensuremath{\boldsymbol{\mu}}\xspace_i /3$, since $v_1(M)\ge 2\ensuremath{\boldsymbol{\mu}}\xspace_1$ by Definition \ref{def:mmshare}.
Initially, we will restrict the number of the goods with positive value (according to $v_1$) in $A_2$. Let $S\subseteq A_2$ be the set of such goods, i.e, $S=\{g\in A_2 \,|\, v_1(g)>0\}$. Let $|S| = k$ and notice that $k$ cannot be $0$ or $1$ since otherwise $v_1(A_1) \geq \ensuremath{\boldsymbol{\mu}}\xspace_1$.
Finally, let $x\in \argmin_{g\in S} v_1(g)$ be a minimum valued good for agent 1 in $S$. We have
\[ \frac{2}{3}\ensuremath{\boldsymbol{\mu}}\xspace_1 = v_1(A_1) \ge v_1(S\setminus\{x\}) \geq v_1(S) - \frac{v_1(S)}{k} = \frac{(k-1)}{k}v_1(A_2)\geq \frac{(k-1)}{k} \frac{4}{3}\ensuremath{\boldsymbol{\mu}}\xspace_1\,, \]
where the first inequality follows from $(A_1, A_2)$ being \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace. Given our observation that $k\le 2$, the above implies that $k=2$.
Name $h_1$ and $h_2$ the goods of $S$, and observe that if $v_1(A_2)=v_1(\{h_1, h_2\})> 4\ensuremath{\boldsymbol{\mu}}\xspace_1 /3$, then $(A_1, A_2)$ cannot be \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace from the perspective of agent 1. Thus, we get that $v_1(A_2)= 4\ensuremath{\boldsymbol{\mu}}\xspace_1 /3$, which in conjunction with \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace implies $v_1(h_1)=v_1(h_2)= 2\ensuremath{\boldsymbol{\mu}}\xspace_1 /3$.
Next we argue that $A_1$ contains at least $2$ goods that have positive value for agent 1.
Indeed, if all the goods in $A_1$ had zero value, then we would have $v_1(A_1)=0< 2 \ensuremath{\boldsymbol{\mu}}\xspace_1 / 3$ as $A_2$ contains two positively valued goods, while if there was just one positively valued good in $A_1$, this would imply that only three goods have positive value for agent 1, and each one of them has value $2 \ensuremath{\boldsymbol{\mu}}\xspace_1 / 3$. The latter would make the existence of a $\ensuremath{\boldsymbol{\mu}}\xspace_1$-\,partition impossible, which is a contradiction.
So, since there are at least two positively valued goods in $A_1$ for agent 1, we arbitrarily choose two of them, and we name them $h_3$ and $h_4$.
We arbitrarily name the remaining goods $h_5, h_6,\ldots, h_m$.
Consider now a different valuation instance $\mathbf{v}^*=(v^*, v^*)$ where the agents have identical values over the goods. The valuation function is defined as
\[
v^*(h_j)= \left\{
\begin{array}{lll}
1.2 & j=1 \\
1 &j \in \{2,3\} \\
\varepsilon & j \in \{4,\ldots , m\} \\
\end{array}
\right.
\]
where $\varepsilon>0$ and $(m-3)\cdot \varepsilon < 0.2$. It is easy to see that for this valuation instance there are only two \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace allocations, namely, $\mathcal{X} = (\{h_1, h_4,\ldots, h_m\},\{h_2, h_3\})$, and its symmetric $\mathcal{Y} = (\{h_2, h_3\}, \{h_1,h_4,\ldots,h_m\})$. According to our assumption, there must be a bidding vector $\mathbf{b}^*=(\bm{b}^*_1, \bm{b}^*_2)$ that is a PNE of
$\mathcal{M}$ for the instance $(\{1,2\},M,\mathbf{v}^*)$, and since all PNE of $\mathcal{M}$ are also EFX, $\mathcal{M}(\mathbf{b}^*)$ must output one of $\mathcal{X}$ and $\mathcal{Y}$. Moreover, observe that the value agent 2 receives (with respect to $V^*$) in these allocations is $2$ and $1.2+ (m-3) \varepsilon < 1.4$ respectively.
For now assume that $\bm{b}_1 \neq \bm{b}^*_1$ and $\bm{b}_2 \neq \bm{b}^*_2$.
We will show that, in this case, running $\mathcal{M}$ with input $\mathbf{b}'=(\bm{b}^*_1, \bm{b}_2)$ results to agent 2 receiving a bundle of value strictly better than $2$ according to $v^*$. This contradicts
the fact that $\mathbf{b}^*=(\bm{b}^*_1, \bm{b}^*_2)$ is a PNE under $\mathbf{v}^*=(v^*, v^*)$.
Recall that $\mathbf{b}=(\bm{b}_1, \bm{b}_2)$ is a PNE under $\mathbf{v}=(v_1, v_2)$, that $v_1(h_1)=v_1(h_2)= v_1(A_1)= 2 \ensuremath{\boldsymbol{\mu}}\xspace_1 / 3$, and that $v_1(h_3), v_1(h_4)$ are strictly positive.
So, let us examine what each agent may get if agent 1 deviates from $\mathbf{b}$ to $\mathbf{b}'=(\bm{b}^*_1, \bm{b}_2)$:
\begin{itemize}
\item In case the bundle of agent 1 contains good $h_1$, it cannot contain any good from $\{h_2,h_3,h_4\}$; otherwise $\mathbf{b}=(\bm{b}_1, \bm{b}_2)$ would not be a PNE under $\mathbf{v}=(v_1, v_2)$. Thus, $\{h_2,h_3,h_4\}$ is part of the bundle of agent 2.
\item In case the bundle of agent 1 contains good $h_2$, it cannot contain any good from $\{h_1,h_3,h_4\}$; otherwise $\mathbf{b}=(\bm{b}_1, \bm{b}_2)$ would not be a PNE under $\mathbf{v}=(v_1, v_2)$. Thus, $\{h_1,h_3,h_4\}$ is part the bundle of agent 2.
\item In case the bundle of agent 1 does not contain any of $h_1$ and $h_2$, then it is possible for her to get any subset $T\subseteq \{h_3, h_4, \ldots , h_m\}$. However, $\{h_1,h_2\}$ is part the bundle of agent 2.
\end{itemize}
Thus, in the allocation returned by $\mathcal{M}(\mathbf{b}')$, agent 2 gets a bundle that contains $\{h_2,h_3,h_4\}$ or $\{h_1,h_3,h_4\}$ or $\{h_1,h_2\}$. Consider the value of these sets according to $v^*$:
\[v^*(\{h_2,h_3,h_4\})=2+\varepsilon\,, \qquad
v^*(\{h_1,h_3,h_4\})=2.2+\varepsilon\,, \qquad
v^*(\{h_1,h_2\})=2.2 \,.\]
That is, in every single case the value agent 2 derives under $\mathbf{v}^*=(v^*, v^*)$ when the profile $\mathbf{b}'=(\bm{b}^*_1, \bm{b}_2)$ is played is strictly better than $2$. However, $2$ is the maximum possible value that agent 2 could derive under $\mathbf{v}^*$ when the profile $\mathbf{b}^*$ is played. This contradicts the fact that $\mathbf{b}^*$ is a PNE under $\mathbf{v}^*$, as $\bm{b}_2$ is a profitable deviation for agent 2.
The remaining corner cases are straightforward to deal with. To begin with, it is not possible to have $\bm{b}_1 = \bm{b}^*_1$ and $\bm{b}_2 = \bm{b}^*_2$, as $\mathcal{X}\neq \mathcal{A}$ and $\mathcal{Y}\neq \mathcal{A}$.
Next, assume that $\bm{b}_1= \bm{b}^*_1$ and $\bm{b}_2 \neq \bm{b}^*_2$. This directly contradicts the fact that $\mathbf{b}^*$ is a PNE under $\mathbf{v}^*=(v^*, v^*)$. To see this, starting from $\mathbf{b}^*$ let agent 2 deviate to $\bm{b}_2$. She then gets $A_2$ which contains $h_1, h_2$ and has value for her $v^*(A_2)\ge 2.2 > 2$.
Finally, assume that $\bm{b}_1\neq \bm{b}^*_1$ and $\bm{b}_2 = \bm{b}^*_2$. This directly contradicts the fact that
$\mathbf{b}$ is a PNE under $\mathbf{v}=(v_1, v_2)$. To see this, starting from $\mathbf{b}$ let agent 1 deviate to $\bm{b}^*_1$. She either gets
$\{h_1, h_4,\ldots , h_m\}$ of value at least $v_1(h_1)+v_1(h_4)> 2\ensuremath{\boldsymbol{\mu}}\xspace_1 /3 = v_1(A_1)$ or she gets $\{h_2, h_3\}$ of value $v_1(h_2)+v_1(h_3)> 2\ensuremath{\boldsymbol{\mu}}\xspace_1 /3 = v_1(A_1)$.
Since every possible case leads to a contradiction, we conclude that every allocation that corresponds to a PNE of a mechanism in the class of interest, guarantees to each agent $i$ value that is strictly better than $2\ensuremath{\boldsymbol{\mu}}\xspace_i /3$, for $i\in[2]$.
\end{proof}
\section{Discussion}
In this work we studied the problem of fair allocating a set of indivisible goods, to a set of strategic agents. Somewhat surprising---given the existing strong impossibilities for truthful mechanisms---our results are mostly positive. In particular, we showed that there exist mechanisms that have PNE for every instance, and at the same time the allocations that correspond to PNE have strong fairness guarantees with respect to the true valuation functions.
We believe that there are several interesting directions for future work that follow our research agenda.
For instance, it would be interesting to explore how algorithms that compute \ensuremath{\textrm{\MakeUppercase{ef}1}}\xspace allocations for richer valuation function domains (e.g., the Envy-Cycle-Elimination algorithm \cite{LMMS04}) behave in the strategic setting we study in this work.
Here the question is twofold. On one hand, it is unclear whether such algorithms have PNE for every valuation instance, while on the other, it would be important to determine if they maintain their fairness properties at their equilibria or not.
The existence of PNE for algorithms that compute approximate \ensuremath{\textrm{\MakeUppercase{mms}}}\xspace allocation is on a similar direction and, as we mentioned in Section \ref{sec:prelims}, in this case we get the \ensuremath{\textrm{\MakeUppercase{mms}}}\xspace guarantee on the equilibria for free.
Theorems \ref{thm:4EFX=MMS} and \ref{thm:NEFX_APMMS} leave an open question on the \ensuremath{\textrm{\MakeUppercase{mms}}}\xspace guarantee that the equilibria of mechanisms that always have PNE and these are \ensuremath{\textrm{\MakeUppercase{efx}}}\xspace. Although we suspect that the corresponding allocations are not always \ensuremath{\textrm{\MakeUppercase{mms}}}\xspace, such a result would immediately imply that for every such mechanism which runs in polynomial time, finding a best response of an agent is a computationally hard problem.
Going beyond the case of two agents here seems to be a highly nontrivial problem as it is not very plausible that the current state of the art for the non-strategic setting could be analysed under incentives.
Finally, while we did not really focus on complexity questions, it is clear that
computing best responses is generally hard. However, when they are not, for instance when the number of agents in Round-Robin is fixed \cite{XiaoL20}, we would like to know if best response dynamics always converge to a PNE or there might be cyclic behavior (as it happens with better response dynamics \cite{GW17}).
\newpage
| {'timestamp': '2021-09-20T02:21:14', 'yymm': '2109', 'arxiv_id': '2109.08644', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08644'} | arxiv |
\section{Introduction}
Training complex neural models usually requires large amounts of data. However, data annotation still poses a challenge for many domains. Thus, much research focuses on data manipulation (e.g., synthesis, augmentation) and additional ways to handle data differently during training.
Prior work on the synthesis of textual data has focused on back translation \cite{parida2019abstract,wang2018switchout,sennrich2016improving} and word replacement~\cite{wang2015s,zhang2015character}.
We, on the other hand, propose a different approach to data synthesis through paraphrasing.
However, synthesis
involves data manipulation on the input level, which might expose the model to grammatically or logically incorrect input. Thus,
we explore a second approach to data manipulation based on augmentation rather than synthesis. Augmentation aims to move data manipulation from the input side to any part of the model. This, in turn, can help the model be more resilient to over-fitting. Third, we explore using data more efficiently by integrating curriculum learning into the training process. Curriculum learning reorders training samples based on external criteria,
which can help train the model gradually and more efficiently without the need for any external data. We also introduce new difficulty metrics based on specificity and abstractiveness for curriculum construction. Finally, we explore combining multiple techniques (synthesis and curriculum) to overcome the data scarcity issue. Thus, our contribution is threefold: 1) We introduce a simple approach for data synthesis through paraphrasing. 2) We use
data augmentation by
sample mixing to move augmentation into
the model. 3) We integrate a curriculum into the training process and introduce two new difficulty metrics.
\section{Related Work}
\textbf{Abstractive summarization for low resource data}.
Prior proposed methods for tackling domains with scarce data have included finetuning pre-trained models \cite{bajaj2021long,yu2021adaptsum,magooda2020abstractive} such as BART \cite{lewis2020bart}
or using few-shot learning
\cite{bravzinskas2020few,sarkhel2020interpretable}. Our work differs
in several aspects. First, our work doesn't focus on improving a certain summarization model; in contrast, we focus on using data efficiently, which can be applied to various models. Second, we focus on techniques that can improve the training process without additional data, e.g., synthesis, augmentation, and curriculum learning.
\textbf{Data synthesis and augmentation}. Data synthesis for text summarization is underexplored, with only a few approaches such as back-generation \cite{parida2019abstract} and template-based summary re-writing \cite{magooda2020abstractive}. We propose doing data synthesis by paraphrasing, which is simpler than the back-translation and template methods. While combining synthesis with paraphrasing has been studied in other contexts \cite{wang2015building,iyyer2018adversarial}, our work differs in both goals and techniques. \citet{wang2015building} proposed synthesizing data, then crowdsourcing paraphrases to train semantic parsers, while \citet{iyyer2018adversarial} synthesized data to train a paraphrasing model. Our work,
to our knowledge, is the first to use a strong language model finetuned for paraphrasing to synthesize data for text summarization.
Finally, for data augmentation, we base our work on the MixText approach \cite{chen2020mixtext}.
While the original MixText model is used for classification-based tasks, we introduce a variation for generative tasks (called MixGen)
and use it for abstractive summarization.
\textbf{Curriculum learning}. Curriculum learning aims to improve the training procedure with the same amount of data. It has been applied in NLP \cite{sachan2016easy,sachan2018self,tay2019simple,xu2020curriculum,wang2020learning} for machine comprehension, question generation, reading comprehension, NLU and machine translation, respectively. We build on the approach introduced in \cite{xu2020curriculum}; however, the core differences are both the downstream tasks (classification versus abstractive summarization) and the difficulty metrics.
In contrast to the only other summarization work that we know of, \citet{kano-etal-2021-quantifying}
focus on large datasets, while we focus on low resource domains. We also introduce two different difficulty metrics (ROUGE and specificity).
\section{Summarization Datasets}
\textbf{CourseMirror (CM)}\label{data:cmirror}
is a student reflections dataset that has been used in prior work to study extractive \cite{luo2015summarizing} and abstractive \cite{magooda2020abstractive}\footnote{https://petal-cs-pitt.github.io/data.html} summarization. The dataset consists of documents and summaries from four courses.
\begin{table}[t]
\small
\begin{center}
\begin{tabular}{|l|c|c||c|c|c|}
\hline
\textbf{Data} & \textbf{\# docs} & \textbf{\# refs} & \textbf{Train} & \textbf{Val} & \textbf{Test}\\
\hline
CM ALL & 368 & 44 & 294 & 37 & 37 \\
\hline
Amazon/Yelp & 160 & 8 & 58 & 42 & 60\\
\hline
\end{tabular}
\end{center}
\caption{\label{dataset_summary} Dataset summary.}
\end{table}
Table \ref{dataset_summary} summarizes the dataset in terms of the \textit{number of documents (\# docs)} and \textit{average reflections per document (\# refs)}.
We compiled all courses into one dataset (named CM ALL), then split the documents into training, validation, and test sets (80\%, 10\%, 10\%, respectively) by sampling equally from all courses.
\textbf{Amazon/Yelp (A/Y)} is another small
dataset, now consisting of opinions (refer to the appendix for examples) \cite{bravzinskas2020few}\footnote{https://github.com/abrazinskas/FewSum}.
The dataset contains customer reviews from Amazon \cite{he2016ups} and Yelp. The data contains 160 products/businesses split into training, validation and test sets as shown in Table \ref{dataset_summary}. Each of the products/businesses contains a set of 8 reviews
\section{Proposed Model}
\subsection{Synthesis via paraphrasing with GPT-2}
Influenced by work in style transfer \cite{krishna2020reformulating}, we propose synthesizing new human summaries by using paraphrasing to generate other potential summaries that are paraphrases of the original human summary. We use the paraphraser trained by \citet{krishna2020reformulating}. They finetuned a large GPT-2 language model with data from PARANMT-50M \cite{wieting-gimpel-2018-paranmt} to direct the model into generating diverse paraphrases that they later used for style transfer.
\subsection{Augmentation with sample mixing}
MixText is a data augmentation approach based on mixing two input samples by weight summing the features corresponding to the two samples at any level of the model (specific layer of the encoder, after encoder, etc.) using $\lambda$. The model is then expected to produce a probability distribution over the available classes, similar to a $\lambda$ weighted sum of the two samples' gold predictions. We train the model using KL divergence between the predicted distribution and the expected one.
We adapt the approach of \citet{chen2020mixtext} for text generation tasks by modifying the decoding process and loss calculation; we call our approach MixGEN. Like the original MixText, we use two input samples and pass them to the encoder. We pass the samples up to a specific layer, then the two hidden states are summed together weighted differently using the $\lambda$ parameter. On the decoder side, first, we construct the expected values using the following:
\begin{equation*}
\begin{split}
& for \:i \;\in \;min(L_1, L_2) \;\;PD_{i} = [P_1, P_2, P_3, .. P_v],\\
& for \:j \;\in \;[1, v]
\begin{cases}
P_j = \lambda, & \text{if } S_1[i]=j\\
P_j = 1-\lambda, & \text{if } S_2[i]=j\\
P_j = 0, & \text{otherwise}
\end{cases}
\\
\end{split}
\end{equation*}
where $v$ = vocab size, and $L_1$, $L_2$ are the human summary of input sample 1 and input sample 2, respectively. $PD_{i}$ is the probability distribution expected for token$_{i}$. $S_1[i]$, $S_2[i]$ are the $i^{th}$ token of the first sample's and second sample's human summary, respectively. In simple wording, during decoding, we expect the output probability distribution across the vocabulary of the decoder at token position $i$ to have two high values, one with value $\lambda$ at vocabulary token corresponding to the $i^{th}$ token of the first sample's human summary, and another value of $1-\lambda$ at vocabulary token corresponding to the $i^{th}$ token of the second sample's human summary. This should continue as long as $i$ is less than or equal to both human summaries' length. Once $i$ is greater than the minimum summaries' length, then the expected distribution would only correspond to the longer summary. Finally, the text generation on the decoder side is auto-regressive, thus, expected token is passed at the end of each generation step. However, If we pass the argmax of the expected distribution, then we will end up always passing the token corresponding to the sample with higher weight (Alpha) vs. (1-Alpha). Thus, we randomly sample from the two input samples based on their weights using the following equation.
\begin{equation*}
\begin{split}
& for \:i \;\in \;[1,L_{min}], \;P_i \thicksim U(0, 1)\\
& for \:i \;\in \;[1,L_{min}]
\begin{cases}
P_i <= \lambda, & T_i\; from \;S_1\\
P_i > \lambda, & T_i \;from \;S_2\\
\end{cases}
\\
\end{split}
\end{equation*}
where $S_1$ and $S_2$ are the first and second sample respectively, $L_{min}$ is minimum length of both $S_1$ and $S_2$. $P_i$ is the sampling probability and $U(0,1)$ is a uniform distribution.
\subsection{Curriculum learning (Cur.)}
Curriculum learning aims to help the model training process by introducing easier samples first followed by more difficult ones according to a particular difficulty metric. We use the curriculum construction approach introduced in \citet{xu2020curriculum}. In this approach, we split data into $N$ buckets based on a difficulty metric. We then train the model in a difficulty incremental setting.
In this work, we use two different curriculum difficulty metrics.
\textbf{Specificity (S)} measures how specific or vague a piece of text is. We argue that the more specific a piece of text is, the more complicated it can get. For example, text like (Nothing, Everything is Easy, etc.) are not specific and easy for the model to learn and vice versa.
We feed the model less specific pieces of text first during training, then introduce the more specific ones as training progresses. Specificity is calculated (Appendix) on the reflection/review level, so we use the average values of the whole set of reflections/reviews as the document value. For example; for a training sample of an input document $D$ consists of $N$ independent reflections/reviews $[r_1, r_2, r_3, .., r_n]$, we calculate the specificity value for the sample as follows:
\begin{equation*}
D_{s} = \sum_{i=1}^{N} S(r_i)/N
\end{equation*}
where $S(r_i)$ is specificity value of the i's reflection/review.
\textbf{ROUGE (R)} is the standard metric for evaluating summarization performance. Thus, we decided to use ROUGE scores as a difficulty metric. For a training sample, we calculate different ROUGE scores between the input document $D$ and its corresponding human summary $S$, then use \textit{average of (R1, R2, RL)} as the difficulty metric.
According to \cite{liu2018generating}, the higher the ROUGE score, the less abstractive the summary is compared to the input, and vice versa. We argue that the more abstractive samples are harder to learn.
\section{Experiments}
\subsection{Parameters}
\textbf{Baselines}: To our knowledge, in prior work there is no data synthesis technique used for summarization except back generation \cite{parida2019abstract} and template synthesis \cite{magooda2020abstractive}. Thus, we developed two synthesis baselines \textbf{(shuffle; shuffle + mask)}. We generated 10
samples for each of the original training samples for both
baselines by randomly shuffling the reflections/reviews. Additionally, for the shuffle-mask baseline, we randomly mask 50\% of the reflection/reviews 50\% of the time.
\textbf{Paraphrasing with GPT-2}: We generate $N$ synthetic samples for each original sample by generating $N$ paraphrases of the human summary and shuffle the input reflections. We varied N between [5, 10] to monitor the effect of synthetic data size.
\textbf{MixGEN}: We integrate MixGEN by combining each sample with $N$ other samples during training. We used $N$=3 for our experiments.
Moreover, we use mixing probability $\alpha$=0.75 as specified by the original code implementation\footnote{https://github.com/GT-SALT/MixText}.
\textbf{Curriculum learning:} In the curriculum learning experiments, we use a specificity prediction model that consists of a DistilBERT \cite{sanh2019distilbert} encoder with a logistic regression classification layer (Appendix). We normalize the whole training data values between 1 and $N$, where $N$ is the number of buckets to split the data. We use $N$=10. Similarly, we normalize the average ROUGE value to also be between 1 and $N$.
\subsection{Model Training}
In all of our experiments, we use the BERTSum\footnote{Easy to use and one of the SOTA summarization models.\\https://github.com/nlpyang/PreSumm}
model proposed by \citet{liu2019text}. We used the same parameters in the original code (Appendix). We conducted experiments on CM and A/Y datasets using proposed methods in a regular training and in a \textbf{(pretraining$\rightarrow$fine-tuning)} setting, where we perform pretraining with synthesized data and fine-tuneing using original data.
\section{Results}
\begin{table}[ht]
\begin{center}
\small
\begin{tabular}{|l|l|c|c|c|}
\hline
\multicolumn{2}{|c|}{} & \multicolumn{3}{|c|}{\bf CM} \\
\hline
Pretraining & finetuning & R1 & R2 & RL \\
\hline
\multicolumn{5}{|c|}{No Pretraining}\\
\hline
\multirow{6}{*}{None} & Original & 36.34 & 11.39 & 26\\
\cline{2-5}
& shuff. & \bf 38.57 & 11.72 & 26.94\\
\cline{2-5}
& shuff.+mask & 37.07 & 11.52 & 26.45\\
\cline{2-5}
& Cur.(S) & 36.88 & \bf 12.41 & \bf 27.63\\
\cline{2-5}
& Cur.(R) & 37.01 & 12.13 & 27.11\\
\cline{2-5}
& Mix(n=3) & 36.87 & 11.98 & 26.57\\
\hline
\hline
\multicolumn{5}{|c|}{With synthetic data pretraining}\\
\hline
\multirow{3}{*}{Synth.(n=5)} & Original & 39.39 & 12.85 & 26.66\\
\cline{2-5}
& Cur.(S) & 40.68 & 13.59 & 26.26\\
\cline{2-5}
& Cur.(R) & 39.35 & 12.33 & 26.48\\
\hline
\multirow{3}{*}{Synth.(n=10)} & Original & \bf 41.14 & \bf 14.24 & 26.98\\
\cline{2-5}
& Cur.(S) & 39.81 & 12.94 & 26.81\\
\cline{2-5}
& Cur.(R) & 40.22 & 14.12 & \bf 27.33\\
\hline
\end{tabular}
\end{center}
\caption{\label{tab:bertsum_results_CM} ROUGE results of BERTSum model with different augmentation techniques on CM data.}
\end{table}
\begin{table}[!ht]
\begin{center}
\small
\begin{tabular}{|l|l|c|c|c|}
\hline
\multicolumn{2}{|c|}{} & \multicolumn{3}{|c|}{\bf A/Y} \\%& Row\\
\hline
Pretraining & finetuning & R1 & R2 & RL \\
\hline
\multicolumn{5}{|c|}{No Pretraining}\\
\hline
\multirow{6}{*}{None} & Original & 27.71 & 3.83 & 17.83\\
\cline{2-5}
& shuff. & 28.34 & 4.04 & 17.74\\
\cline{2-5}
& shuff.+mask & 28.01 & 4.21 & 17.87\\
\cline{2-5}
& Cur.(S) & 28.69 & 4.28 & 17.95\\
\cline{2-5}
& Cur.(R) & \bf 28.8 & \bf 4.33 & \bf 18.18\\
\cline{2-5}
& Mix(n=3) & 27.85 & 3.95 & 17.89\\
\hline
\hline
\multicolumn{5}{|c|}{With synthetic data pretraining}\\
\hline
\multirow{3}{*}{Synth.(n=5)} & Original & 28.27 & 4.36 & 17.84\\
\cline{2-5}
& Cur.(S) & 27.95 & 4.4 & 18.01\\
\cline{2-5}
& Cur.(R) & \bf 28.56 & 4.25 & 18.06\\
\hline
\multirow{3}{*}{Synth.(n=10)} & Original & 28.49 & \bf 4.54 & 18.08\\
\cline{2-5}
& Cur.(S) & 28.52 & 4.5 & \bf 18.15\\
\cline{2-5}
& Cur.(R) & 28.21 & 4.35 & 17.87\\
\hline
\end{tabular}
\end{center}
\caption{\label{tab:bertsum_results_Amazon}
ROUGE results of BERTSum model with different augmentation techniques on A/Y data.}
\end{table}
Tables \ref{tab:bertsum_results_CM} and \ref{tab:bertsum_results_Amazon} show results obtained through conducting experiments on CM and A/Y datasets. Considering \textbf{data synthesis and augmentation}, we first see that the two baselines (shuffle and shuffle+mask) can improve performance compared to no data manipulation across all ROUGE scores except RL for shuffle baseline on the A/Y dataset. This shows that reducing the model dependency on the input sentence order can help the model depend more on the actual input text.
Moving to the proposed augmentation technique (MixGEN), we see that we can get a performance gain across all ROUGE scores across both datasets by mixing training samples compared to normal training with a single sample. Similarly, we can see that providing synthetic data with the proposed paraphrasing approach can help outperform both using original data as well as baselines with (41.14, 14.24, 26.98) compared to (36.34, 11.39, 26) and (38.57, 11.72, 26.94) for original and shuffle baseline respectively on CM, and (28.49, 4.54, 18.08) compared to (27.71, 3.83, 17.83) and (28.34, 4.04, 17.74) on A/Y. Additionally, we can see that increasing the synthetic data size helps to improve the model performance across all ROUGE scores for both CM and A/Y datasets (N=5 vs. N=10).
Now moving to \textbf{curriculum learning}, we can see that integrating a curriculum to reorder training data differently using any of the two proposed difficulty metrics can lead to consistent improvements across all ROUGE scores for both CM and A/Y datasets. Additionally, we can see that curriculum can improve scores compared to the two augmentation baselines across all ROUGE scores except R1 for CM data. On the other hand, we don't see consistent ROUGE score improvement when using curriculum for fine-tuning after pretraining with synthetic data. We hypothesize that this behavior might be due to performing the pretraining phase without curriculum integration, unlike the fine-tuning phase. We plan to conduct experiments with a curriculum integrated into both pretraining and fine-tuning to validate our hypothesis. Furthermore, while both curriculum difficulty metrics (i.e., Specificity and ROUGE) introduced improvement compared to training with no curriculum, we didn't observe any consistent improvement pattern in using one metric over the other.
\section{Conclusion and Future work}
In this work, we showed that we could mitigate the effect of data scarcity in different datasets (i.e., CourseMirror and Amazon/Yelp) for abstractive summarization using three simple data manipulation techniques. We showed that synthesizing data with paraphrasing to use for pretraining can boost the model performance across all ROUGE scores for different datasets. Additionally, we showed that mixing samples for training can also push the model to be more resilient to overfitting and improve its performance. Finally, we showed that reordering training samples through curriculum, using the proposed difficulty metrics \textbf{(i.e., Specificity, and ROUGE)} would help improve all ROUGE scores across different datasets without the need for any additional data (either true or synthetic). In the future, we plan to try more $N$ values for synthesis and MixGen. Additionally, we plan to investigate other curriculum difficulty metrics. We plan to use BART model as one of the SOTA models for abstractive summarization. Finally, we are doing additional experiments on multitask learning, and we plan to combine both techniques in one framework targeting low resource domains.
\section*{Acknowledgements}
The research reported here was supported, in whole or in
part, by the institute of Education Sciences, U.S. Department
of Education, through Grant R305A180477 to the University of Pittsburgh. The opinions expressed are those of the
authors and do not represent the views of the institute or the
U.S. Department of Education. We like to thank the Pitt PETAL group and the anonymous reviewers for advice in improving this paper.
| {'timestamp': '2021-09-20T02:18:43', 'yymm': '2109', 'arxiv_id': '2109.08569', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08569'} | arxiv |
\section{Introduction}
\begin{figure}[ht]
\centering
\includegraphics[width=0.6\textwidth]{diagram.pdf}
\caption{Diagram of a modular predictively cashed RL architecture. }
\label{fig: diagram}
\end{figure}
We live in a world of information. In our daily lives, almost every novel task inevitably starts with a series of targeted information retrieval actions, whether performing an internet search or just asking a question to a friend. It is therefore imperative for the deployment of artificial intelligence in the real world to develop efficient algorithms capable of learning how to find and use information in complex environments. In the context of Bayesian reinforcement learning (RL), information and knowledge are formalized as the concept of belief state (also known as information state) \citep{ghavamzadeh2015}. One of the key results of Bayesian RL is that optimal exploration (also known as \emph{Bayes adaptive} exploration), and consequently optimal information retrieval, can be achieved by augmenting the state space with the belief state and solving a standard control problem on this augmented space \citep{ghavamzadeh2015}. In spite of its elegance, the very high dimensionality of belief-augmented problems, together with the intrinsic intractability of Bayesian inference, limits the range of applicability of this approach. Perhaps for this reason, most of the modern deep reinforcement learning literature adopts heuristic exploration methods such as $\epsilon$-greedy, Thompson sampling \citep{osband2015bootstrapped, osband2016deep, azizzadenesheli2018efficient}, noisy networks \citep{fortunato2017noisy}, random network exploration bonuses \citep{burda2018exploration} and curiosity-based approaches \citep{still2012information, frank2014curiosity, zhelo2018curiosity}. Recent developments in variational inference and deep reinforcement learning re-ignited the interest in approximate Bayes-adaptive exploration as a form of meta-reinforcement learning \citep{duan2016rl, zintgraf2019varibad, dorfman2020offline}. Nevertheless, learning targeted exploratory actions remains a very challenging task even with modern deep RL techniques, given the high dimensionality of the belief space and the fact that information gathering actions are only very indirectly related to the collection of reward. Fortunately the situation is less dire than it could superficially appear as belief-augmented RL problems inherit a considerable amount of structure from the underlying full information control problems and the nature of iterated Bayesian inference. In this paper we exploit this mathematical structure in order to simultaneously address two related sub-problems that make this setting hard: I) The sparsity of the reward structure \citep{zintgraf2021exploration} and II) the so called "chicken-and-egg problem" of exploration and exploitation \citep{liu2021decoupling}. This latter problem arises from the fact that the value of information gathering depends on its use to collect reward but a proper exploitation policy depends on the use of the available information.
The other main problem limiting the use of Bayes-adaptive learning is the inherent computational complexity of non-conjugate iterated Bayesian inference. This paper does not deal with this problem and we recommend the reader to the extensive literature on approximate Bayesian inference \citep{zhang2018advances, blei2017variational, betancourt2017conceptual, sarkka2013bayesian}. Therefore, we limit our analysis to conjugate Bayesian models where inference can be performed using a simple update rule. However, all techniques introduced here can be straightforwardly applied to approximate inference settings, including modern approaches using variational autoencoders (VAEs) such as \citep{zintgraf2019varibad, dorfman2020offline}, possibly in combination with training bonuses methods such as in \citep{zintgraf2021exploration}.
\section{Related work}
The theoretical framework for optimal control on a belief-augmented state space was first developed in the control theory literature under the name of dual control theory \citep{feldbaum1960dual1, feldbaum1960dual2, feldbaum1961dual3, filatov2000survey}. The high computational complexity of the approach, stemming from the very high dimensionality of the state space, limited the diffusion of the theory. However, the approach was re-introduced in the context of model-based Bayesian reinforcement learning \citep{rieder1975bayesian, ross2007bayes} where the domain of applicability was greatly increased by the introduction of Monte Carlo tree search methods \citep{guez2012efficient, guez2013scalable, asmuth2012learning, katt2017learning}. The use of belief-augmentation in model-free RL methods is very limited. To the best of our knowledge, the first use of temporal difference (TD) learning to solve dual control problems is in \cite{santamar1997new}. Until recently, the deep reinforcement learning literature ignored the concept of Bayes-adaptive exploration, belief-augmentation and dual control. However, important progresses have been made in the related field of model-free meta-RL \citep{wang2016learning, duan2016rl, gupta2018meta}. For example, $\text{RL}^2$ involves the training of a recurrent meta-network in order to learn optimal exploration in novel environments \citep{duan2016rl}. This can be seen as a model-free form of Bayes-optimal learning since the information encoded in a Bayesian belief state is fully contained in the sequence of past transitions that are fed into the recurrent network. However, this results in redundant encoding as it ignores the exchangability of the observations, which in turn can make an already difficult learning problem into something substantially harder. The recently proposed variBAD method is the first work using modern deep learning techniques in an explicitly belief-augmented setting \cite{zintgraf2019varibad}. This work uses VAEs for performing the approximate inference and hence obtaining the belief-state and then exploits a policy gradient method in order to obtain an approximate Bayes-adaptive policy. Unfortunately, the extremely sparse reward structure of most useful optimal exploration tasks makes methods such as variBAD very challenging to train. The HyperX method addresses this problem with a shaping approach by adding a series of reward
bonuses to promote (meta-)exploration of the belief-augmented state space during training \citep{zintgraf2021exploration}. While our paper deals with the same underlying problem, our solution involves the reformulation of the reward structure into an equivalent one without the use of any heuristic shaping bonus. In this sense, our approach and HyperX are orthogonal and potentially complementary and can be used together to solve more challenging targeted exploration tasks. Similarly to our work, the recently introduced DREAM method decouples the learning of the exploitation and exploration modules so as to ameliorate the "chicken-and-egg" problem that arises from their interdependence \citep{liu2021decoupling}. However, the approach used in DREAM is radically different from ours, as it exploits the environment ID and uses an information bottleneck loss to extract task relevant information. Our predictively cashed reward bears some superficial resemblance to curiosity-based approaches such as \citep{schmidhuber1991possibility, oudeyer2007intrinsic, frank2014curiosity, stadie2015incentivizing, bellemare2016unifying, tang2016exploration, ostrovski2017count, zhao2019curiosity} since it directly rewards the discovery of new information. However, while curiosity rewards information in itself, the predictively cashed reward only values the difference in predicted reward that the new information allows to collect.
\section{Preliminaries}
Markov decision processes (MDPs) are a mathematical formalization of sequential decision making in stochastic environments. A MDP is defined by: 1) a family of stochastic processes specified by a set of transition probabilities $p\!\left(x_{t+1}\mid x_{t}, a_{t}\right)$ between states $x_t$ that are conditional on a sequence of action variables $a_t$ and 2) a family of reward probabilities $p\!\left(r_t \mid x_t, a_t \right)$. In a RL problem, transition and reward probabilities are not known in advance. Without loss of generality, we can formalize this uncertainty by making the transition and reward probabilities dependent on a set of "environment" parameters $e$:
\begin{align} \label{eq: transition}
&p\left(x_{t+1}\mid x_{t}, a_{t}\right) = T\left(x_{t+1}\mid x_{t}, a_{t} , e\right)~,\\ \label{eq: reward}
&p \left(r_t \mid x_t, a_t \right) = R \left(r_t \mid x_t, a_t, e \right)~.
\end{align}
This model describes a family of Markov decision processes parameterized by the environment variable $e$, which is not directly accessible to the agent and can only be inferred from the observed transitions/rewards. A policy $\pi(a_t \mid \{\ x_\tau, a_\tau, r_\tau\}_{\tau=0}^{t-1})$ is a distribution over actions conditional on a previous sequence of state transitions. Every policy $\pi$ defines a $\pi$-controlled process where the actions are sampled according to the policy and state transitions and rewards are sampled accordingly. We denote the expectation under a $\pi$-controlled process in an environment $e$ as $\mean{\cdot}{\pi \mid e}$. The discounted expected value (often simply referred to as just the value) of a policy $\pi$ in an environment $e$ is defined as:
\begin{equation}\label{eq: optimal value of e}
v^\pi(x_t; e) = \mean{\sum_{\tau = t}^{\infty} \gamma^{\tau - t} r_t}{\pi \mid e}~,
\end{equation}
where $\gamma \in (0, 1)$ is a discounting factor and the sequence of states and rewards is sampled from the $\pi$-controlled stochastic process. The optimal value $v^e(x_t; e)$ is defined as the global optimum of Eq.~\ref{eq: optimal value of e} with respect to the policy (the reason for this unusual notation will be clear later on). Now assume that environment $e$ is sampled from a prior distribution $p(e; b_0)$, parameterized by the initial "belief state" $b_0$. This initial belief state summarizes all the information available to the agent at time zero. After each transition
$
x_t, a_t, r_t \rightarrow x_{t+1}
$
the belief state is updated using Bayes rule:
\begin{equation}
p(e; b_{t+1}) = p(e \mid x_t, x_{t+1}, a_t, r_t) \propto R \left(r_t \mid x_t, a_t, e \right) T\left(x_{t+1}\mid x_{t}, a_{t} , e\right) p(e; b_t)~.
\end{equation}
Here we assumed that the posterior distribution can be parameterized by the belief variables $b_{t+1}$ given any possible transition. This is only approximately possible in non-conjugate cases, unless we allow for the use of infinite dimensional belief states (in that case the belief state can be chosen to be the posterior density itself). The appropriate objective function for learning optimal exploration is then simply the average of the environment specific values under the belief state:
\begin{equation}\label{eq: bayes value}
v^\pi(x_t, b_t) = \mean{v^\pi_t(x_t; e)}{e \sim b_t} = \mean{\mean{\sum_{\tau = t}^{\infty} \gamma^{\tau - t} r_\tau}{\pi \mid e}}{e \sim b_t}~.
\end{equation}
A Bayes-adaptive policy is a global maximizer of Eq.~\ref{eq: bayes value}. We denote the optimal belief-augmented value as $v^*(x_t,b_t)$. In order to maximize the expected value, the agent needs to perform exploratory actions to update its belief state and then use the information to collect reward. Roughly speaking, these dynamics can be separated into an initial exploration phase and a subsequent exploitation phase. The optimal policy is non-Markov with respect to the state variable since the information at time $t$ concerning the environment $e$ depends on past transitions. However, the policy is Markov if state $x_t$ is augmented by the belief state $b_t$. The computational challenge of belief-augmented reinforcement learning led the community towards more tractable alternatives. A simple option is Thompson sampling, where the belief-augmented policy is approximated by the optimal policy of an environment $e'$ sampled from the belief state:
$
\pi(x_t, b_t) \approx \pi(x_t; e'), \text{ with } e' \sim b_t~.
$
However, a posterior sampling agent cannot learn how to perform actions that are not optimal in any known environment in the full information regime. In other words, the agent cannot learn to perform actions such as asking questions, consulting a map or performing an internet search as these actions are solely aimed at acquiring new information. Belief-augmentation allows us to solve the optimal exploration problem, also known as the exploration/exploitation dilemma, using standard reinforcement learning techniques. For example, given a belief-augmented transition
$
x_t, b_t, a_t, r_t \rightarrow x_{t+1}, b_{t+1}~
$
under a belief-augmented policy $\pi(x_t, b_t)$, we can learn the expected value of the policy using the standard TD learning (tabular) update rule
\begin{equation} \label{eq: belief-augmented update}
v^\pi(x_t, b_t) \shortleftarrow v^\pi(x_t, b_t) + \eta \left( r_t + \gamma v_{t+1}^\pi(x_{t+1}, b_{t+1}) - v^\pi(x_t, b_t) \right)~,
\end{equation}
where $\eta$ is a learning rate. The key difference when compared with standard TD learning is that the value is now a function of the belief state. This allows to assign high values to belief states where the agent has precise information concerning how to collect reward. For example, the value of being on a Caribbean island and knowing that it hides a buried pirate treasure is higher than the value of being in the same island without that knowledge. This is true both because the belief correlates with the actual state of the world and because it affects the optimal policy (e.g. digging vs sunbathing).
\section{Cross-values and the value of current and future information}
We are now in the position to introduce our main contribution. Here we will show that a simplified version of the posterior sampling policy can be used to quantify the value of the information currently held by the agent. The expected value of a posterior sampling policy is not easy to quantify as each action leads to new belief updates. However, we can evaluate the value of a simplified sampling policy where the environment is sampled once from the belief and then the policy acts optimally until the end of the episode according to the sampled environment. In this case, the expected value is
\begin{equation} \label{eq: avg cross value}
\mean{v^{e'} (x_t; e)}{e' \sim b_t}~.
\end{equation}
We refer to the quantity $v^{e'} (x_t; e)$ as the \emph{cross-value}, which is defined as the expected reward collected in environment $e$ under the optimal policy of environment $e'$. The cross-value plays a crucial role in the present work as it will allow us to quantify the penalty that the agent has to pay when acting under "wrong beliefs". Our starting point is Eq.~\ref{eq: bayes value}, which expresses the optimal belief-augmented value as an average of environment-specific values:
\begin{align} \nonumber
v^*(x_t,b_t) &= \mean{\mean{\sum_{\tau=t}^{\infty} \gamma^{\tau - t} r_\tau}{{\pi \mid b_t}; e}}{e \sim b_t} \\
&= \mean{v^*(x_t,b_t \mid e)}{e \sim b_t}~, \label{eq: optimal ba value}
\end{align}
where $v^*(x_t,b_t \mid e)$ is the value of the optimal belief-augmented policy when the agent is in environment $e$. The value $v^*(x_t,b_t, a_t \mid e)$ still depends on the belief state through the belief-augmented policy. However, an interesting belief independent approximation can be obtained by replacing the belief-augmented value $v^*(x_t,b_t, a_t \mid e)$ with the posterior sampling value given in Eq.~\ref{eq: avg cross value}:
\begin{align}
v^c(x_t,b_t) &= \mean{\mean{v^{e'} (x_t; e)}{e' \sim b_t}}{e \sim b_t} = \mean{v^{e'} (x_t; e)}{e,e' \underset{\text{iid}}{\sim} b_t}~.
\end{align}
We refer to $v^c$ as the \emph{value of current information} as it can it interpreted as the value of a policy that stops acquiring information and starts acting on a fixed environment sampled according to its current belief. This quantity has some important and intuitive properties. If we denote a deterministic belief state as $\delta_e$ (dirac measure), we have that $v^c(x_t,\delta_e) = v^e(x_t; e)$. In words, the value of future information is equal to the optimal value in the full information regime. More generally, the value of current information tends to increase as the entropy of the belief state decreases since the cross-values tend to converge to the optimal values. From the optimality of the value in Eq.~\ref{eq: optimal ba value} it follows that the value of current information is a lower bound on the optimal belief-augmented value:
\begin{equation}
v^c(x_t,b_t) \leq v^*(x_t,b_t)~.
\end{equation}
Therefore, we can express the optimal belief-augmented value as a sum of the value of current information and a positive-valued term:
\begin{equation} \label{eq: value decomposition}
v^*(x_t,b_t) = v^c(x_t,b_t) + v^f(x_t,b_t)~.
\end{equation}
We refer to $v^f(x_t,b_t, a_t)$ as the value of future information. Since the value of current information can be computed in a non-augmented state space, the belief-augmented problem reduces to learning the value of future information.
\paragraph{Predictive reward cashing.}
The central result of this paper is that, once we have an expression for the cross-values, the full belief-augmented problem can be reduced to a simpler problem where information acquisition is directly rewarded. We can achieve this by plugging the decomposition of the value in Eq.~\ref{eq: value decomposition} into the belief-augmented update rule in Eq.~\ref{eq: belief-augmented update}. This results in a similar update rule for the value of future information:
\begin{equation} \label{eq: v update rule}
v^f(x_t, b_t) \shortleftarrow v^f(x_t, b_t) + \eta \left(\lambda_t + \gamma v_{t+1}^f(x_{t+1}, b_{t+1}) - v^f(x_t, b_t)\right)~,
\end{equation}
where $\lambda_t$ is the \emph{predictively cashed} reward
\begin{align}\label{eq: modified reward}
\lambda_t =r_t + \gamma v^c(x_{t+1}, b_{t+1}) - v^c(x_{t}, b_{t})~.
\end{align}
This can been seen by plugging Eq.~\ref{eq: value decomposition} into the TD target:
\begin{align} \nonumber
&r_t + \gamma v^\pi_{t+1}(x_{t+1}, b_{t+1}) - v^\pi(x_t, b_t) \\ \nonumber
&= r_t + \gamma \left(v^c(x_{t+1}, b_{t+1}) + v^f(x_{t+1}, b_{t+1})\right) - \left(v^c(x_t, b_t) + v^f(x_t, b_t)\right) \\ \nonumber
&= \lambda_t + \gamma v_{t+1}^f(x_{t+1}, b_{t+1}) - v^f(x_t, b_t)~.
\end{align}
This quantity can be interpreted as the difference between the future expected reward collected in the past and present belief states if the agent were to stop updating its belief and act optimally according to an environment sampled from the belief. This can be seen by evaluating its expected value:
\begin{align} \nonumber
\mean{\lambda_t}{r_t, x_{t+1}} &= \mean{r_t}{r_t} + \gamma v^c(x_{t+1}, b_{t+1}) - v^c(x_{t}, b_{t})\\ \nonumber
&= \mean{ \mean{r_t}{r_t \mid e} + \gamma \mean{v^{e'}(x_{t+1}; e)}{x_{t+1}\mid \pi(e)}}{e,e'} - v^c(x_{t}, b_{t}) \\ \nonumber
& \approx \mean{ \mean{r_t}{r_t \mid e} + \gamma \mean{v^{e'}(x_{t+1}; e)}{x_{t+1}\mid \pi^{e'}(e)}}{e,e'} - v^c(x_{t}, b_{t}) \\
& = v^c(x_{t+1}, b_{t}) - v^c(x_{t}, b_{t}) \label{eq: approximate PCR}~,
\end{align}
where the approximation comes from the fact that we took the expectation with respect to the optimal policy under the environment $e'$ instead of the Bayes-adaptive policy. Therefore, the predictively cashed reward allows to immediately "cash in" future reward coming from an increase of available information. In practice, this transformation converts the very sparse reward structure of a belief-augmented problem into a much denser reward structure where reward is delivered directly as soon as relevant information is acquired.
A key feature of the value of future information is that it can be bounded by full information quantities (i.e. quantities that can be computed without solving the belief-augmented problem). This is important as it means that we can bound function approximations of the value of future information without need for training, thereby ensuring the proper convergence of the belief-augmented values to the environment-specific optimal values as soon as the agent acquires information. The starting point is the inequality:
\begin{equation}
v^*(x_t,b_t) = v^c(x_t,b_t) + v^f(x_t,b_t) \leq \mean{v^e(x_t; e)}{e \sim b_t}~.
\end{equation}
This result is obvious, it simply says that on average an optimal agent with full information collects at least as much reward as a belief-augmented agent with potentially incomplete knowledge of its environment. Therefore, $0 \leq v^f(x_t,b_t) \leq \mathcal{B}(x_t, b_t)~$, where the upper bound is given by
\begin{equation}\label{eq: bound}
\mathcal{B}(x_t, b_t) = \mean{v^e(x_t; e) - \mean{v^{e'}(x_t; e)}{e' \sim b_t}}{e \sim b_t}~.
\end{equation}
This is the difference between the average expected future reward that can be acquired under the current information state and the average optimal expected reward.
\section{Practical algorithms}
The predictively cashed reward (\ref{eq: modified reward}) can rarely be computed analytically even when the cross-value function is available. However, it is straightforward to obtain an unbiased stochastic estimator by replacing the exact expectation with an average over a finite number of samples:
$
\lambda_t^{(M, N)} = r_t + \frac{1}{M N} \sum_{m=1}^M \sum_{n=1}^N v^{e_n} (x_t; e_m)
$,
with all the $e_k$ sampled independently from the belief state. We can therefore use this stochastic estimator as reward during training in place of the true $\lambda_t$ without affecting the asymptotic convergence. This is equivalent to switching from expected rewards to sampled rewards in conventional RL algorithms. In practice, we suggest to use $M = 1$. This generally provides a strong reward signal even when $N$ is small since the cross-value usually decreases sharply as the difference between the two environments increases, delivering strong reward signals when relevant information is acquired. All standard value-based RL algorithms can be used to learn the value of future information from this modified reward structure. The main difference between the predictively cashed training and standard training is that the policy should maximize the total value $v^*(x_t,b_t) = v^c(x_t,b_t) + v^f(x_t,b_t)$ instead of just the learned value $v^f(x_t,b_t)$. In practice, $v^c(x_t,b_t)$ has to be estimated from the cross-values using a finite number of samples. This leads to a stochasticity in the policy similar to standard Thompson sampling, which can potentially facilitate (meta-)exploration during training. Convergence of the tabular algorithm follows from the standard convergence results of RL. \textbf{Tabular approaches in finite deterministic inference settings}:
For the sake of simplicity, so far we presented the approach by its tabular update rule. Unfortunately, tabular algorithms are rarely feasible in a belief-augmented setting as there usually are infinitely many belief states even for very simple inference problems. However, there is an interesting class of problems where the full belief-augmented state space has a finite number of states. This happens when there is a finite number of possible environments and inference is deterministic, meaning that the belief variable can only transition from its prior value to a full information state. For a set of $S$ possible environments, the belief state can be parameterized by an array of posterior probabilities $b_t = (\rho^{(1)}_t,...,\rho^{(S)}_t)$. When inference is deterministic, the belief state can either stay on its prior value or "collapse" on a one-hot-encoded array representing a full information state. This implies that the belief space has $S + 1$ different states and, assuming that the environments have $H$ many states, the belief-augmented value can be represented by a table of $H$ numbers. This is true because we know that the value of future information is zero for full information states. Thus, the only non-zero values are in the starting prior belief state. While deterministic inference can sound very restrictive, it can effectively represent many different experimental behavioral and cognitive tasks in animals and humans where cues offer an unambiguous disambiguation of the latent state \citep{friston2016active}. \textbf{Function approximations with approximate value bound:}
In most realistic scenarios the belief-augmented state space has an exponentially large or infinite number of states and tabular algorithms become unfeasible. In these situations we can use standard function approximation techniques to estimate $v^f(x_t,b_t)$. We can also obtain a functional approximation of the value of future information that automatically satisfies the bound:
\begin{equation}\label{eq: function approximation with bound}
v^f(x_t,b_t) = \mathcal{B}(x_t, b_t)w(x_t, b_t)~,
\end{equation}
where $w(x_t, b_t) \in (0,1)$ is the output of a parameterized function approximation such as a deep neural architecture. In practice, the bound $\mathcal{B}(x_t, b_t)$ can be estimated using a finite number of samples. This approximation ensures that the policy switches from exploratory to the optimal exploitative policy automatically as soon as enough relevant information has been collected. This is because the belief-augmented value is the sum of the value of current information, which converges to the optimal full-information value as the belief converges to a deterministic measure, and a term $v^f \leq \mathcal{B}$ that is guaranteed to vanish under this limit. Additionally and perhaps more importantly, the use of the bound in a functional approximation means that the agent does not need to learn how the predictively cashed reward coming from the same state is down-scaled when information is acquired. This is crucially important as the apparent inconsistency of the reward schedule makes the learning problem particularly hard.
\section{Learning the cross-values}
So far we assumed the cross-values to already be available before training. Here we will present some methods to either pre-compute the cross-values or to jointly train them together with the value of future information. When the expected reward and transition distributions are known, the optimal expected values can be obtained by solving the Bellman equation. It is straightforward to extend the approach in order to compute the cross-values, as described in Appendix A. Importantly, the resulting recursive system of equations can be efficiently parallelized on GPUs in a manner similar to convolutional neural networks. This allows to efficiently compute a batch of cross-values in order to estimate the expectations in Eq.~\ref{eq: modified reward} and Eq.~\ref{eq: bound}. In the stationary infinite horizon case, the time dependent system of equations is replaced by steady state value iterations as usual. When the reward and transition distributions are not available the cross-values can be learned using standard on-policy RL methods from sampled transitions.
If the ground truth environment $e$ of each transition is available, the cross-value with respect to an arbitrary environment $e'$ can be updated using the tabular rule
\begin{equation} \label{eq: cross update}
v^{e'}(x_t; e) \shortleftarrow v^{e'}(x_t; e) + \eta \left( r_t + \gamma v_{t+1}^{e'}(x_{t+1}; e) - v^{e'}(x_t; e) \right)~,
\end{equation}
where the action $a_t$ is chosen to maximize the current estimate of the optimal value $v^{e'}(x_t; e')$ through on-policy techniques such as policy gradients. In practice, the environment $e'$ can be sampled before each action from the belief state $b_t$, resulting in a Thompson sampling policy.
\paragraph{Belief horizon sampling.}
As we have shown, it is straightforward to estimate the cross-value function when the ground truth environment $e$ is available at training time. However, in the most interesting settings the true environment can only be inferred through the agent's observations. In this situation, we propose the use of a method we call \emph{belief horizon sampling} where the "ground truth" environment is sampled from the terminal belief state of the episode $b_T$, with $T$ the last time point of the episode. This is equivalent to training with the actual ground truth for $T$ tending to infinity, as long as the $\pi$-controlled process satisfies the convergence conditions of the posterior to the maximum likelihood estimate. However, this approach also works well when the posterior is far from convergence since, loosely speaking, the sequence $\{\ x_\tau, a_\tau, r_\tau\}_{\tau=0}^{T}$ has high probability under all the conditional distributions $p(\{\ x_\tau, a_\tau, r_\tau\}_{\tau=0}^{T} \mid e')$ with $e'$ in the high probability region of the posterior $p(e \mid \{\ x_\tau, a_\tau, r_\tau\}_{\tau=0}^{T})$. In appendix B we show that this converges to the correct cross-values in the special case of deterministic inference.
\section{Modular Bayes-adaptive deep reinforcement learning}
From the point of view of deep RL, the simultaneous learning of cross-values through belief horizon sampling and of the value of future information using predictively cashed rewards results in a modular architecture with components trained with separate loss functions from the same experienced transitions, as visualized in Fig.~\ref{fig: diagram}. On one hand, the cross-values are estimated by a deep net that takes $e$, $e'$ and $x$ and outputs the cross-value (red module in the figure). On the other hand, another deep RL architecture is used to approximate the value of future information from predictively cashed rewards estimated using the cross-values (violet module). When inference cannot be performed in closed-form, an additional inference network needs to be trained using techniques such as variational inference \cite{zintgraf2019varibad} (blue module). Finally, the policy network is trained to maximize the estimated belief-augmented value (green module).
\section{Experiments}
In this section we investigate the performance of the approach in a series of problems with closed-form Bayesian updates. In particular, we focus on problems where there is either an action or a state whose purpose is to reveal the location of reward.
\paragraph{Disambiguation from a finite set of environments.}
\begin{figure}[ht]
\centering
\includegraphics[width=1\textwidth]{Tmaze.pdf}
\caption{Maze disambiguation experiment. A) The two possible environments. The green square represents reward (+1) while the red square represents punishment (-7). The blue/purple circles are disambiguation cues that indicate the location of the reward. The optimal course of action is to visit the cue and then go towards the reward. B) Results of tabular PCR q-learning. The black line denotes the median collected reward (q-loss for bottom panel) over 15 repetitions as a function of epoch. The shaded blue area shows the median absolute deviation from the median. Individual transparent lines are the result of individual repetitions. C) Results of the standard tabular q-learning algorithm. D) Visualization of the (median) trained policy of PCR-TD (left diagram) and TD (right diagram) in the maze with left reward. The terminal black dot signifies that the agent stays at the location until the end of the episode. The PCR-TD policy is optimal. The TD policy learns to approach the reward region and then stops as it cannot disambiguate reward from punishment, resulting in zero total collected reward.}
\label{fig: t maze result}
\end{figure}
We start with a single experimental set up inspired by animal neuroscience research \citep{friston2016active, wauthier2021learning}. The environment is a T-shaped maze with the bifurcation at the upper end (see Fig.~\ref{fig: t maze result} A). Each arm either contains a reward (+1) or a punishment (-7) while the other arm has the opposite. The bottom part of the maze contains a disambiguation cue that allows to distinguish whether the reward is in the right or in the left arm. Since the are only two possible environments (which we assume to have equal prior) and the cue and rewards are deterministic, the belief state is a single number in $\{0, 0.5, 1\}$. This allows us to organize the belief-augmented values into a $3 \times S$ table, where $S$ is the number of states (length of the maze). In this case, the dynamics of the belief state are very simple. The belief transitions from its starting $0.5$ to either $0$ or $1$ once either the cue or the reward/punishment locations are visited. The agent always starts in the middle of the maze, equally distant from the cue end and the reward/punishment ends. The agent can move up or down in the middle of the maze and down, left or right in the upper end. Each episode lasts $T = 20$ time steps. The agent collects reward/punishment at each time point as long as it is in the proper location in the maze. The optimal course of action is to reach the cue (information gathering) and then move to the other end to collect reward. In this problem there are $S \times 3$ possible belief-augmented states, where $S$ is the number of locations. As baseline, we use the classical (belief-augmented) tabular q-learning algorithm (Eq.~\ref{eq: belief-augmented update}) with $\epsilon$-greedy policy ($\epsilon = 0.5$) and decreasing learning rate $\eta_n = 0.01/(1 + 0.001 n)$, where $n$ is the epoch number. Our method is a tabular q-learning algorithm with PCR rewards. The value of future information is stored as a table of $S$ values since only the belief $0.5$ has non-zero value of future information. The cross-values are learned together with the value of future information from belief-augmented transitions without accessing the known ground truth environment using our belief horizon sampling approach. The value of future information is updated only after $100$ epochs so as to ensure some convergence of the cross q-values. Learning rates and $\epsilon$ were equal to the vanilla baseline. The results are visualized in Fig.~\ref{fig: t maze result}. These results are obtained using the greedy policy. The baseline algorithm quickly learns the correct deterministic dynamics but it does not learn the information gathering policy, leading to zero reward collection (see Fig.\ref{fig: t maze result} C). On the other hand, q-learning with PCR reward quickly learns the correct value function, leading to optimal reward collection in most repetitions (see Fig.\ref{fig: t maze result} B).
\paragraph{The treasure map problem.}
\begin{figure}[ht]
\centering
\includegraphics[width=0.8\textwidth]{SpatialFinal.pdf}
\caption{The "treasure map" experiment. A) Total training reward as function of the epoch of PCR-TD (red), TD (blue) and Vi-TD (green) for the three grid-world environments. The dashed line denotes the average over the runs. B) Example trajectory of trained PCR-TD. No other method learned how to systematically reach the map. }
\label{fig: spatial}
\end{figure}
We now move to a more complex task where the agent needs to find a "treasure map" that reveals the reward distribution in a 2d environment. This is conceptually very similar to the "treasure mountain" problem used in \citep{zintgraf2021exploration}. We formalize this task as a spatial multi-armed bandit, where the rewards follow Bernoulli distributions and each cell in the grid-world has an independent reward probability. As in the conventional Bernoulli multi-armed bandit problem, the belief state can be updated analytically and is given by the counting parameters of the beta posterior distribution of each cell. When the agent visits a cell, reward is sampled from the appropriate Bernoulli distribution. Furthermore, the agent also observes 5 additional simulated "pulls" that update the belief state but do not give reward (this is an operationalization of the act of looking around and exploring the cell). Importantly, the central cell is a "treasure map" that allows the agent to observe 5 simulated "pulls" for each cell. In our proposed method (denoted as PRC-TD), the value of future information is given by the output of a convolutional network with two hidden layers that takes the spatial array of belief variables as input. Specifically, the network outputs the $w(x_t, b_t)$ function as in Eq.~\ref{eq: function approximation with bound} and the bound $\mathcal{B}(x_t, b_t)$ is estimated using $M=1$ and $N=40$. Instead of learning the cross-values with belief horizon sampling we compute them with (cross-)value iterations (see Appendix A). As main baseline, we use a more standard deep belief-augmented TD learning approach where the total belief-augmented value is given by the output of a deep network trained on the original reward structure. Since our method exploits the output of the value iterations, we also compared the results with a more sophisticated baseline (VI-TD) with the belief-augmented value given by the sum of the network output and the output of the value iterations applied to the expected reward probabilities (as inferred by the belief state). We also included VI-Greedy and VI-Thompson baselines, which implement greedy and Thompson sampling policies respectively on the values obtained by value iteration. All networks were trained for $2000$ epochs. In each epoch, a batch of $10$ environments (reward probabilities) were generated from the beta prior ($a = 0.1, b = 1$) and controlled sequences were simulated from the $\epsilon$-greedy policies. The TD loss was summed over all transitions and then backpropagated. Training performance was stored for each epoch. We selected the epoch with highest training performance for the test run. Test performance was quantified as (non-discounted) average total reward collected during $20$ trials on newly generated environments (averaged over a batch of $10$ environments per trial). Additional details about task, training and architectures are given in Appendix C. The total reward as function of the epoch can be seen in Fig.~\ref{fig: spatial} A for the $7 \times 7$ environments. All results are given in Table \ref{tab: foraging} for the three environment sizes. Only our PCR-TD method was able to learn to visit the "treasure map" cell at the center in order to collect information and then switch to the optimal exploitation policy. A typical learned trajectory of this kind can be seen in Fig.~\ref{fig: spatial} B.
\begin{table}[]
\centering
\begin{tabular}{|l|l|l|l|l|l|}
\hline
& PRC-TD & TD & VI-TD & VI-Thompson & VI-Greedy \\ \hline
$3 \times 3$ & $\boldsymbol{10.78 \pm 0.24}$ & $7.30 \pm 0.31$ & $8.28 \pm 0.21$ & $10.41 \pm 0.16$ & $9.39 \pm 0.16$ \\ \hline
$5 \times 5$ & $\boldsymbol{15.17 \pm 0.22}$ & $10.46 \pm 0.37$ & $11.02 \pm 0.75$ & $11.72 \pm 0.12$ & $9.91 \pm 0.11$ \\ \hline
$7 \times 7$ & $\boldsymbol{15.33 \pm 0.16}$ & $10.42 \pm 0.26$ & $9.55 \pm 0.82$ & $10.41 \pm 0.15$ & $9.64 \pm 0.10$ \\ \hline
\end{tabular} \label{tab: foraging} \caption{Quantitative results of the treasure map experiment.}
\end{table}
\section{Conclusion \& Future work}
In the paper we showed that predictive reward cashing, with its associated policy that decouples the exploitation and exploration component, dramatically facilitates learning the Bayes-adaptive policy. While we developed the methods with a modular deep learning architecture in mind (see Fig.~\ref{fig: diagram}), in order to isolate the key contribution of the paper we limited our attention to settings where inference can be performed in closed-form. However, all approaches introduced here can in principle work together with approximate inference networks such as those used in \citep{zintgraf2019varibad} and \citep{zintgraf2021exploration}.
| {'timestamp': '2021-09-20T02:16:37', 'yymm': '2109', 'arxiv_id': '2109.08518', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08518'} | arxiv |
\section{Rules and Programs with Aggregates}\label{sec:aggregates}
This section addresses basic syntactic and semantic concepts of propositional logic programs
with aggregate expressions.
Section~\ref{subsec:syntax} introduces the syntax of aggregate expressions as well as
rules and logic programs including them, and further specifies the satisfaction
of these constructs by interpretations over propositional atoms.
In Section~\ref{subsec:satisfiability}, we investigate the complexity of deciding
whether an aggregate expression is satisfiable, i.e., checking the existence of some
interpretation satisfying the aggregate expression.
Finally, Section~\ref{subsec:monotonicity} turns to monotonicity properties of
aggregate expressions, which characterize their satisfaction w.r.t.\ evolving interpretations.
\subsection{Syntax and Satisfaction of Aggregates}\label{subsec:syntax}
In order to characterize the similarities and differences between
the main aggregate semantics proposed for propositional
logic programs
\begin{rev}\cite{depebr01a,fapfle11a,ferraris11a,gelzha19a,liposotr10a,marrem04a,pedebr07a}\end{rev},%
\footnote{%
\citeN{baleme11a}, \citeN{gehakalisc15a}, and \citeN{harlif19a} provide
first-order generalizations of the aggregate semantics in \cite{fapfle11a,ferraris11a},
while \citeN{gelzha19a} as well as \citeN{pedebr07a} genuinely accommodate first-order aggregates.
Specific aggregates in the form of cardinality and weight constraints
are elaborated in \cite{ferlif02a,liuyou13a,siniso02a}.}
we consider a set \ensuremath{\mathcal{P}}\xspace of \emph{propositional atoms}.
An \emph{aggregate expression} has the form\pagebreak[1]
\begin{equation}\label{eq:syntax:agg}
\mathtext{agg}\xspace\lits{w_1:p_1,\dots,w_n:p_n}\ensuremath{\odot}\xspace\ensuremath{w_0}\xspace
\end{equation}
where $n\geq 0$ and
\begin{itemize}
\item
$\mathtext{agg}\xspace\in\{\mathtext{sum}\xspace, \mathtext{times}\xspace, \mathtext{avg}\xspace, \mathtext{min}\xspace, \mathtext{max}\xspace\}$
is the name of an \emph{aggregation function},
\item
$\ensuremath{w_0}\xspace,w_1,\dots,w_n$ are integers,
where $w_i$ is a \emph{weight}, for $1 \leq i \leq n$, and
\ensuremath{w_0}\xspace is a \emph{bound},
\item
$p_1,\dots,p_n$ are propositional atoms from \ensuremath{\mathcal{P}}\xspace, and
\item
$\ensuremath{\odot}\xspace\in\{<,\leq,\geq,>,=,\neq\}$ is a comparison operator.%
\end{itemize}
\begin{rev}
Note that the common \mathtext{count}\xspace aggregation function is a special case of \mathtext{sum}\xspace such that
each weight is $1$.
Similarly, \mathtext{even}\xspace and \mathtext{odd}\xspace are special cases of \mathtext{times}\xspace such that each weight is $-1$, the bound is $1$, and $\ensuremath{\odot}\xspace$ is $=$ or $\neq$, respectively.
More liberal aggregate concepts also account for rational or
real numbers rather than integers, formulas instead of propositional atoms only,
as well as a second comparison operator and bound \cite{cafageiakakrlemarisc19a,ferraris11a}.
\end{rev}
For an aggregate expression~$A$ as in~\eqref{eq:syntax:agg},
by $\atoms{A}=\{p_1,\dots,p_n\}$ we denote the set of
propositional atoms occurring in~$A$.
A \emph{rule} has the form
\begin{equation}\label{eq:syntax:rule}
p_1 \vee \dots \vee p_m \leftarrow A_1 \wedge \dots \wedge A_n
\end{equation}
where $m\geq 0$, $n\geq 0$,
$p_1,\dots,p_m$ are propositional atoms, and
$A_1,\dots,A_n$ are aggregate expressions.
For a rule $r$ as in \eqref{eq:syntax:rule},
let $\head{r}=\{p_1,\dots,p_m\}$ and $\body{r}=\{A_1,\dots,A_n\}$
denote the \emph{head} and \emph{body} of~$r$.
We say that $r$ is \emph{non-disjunctive} if $|\head{r}|\leq 1$, in which
case the consequent of \eqref{eq:syntax:rule} is either of the form $p_1$
or~$\bot$, the latter representing an empty disjunction, i.e., a contradiction.
The rule~$r$ is also called a \emph{constraint} if $\head{r}=\emptyset$,
and a \emph{fact} if $\body{r}=\emptyset$,
where an empty conjunction in the antecedent of~\eqref{eq:syntax:rule} is denoted by $\top$.
While the bodies of rules do not explicitly allow for (negated) propositional atoms~$p$,
they can easily be represented by aggregate expressions of the form
$\mathtext{sum}\xspace\lits{1:p}>0$ or $\mathtext{sum}\xspace\lits{1:p}<1$,
so that the syntax at hand includes disjunctive rules \cite{eitgot95a,gellif91a}.
A \emph{program} \ensuremath{P}\xspace is a finite set of rules, and we call \ensuremath{P}\xspace a
\emph{non-disjunctive} program if each $r\in\ensuremath{P}\xspace$ is non-disjunctive.
An \emph{interpretation} $X\subseteq\ensuremath{\mathcal{P}}\xspace$ is represented by the set of
its true propositional atoms.
It allows us to map each aggregate expression~$A$ of the form~\eqref{eq:syntax:agg} to
a multiset $\multi{A}{X}=[w_i \mid 1\leq i\leq n,p_i\in X]$ of weights, and then to
an expression $\eval{A}{X}$
where
\begin{itemize}
\item for $\mathtext{agg}\xspace=\mathtext{sum}\xspace$, $\eval{A}{X} = \sum_{w\in\multi{A}{X}}w$,
\item for $\mathtext{agg}\xspace=\mathtext{times}\xspace$, $\eval{A}{X} = \prod_{w\in\multi{A}{X}}w$,
\item for $\mathtext{agg}\xspace=\mathtext{avg}\xspace$,
$\eval{A}{X} = \left\{
\begin{array}{@{}l@{}l@{}}
\sum_{w\in\multi{A}{X}}w/|\multi{A}{X}|
& \text{, if $|\multi{A}{X}| > 0$,}
\\
\ensuremath{\varepsilon}\xspace
& \text{, if $|\multi{A}{X}| = 0$,}
\end{array}
\right.$
\item for $\mathtext{agg}\xspace=\mathtext{min}\xspace$, $\eval{A}{X} = \min\{w \mid w\in\multi{A}{X}\}$, and
\item for $\mathtext{agg}\xspace=\mathtext{max}\xspace$, $\eval{A}{X} = \max\{w \mid w\in\multi{A}{X}\}$.%
\end{itemize}
\begin{rev}
Note that the average over a (non-empty) multiset of weights
can be a rational number, e.g., $(1+2)/|[1,2]|=3/2$.
The \ensuremath{\varepsilon}\xspace outcome of taking the average over the
empty multiset stands for undefined,
while other aggregation functions map the empty multiset to their neutral elements:
$\sum_{w\in[]}w=0$, $\prod_{w\in[]}w=1$, $\min\{w \mid w\in[]\}=\infty$,
and $\max\{w \mid w\in[]\}=-\infty$.
\end{rev}
For
$\ensuremath{\odot}\xspace\in\{<,\leq,\geq,>,=,\neq\}$,
by $X\models (\eval{A}{X} \ensuremath{\odot}\xspace \ensuremath{w_0}\xspace)$ we denote that $\eval{A}{X} \ensuremath{\odot}\xspace \ensuremath{w_0}\xspace$ holds,
and write $X\ensuremath{\not\models}\xspace (\eval{A}{X} \ensuremath{\odot}\xspace \ensuremath{w_0}\xspace)$ otherwise.
Note that
$X\models (\infty \geq \ensuremath{w_0}\xspace)$,
$X\models (\infty >\nolinebreak \ensuremath{w_0}\xspace)$,
$X\models (\infty \neq \ensuremath{w_0}\xspace)$,
$X\models (-\infty < \ensuremath{w_0}\xspace)$,
$X\models (-\infty \leq \ensuremath{w_0}\xspace)$, and
$X\models (-\infty \neq \ensuremath{w_0}\xspace)$
apply independently of the (integer) bound \ensuremath{w_0}\xspace, while
$X\ensuremath{\not\models}\xspace (\infty < \ensuremath{w_0}\xspace)$,
$X\ensuremath{\not\models}\xspace (\infty \leq \ensuremath{w_0}\xspace)$,
$X\ensuremath{\not\models}\xspace (\infty = \ensuremath{w_0}\xspace)$,
$X\ensuremath{\not\models}\xspace (-\infty \geq \ensuremath{w_0}\xspace)$,
$X\ensuremath{\not\models}\xspace (-\infty > \ensuremath{w_0}\xspace)$,
$X\ensuremath{\not\models}\xspace (-\infty = \ensuremath{w_0}\xspace)$, and
$X\ensuremath{\not\models}\xspace (\ensuremath{\varepsilon}\xspace \ensuremath{\odot}\xspace \ensuremath{w_0}\xspace)$, for $\ensuremath{\odot}\xspace\in\{<,\leq,\geq,>,=,\neq\}$,
are the cases in which $\eval{A}{X} \ensuremath{\odot}\xspace \ensuremath{w_0}\xspace$ cannot hold.
An aggregate expression~$A$ of the form~\eqref{eq:syntax:agg} is \emph{satisfied}
by an interpretation~$X$,
also written $X\models A$, if $X\models (\eval{A}{X} \ensuremath{\odot}\xspace \ensuremath{w_0}\xspace)$,
and otherwise $X\ensuremath{\not\models}\xspace A$ denotes that $A$ is \emph{unsatisfied} by~$X$.
The body of a rule~$r$ as in~\eqref{eq:syntax:rule} is satisfied by~$X$,
written $X\models\body{r}$,
if $X\models A$ for each $A\in\body{r}$,
and unsatisfied by~$X$, indicated by $X\ensuremath{\not\models}\xspace \body{r}$, otherwise.
Likewise, the head of~$r$ is satisfied by $X$, $X\models\head{r}$,
if $\head{r}\cap X \neq \emptyset$, and otherwise $X\ensuremath{\not\models}\xspace\head{r}$
expresses that $\head{r}$ is unsatisfied by~$X$.
The rule $r$ is satisfied by~$X$, i.e., $X\models r$,
if $X\models \body{r}$ implies $X\models \head{r}$,
while $r$ is unsatisfied by~$X$, $X\ensuremath{\not\models}\xspace r$, otherwise.
Note that we have $X\ensuremath{\not\models}\xspace \head{r}$ when $r$ is a constraint,
so that $X\ensuremath{\not\models}\xspace \body{r}$ is necessary to satisfy a constraint~$r$ by~$X$.
For a fact~$r$, $X\models \body{r}$ is instantaneous, and $r$ is satisfied by~$X$
only if $X\models \head{r}$.
Finally, $X$ is a \emph{model} of a program \ensuremath{P}\xspace, denoted by $X\models \ensuremath{P}\xspace$,
if $X\models r$ for every $r\in\ensuremath{P}\xspace$,
and we write $X\ensuremath{\not\models}\xspace \ensuremath{P}\xspace$ otherwise.
\begin{example}\label{ex:model}
Consider the program $\ensuremath{P}\xspace_1$ consisting of three rules as follows:\pagebreak[1]
\begin{alignat}{1}
\label{eq1:r1}\tag{$r_1$}
& p \leftarrow \mathtext{sum}\xspace\lits{1:p,-1:q} \geq 0
\\
\label{eq1:r2}\tag{$r_2$}
& p \leftarrow \mathtext{sum}\xspace\lits{1:q} > 0
\\
\label{eq1:r3}\tag{$r_3$}
& q \leftarrow \mathtext{sum}\xspace\lits{1:p} > 0
\end{alignat}
Intuitively, rule $r_1$ requires $p$ to be true if $p$ is true or $q$ is false, rule $r_2$ requires $p$ true if $q$ is true, and rule $r_3$ requires $q$ true if $p$ is true.
The four interpretations over the set $\ensuremath{\mathcal{P}}\xspace=\{p,q\}$ of propositional atoms are
$X_1=\emptyset$, $X_2=\{p\}$, $X_3=\{q\}$, and $X_4=\{p,q\}$.
We have that $\eval{\mathtext{sum}\xspace\lits{1:p,-1:q} \geq 0}{X_1}=0$,
so that $X_1\models \body{$\ref{eq1:r1}$}$ but $X_1\ensuremath{\not\models}\xspace \head{$\ref{eq1:r1}$}$.
For $X_2$ and $X_3$,
$\eval{\mathtext{sum}\xspace\lits{1:p} > 0}{X_2}=1$ and
$\eval{\mathtext{sum}\xspace\lits{1:q} > 0}{\linebreak[1]X_3}=1$ yield
$X_2\models \body{$\ref{eq1:r3}$}$ and
$X_3\models \body{$\ref{eq1:r2}$}$, while
$X_2\ensuremath{\not\models}\xspace \head{r_3}$ and
$X_3\ensuremath{\not\models}\xspace \head{r_2}$.
That is, neither $X_1$, $X_2$, nor $X_3$ is a model of $\ensuremath{P}\xspace_1$.
The remaining interpretation $X_4$ is such that
$X_4\models \body{r}$ and $X_4\models \head{r}$ for every $r\in\ensuremath{P}\xspace_1$,
so that $X_4$ is a model of~$\ensuremath{P}\xspace_1$.
\end{example}
\subsection{Satisfiability of Aggregates}\label{subsec:satisfiability}
With the syntax and satisfaction of aggregate expressions at hand,
let us turn to the complexity of deciding whether an aggregate expression~$A$ is \emph{satisfiable},
i.e., checking whether there is some interpretation $X\subseteq\ensuremath{\mathcal{P}}\xspace$ such that
$X\models A$.
To this end,
we first note that determining the smallest and greatest feasible outcome,
denoted by $\lb{A}$ and $\ub{A}$,
of the aggregation function in~$A$ of the form~\eqref{eq:syntax:agg} can be accomplished as follows (where $\ensuremath{\varepsilon}\xspace$ denotes an \emph{undefined outcome}):
\begin{itemize}
\item for $\mathtext{agg}\xspace=\mathtext{sum}\xspace$,
$\begin{array}[t]{@{}l@{}c@{}l@{}}
\lb{A} & {} = {} & \sum_{p\in\atoms{A},\eval{A}{\{p\}}<0}\eval{A}{\{p\}}\text{,}
\\
\ub{A} & {} = {} & \sum_{p\in\atoms{A},\eval{A}{\{p\}}>0}\eval{A}{\{p\}}\text{,}
\end{array}$
\item for $\mathtext{agg}\xspace=\mathtext{times}\xspace$,
let $\begin{array}[t]{@{}l@{}c@{}l@{}}
\multicolumn{3}{@{}l@{}}{
\begin{array}[t]{@{}r@{}c@{}l@{}}
\pi_\pm & {} = {} & \prod_{p\in\atoms{A},\eval{A}{\{p\}}\neq 0}\eval{A}{\{p\}}\text{,}
\\
\pi_0 & {} = {} & \prod_{p\in\atoms{A},\eval{A}{\{p\}}= 0}\eval{A}{\{p\}}\text{, and}
\\
w & {} = {} & \max\{\eval{A}{\{p\}} \mid p\in\atoms{A}, \eval{A}{\{p\}}< 0\} \text{ in}
\end{array}}
\\
\lb{A} & {} = {} &
\left\{
\begin{array}{@{}l@{}l@{}}
\pi_\pm
& \text{, if $\pi_\pm < 0$,}
\\
\pi_\pm/w
& \text{, if $\pi_\pm > 0$ and $w\neq-\infty$,}
\\
\pi_0
& \text{, if $w=-\infty$,}
\end{array}
\right.
\\
\ub{A} & {} = {} &
\left\{
\begin{array}{@{}l@{}l@{}}
\pi_\pm
& \text{, if $\pi_\pm > 0$,}
\\
\pi_\pm/w
& \text{, if $\pi_\pm < 0$,}
\end{array}
\right.
\end{array}$
\item for $\mathtext{agg}\xspace=\mathtext{avg}\xspace$,
$\begin{array}[t]{@{}l@{}c@{}l@{}}
\lb{A} & {} = {} &
\left\{
\begin{array}{@{}l@{}l@{}}
\min\{\eval{A}{\{p\}} \mid p\in\atoms{A}\}
& \text{, if $\atoms{A}\neq\emptyset$,}
\\
\ensuremath{\varepsilon}\xspace
& \text{, if $\atoms{A}=\emptyset$,}
\end{array}
\right.
\\
\ub{A} & {} = {} &
\left\{
\begin{array}{@{}l@{}l@{}}
\max\{\eval{A}{\{p\}} \mid p\in\atoms{A}\}
& \text{, if $\atoms{A}\neq\emptyset$,}
\\
\ensuremath{\varepsilon}\xspace
& \text{, if $\atoms{A}=\emptyset$,}
\end{array}
\right.
\end{array}$
\item for $\mathtext{agg}\xspace=\mathtext{min}\xspace$,
$\begin{array}[t]{@{}l@{}c@{}l@{}}
\lb{A} & {} = {} & \min\{\eval{A}{\{p\}} \mid p\in\atoms{A}\}\text{,}
\\
\ub{A} & {} = {} & \infty\text{,}
\end{array}$
\item for $\mathtext{agg}\xspace=\mathtext{max}\xspace$,
$\begin{array}[t]{@{}l@{}c@{}l@{}}
\lb{A} & {} = {} & -\infty\text{,}
\\
\ub{A} & {} = {} & \max\{\eval{A}{\{p\}} \mid p\in\atoms{A}\}\text{.}
\end{array}$
\end{itemize}
For the \mathtext{sum}\xspace aggregation function, the lower and upper bound are obtained
by summing over all atoms associated with a negative or positive weight, respectively.
In case of \mathtext{avg}\xspace, we just pick an atom with the smallest or greatest
weight, provided that some atom occurs in~$A$.
For \mathtext{min}\xspace and \mathtext{max}\xspace, either the upper or the lower bound is trivial, and
the respective counterpart is obtained by applying the aggregation function
to all weights.
The \mathtext{times}\xspace aggregation function is the most sophisticated,
as negative weights may swap the sign of its outcome.
If
the product $\pi_\pm$ over all atoms with a non-zero weight is negative,
$\pi_\pm$ yields the lower bound,
while it
is otherwise divided by the greatest negative weight~$w$
(i.e., smallest absolute value), provided that it exists, to achieve a negative outcome.
In the remaining case that no negative outcome is feasible, the lower bound
\begin{rev}$\pi_0$\end{rev} is zero when there is some atom with the weight zero, or it defaults to one.
Finally, the upper bound is given by $\pi_\pm$ if it is positive,
and otherwise we divide $\pi_\pm$ by the greatest negative weight~$w$ to obtain the
greatest positive outcome.
Given $\lb{A}$ and $\ub{A}$ for an aggregate expression~$A$
of the form~\eqref{eq:syntax:agg},
$\lb{A}=\ub{A}=\ensuremath{\varepsilon}\xspace$ indicates that $A$ is unsatisfiable
regardless of the comparison operator \ensuremath{\odot}\xspace,
which applies only when $A$ matches $\mathtext{avg}\xspace\lits{}\ensuremath{\odot}\xspace\ensuremath{w_0}\xspace$.
Otherwise,
if the comparison operator \ensuremath{\odot}\xspace is $<$ or $\leq$,
we have that $A$ is satisfiable if and only if\xspace $\lb{A}<\ensuremath{w_0}\xspace$ or
$\lb{A}\leq\ensuremath{w_0}\xspace$ holds, respectively.
The comparison operators $>$ and $\geq$ are dual,
and an aggregate expression~$A$ including one of them is satisfiable if and only if\xspace
either $\ub{A}>\ensuremath{w_0}\xspace$ or
$\ub{A}\geq\ensuremath{w_0}\xspace$ holds.
In case \ensuremath{\odot}\xspace is $\neq$, we have that $A$ is satisfiable if and only if\xspace
$\lb{A}\neq\ensuremath{w_0}\xspace$ or $\ub{A}\neq\ensuremath{w_0}\xspace$ holds.
These considerations show that checking the satisfiability of an
aggregate expression with a comparison operator other than $=$ is tractable, i.e.,
in the complexity class~\mathtext{P}\xspace.
The situation gets more involved when \ensuremath{\odot}\xspace is $=$, where the aggregation functions
\mathtext{min}\xspace and \mathtext{max}\xspace still allow for tractable decisions:
an aggregate expression~$A$ with \mathtext{agg}\xspace either \mathtext{min}\xspace or \mathtext{max}\xspace and $=$ for \ensuremath{\odot}\xspace
is satisfiable if and only if\xspace $\eval{A}{\{p\}}=\ensuremath{w_0}\xspace$ for some $p\in\atoms{A}$.
Unlike that, for $\mathtext{agg}\xspace=\mathtext{sum}\xspace$ and $\mathtext{agg}\xspace=\mathtext{times}\xspace$, deciding whether there
is some (non-empty) subset~$X$ of $\atoms{A}$ such that $\eval{A}{X}=\ensuremath{w_0}\xspace$
amounts to the \mathtext{NP}\xspace-complete \emph{subset sum} or \emph{subset product}
problem \cite{garjoh79}.
Concerning $\mathtext{agg}\xspace=\mathtext{avg}\xspace$,
subset sum can be reduced to checking whether an aggregate expression~$A$ with bound $0$ is satisfiable:
$\mathtext{sum}\xspace\lits{w_1:p_1,\dots,w_n:p_n}=\ensuremath{w_0}\xspace$
with positive integers $w_0,\dots,w_n$ is satisfiable if and only if\xspace
$\mathtext{avg}\xspace\lits{w_1:p_1,\dots,w_n:p_n,-\ensuremath{w_0}\xspace:p}=0$ is satisfiable,
where $p\in\ensuremath{\mathcal{P}}\xspace$ is some new atom.
As constants like $\ensuremath{w_0}\xspace+1$ can be added to each weight and the bound
of an aggregate expression with \mathtext{avg}\xspace,
we have \mathtext{NP}\xspace-completeness of checking whether $A$ with $\mathtext{agg}\xspace\in\{\mathtext{sum}\xspace,\mathtext{times}\xspace,\mathtext{avg}\xspace\}$
and $=$ for \ensuremath{\odot}\xspace is satisfiable,
which applies regardless of whether the included weights and bound are restricted to
be positive or negative integers only.
\begin{example}\label{ex:satisfiable}
Consider aggregate expressions constructed as follows:\pagebreak[1]
\begin{alignat}{1}
\label{eq2:A1}\tag{$A_1$}
\mathtext{sum}\xspace\lits{1:p_1,3:p_2,3:p_3,-4:p_4} \ensuremath{\odot}\xspace \ensuremath{w_0}\xspace
\\
\label{eq2:A2}\tag{$A_2$}
\mathtext{times}\xspace\lits{0:p_1,3:p_2,-2:p_3,-4:p_4} \ensuremath{\odot}\xspace \ensuremath{w_0}\xspace
\\
\label{eq2:A3}\tag{$A_3$}
\mathtext{avg}\xspace\lits{1:p_1,2:p_2,3:p_3,6:p_4} \ensuremath{\odot}\xspace \ensuremath{w_0}\xspace
\\
\label{eq2:A4}\tag{$A_4$}
\mathtext{min}\xspace\lits{0:p_1,3:p_2,-2:p_3,-4:p_4} \ensuremath{\odot}\xspace \ensuremath{w_0}\xspace
\\
\label{eq2:A5}\tag{$A_5$}
\mathtext{max}\xspace\lits{1:p_1,3:p_2,3:p_3,-4:p_4} \ensuremath{\odot}\xspace \ensuremath{w_0}\xspace
\end{alignat}
By summing up negative or positive weights, respectively,
we get $\lb{A_1}=-4$ and $\ub{A_1}=7$.
Hence, $A_1$ is satisfiable
for ${\ensuremath{\odot}\xspace}={<}$ and any bound \ensuremath{w_0}\xspace greater than $-4$,
for ${\ensuremath{\odot}\xspace}={\leq}$ and \ensuremath{w_0}\xspace not smaller than $-4$,
for ${\ensuremath{\odot}\xspace}={\geq}$ and \ensuremath{w_0}\xspace not greater than $7$,
for ${\ensuremath{\odot}\xspace}={>}$ and \ensuremath{w_0}\xspace smaller than $7$, and
for ${\ensuremath{\odot}\xspace}={\neq}$ with any bound~\ensuremath{w_0}\xspace.
When \ensuremath{\odot}\xspace is $=$, satisfiability is more intricate,
and one can check that $A_1$ is satisfiable for bounds \ensuremath{w_0}\xspace other than
$-2$ and $5$ in the range from $\lb{A_1}=-4$ to $\ub{A_1}=7$.
The product of non-zero weights, two of which are negative,
for $A_2$ is $24$.
To obtain the lower bound for $A_2$, we have thus to divide by
the greatest negative weight $-2$, leading to $\lb{A_2}=-12$,
while $\ub{A_2}=24$.
For $\ensuremath{\odot}\xspace\in\{<,\leq,\geq,>,\neq\}$,
satisfiability is determined similar to $A_1$,
yet w.r.t.\ the lower and upper bound for $A_2$.
When \ensuremath{\odot}\xspace is $=$, we have that $A_2$ is satisfiable for
$\ensuremath{w_0}\xspace\in\{-12,\linebreak[1]-6,\linebreak[1]-4,\linebreak[1]-2,
\linebreak[1]0,\linebreak[1]1,\linebreak[1]3,\linebreak[1]8,\linebreak[1]24\}$,
and unsatisfiable otherwise.
Concerning $A_3$, we get $\lb{A_3}=1$ and $\ub{A_3}=6$,
and satisfiability for $\ensuremath{\odot}\xspace\in\{<,\leq,\geq,>,\neq\}$
w.r.t.\ these bounds is analogous.
As $1$, $2$, $3$, $4$, and $6$ are the feasible integer outcomes,
$A_3$ with $=$ for \ensuremath{\odot}\xspace is satisfiable for such outcomes as \ensuremath{w_0}\xspace,
and unsatisfiable for any other bound~\ensuremath{w_0}\xspace.
Turning to $A_4$ and $A_5$,
the lower and upper bounds are
$\lb{A_4}=-4$, $\ub{A_4}=\infty$, $\lb{A_5}=-\infty$, and $\ub{A_5}=3$.
For $\ensuremath{\odot}\xspace\in\{<,\leq,\geq,>,\neq\}$,
satisfiability is determined similar to $A_1$,
where $A_4$ is satisfiable for ${\ensuremath{\odot}\xspace}={\geq}$, ${\ensuremath{\odot}\xspace}={>}$, and ${\ensuremath{\odot}\xspace}={\neq}$
regardless of the bound \ensuremath{w_0}\xspace,
and likewise $A_5$ for ${\ensuremath{\odot}\xspace}={<}$, ${\ensuremath{\odot}\xspace}={\leq}$, and ${\ensuremath{\odot}\xspace}={\neq}$.
When \ensuremath{\odot}\xspace is ${=}$, we have that $A_4$ and $A_5$ are satisfiable for
bounds \ensuremath{w_0}\xspace matching their contained weights, i.e.,
$\ensuremath{w_0}\xspace\in\{-4,-2,0,3\}$ or $\ensuremath{w_0}\xspace\in\{-4,1,3\}$, respectively.
\end{example}
\subsection{Monotonicity of Aggregates}\label{subsec:monotonicity}
A relevant property related to satisfiability concerns the
(non)monotonicity of aggregate expressions (cf.\ \citeNP{fapfle11a,liposotr10a}) \begin{rev}and the notion of convex aggregates introduced by \citeN{liutru06a}\end{rev}.
An aggregate expression~$A$ is \emph{convex} if $X \subseteq Y$, $X \models A$ and $Y \models A$ imply $Z \models A$ for any interpretation~$Z$ between $X$ and $Y$, that is,
$X\models A$ and $Y\models A$ yield $Z\models A$ for all $X\subseteq Z\subseteq Y$.
Otherwise, the aggregate expression is \emph{non-convex}.
Two frequent special cases of convexity are given by
\emph{monotone} and \emph{anti-monotone} aggregate expressions,
for which $X\models A$ implies that $\ensuremath{\mathcal{P}}\xspace\models A$ or
$\emptyset\models A$, respectively.
That is, a monotone aggregate expression~$A$ remains satisfied when adding
(true) propositional atoms to an interpretation~$X$ satisfying~$A$,
while the satisfaction of an anti-monotone~$A$ is preserved when
propositional atoms from $X$ are falsified.
Specific monotonicity properties that follow from the aggregation
functions and comparison operators of aggregate expressions are summarized
in Figure~\ref{fig:convex} in the introduction.
For the \mathtext{sum}\xspace and \mathtext{times}\xspace aggregation functions,
restrictions to positive or negative weights and bounds
affect monotonicity, and the subscripts $_+$ and $_-$ indicate
such particular conditions.
Unlike that, the signs of weights and bounds are immaterial for
\mathtext{avg}\xspace, \mathtext{min}\xspace, and \mathtext{max}\xspace, and we also disregard special cases like the
unsatisfiability of $\mathtext{avg}\xspace\lits{}\ensuremath{\odot}\xspace\ensuremath{w_0}\xspace$, which makes aggregate expressions
with \mathtext{avg}\xspace over the empty multiset monotone, anti-monotone, and convex.
While aggregate expressions with \mathtext{sum}\xspace are in general non-convex regardless of the comparison
operator, restrictions to positive or negative weights and bounds make them convex
for comparison operators other than $\neq$,
given that the sum of weights can merely increase or decrease when
propositional atoms are added to an interpretation.
More specifically, positive weights and bounds lead to an anti-monotone aggregate expression
for $<$ or $\leq$ as comparison operator, and to a monotone aggregate expression for $\geq$
or $>$, where dual properties apply in case of negative weights and bounds only.
For either restriction,
the comparison operator~$\neq$ does not lead to more regular monotonicity though
because a respective aggregate expression may be satisfied by the empty interpretation~$\emptyset$,
become unsatisfied when atoms whose weights sum up to the bound~\ensuremath{w_0}\xspace are made true,
and then get satisfied again by adding further propositional atoms to the interpretation.
Aggregate expressions with \mathtext{times}\xspace are generally non-convex, even if weights and bounds are
restricted to be negative only.
This is due to the condition that negative weights swap the sign of the outcome,
so that satisfaction may switch back and forth for any comparison operator.
With positive weights and bounds (excluding zero),
the outcome increases when more propositional atoms are included in an interpretation.
Hence, such aggregate expressions yield similar monotonicity as \mathtext{sum}\xspace with positive weights and bounds,
and entries for $\mathtext{sum}\xspace_+$ and $\mathtext{times}\xspace_+$ in Figure~\ref{fig:convex} match.
For the remaining aggregation functions, \mathtext{avg}\xspace, \mathtext{min}\xspace, and \mathtext{max}\xspace,
the signs of weights do not make a difference regarding monotonicity.
In fact, the outcome of \mathtext{avg}\xspace may increase or decrease when propositional atoms
are added to an interpretation, so that corresponding aggregate expressions are generally
non-convex regardless of the comparison operator.
The outcomes of \mathtext{min}\xspace and \mathtext{max}\xspace monotonically decrease or increase, respectively,
with growing interpretations, leading to (an\-ti\nobreakdash-)\-mo\-no\-to\-ni\-ci\-ty for the comparison
operators $<$ or $\leq$ and $\geq$ or $>$, as well as convexity for~$=$.
Similar to the other aggregation functions,
no matter whether weights and bounds are positive, negative, or unrestricted,
$\neq$ as comparison operator makes aggregate expressions with \mathtext{min}\xspace and \mathtext{max}\xspace
non-convex in general,
as they are satisfied by the empty interpretation~$\emptyset$, may become
unsatisfied and then satisfied again when the interpretation is extended
by propositional atoms.
\begin{example}\label{ex:monotonicity}
The aggregate expression\pagebreak[1]
\begin{alignat}{1}
\label{eq3:A6}\tag{$A_6$}
\mathtext{sum}\xspace\lits{1:p_1,2:p_2,2:p_3,3:p_4} \ensuremath{\odot}\xspace 5
\end{alignat}
is monotone for ${\ensuremath{\odot}\xspace}={\geq}$ or ${\ensuremath{\odot}\xspace}={>}$,
anti-monotone for ${\ensuremath{\odot}\xspace}={<}$ or ${\ensuremath{\odot}\xspace}={\leq}$,
convex when \ensuremath{\odot}\xspace is $=$, and
non-convex with $\neq$ for \ensuremath{\odot}\xspace.
The three mutually incomparable interpretations $\{p_1,p_2,p_3\}$,
$\{p_2,p_4\}$, and $\{p_3,p_4\}$ satisfying $A_6$ with $=$ for \ensuremath{\odot}\xspace
meet the condition for convexity, but neither the additional requirements
for monotonicity nor anti-monotonicity.
Moreover, they witness the non-convexity of $A_6$ when \ensuremath{\odot}\xspace is $\neq$,
as there are interpretations with both fewer and more propositional atoms such that
their (positive) weights do not sum up to the bound~$5$ and satisfy~$A_6$
for ${\ensuremath{\odot}\xspace}={\neq}$
\end{example}
\section{Answer Set Semantics of Aggregates}\label{sec:answersets}
This section characterizes the main answer set semantics proposed for
logic programs with aggregate expressions
\begin{rev}\cite{depebr01a,fapfle11a,ferraris11a,gelzha19a,liposotr10a,marrem04a,pedebr07a}\end{rev}.
Their common essence is to extend the notion of provability of
the true propositional atoms in a model to programs that include aggregate expressions.
In Section~\ref{subsec:model}, we review aggregate semantics based on
$\subseteq$-minimal models of a program reduct.
Section~\ref{subsec:construction} then gathers several constructive approaches
to capture the provability of true atoms.
Correspondences between different aggregate semantics w.r.t.\ the monotonicity of
aggregate expressions are analyzed in Section~\ref{subsec:relationships}.
\subsection{Model-based Semantics}\label{subsec:model}
In line with \cite{gellif88b,gellif91a},
we let the \emph{reduct} of a program \ensuremath{P}\xspace relative to
an interpretation $X\subseteq\ensuremath{\mathcal{P}}\xspace$ be
$\reduct{\ensuremath{P}\xspace}{X}=\{r\in\ensuremath{P}\xspace \mid X\models\body{r}\}$.
In other words, the reduct is obtained from \ensuremath{P}\xspace by dropping rules
whose bodies are unsatisfied by~$X$.
(Note that the original definition of reduct provided by \citeN{gellif88b} also removes negative literals, which are not part of the language considered in this paper.)
Hence, we have that $X$ is a model of \ensuremath{P}\xspace if and only if\xspace $X$ is a model of $\reduct{\ensuremath{P}\xspace}{X}$.
Different answer set semantics inspect the reduct in specific ways to
check the provability of true atoms.
We note that our reduct notion matches the definitions given by \citeN{fapfle11a} and by \citeN{ferraris11a}, as it does not eliminate
false atoms or falsified expressions, respectively.
The latter would happen for negated atoms with the seminal Gelfond-Lifschitz
reduct \cite{gellif88b,gellif91a}, and entirely with the reduct by \citeN{ferraris11a}.
However, the syntax of aggregate expressions and rules in
\eqref{eq:syntax:agg}--\eqref{eq:syntax:rule} is chosen such that specific
reducts do not make a difference regarding answer sets.
The model-theoretic approaches by
\begin{rev}Faber, Pfeifer and Leone \citeyear{fapfle11a}\end{rev}
and \citeN{ferraris11a} agree in
focusing on $\subseteq$-minimal models of the reduct $\reduct{\ensuremath{P}\xspace}{X}$
of a program \ensuremath{P}\xspace relative to an interpretation $X\subseteq\ensuremath{\mathcal{P}}\xspace$.
We use the convention to indicate particular semantics by their proposers,
and call $X$ an \emph{\mathtext{FFLP}\xspace-answer set} of \ensuremath{P}\xspace if $X$ is a $\subseteq$-minimal
model of $\reduct{\ensuremath{P}\xspace}{X}$.
That is, an \mathtext{FFLP}\xspace-answer set of \ensuremath{P}\xspace fulfills two conditions:
\begin{itemize}
\item $X$ is a model of \ensuremath{P}\xspace, i.e., $X\models \ensuremath{P}\xspace$, and
\item for any interpretation $Y\subset X$, we have that $Y\ensuremath{\not\models}\xspace\reduct{\ensuremath{P}\xspace}{X}$.
\end{itemize}
While the first condition is equivalent to $X\models \reduct{\ensuremath{P}\xspace}{X}$,
exchanging $Y\ensuremath{\not\models}\xspace\reduct{\ensuremath{P}\xspace}{X}$ for $Y\ensuremath{\not\models}\xspace \ensuremath{P}\xspace$ in the second
condition would yield a different semantics.
\begin{example}\label{ex:unsatisfiable}
Consider the program $\ensuremath{P}\xspace_2$ containing the following two rules:\pagebreak[1]
\begin{alignat}{1}
\label{eq4:r4}\tag{$r_4$}
& p \leftarrow \mathtext{sum}\xspace\lits{1:p} > 0
\\
\label{eq4:r5}\tag{$r_5$}
& p \leftarrow \mathtext{sum}\xspace\lits{1:p} < 1
\end{alignat}
Intuitively, rule $r_4$ requires $p$ true if $p$ is true, and rule $r_5$ requires $p$ true if $p$ is false.
The interpretation $X_1=\emptyset$ is not a model of $\ensuremath{P}\xspace_2$
because $\eval{\mathtext{sum}\xspace\lits{1:p} < 1}{X_1}=0$ yields that
$X_1\models \body{$\ref{eq4:r5}$}$ but $X_1\ensuremath{\not\models}\xspace \head{$\ref{eq4:r5}$}$.
For $X_2=\{p\}$, we have that $\eval{\mathtext{sum}\xspace\lits{1:p} < 1}{X_2}=1$,
so that $X_2\ensuremath{\not\models}\xspace \body{$\ref{eq4:r5}$}$.
Hence, $\reduct{\ensuremath{P}\xspace_2}{X_2}$ consists of the rule \ref{eq4:r4} only.
Since $X_1\subset X_2$ is such that $\eval{\mathtext{sum}\xspace\lits{1:p} > 0}{X_1}=0$,
$X_1\ensuremath{\not\models}\xspace \body{$\ref{eq4:r4}$}$, and $X_1\models \reduct{\ensuremath{P}\xspace_2}{X_2}$,
the interpretation $X_1$ shows that $X_2$ is not a $\subseteq$-minimal
model of $\reduct{\ensuremath{P}\xspace_2}{X_2}$.
As a consequence, the program $\ensuremath{P}\xspace_2$ does not have any \mathtext{FFLP}\xspace-answer set.
However, note that $X_2$ is the $\subseteq$-minimal model of $\ensuremath{P}\xspace_2$
in view of $X_2\models \ensuremath{P}\xspace_2$ and $X_1\ensuremath{\not\models}\xspace \ensuremath{P}\xspace_2$.
\end{example}
\begin{example}\label{ex:minmodel}
Reconsider the program~$\ensuremath{P}\xspace_1$ from Example~\ref{ex:model}:\pagebreak[1]
\begin{alignat}{1}
\tag{\ref{eq1:r1}}
& p \leftarrow \mathtext{sum}\xspace\lits{1:p,-1:q} \geq 0
\\
\tag{\ref{eq1:r2}}
& p \leftarrow \mathtext{sum}\xspace\lits{1:q} > 0
\\
\tag{\ref{eq1:r3}}
& q \leftarrow \mathtext{sum}\xspace\lits{1:p} > 0
\end{alignat}
As checked in Example~\ref{ex:model},
we have that $X_4=\{p,q\}$ is the unique model of $\ensuremath{P}\xspace_1$
(over the set $\ensuremath{\mathcal{P}}\xspace=\{p,q\}$ of propositional atoms).
Given that $X_4\models \body{r}$ for every $r\in\ensuremath{P}\xspace_1$,
we obtain $\reduct{\ensuremath{P}\xspace_1}{X_4}=\ensuremath{P}\xspace_1$,
which shows that $X_4$ is an \mathtext{FFLP}\xspace-answer set of $\ensuremath{P}\xspace_1$.
\end{example}
\begin{example}\label{ex:subsum}
Consider the program $\ensuremath{P}\xspace_3$ consisting of the following rules:\pagebreak[1]
\begin{alignat}{1}
\label{eq6:r6}\tag{$r_6$}
& x_1 \leftarrow \mathtext{sum}\xspace\lits{1:y_1} < 1
\\
\label{eq6:r7}\tag{$r_7$}
& y_1 \leftarrow \mathtext{sum}\xspace\lits{1:x_1} < 1
\\
\label{eq6:r8}\tag{$r_8$}
& x_2 \leftarrow \mathtext{sum}\xspace\lits{1:y_2} < 1
\\
\label{eq6:r9}\tag{$r_9$}
& y_2 \leftarrow \mathtext{sum}\xspace\lits{1:x_2} < 1
\\
\label{eq6:r10}\tag{$r_{10}$}
& z_1 \leftarrow \mathtext{sum}\xspace\lits{1:p} > 0
\\
\label{eq6:r11}\tag{$r_{11}$}
& z_2 \leftarrow \mathtext{sum}\xspace\lits{1:p} > 0
\\
\label{eq6:r12}\tag{$r_{12}$}
& p \leftarrow \mathtext{sum}\xspace\lits{1:y_1,2:y_2,2:z_1,3:z_2} \neq 5
\\
\label{eq6:r13}\tag{$r_{13}$}
& \bot \leftarrow \mathtext{sum}\xspace\lits{1:p} < 1
\end{alignat}
As will be clarified later in Section~\ref{sec:complexity} and Example~\ref{ex:exist}, $\ensuremath{P}\xspace_3$ \begin{rev}(under \mathtext{FFLP}\xspace-, \mathtext{LPST}\xspace-, or \mathtext{DPB}\xspace-answer set semantics)\end{rev} encodes an instance of \emph{generalized subset sum} \cite{bekalaplry02a}, specifically
\begin{alignat*}{1}
\exists y_1 y_2 \forall z_1 z_2 (1 \cdot y_1 + 2 \cdot y_2 + 2 \cdot z_1 + 3 \cdot z_2 \neq 5)\text{.}
\end{alignat*}
Intuitively, rules $r_6$ and $r_7$ are intended to select exactly one of $x_1$ and $y_1$, and similarly rules $r_8$ and $r_9$ are intended to select exactly one of $x_2$ and $y_2$;
these rules represent the existential variables of the generalized subset sum instance.
Rules $r_{10}$ and $r_{11}$ require $z_1$ and $z_2$ to be true if $p$ is true;
these rules represent the universal variables of the generalized subset sum instance.
Rule $r_{13}$ enforces $p$ true, but does not provide a justification for it, which instead must be provided by rule $r_{12}$, encoding the inequality of the generalized subset sum instance.
\begin{rev}
Note that $\ensuremath{P}\xspace_3$ follows the \emph{saturation technique} by \citeN{eitgot95a} to express that $z_1$ and $z_2$ are universally quantified:
$z_1$ and $z_2$ must be true because of~$p$
(they are saturated),
while $p$ (and $z_1$, $z_2$) are provable if and only if\xspace
the universal quantification holds w.r.t.\ the chosen (true) subset of $\{y_1,y_2\}$.
\end{rev}
Let us focus on interpretations that are potential candidates for
\mathtext{FFLP}\xspace-answer sets of $\ensuremath{P}\xspace_3$.
In view of the constraint \ref{eq6:r13},
each model of $\ensuremath{P}\xspace_3$ must include the atom~$p$,
and then the atoms $z_1$ and $z_2$ because of the rules
\ref{eq6:r10} and \ref{eq6:r11}.
Regarding $x_i$ and $y_i$ for $1\leq i\leq 2$,
having both atoms false yields unsatisfied rules \ref{eq6:r6} and \ref{eq6:r7} or
\ref{eq6:r8} and \ref{eq6:r9},
while both atoms true lead to a reduct excluding \ref{eq6:r6} and \ref{eq6:r7} or
\ref{eq6:r8} and \ref{eq6:r9}.
In the latter case, falsifying $x_i$ and $y_i$ gives a smaller model of the reduct,
so that the original interpretation cannot be an \mathtext{FFLP}\xspace-answer set of $\ensuremath{P}\xspace_3$.
The previous considerations leave the models
$X_1=\{x_1,x_2,z_1,z_2,p\}$,
$X_2=\{x_1,y_2,z_1,z_2,p\}$,
$X_3=\{y_1,x_2,z_1,z_2,p\}$, and
$X_4=\{y_1,y_2,z_1,z_2,p\}$ as potential
\mathtext{FFLP}\xspace-answer sets of $\ensuremath{P}\xspace_3$.
For each of these interpretations,
the reduct includes either of the rules \ref{eq6:r6} or \ref{eq6:r7}
as well as \ref{eq6:r8} or \ref{eq6:r9},
so that falsifying an atom $x_i$ or $y_i$ leads to unsatisfaction of the
rule with the atom in the head.
A smaller model of the reduct must thus falsify $p$ along with an
appropriate combination of the atoms $z_1$ and $z_2$,
in order to establish the unsatisfaction of $\body{$\ref{eq6:r12}$}$.
Note that the reduct does not include the constraint \ref{eq6:r13},
which enables the falsification of $p$, provided that $\body{$\ref{eq6:r12}$}$ is unsatisfied.
For $X_1$,
the observation that
$\eval{\mathtext{sum}\xspace\lits{1:y_1,\linebreak[1]2:y_2,\linebreak[1]2:z_1,\linebreak[1]3:z_2} \neq 5}{X_1}=5$ yields
$X_1\ensuremath{\not\models}\xspace \body{$\ref{eq6:r12}$}$ and $\text{\ref{eq6:r12}}\notin\reduct{\ensuremath{P}\xspace_3}{X_1}$,
so that $Y_1\models \reduct{\ensuremath{P}\xspace_3}{X_1}$,
for each $\{x_1,x_2\}\subseteq Y_1\subseteq X_1\setminus\{p\}$,
disproves $X_1$ to be an \mathtext{FFLP}\xspace-answer set of $\ensuremath{P}\xspace_3$.
Regarding $X_2$ and $X_4$, we have that
$Y_2=X_2\setminus\{z_1,p\}=\{x_1,y_2,z_2\}$ and
$Y_4=X_4\setminus\{z_2,p\}=\{y_1,y_2,z_1\}$ furnish
counterexamples satisfying the respective reduct
in view of $Y_2\ensuremath{\not\models}\xspace \body{$\ref{eq6:r12}$}$ and $Y_4\ensuremath{\not\models}\xspace \body{$\ref{eq6:r12}$}$.
It thus remains to investigate $X_3$, where
$\reduct{\ensuremath{P}\xspace_3}{X_3}=\{\text{\ref{eq6:r7}},\text{\ref{eq6:r8}},\text{\ref{eq6:r10}},\text{\ref{eq6:r11}},\text{\ref{eq6:r12}}\}$ and
$\eval{\mathtext{sum}\xspace\lits{1:y_1,\linebreak[1]2:y_2,\linebreak[1]2:z_1,\linebreak[1]3:z_2} \neq 5}{X_3}=6$.
That is, an interpretation $Y_3\subset X_3$ with
$\eval{\mathtext{sum}\xspace\lits{1:\nolinebreak y_1,\linebreak[1]2:y_2,\linebreak[1]2:z_1,\linebreak[1]3:z_2} \neq 5}{Y_3}=5$
can only be obtained by falsifying $y_1$, which leads to $Y_3\ensuremath{\not\models}\xspace \text{\ref{eq6:r7}}$.
In turn, $Y\models \body{$\ref{eq6:r12}$}$ is the case for
every model $Y\subseteq X_3$ of $\reduct{\ensuremath{P}\xspace_3}{X_3}$,
leaving $Y=X_3$ as the unique such interpretation.
Hence, we conclude that $X_3$ is a $\subseteq$-minimal model of $\reduct{\ensuremath{P}\xspace_3}{X_3}$
and thus an \mathtext{FFLP}\xspace-answer set of $\ensuremath{P}\xspace_3$.
\end{example}
\subsection{Construction-based Semantics}\label{subsec:construction}
While the aggregate semantics by \citeN{fapfle11a} and \citeN{ferraris11a} build on
$\subseteq$-minimal models of a reduct, without considering the calculation
of such models in the first place,
the semantics given by \citeN{gelzha19a}, Liu, Pontelli, Son and Truszczy{\'n}ski \citeyear{liposotr10a}, \citeN{marrem04a}, and \begin{rev}Denecker, Pelov and Bruynooghe \citeyear{depebr01a}\end{rev}
focus on constructive characterizations for checking the provability of true atoms.
\begin{rev}
In particular, the semantics by \citeN{gelzha19a} and \citeN{liposotr10a},
referred to as \mathtext{GZ}\xspace- and \mathtext{LPST}\xspace-answer set semantics
indicated by their proposers,
are based on a monotone fixpoint construction to check the stability of an answer set candidate $X$, which amounts to testing whether all atoms of $X$ (and only those) can be constructed/derived from the rules, assuming that atoms not contained in $X$ are fixed to false.
The family of semantics by \citeN{pedebr07a},
defined in terms of approximation fixpoint theory,
provides a strongly related approach:
for each suitable choice of a three-valued truth assignment function
mapping each aggregate expression
to true, false, or unknown w.r.t.\ a
partial interpretation,
the framework induces an answer set, a well-founded, and a Kripke-Kleene semantics.
As shown by \citeN{DBLP:journals/corr/abs-2104-14789},
the particular truth assignment functions for
\emph{trivial} and \emph{ultimate} approximating aggregates
\cite{pedebr07a}
lead exactly to the \mathtext{GZ}\xspace- or \mathtext{LPST}\xspace-answer set semantics,
respectively.
In addition, \citeN{pedebr07a} proposed a truth assignment function for
\emph{bound} approximating aggregates, based on evaluating lower and upper bounds like $\lb{A}$ and $\ub{A}$ in Section~\ref{subsec:satisfiability}, which
achieves provability for more answer set candidates than the
\mathtext{GZ}\xspace-answer set semantics without increasing the computational complexity.
Given such close relationships, we do not separately address
trivial, ultimate, and bound approximating aggregates,
but focus on the so-called \emph{ultimate semantics},
originally introduced in earlier work \cite{depebr01a}, as
a complementary instance of the framework by \citeN{pedebr07a}.%
\end{rev}
\begin{rev}In the following, we describe the constructions characterizing the aforementioned semantics\end{rev} by dedicated extensions of the
well-known immediate consequence operator $\tp{\ensuremath{P}\xspace}$ \cite{emdkow76a,lloyd87}
to programs with aggregate expressions.
We start by specifying particular notions of satisfaction,
again indicated by the proposers of a semantics, of an aggregate expression $A$ relative to two
interpretations $Y\subseteq \ensuremath{\mathcal{P}}\xspace,X\subseteq \ensuremath{\mathcal{P}}\xspace$, where $X$ is an answer set candidate and $Y$ is the reconstructed model:
\begin{itemize}
\item $(Y,X) \sat{\mathtext{GZ}\xspace} A$ if $X\models A$ and $\atoms{A}\cap Y = \atoms{A}\cap X$,
\item $(Y,X) \sat{\mathtext{LPST}\xspace} A$ if $Z\models A$ for every interpretation $Y\subseteq Z\subseteq X$, and
\item $(Y,X) \sat{\mathtext{MR}\xspace} A$ if $X\models A$ and there is some interpretation $Z\subseteq Y$ such that $Z\models A$.
\end{itemize}
When $Y\subseteq X$, the satisfaction relations $\sat{\mathtext{GZ}\xspace}$, $\sat{\mathtext{LPST}\xspace}$, and $\sat{\mathtext{MR}\xspace}$
can apply only if $X\models A$, which parallels the idea of a reduct relative to~$X$.
Their second purpose is to determine partial interpretations $(Y,X)$,
where the truth of atoms in $X\setminus Y$ is considered unknown,
for which an aggregate expression $A$ should be regarded as provably true:
$(Y,X) \sat{\mathtext{GZ}\xspace} A$ expresses that no unknown atoms from $X\setminus Y$ occur in~$A$,
$(Y,X) \sat{\mathtext{LPST}\xspace} A$ means that $A$ is satisfied no matter which unknown atoms
are taken to be true or false, respectively, and
$(Y,X) \sat{\mathtext{MR}\xspace} A$ merely requires the satisfaction of~$A$ by some subset of the
true atoms in~$Y$.
Unlike that, the
ultimate semantics
relies on the conventional satisfaction of aggregate expressions, as introduced in
Section~\ref{subsec:satisfiability}. %
Similar to $X\models \body{r}$, we extend $\sat{\ensuremath{\Delta}\xspace}$, for $\ensuremath{\Delta}\xspace\in\{\mathtext{GZ}\xspace,\mathtext{LPST}\xspace,\mathtext{MR}\xspace\}$,
to the body of a rule~$r$ by writing $(Y,X) \sat{\ensuremath{\Delta}\xspace} \body{r}$
if $(Y,X) \sat{\ensuremath{\Delta}\xspace} A$ for each $A\in\body{r}$,
and indicate that $(Y,X) \unsat{\ensuremath{\Delta}\xspace} A$, for some $A\in\body{r}$,
by $(Y,X) \unsat{\ensuremath{\Delta}\xspace} \body{r}$.
\begin{example}\label{ex:interpretations}
Let us investigate the aggregate expression\pagebreak[1]
\begin{alignat}{1}
\label{eq7:A7}\tag{$A_7$}
\mathtext{sum}\xspace\lits{1:y_1,2:y_2,2:z_1,3:z_2} \neq 5
\end{alignat}
along with the interpretation $X=\{y_1,z_1,z_2\}$,
where $\eval{A_7}{X}=6$ and thus $X\models A_7$.
The condition for $(Y,X) \sat{\mathtext{GZ}\xspace} A_7$ additionally requires
$\atoms{A_7}\cap Y=\atoms{A_7}\cap X=\{y_1,z_1,z_2\}$,
so that $Y=X=\{y_1,z_1,z_2\}$ is the only subset of $X$
for which $\sat{\mathtext{GZ}\xspace}$ applies.
For identifying interpretations $Y\subseteq X$ such that $(Y,X) \sat{\mathtext{LPST}\xspace} A_7$,
observe that $\eval{A_7}{\{z_1,z_2\}}=5$ and $\{z_1,z_2\}\ensuremath{\not\models}\xspace A_7$.
That is, any subset of $X$ that excludes $y_1$ can be filled up to the interpretation
$Z=\{z_1,z_2\}$ for which $A_7$ is unsatisfied.
In turn, such a $Z$ does not exist for interpretations $\{y_1\}\subseteq Y\subseteq X$,
and we have $(Y,X) \sat{\mathtext{LPST}\xspace} A_7$ for each subset $Y$ of $X$ that includes $y_1$.
Regarding $(Y,X) \sat{\mathtext{MR}\xspace} A_7$, it is sufficient to observe that
$\eval{A_7}{\emptyset}=0$ and $\emptyset\models A_7$,
so that $\sat{\mathtext{MR}\xspace}$ applies for every subset $Y$ of~$X$.
\end{example}
Provided that $Y\subseteq X\subseteq \ensuremath{\mathcal{P}}\xspace$,
we have that $(Y,X) \sat{\mathtext{GZ}\xspace} A$ implies $(Y,X) \sat{\mathtext{LPST}\xspace} A$,
and also that $(Y,X) \sat{\mathtext{LPST}\xspace} A$ implies $(Y,X) \sat{\mathtext{MR}\xspace} A$.
Moreover, $(Y,X) \sat{\ensuremath{\Delta}\xspace} A$ yields $(Z,X) \sat{\ensuremath{\Delta}\xspace} A$
for interpretations $Y\subseteq Z\subseteq X$ and $\ensuremath{\Delta}\xspace\in\{\mathtext{GZ}\xspace,\mathtext{LPST}\xspace,\mathtext{MR}\xspace\}$.
These properties carry forward to the body $\body{r}$ of a rule~$r$.
Given the specific satisfaction relations,
we now formulate \emph{immediate consequence operators}
characterizing semantics based on constructions
for a program \ensuremath{P}\xspace and interpretations $Y\subseteq \ensuremath{\mathcal{P}}\xspace,\linebreak[1]X\subseteq\nolinebreak \ensuremath{\mathcal{P}}\xspace$:%
\begin{alignat*}{1}
\tpc{\ensuremath{\Delta}\xspace}{\ensuremath{P}\xspace}{X}{Y} & {} = \text{$\bigcup$}_{r\in\ensuremath{P}\xspace,(Y,X)\sat{\ensuremath{\Delta}\xspace}\body{r}}\head{r}
\text{, for $\ensuremath{\Delta}\xspace\in\{\mathtext{GZ}\xspace,\mathtext{LPST}\xspace,\mathtext{MR}\xspace\}$,}
\\
\tpc{\mathtext{DPB}\xspace}{\ensuremath{P}\xspace}{X}{Y} & {} = \text{$\bigcap$}_{Y\subseteq Z\subseteq X}
\left(
\text{$\bigcup$}_{r\in\ensuremath{P}\xspace,Z\models\body{r}}\head{r}
\right)
\text{.}
\end{alignat*}
Each operator $\tpx{\ensuremath{\Delta}\xspace}{\ensuremath{P}\xspace}{X}$,
for $\ensuremath{\Delta}\xspace\in\{\mathtext{GZ}\xspace,\mathtext{LPST}\xspace,\mathtext{MR}\xspace,\mathtext{DPB}\xspace\}$,
joins the heads of rules such that the underlying satisfaction relation
applies to their bodies.
This would yield unintended results for (proper) disjunctive rules
like $p\vee q\leftarrow \top$,
having $\{p\}$ and $\{q\}$ as its standard answer sets \cite{gellif91a},
while any of the operators $\tpx{\ensuremath{\Delta}\xspace}{\ensuremath{P}\xspace}{X}$ would produce the non-minimal model $\{p,q\}$.
In fact, such immediate consequence operators have been devised with
non-disjunctive rules in mind,
and in the following we assume that $|\head{r}|\leq 1$ for rules~$r$
under consideration.
\begin{rev}For the sake of completeness, we point out that the semantics by \citeN{gelzha19a}, \citeN{liposotr10a}, and \citeN{marrem04a} additionally
allow for aggregate expressions in heads of rules,
understood as choice constructs \cite{siniso02a},
and \citeN{gelzha19a} also handle disjunctive rules,
as their original concept builds on a specific reduct rather than
an operational characterization.\end{rev}
The operators $\tpx{\ensuremath{\Delta}\xspace}{\ensuremath{P}\xspace}{X}$
have in common that $\tpc{\ensuremath{\Delta}\xspace}{\ensuremath{P}\xspace}{X}{Y} \subseteq \tpc{\ensuremath{\Delta}\xspace}{\ensuremath{P}\xspace}{X}{Z}$
when $Y\subseteq Z\subseteq X$.
Considering $\tpx{\mathtext{DPB}\xspace}{\ensuremath{P}\xspace}{X}$, this is because the intersection over
interpretations between $Z$ and $X$ involves fewer elements than with~$Y$,
while $(Y,X)\sat{\ensuremath{\Delta}\xspace}\body{r}$ implies $(Z,X)\sat{\ensuremath{\Delta}\xspace}\body{r}$ for the
remaining operators $\tpx{\ensuremath{\Delta}\xspace}{\ensuremath{P}\xspace}{X}$ and any rule $r\in\ensuremath{P}\xspace$.
Provided that $X$ is a model of \ensuremath{P}\xspace, in which case
$\tpc{\mathtext{GZ}\xspace}{\ensuremath{P}\xspace}{X}{X} = \tpc{\mathtext{LPST}\xspace}{\ensuremath{P}\xspace}{X}{X} =
\tpc{\mathtext{MR}\xspace}{\ensuremath{P}\xspace}{X}{X} = \tpc{\mathtext{DPB}\xspace}{\ensuremath{P}\xspace}{X}{X} \subseteq X$,
the least fixpoint of $\tpx{\ensuremath{\Delta}\xspace}{\ensuremath{P}\xspace}{X}$
is thus guaranteed to exist and can be constructed as follows:
\begin{alignat*}{1}
\tpu{\ensuremath{\Delta}\xspace}{\ensuremath{P}\xspace}{X}{0} & {} = \emptyset
\text{,}
\\
\tpu{\ensuremath{\Delta}\xspace}{\ensuremath{P}\xspace}{X}{i+1} & {} = \tpc{\ensuremath{\Delta}\xspace}{\ensuremath{P}\xspace}{X}{\tpu{\ensuremath{\Delta}\xspace}{\ensuremath{P}\xspace}{X}{i}}
\text{.}
\end{alignat*}
That is, starting from the empty interpretation~$\emptyset$ for
$\tpu{\ensuremath{\Delta}\xspace}{\ensuremath{P}\xspace}{X}{0}$,
the iterated application of $\tpx{\ensuremath{\Delta}\xspace}{\ensuremath{P}\xspace}{X}$ leads to
$\tpu{\ensuremath{\Delta}\xspace}{\ensuremath{P}\xspace}{X}{i+1} = \tpc{\ensuremath{\Delta}\xspace}{\ensuremath{P}\xspace}{X}{\tpu{\ensuremath{\Delta}\xspace}{\ensuremath{P}\xspace}{X}{i}}
= \tpu{\ensuremath{\Delta}\xspace}{\ensuremath{P}\xspace}{X}{i}$
for some $i\geq 0$, and we denote this \emph{least fixpoint} by $\tpu{\ensuremath{\Delta}\xspace}{\ensuremath{P}\xspace}{X}{\infty}$.
For $\ensuremath{\Delta}\xspace\in\{\mathtext{GZ}\xspace,\mathtext{LPST}\xspace,\mathtext{MR}\xspace,\mathtext{DPB}\xspace\}$,
we call $X$ a \emph{\ensuremath{\Delta}\xspace-answer set} of \ensuremath{P}\xspace if $X$ is a model of \ensuremath{P}\xspace
such that $\tpu{\ensuremath{\Delta}\xspace}{\ensuremath{P}\xspace}{X}{\infty} = X$.
\begin{example}\label{ex:pdb}
Reconsider the program $\ensuremath{P}\xspace_2$ from Example~\ref{ex:unsatisfiable}:\pagebreak[1]
\begin{alignat}{1}
\tag{\ref{eq4:r4}}
& p \leftarrow \mathtext{sum}\xspace\lits{1:p} > 0
\\
\tag{\ref{eq4:r5}}
& p \leftarrow \mathtext{sum}\xspace\lits{1:p} < 1
\end{alignat}
We have that $X=\{p\}$ is the unique model of $\ensuremath{P}\xspace_2$ (over $\ensuremath{\mathcal{P}}\xspace=\{p\}$).
Then, $\eval{\mathtext{sum}\xspace\lits{1:p} < 1}{X}=1$ yields $X\ensuremath{\not\models}\xspace \body{$\ref{eq4:r5}$}$
and $(\emptyset,X) \unsat{\ensuremath{\Delta}\xspace} \body{$\ref{eq4:r5}$}$ for $\ensuremath{\Delta}\xspace\in\{\mathtext{GZ}\xspace,\mathtext{LPST}\xspace,\mathtext{MR}\xspace\}$.
Moreover, $(\emptyset,X) \unsat{\ensuremath{\Delta}\xspace} \body{$\ref{eq4:r4}$}$ follows from
$\eval{\mathtext{sum}\xspace\lits{1:p} > 0}{\emptyset}=0$ and $\emptyset\ensuremath{\not\models}\xspace \body{$\ref{eq4:r4}$}$.
As a consequence, for $\ensuremath{\Delta}\xspace\in\{\mathtext{GZ}\xspace,\mathtext{LPST}\xspace,\mathtext{MR}\xspace\}$,
we obtain $\tpu{\ensuremath{\Delta}\xspace}{\ensuremath{P}\xspace_2}{X}{\infty}=\tpu{\ensuremath{\Delta}\xspace}{\ensuremath{P}\xspace_2}{X}{0}=\emptyset$,
so that $X$ is not a \ensuremath{\Delta}\xspace-answer set of $\ensuremath{P}\xspace_2$.
Unlike that, $\emptyset\models \body{$\ref{eq4:r5}$}$ and
$X\models \body{$\ref{eq4:r4}$}$ with
$\head{$\ref{eq4:r5}$} = \head{$\ref{eq4:r4}$} = \{p\}$ lead to
$\tpu{\mathtext{DPB}\xspace}{\ensuremath{P}\xspace_2}{X}{\infty} = \tpu{\mathtext{DPB}\xspace}{\ensuremath{P}\xspace_2}{X}{\nolinebreak 1} =
\tpc{\mathtext{DPB}\xspace}{\ensuremath{P}\xspace_2}{X}{\emptyset} = \{p\} = X$.
Hence, we conclude that $X$ is a \mathtext{DPB}\xspace-answer set of $\ensuremath{P}\xspace_2$.%
\end{example}
\begin{example}\label{ex:fflp}
Recall from Example~\ref{ex:minmodel}
that $X=\{p,q\}$ is the unique model and
\mathtext{FFLP}\xspace-answer set of~$\ensuremath{P}\xspace_1$:\pagebreak[1]
\begin{alignat}{1}
\tag{\ref{eq1:r1}}
& p \leftarrow \mathtext{sum}\xspace\lits{1:p,-1:q} \geq 0
\\
\tag{\ref{eq1:r2}}
& p \leftarrow \mathtext{sum}\xspace\lits{1:q} > 0
\\
\tag{\ref{eq1:r3}}
& q \leftarrow \mathtext{sum}\xspace\lits{1:p} > 0
\end{alignat}
Considering the empty interpretation $\emptyset$,
we have that $\atoms{A}\cap X\neq \emptyset$ for each aggregate expression
$A\in\body{$\ref{eq1:r1}$}\cup\body{$\ref{eq1:r2}$}\cup\body{$\ref{eq1:r3}$}$.
Hence, $\tpu{\mathtext{GZ}\xspace}{\ensuremath{P}\xspace_1}{X}{\infty}=\tpu{\mathtext{GZ}\xspace}{\ensuremath{P}\xspace_1}{X}{0}=\emptyset$
yields that $X$ is not a \mathtext{GZ}\xspace-answer set of~$\ensuremath{P}\xspace_1$.
Regarding $\tpx{\mathtext{LPST}\xspace}{\ensuremath{P}\xspace_1}{X}$,
observe that $\emptyset\ensuremath{\not\models}\xspace\body{$\ref{eq1:r2}$}$,
$\emptyset\ensuremath{\not\models}\xspace\body{$\ref{eq1:r3}$}$, and
$\{q\}\ensuremath{\not\models}\xspace\body{$\ref{eq1:r1}$}$ in view of
$\eval{\mathtext{sum}\xspace\lits{1:p,-1:q} \geq 0}{\{q\}}=-1$.
This means that $(\emptyset,X)\unsat{\mathtext{LPST}\xspace} \body{r}$ for all $r\in\ensuremath{P}\xspace_1$,
so that $\tpu{\mathtext{LPST}\xspace}{\ensuremath{P}\xspace_1}{X}{\infty}=\tpu{\mathtext{LPST}\xspace}{\ensuremath{P}\xspace_1}{X}{0}=\emptyset$
disproves $X$ to be an \mathtext{LPST}\xspace-answer set of~$\ensuremath{P}\xspace_1$.
When we turn to $\tpx{\mathtext{MR}\xspace}{\ensuremath{P}\xspace_1}{X}$, then
$\eval{\mathtext{sum}\xspace\lits{1:p,-1:q} \geq 0}{\emptyset} =
\eval{\mathtext{sum}\xspace\lits{1:p,-1:q} \geq 0}{X} = 0$
shows that $(\emptyset,X)\sat{\mathtext{MR}\xspace}\body{$\ref{eq1:r1}$}$ and
$\tpu{\mathtext{MR}\xspace}{\ensuremath{P}\xspace_1}{X}{1} = \tpc{\mathtext{MR}\xspace}{\ensuremath{P}\xspace_1}{X}{\emptyset} = \{p\}$.
Given that $(\{p\},X)\sat{\mathtext{MR}\xspace}\body{$\ref{eq1:r3}$}$,
this leads on to
$\tpu{\mathtext{MR}\xspace}{\ensuremath{P}\xspace_1}{X}{\infty} =
\tpu{\mathtext{MR}\xspace}{\ensuremath{P}\xspace_1}{X}{2} =
\tpc{\mathtext{MR}\xspace}{\ensuremath{P}\xspace_1}{X}{\{p\}} = \{p,q\} = X$,
from which we conclude that $X$ is an \mathtext{MR}\xspace-answer set of $\ensuremath{P}\xspace_1$.
For obtaining the least fixpoint of $\tpx{\mathtext{DPB}\xspace}{\ensuremath{P}\xspace_1}{X}$,
consider the rules \ref{eq1:r1} and \ref{eq1:r2},
and observe that
$\emptyset\models \body{$\ref{eq1:r1}$}$,
$\{p\}\models \body{$\ref{eq1:r1}$}$,
$\{q\}\models \body{$\ref{eq1:r2}$}$,
and
$X\models \body{$\ref{eq1:r1}$}$ as well as
$X\models \body{$\ref{eq1:r2}$}$.
That is, for each interpretation $Z\subseteq X$,
the body of some rule with $p$ in the head is satisfied by~$Z$.
Hence, we get
$\tpu{\mathtext{DPB}\xspace}{\ensuremath{P}\xspace_1}{X}{\nolinebreak 1} = \tpc{\mathtext{DPB}\xspace}{\ensuremath{P}\xspace_1}{X}{\emptyset} = \{p\}$,
which in view of $\{p\}\models \body{$\ref{eq1:r3}$}$ and
$X\models \body{$\ref{eq1:r3}$}$ brings us further to
$\tpu{\mathtext{DPB}\xspace}{\ensuremath{P}\xspace_1}{X}{\infty} = \tpu{\mathtext{DPB}\xspace}{\ensuremath{P}\xspace_1}{X}{2} =
\tpc{\mathtext{DPB}\xspace}{\ensuremath{P}\xspace_1}{X}{\{p\}} = \{p,q\} = X$.
This means that $X$ is also a \mathtext{DPB}\xspace-answer set of $\ensuremath{P}\xspace_1$.
Let us modify the program $\ensuremath{P}\xspace_1$ to $\ensuremath{P}\xspace_1'$ over $\ensuremath{\mathcal{P}}\xspace=\{p,q,s\}$, in which
\ref{eq1:r1} and \ref{eq1:r3} are replaced by:\pagebreak[1]
\begin{alignat}{1}
\label{eq1:r1p}\tag{$r_1'$}
& s \leftarrow \mathtext{sum}\xspace\lits{1:p,-1:q} \geq 0
\\
\label{eq1:r3p}\tag{$r_3'$}
& q \leftarrow \mathtext{sum}\xspace\lits{1:s} > 0
\end{alignat}
Intuitively, rule $r_1'$ requires $s$ true if $p$ is true or $q$ is false, and rule $r_3'$ requires $q$ true if $s$ is true (recall that $r_2$ requires $p$ true if $q$ is true).
One can check that $X'=\{p,q,s\}$ is the unique model as well as an
\mathtext{FFLP}\xspace- and \mathtext{MR}\xspace-answer set of $\ensuremath{P}\xspace_1'$.
Turning again to $\tpx{\mathtext{DPB}\xspace}{\ensuremath{P}\xspace_1'}{X'}$,
we have that
$\emptyset\ensuremath{\not\models}\xspace \body{$\ref{eq1:r2}$}$,
$\emptyset\ensuremath{\not\models}\xspace \body{$\ref{eq1:r3p}$}$,
$\{q\}\ensuremath{\not\models}\xspace \body{$\ref{eq1:r1p}$}$,
$\{q\}\ensuremath{\not\models}\xspace \body{$\ref{eq1:r3p}$}$,
and the heads of \ref{eq1:r1p} and \ref{eq1:r2}
are disjoint for the modified program $\ensuremath{P}\xspace_1'$.
(Each interpretation $Z'\subseteq X'$
is such that $Z'\models \body{$\ref{eq1:r1p}$}$ or $Z'\models \body{$\ref{eq1:r2}$}$,
yet $\head{$\ref{eq1:r1p}$}\cap \head{$\ref{eq1:r2}$} = \{s\} \cap \{p\} = \emptyset$.)
Given these considerations,
we conclude that
$\tpu{\mathtext{DPB}\xspace}{\ensuremath{P}\xspace_1'}{X'}{\infty} = \tpu{\mathtext{DPB}\xspace}{\ensuremath{P}\xspace_1'}{X'}{0} = \emptyset$,
so that $\ensuremath{P}\xspace_1'$ does not have any \mathtext{DPB}\xspace-answer set.
This shows that \mathtext{FFLP}\xspace-answer sets are
not necessarily \mathtext{DPB}\xspace-answer sets as well.%
\end{example}
\begin{example}\label{ex:mr}
In Example~\ref{ex:subsum},
we have checked that $X=\{y_1,x_2,z_1,z_2,p\}$
is the unique \mathtext{FFLP}\xspace-answer set of~$\ensuremath{P}\xspace_3$:\pagebreak[1]%
\begin{alignat}{1}
\tag{\ref{eq6:r6}}
& x_1 \leftarrow \mathtext{sum}\xspace\lits{1:y_1} < 1
\\
\tag{\ref{eq6:r7}}
& y_1 \leftarrow \mathtext{sum}\xspace\lits{1:x_1} < 1
\\
\tag{\ref{eq6:r8}}
& x_2 \leftarrow \mathtext{sum}\xspace\lits{1:y_2} < 1
\\
\tag{\ref{eq6:r9}}
& y_2 \leftarrow \mathtext{sum}\xspace\lits{1:x_2} < 1
\\
\tag{\ref{eq6:r10}}
& z_1 \leftarrow \mathtext{sum}\xspace\lits{1:p} > 0
\\
\tag{\ref{eq6:r11}}
& z_2 \leftarrow \mathtext{sum}\xspace\lits{1:p} > 0
\\
\tag{\ref{eq6:r12}}
& p \leftarrow \mathtext{sum}\xspace\lits{1:y_1,2:y_2,2:z_1,3:z_2} \neq 5
\\
\tag{\ref{eq6:r13}}
& \bot \leftarrow \mathtext{sum}\xspace\lits{1:p} < 1
\end{alignat}
Inspecting $\tpx{\mathtext{GZ}\xspace}{\ensuremath{P}\xspace_3}{X}$,
we get
$\tpu{\mathtext{GZ}\xspace}{\ensuremath{P}\xspace_3}{X}{1} =
\tpc{\mathtext{GZ}\xspace}{\ensuremath{P}\xspace_3}{X}{\emptyset} = \{y_1,x_2\}$
because $X\models \body{$\ref{eq6:r7}$}$, $X\models \body{$\ref{eq6:r8}$}$, and
$\atoms{\mathtext{sum}\xspace\lits{1:x_1} < 1}\cap X = \atoms{\mathtext{sum}\xspace\lits{1:y_2} < 1}\cap X = \emptyset$.
Given that $X\ensuremath{\not\models}\xspace \body{$\ref{eq6:r6}$}$, $X\ensuremath{\not\models}\xspace \body{$\ref{eq6:r9}$}$,
$\atoms{\mathtext{sum}\xspace\lits{1:p} > 0}\cap \{y_1,x_2\} = \emptyset \neq \{p\} =
\atoms{\mathtext{sum}\xspace\lits{1:p} > 0}\cap X$, and
$\atoms{\mathtext{sum}\xspace\lits{1:y_1,\linebreak[1]2:y_2,\linebreak[1]2:z_1,\linebreak[1]3:z_2} \neq 5}\cap \{y_1,x_2\} =
\{y_1\} \neq \{y_1,z_1,z_2\} =
\atoms{\mathtext{sum}\xspace\lits{1:y_1,2:y_2,2:z_1,3:z_2} \neq 5}\cap X$,
we obtain
$\tpu{\mathtext{GZ}\xspace}{\ensuremath{P}\xspace_3}{X}{\infty} =
\tpu{\mathtext{GZ}\xspace}{\ensuremath{P}\xspace_3}{X}{1} = \{y_1,x_2\}$,
so that $X$ is not a \mathtext{GZ}\xspace-answer set of $\ensuremath{P}\xspace_3$.
For $\ensuremath{\Delta}\xspace\in\{\mathtext{LPST}\xspace,\mathtext{DPB}\xspace\}$,
we also have that
$\tpu{\ensuremath{\Delta}\xspace}{\ensuremath{P}\xspace_3}{X}{1} =
\tpc{\ensuremath{\Delta}\xspace}{\ensuremath{P}\xspace_3}{X}{\emptyset} = \{y_1,x_2\}$,
as $Z\models \body{$\ref{eq6:r7}$}$ and $Z\models \body{$\ref{eq6:r8}$}$
for each $Z\subseteq X$, while the interpretation
$\{z_1,z_2\}\subseteq X$ is such that
$\{z_1,z_2\}\ensuremath{\not\models}\xspace \mathtext{sum}\xspace\lits{1:p}\linebreak[1] > 0$ and
$\{z_1,z_2\}\ensuremath{\not\models}\xspace \mathtext{sum}\xspace\lits{1:y_1,2:y_2,2:z_1,3:z_2} \neq 5$.
However, $Z\models \mathtext{sum}\xspace\lits{1:y_1,\linebreak[1]2:y_2,\linebreak[1]2:z_1,\linebreak[1]3:z_2} \neq 5$ is the case
for every $\{y_1,x_2\}\subseteq Z\subseteq X$,
which leads to
$\tpu{\ensuremath{\Delta}\xspace}{\ensuremath{P}\xspace_3}{X}{2} =
\tpc{\ensuremath{\Delta}\xspace}{\ensuremath{P}\xspace_3}{X}{\{y_1,x_2\}} = \{y_1,x_2,p\}$.
Then, $Z\models \mathtext{sum}\xspace\lits{1:p} > 0$, for any interpretation $\{y_1,x_2,p\}\subseteq Z$,
yields
$\tpu{\ensuremath{\Delta}\xspace}{\ensuremath{P}\xspace_3}{X}{\infty} =
\tpu{\ensuremath{\Delta}\xspace}{\ensuremath{P}\xspace_3}{X}{3} =
\tpc{\ensuremath{\Delta}\xspace}{\ensuremath{P}\xspace_3}{X}{\{y_1,x_2,p\}} = \{y_1,x_2,z_1,z_2,p\}=X$,
which shows that $X$ is an \mathtext{LPST}\xspace- and a \mathtext{DPB}\xspace-answer set of~$\ensuremath{P}\xspace_3$.
Regarding $\tpx{\mathtext{MR}\xspace}{\ensuremath{P}\xspace_3}{X}$,
in view of
$X\models \mathtext{sum}\xspace\lits{1:y_1,\linebreak[1]2:y_2,\linebreak[1]2:z_1,\linebreak[1]3:z_2} \neq 5$
and
$\eval{\mathtext{sum}\xspace\lits{1:y_1,\linebreak[1]2:y_2,\linebreak[1]2:z_1,\linebreak[1]3:z_2} \neq 5}{\emptyset} = 0$,
we get
$\tpu{\mathtext{MR}\xspace}{\ensuremath{P}\xspace_3}{X}{1} =
\tpc{\mathtext{MR}\xspace}{\ensuremath{P}\xspace_3}{X}{\emptyset} = \{y_1,x_2,p\}$ in the first step, and then
$\tpu{\mathtext{MR}\xspace}{\ensuremath{P}\xspace_3}{X}{\infty} =
\tpu{\mathtext{MR}\xspace}{\ensuremath{P}\xspace_3}{X}{2} =
\tpc{\mathtext{MR}\xspace}{\ensuremath{P}\xspace_3}{X}{\{y_1,x_2,p\}} = \{y_1,x_2,z_1,z_2,p\}=X$.
On the one hand, this means that $X$ is an \mathtext{MR}\xspace-answer set of $\ensuremath{P}\xspace_3$.
On the other hand,
the interpretations
$X_2=\{x_1,y_2,z_1,z_2,p\}$ and
$X_4=\{y_1,y_2,z_1,z_2,p\}$ (according to the naming scheme of Example~\ref{ex:subsum})
are obtained as additional \mathtext{MR}\xspace-answer sets of $\ensuremath{P}\xspace_3$ that are
not backed up by any of the other semantics.
In fact,
counting on the existence of some interpretation $Z \subseteq \tpu{\mathtext{MR}\xspace}{\ensuremath{P}\xspace}{X}{i}$
such that $Z\models A$, for an aggregate expression~$A$ belonging to the body of a rule $r\in \ensuremath{P}\xspace$,
to proceed with (potentially) adding $\head{r}$ to $\tpu{\mathtext{MR}\xspace}{\ensuremath{P}\xspace}{X}{i}$
disregards the satisfaction of $A$ by $\tpu{\mathtext{MR}\xspace}{\ensuremath{P}\xspace}{X}{i}$ itself as well as interpretations
extending it.
\begin{rev}
For this reason, \citeN{DBLP:journals/corr/abs-2104-14789}
classify $\tpx{\mathtext{MR}\xspace}{\ensuremath{P}\xspace}{X}$ as not well-behaved,
while $\tpx{\ensuremath{\Delta}\xspace}{\ensuremath{P}\xspace}{X}$
is well-behaved for $\ensuremath{\Delta}\xspace\in\{\mathtext{GZ}\xspace,\mathtext{LPST}\xspace,\mathtext{DPB}\xspace\}$.
\end{rev}
\end{example}
The programs considered in Example \ref{ex:pdb}--\ref{ex:mr} did not have
\mathtext{GZ}\xspace-answer sets because of the strong condition
$\atoms{A}\cap Y = \atoms{A}\cap X$ for $(Y,X)\sat{\mathtext{GZ}\xspace} A$.
Its intention is to circumvent so-called vicious circles \cite{gelzha19a},
where the satisfaction of an aggregate expression~$A$ has some influence on the
outcome of the aggregation function in~$A$,
which happens in Example \ref{ex:pdb}--\ref{ex:mr}, e.g.,
with the rule $p \leftarrow \mathtext{sum}\xspace\lits{1:p,-1:q} \geq 0$
to conclude~$p$ from an aggregate expression mentioning~$p$.
To make circularity more formal, for a program~\ensuremath{P}\xspace, let
$\gp{\ensuremath{P}\xspace}=(\ensuremath{\mathcal{P}}\xspace,\{(p,q) \mid r\in\ensuremath{P}\xspace,\linebreak[1] p\in\head{r},\linebreak[1] A\in\body{r},\linebreak[1] q\in\atoms{A}\})$
be the (directed) \emph{atom dependency graph} of~\ensuremath{P}\xspace.
If $\gp{\ensuremath{P}\xspace}$ is acyclic (and the rules in \ensuremath{P}\xspace are non-disjunctive),
one can show that there is at most one \ensuremath{\Delta}\xspace-answer set of \ensuremath{P}\xspace,
for $\ensuremath{\Delta}\xspace\in\{\mathtext{FFLP}\xspace,\mathtext{GZ}\xspace,\mathtext{LPST}\xspace,\mathtext{MR}\xspace,\mathtext{DPB}\xspace\}$,
and that all aggregate semantics under consideration coincide.
Provided that \ensuremath{P}\xspace does not include constraints,
acyclicity of $\gp{\ensuremath{P}\xspace}$ is sufficient for the existence
of a \mathtext{GZ}\xspace-answer set of \ensuremath{P}\xspace.
However, such acyclicity is not a necessary condition, e.g.,
\mathtext{GZ}\xspace-answer sets match standard answer sets \cite{gellif88b}
when aggregate expressions of the form
$\mathtext{sum}\xspace\lits{1:p}>0$ or $\mathtext{sum}\xspace\lits{1:p}<1$
replace (negated) propositional atoms~$p$,
no matter whether $\gp{\ensuremath{P}\xspace}$ is acyclic or not,
and this correspondence applies to all but the \mathtext{DPB}\xspace-answer set semantics
(cf.\ Example~\ref{ex:pdb}).
In fact, vicious circles are not identified syntactically,
but rather the construction of a \mathtext{GZ}\xspace-answer set $X$ of \ensuremath{P}\xspace
by $\tpx{\mathtext{GZ}\xspace}{\ensuremath{P}\xspace}{X}$ witnesses the non-circular provability of all atoms in~$X$.
\begin{figure}
\figrule
\centering
\tikzstyle{none} = [text centered]
\tikzstyle{line} = [draw, ->]
\begin{tikzpicture
\node at (0,0) [none](oab) {$o_{a,b}$};
\node at (1.5,0) [none](oac) {$o_{a,c}$};
\node at (4.5,0) [none](obc) {$o_{b,c}$};
\node at (0,-1) [none](cab) {$c_{a,b}$};
\node at (1.5,-1) [none](cac) {$c_{a,c}$};
\node at (3,-1) [none](cba) {$c_{b,a}$};
\node at (4.5,-1) [none](cbc) {$c_{b,c}$};
\path[line] (cab) -- (oab);
\path[line] (cac) -- (oac);
\path[line] (cac) -- (cab);
\path[line] (cbc) -- (obc);
\path[line] (cbc) -- (cba);
\end{tikzpicture}
\caption{Dependency graph of program $\ensuremath{P}\xspace_4$ from Example~\ref{ex:gz}.}\label{fig:company-depgraph}
\figrule
\end{figure}
\begin{example}\label{ex:gz}
Consider the program $\ensuremath{P}\xspace_4$,
which constitutes a propositional version of the company controls problem encoding
introduced in Section~\ref{sec:introduction} for the instance given in Figure~\ref{fig:company}:\pagebreak[1]
\begin{alignat}{1}
\label{eq11:r14}\tag{$r_{14}$}
& o_{a,b} \leftarrow \top
\\
\label{eq11:r15}\tag{$r_{15}$}
& o_{a,c} \leftarrow \top
\\
\label{eq11:r16}\tag{$r_{16}$}
& o_{b,c} \leftarrow \top
\\
\label{eq11:r17}\tag{$r_{17}$}
& c_{a,b} \leftarrow \mathtext{sum}\xspace\lits{80: o_{a,b}} > 50
\\
\label{eq11:r18}\tag{$r_{18}$}
& c_{a,c} \leftarrow \mathtext{sum}\xspace\lits{30: o_{a,c}, 30: c_{a,b}} > 50
\\
\label{eq11:r19}\tag{$r_{19}$}
& c_{b,c} \leftarrow \mathtext{sum}\xspace\lits{30: o_{b,c}, 30: c_{b,a}} > 50
\end{alignat}
The atom dependency graph
$\gp{\ensuremath{P}\xspace_4}=(\{o_{a,b},o_{a,c},o_{b,c},c_{a,b},c_{a,c},c_{b,a},c_{b,c}\},
\{(c_{a,b},o_{a,b}),\linebreak[1]
(c_{a,c},o_{a,c}),\linebreak[1](c_{a,c},c_{a,b}),\linebreak[1]
(c_{b,c},o_{b,c}),\linebreak[1](c_{b,c},c_{b,a})\})$,
shown in Figure~\ref{fig:company-depgraph},
is acyclic, and the interpretation $X=\{o_{a,b},o_{a,c},o_{b,c},c_{a,b},c_{a,c}\}$
is a model of $\ensuremath{P}\xspace_4$.
Let us construct $\tpu{\mathtext{GZ}\xspace}{\ensuremath{P}\xspace_4}{X}{\infty}$ to check that
$X$ is a \mathtext{GZ}\xspace-answer set of $\ensuremath{P}\xspace_4$.
In the first step, $(\emptyset,X)\sat{\mathtext{GZ}\xspace}\body{r}$ applies for the facts
$r\in\{$\ref{eq11:r14}$,$\ref{eq11:r15}$,$\ref{eq11:r16}$\}$, so that
$\tpu{\mathtext{GZ}\xspace}{\ensuremath{P}\xspace_4}{X}{1} =
\tpc{\mathtext{GZ}\xspace}{\ensuremath{P}\xspace_4}{X}{\emptyset} =
\{o_{a,b},\linebreak[1]o_{a,c},\linebreak[1]o_{b,c}\}$.
Then, we have that
$\atoms{\mathtext{sum}\xspace\lits{80: o_{a,b}} > 50}\cap \tpu{\mathtext{GZ}\xspace}{\ensuremath{P}\xspace_4}{X}{1} =
\atoms{\mathtext{sum}\xspace\lits{80: o_{a,b}} > 50}\cap X = \{o_{a,b}\}$, and
$X\models \body{$\ref{eq11:r17}$}$ in view of
$\eval{\mathtext{sum}\xspace\lits{80: o_{a,b}} > 50}{X}=80$.
We thus get
$\tpu{\mathtext{GZ}\xspace}{\ensuremath{P}\xspace_4}{X}{2} =
\tpc{\mathtext{GZ}\xspace}{\ensuremath{P}\xspace_4}{X}{\{o_{a,b},\linebreak[1]o_{a,c},\linebreak[1]o_{b,c}\}} =
\{o_{a,b},\linebreak[1]o_{a,c},\linebreak[1]o_{b,c},\linebreak[1]c_{a,b}\}$,
and
$\atoms{\mathtext{sum}\xspace\lits{30: o_{a,c}, 30: c_{a,b}} > 50}\cap \tpu{\mathtext{GZ}\xspace}{\ensuremath{P}\xspace_4}{X}{\nolinebreak 2} =
\atoms{\mathtext{sum}\xspace\lits{30: o_{a,c}, 30: c_{a,b}} > 50}\cap X = \{o_{a,c},\linebreak[1]c_{a,b}\}$
along with
$\eval{\mathtext{sum}\xspace\lits{30: o_{a,c},\linebreak[1] 30: c_{a,b}} > 50}{X}=60$ and
$X\models \body{$\ref{eq11:r18}$}$ lead to
$\tpu{\mathtext{GZ}\xspace}{\ensuremath{P}\xspace_4}{X}{3} =
\tpc{\mathtext{GZ}\xspace}{\ensuremath{P}\xspace_4}{X}{\{o_{a,b},\linebreak[1]o_{a,c},\linebreak[1]o_{b,c},\linebreak[1]c_{a,b}\}} =
\{o_{a,b},\linebreak[1]o_{a,c},\linebreak[1]o_{b,c},\linebreak[1]c_{a,b},\linebreak[1]c_{a,c}\} = X$.
Given that $X\ensuremath{\not\models}\xspace \body{$\ref{eq11:r19}$}$, the least fixpoint
$\tpu{\mathtext{GZ}\xspace}{\ensuremath{P}\xspace_4}{X}{\infty} = \tpu{\mathtext{GZ}\xspace}{\ensuremath{P}\xspace_4}{X}{3} = X$
yields that $X$ is a \mathtext{GZ}\xspace-answer set of $\ensuremath{P}\xspace_4$.
However, note that $X$ is no longer a \mathtext{GZ}\xspace-answer set of $\ensuremath{P}\xspace_4'$,
obtained by replacing \ref{eq11:r17} with
\begin{alignat}{1}
\label{eq11:r17p}\tag{$r_{17}'$}
& c_{a,b} \leftarrow \mathtext{sum}\xspace\lits{80: o_{a,b}, w: c_{a,c}} > 50
\end{alignat}
for some weight $w\geq 0$.
While we still obtain
$\tpu{\mathtext{GZ}\xspace}{\ensuremath{P}\xspace_4'}{X}{1} =
\tpc{\mathtext{GZ}\xspace}{\ensuremath{P}\xspace_4'}{X}{\emptyset} =
\{o_{a,b},\linebreak[1]o_{a,c},\linebreak[1]o_{b,c}\}$,
we end up with
$\tpu{\mathtext{GZ}\xspace}{\ensuremath{P}\xspace_4'}{X}{\infty} =
\tpu{\mathtext{GZ}\xspace}{\ensuremath{P}\xspace_4'}{X}{1}$
because
$\atoms{\mathtext{sum}\xspace\lits{80: o_{a,b}, w: c_{a,c}} > 50}\cap \tpu{\mathtext{GZ}\xspace}{\ensuremath{P}\xspace_4'}{X}{1}
= \{o_{a,b}\} \neq \{o_{a,b},\linebreak[1]c_{a,c}\}=
\atoms{\mathtext{sum}\xspace\lits{80: o_{a,b}, w: c_{a,c}} > 50}\cap X$
and thus
$(\tpu{\mathtext{GZ}\xspace}{\ensuremath{P}\xspace_4'}{X}{1},X)\unsat{\mathtext{GZ}\xspace} \body{$\ref{eq11:r17p}$}$.
That is, $X$ is rejected as a $\mathtext{GZ}\xspace$-answer set of $\ensuremath{P}\xspace_4'$ in view of
the circularity between $c_{a,b}$ and $c_{a,c}$,
which are
involved in aggregate expressions in the bodies of \ref{eq11:r17p} and \ref{eq11:r18}.
When considering standard answer sets of programs without (sophisticated) aggregates
\cite{gellif88b,gellif91a},
circular rules alone do not yield provability of atoms in their heads.
Unlike that,
not all propositional atoms subject to an aggregation function may be needed
to satisfy a respective aggregate expression,
so that rejecting any circularity is a very strong condition for programs with aggregates.
In fact, without going into the details,
we have that $X$ is the unique \ensuremath{\Delta}\xspace-answer set of both $\ensuremath{P}\xspace_4$ and $\ensuremath{P}\xspace_4'$
for $\ensuremath{\Delta}\xspace\in\{\mathtext{FFLP}\xspace,\mathtext{LPST}\xspace,\mathtext{MR}\xspace,\mathtext{DPB}\xspace\}$, i.e.,
all aggregate semantics other than \mathtext{GZ}\xspace.%
\end{example}
\subsection{Semantic Relationships}\label{subsec:relationships}
As mentioned above, the satisfaction relation $\sat{\mathtext{GZ}\xspace}$ is a subset of
$\sat{\mathtext{LPST}\xspace}$, which is in turn a subset of $\sat{\mathtext{MR}\xspace}$.
That is, given a model $X$ of a (non-disjunctive) program~\ensuremath{P}\xspace,
we immediately get
$\tpu{\mathtext{LPST}\xspace}{\ensuremath{P}\xspace}{X}{\infty} = X$ from
$\tpu{\mathtext{GZ}\xspace}{\ensuremath{P}\xspace}{X}{\infty} = X$, and
$\tpu{\mathtext{MR}\xspace}{\ensuremath{P}\xspace}{X}{\infty} = X$ from
$\tpu{\mathtext{LPST}\xspace}{\ensuremath{P}\xspace}{X}{\infty} = X$,
which means that a \mathtext{GZ}\xspace-answer set $X$ of \ensuremath{P}\xspace is an \mathtext{LPST}\xspace-answer set as well,
and an \mathtext{LPST}\xspace-answer set $X$ of \ensuremath{P}\xspace also an \mathtext{MR}\xspace-answer set.
The converse relationships do not apply in general, yet may come into effect for
programs restricted to monotone, anti-monotone, or convex aggregate expressions only.
Moreover, the question arises how \mathtext{DPB}\xspace-answer sets determined by the operator
$\tpx{\mathtext{DPB}\xspace}{\ensuremath{P}\xspace}{X}$ and model-based \mathtext{FFLP}\xspace-answer sets relate to the other
aggregate semantics.
A part of these relationships have already been studied by
\citeN{ferraris11a} and \citeN{liposotr10a},
and in the following we give a complete account for the aggregate semantics
under consideration, assuming programs in question to be non-disjunctive.
Figure~\ref{fig:answersets} \begin{rev}and Table~\ref{tab:answersets} visualize\end{rev} the relationships between
different aggregate semantics, where arcs without label express that
answer sets under one semantics are preserved by another semantics for
programs with arbitrary, i.e., possibly non-convex, aggregate expressions.
The restriction of such a correspondence to programs with convex, monotone,
or anti-monotone aggregate expressions only is indicated by the arc label $\pm$,
$+$, or $-$, respectively.
Transitive relationships, e.g., the fact that each \mathtext{GZ}\xspace-answer set is an
\mathtext{MR}\xspace-answer set as well, are not stated by explicit arcs for better readability.
A summary of the logic programs used to
illustrate the similarities and differences between the aggregate semantics
in \begin{rev}Sections~\ref{subsec:model} and~\ref{subsec:construction}\end{rev}
is given in Table~\ref{tab:relationships}.
\begin{figure}[t]
\figrule
\centering
\tikzstyle{none} = [text centered]
\tikzstyle{line} = [draw, ->]
\begin{tikzpicture
\node at (0.5,0) [none](gz) {\mathtext{GZ}\xspace};
\node at (3,0) [none](lpst) {\mathtext{LPST}\xspace};
\node at (6,0) [none](pdb) {\mathtext{DPB}\xspace};
\node at (3,-2) [none](fflp) {\mathtext{FFLP}\xspace};
\node at (5.5,-2) [none](mr) {\mathtext{MR}\xspace};
\path[line] (gz) -- (lpst);
\path[line] (lpst) -- (pdb);
\path[line] (pdb) to[bend right=20] node[midway, above] {$+$} (lpst);
\path[line] (pdb) to[bend left=20] node[midway, below] {$-$} (lpst);
\path[line] (lpst) to (fflp);
\path[line] (fflp) to (mr);
\path[line] (mr) to node[midway, below] {$\pm$} (lpst);
\end{tikzpicture}
\vspace{1em}
\caption{Relationships between aggregate semantics,
where an arc indicates that answer sets carry forward from
the origin to the target semantics for non-disjunctive programs with
monotone (arc label $+$),
anti-monotone (arc label $-$),
convex (arc label $\pm$), or
arbitrary (no arc label) aggregate expressions, respectively.\label{fig:answersets}}
\figrule
\end{figure}
\begin{table}[t]
\caption{
\protect\begin{rev}%
Monotonicity conditions guaranteeing answer sets according to the semantics in rows to be answer sets according to the semantics in columns.
\protect\end{rev}%
}\label{tab:answersets}
\begin{rev}
\begin{tabular}{cccccc}
\hline\hline
& \mathtext{GZ}\xspace & \mathtext{LPST}\xspace & \mathtext{DPB}\xspace & \mathtext{FFLP}\xspace & \mathtext{MR}\xspace \\
\hline
\mathtext{GZ}\xspace & --- & arbitrary & arbitrary & arbitrary & arbitrary \\
\mathtext{LPST}\xspace & none & --- & arbitrary & arbitrary & arbitrary \\
\mathtext{DPB}\xspace & none & (anti-)monotone & --- & (anti-)monotone & (anti-)monotone \\
\mathtext{FFLP}\xspace & none & convex & convex & --- & arbitrary \\
\mathtext{MR}\xspace & none & convex & convex & convex & ---\\
\hline\hline
\end{tabular}
\end{rev}
\end{table}
\begin{table}[t]
\caption{Summary of examples showing differences between aggregate semantics, where $X = \{o_{a,b},o_{a,c},o_{b,c},c_{a,b},c_{a,c}\}$.}\label{tab:relationships}
\begin{tabular}{cccccc}
\hline\hline
Program & \mathtext{FFLP}\xspace & \mathtext{GZ}\xspace & \mathtext{LPST}\xspace & \mathtext{MR}\xspace & \mathtext{DPB}\xspace \\
\hline
$\ensuremath{P}\xspace_1$ & $\{p,q\}$ & --- & --- & $\{p,q\}$ & $\{p,q\}$ \\
Example~\ref{ex:model} & Example~\ref{ex:minmodel} & Example~\ref{ex:fflp} & Example~\ref{ex:fflp} & Example~\ref{ex:fflp} & Example~\ref{ex:fflp} \\
\,\\
$\ensuremath{P}\xspace_1'$ & $\{p,q,s\}$ & --- & --- & $\{p,q,s\}$ & --- \\
Example~\ref{ex:fflp} & Example~\ref{ex:fflp} & Example~\ref{ex:fflp} & Example~\ref{ex:fflp} & Example~\ref{ex:fflp} & Example~\ref{ex:fflp} \\
\,\\
$\ensuremath{P}\xspace_2$ & --- & --- & --- & --- & $\{p\}$ \\
Example~\ref{ex:unsatisfiable} & Example~\ref{ex:unsatisfiable} & Example~\ref{ex:pdb} & Example~\ref{ex:pdb} & Example~\ref{ex:pdb} & Example~\ref{ex:pdb} \\
\,\\
& & & & $\{x_1,y_2,z_1,z_2,p\}$, \\
& & & & $\{y_1,y_2,z_1,z_2,p\}$, \\
$\ensuremath{P}\xspace_3$ & $\{y_1,x_2,z_1,z_2,p\}$ & --- & $\{y_1,x_2,z_1,z_2,p\}$ & $\{y_1,x_2,z_1,z_2,p\}$\, & $\{y_1,x_2,z_1,z_2,p\}$ \\
Example~\ref{ex:subsum} & Example~\ref{ex:subsum} & Example~\ref{ex:mr} & Example~\ref{ex:mr} & Example~\ref{ex:mr} & Example~\ref{ex:mr} \\
\,\\
$\ensuremath{P}\xspace_4$ & $X$ & $X$ & $X$ & $X$ & $X$ \\
Example~\ref{ex:gz} & Example~\ref{ex:gz} & Example~\ref{ex:gz} & Example~\ref{ex:gz} & Example~\ref{ex:gz} & Example~\ref{ex:gz} \\
\,\\
$\ensuremath{P}\xspace_4'$ & $X$ & --- & $X$ & $X$ & $X$ \\
Example~\ref{ex:gz} & Example~\ref{ex:gz} & Example~\ref{ex:gz} & Example~\ref{ex:gz} & Example~\ref{ex:gz} & Example~\ref{ex:gz} \\
\hline\hline
\end{tabular}
\end{table}
The most restrictive semantics is obtained with \mathtext{GZ}\xspace-answer sets, in the sense
that the fewest models $X$ of a program $\ensuremath{P}\xspace$ pass the construction by means of $\tpx{\mathtext{GZ}\xspace}{\ensuremath{P}\xspace}{X}$.
As $\tpx{\mathtext{LPST}\xspace}{\ensuremath{P}\xspace}{X}$ relaxes the conditions for concluding head atoms,
\mathtext{LPST}\xspace-answer sets are guaranteed to include \mathtext{GZ}\xspace-answer sets, as indicated by
an arc without label in Figure~\ref{fig:answersets}.
The observation that $(Y,X)\sat{\mathtext{LPST}\xspace} \body{r}$, for some rule $r\in\ensuremath{P}\xspace$ and $Y\subseteq X$,
implies $Z\models \body{r}$ for every interpretation $Y\subseteq Z\subseteq X$
yields that $\head{r}\subseteq \tpc{\mathtext{DPB}\xspace}{\ensuremath{P}\xspace}{X}{Y}$,
so that each \mathtext{LPST}\xspace-answer set $X$ of \ensuremath{P}\xspace is a \mathtext{DPB}\xspace-answer set as well.
Moreover, when $Y\subset X$ for an \mathtext{LPST}\xspace-answer set $X$ of \ensuremath{P}\xspace,
the fact that $\tpc{\mathtext{LPST}\xspace}{\ensuremath{P}\xspace}{X}{Y}\nsubseteq Y$ shows that $Y$ is not a model
of the reduct $\reduct{\ensuremath{P}\xspace}{X}$,
which in turn witnesses that $X$ is a $\subseteq$-minimal model of $\reduct{\ensuremath{P}\xspace}{X}$
and thus an \mathtext{FFLP}\xspace-answer set of \ensuremath{P}\xspace.
The last general relationship that applies for programs with arbitrary aggregate expressions
expresses that each \mathtext{FFLP}\xspace-answer set~$X$ of \ensuremath{P}\xspace is also an \mathtext{MR}\xspace-answer set, given that
$Y\ensuremath{\not\models}\xspace \reduct{\ensuremath{P}\xspace}{X}$, for any interpretation $Y\subset X$,
implies that $\tpc{\mathtext{MR}\xspace}{\ensuremath{P}\xspace}{X}{Y}\nsubseteq Y$.
As discussed in \begin{rev}Examples~\ref{ex:pdb} and~\ref{ex:fflp}\end{rev},
\mathtext{FFLP}\xspace- and \mathtext{DPB}\xspace-answer sets can be mutually distinct,
so that no (transitive) general relationship is obtained between these two aggregate semantics.
Considering relationships for convex, monotone, or anti-monotone aggregate expressions,
an \mathtext{MR}\xspace-answer set $X$ of \ensuremath{P}\xspace is also an \mathtext{LPST}\xspace-answer set when the program \ensuremath{P}\xspace
includes convex aggregate expressions only.
This follows from the observation that, for
a convex aggregate expression $A$ and each interpretation $Y\subseteq X$,
the conditions $X\models A$ and $Z\models A$, for some $Z\subseteq Y$, of
$(Y,X)\sat{\mathtext{MR}\xspace} A$ yield the condition of $(Y,X)\sat{\mathtext{LPST}\xspace} A$ that
$Z\models A$ for every $Y\subseteq Z\subseteq X$.
The general relationship between \mathtext{LPST}\xspace- and \mathtext{FFLP}\xspace-answer sets then further
implies that $X$ is an \mathtext{FFLP}\xspace-answer set of~\ensuremath{P}\xspace as well,
so that \mathtext{FFLP}\xspace-, \mathtext{LPST}\xspace-, and \mathtext{MR}\xspace-answer sets coincide for programs with
convex aggregate expressions only.
For establishing similar correspondences to \mathtext{DPB}\xspace-answer sets,
as Example~\ref{ex:pdb} shows,
programs with convex or both monotone and anti-monotone
aggregate expressions, respectively, are still too general.
However, when the aggregate expressions in a program \ensuremath{P}\xspace are monotone or anti-monotone only,
for interpretations $Y\subseteq X$,
the intersection over all $Y\subseteq Z\subseteq X$ taken by
$\tpc{\mathtext{DPB}\xspace}{\ensuremath{P}\xspace}{X}{Y}$ collapses to checking whether rule bodies
are satisfied by $Y$ or $X$, respectively,
while satisfaction by other interpretations $Z$ is a consequence of
(anti-)monotonicity.
Hence, we have that $\tpc{\mathtext{LPST}\xspace}{\ensuremath{P}\xspace}{X}{Y}=\tpc{\mathtext{DPB}\xspace}{\ensuremath{P}\xspace}{X}{Y}$,
which means that each \mathtext{DPB}\xspace-answer set~$X$ of \ensuremath{P}\xspace is also an \mathtext{LPST}\xspace-answer set
in case of monotone or anti-monotone aggregate expressions only.
By (transitive) general relationships,
this correspondence carries forward to \mathtext{FFLP}\xspace- and \mathtext{MR}\xspace-answer sets.
\begin{rev}
Interestingly, \mathtext{GZ}\xspace-answer sets do not correspond to the other semantics even for programs whose aggregate expressions are restricted to be monotone.
\end{rev}
For instance,
the program \ensuremath{P}\xspace consisting of the rule
$p \leftarrow \mathtext{sum}\xspace\lits{1:p} \geq 0$,
which includes the monotone as well as anti-monotone aggregate expression $\mathtext{sum}\xspace\lits{1:p} \geq 0$,
has $\{p\}$ as an answer set under all aggregate semantics but \mathtext{GZ}\xspace,
where the latter is due to
$\tpu{\mathtext{GZ}\xspace}{\ensuremath{P}\xspace}{\{p\}}{\infty}=\tpu{\mathtext{GZ}\xspace}{\ensuremath{P}\xspace}{\{p\}}{0}=\emptyset$
in view of $\atoms{\mathtext{sum}\xspace\lits{1:p} \geq 0}\cap \{p\}\neq \emptyset$.
As $\{p\}$ is the unique model of \ensuremath{P}\xspace,
this means that \ensuremath{P}\xspace does not have any \mathtext{GZ}\xspace-answer set,
even though \ensuremath{P}\xspace includes only one aggregate expression that is both monotone and anti-monotone.
Such a behavior is justified by \citeN{gelzha19a} by a more uniform treatment of recursive symbolic rules like the following:
\begin{asp}
p :- #sum{1 : p} >= 0.
p :- #sum{1 : p} = S, S >= 0.
\end{asp}
In fact, a program consisting of the second rule above, would be instantiated as\pagebreak[1]
\begin{alignat*}{1}
& p \leftarrow \mathtext{sum}\xspace\lits{1: p} = 0\\
& p \leftarrow \mathtext{sum}\xspace\lits{1: p} = 1
\end{alignat*}
which has no answer sets according to all semantics discussed in this paper.
\section{Computational Complexity of Aggregates}\label{sec:complexity}
The expressiveness of programs with aggregate expressions can be assessed in terms of the
computational complexity \begin{rev}\cite{garjoh79}\end{rev} of specific reasoning tasks.
To this end, we investigate the following two decision problems for $\ensuremath{\Delta}\xspace\in\{\mathtext{FFLP}\xspace,\mathtext{GZ}\xspace,\mathtext{LPST}\xspace,\mathtext{MR}\xspace,\mathtext{DPB}\xspace\}$:
\begin{description}
\item[\textnormal{\textbf{Check}\xspace:}]
For a program \ensuremath{P}\xspace and an interpretation $X\subseteq\ensuremath{\mathcal{P}}\xspace$,
decide whether $X$ is a \ensuremath{\Delta}\xspace-answer set of~\ensuremath{P}\xspace.
\item[\textnormal{\textbf{Exist}\xspace:}]
For a program \ensuremath{P}\xspace, decide whether there is some \ensuremath{\Delta}\xspace-answer set of~\ensuremath{P}\xspace.
\end{description}
The complexity of both tasks is well-understood \begin{rev}\cite{daeigovo01a}\end{rev}
for programs \ensuremath{P}\xspace in which rule bodies consist of (negated) propositional atoms~$p$,
corresponding to aggregate expressions of the form $\mathtext{sum}\xspace\lits{1:p}>0$ or $\mathtext{sum}\xspace\lits{1:p}<1$,
under standard answer set semantics \cite{gellif88b,gellif91a}.
Here the complexity of reasoning tasks depends on whether \ensuremath{P}\xspace is non-disjunctive or not,
\textbf{Check}\xspace is \mathtext{P}\xspace-complete (i.e., tractable) in the non-disjunctive case,
and \mathtext{coNP}\xspace-complete otherwise.
The \textbf{Exist}\xspace task, where no interpretation $X\subseteq \ensuremath{\mathcal{P}}\xspace$ is fixed,
is \mathtext{NP}\xspace-complete when \ensuremath{P}\xspace is non-disjunctive,
and in general \ensuremath{\Sigma_2^\poly}\xspace-complete in the presence of (proper) disjunctive rules.
The latter means that two orthogonal combinatorial problems are interleaved,
one about determining candidate models~$X$ among an exponential number of interpretations,
and the other concerning the check that no $Y\subset X$ is a model of the reduct relative to~$X$ (again, the search space for $Y$ is exponential).
Given that (proper) disjunctive rules lead to elevated computational complexity
already for the simple forms of aggregate expressions resembling (negated) propositional atoms,
we again assume programs to be non-disjunctive in the following.
This allows us to study the complexity of the \textbf{Check}\xspace and \textbf{Exist}\xspace tasks
for \ensuremath{\Delta}\xspace-answer sets relative to $\ensuremath{\Delta}\xspace\in\{\mathtext{FFLP}\xspace,\mathtext{GZ}\xspace,\mathtext{LPST}\xspace,\mathtext{MR}\xspace,\mathtext{DPB}\xspace\}$
and the monotonicity of aggregate expressions,
where the obtained complexity classes are summarized in Table~\ref{tab:complexity}.
Except for the complexity class~\mathtext{P}\xspace, for which we indicate membership but not
necessarily hardness, our considerations address completeness, i.e.,
membership along with hardness for some complexity class beyond~\mathtext{P}\xspace.
In Section~\ref{subsec:check},
we investigate the computational complexity of the \textbf{Check}\xspace task in detail,
and Section~\ref{subsec:exist} provides a closer study of the \textbf{Exist}\xspace task.
\begin{table}[t]
\caption{Computational complexity of the \textbf{Exist}\xspace and \textbf{Check}\xspace
reasoning tasks for different aggregate semantics and the
monotonicity of aggregate expressions included in non-disjunctive programs,
where cases in which elevated complexity relies on the \mathtext{NP}\xspace-hardness of
deciding whether aggregate expressions under consideration are satisfiable
are indicated by lower complexity classes obtained with tractable
satisfiability checks in parentheses.\label{tab:complexity}}
\setlength{\tabespace}{\widthof{)}}
\renewcommand{\arraystretch}{1.2}
\begin{tabular}{rrrrrrl}
\hline\hline
Monotonicity & \mathtext{GZ}\xspace & \mathtext{MR}\xspace & \mathtext{LPST}\xspace & \mathtext{FFLP}\xspace & \mathtext{DPB}\xspace &
\\
\hline
monotone & \mathtext{P}\xspace & \mathtext{P}\xspace & \mathtext{P}\xspace & \mathtext{P}\xspace & \mathtext{P}\xspace & \multirow{4}{*}{\rotatebox{270}{\textbf{Check}\xspace\hspace{0.5em}}}
\\
anti-monotone & \mathtext{P}\xspace & \mathtext{P}\xspace & \mathtext{P}\xspace & \mathtext{P}\xspace & \mathtext{P}\xspace &
\\
convex & \mathtext{P}\xspace & \mathtext{P}\xspace & \mathtext{P}\xspace & \mathtext{P}\xspace & \mathtext{coNP}\xspace &
\\
arbitrary & \mathtext{P}\xspace & \mathtext{NP}\xspace (\mathtext{P}\xspace)\hspace*{-\tabespace} & \mathtext{coNP}\xspace (\mathtext{P}\xspace)\hspace*{-\tabespace} & \mathtext{coNP}\xspace & \mathtext{coNP}\xspace &
\\
\hline
monotone & \mathtext{P}\xspace & \mathtext{P}\xspace & \mathtext{P}\xspace & \mathtext{P}\xspace & \mathtext{P}\xspace & \multirow{4}{*}{\rotatebox{270}{\textbf{Exist}\xspace\hspace{0.5em}}}
\\
anti-monotone & \mathtext{NP}\xspace & \mathtext{NP}\xspace & \mathtext{NP}\xspace & \mathtext{NP}\xspace & \mathtext{NP}\xspace &
\\
convex & \mathtext{NP}\xspace & \mathtext{NP}\xspace & \mathtext{NP}\xspace & \mathtext{NP}\xspace & \ensuremath{\Sigma_2^\poly}\xspace &
\\
arbitrary & \mathtext{NP}\xspace & \mathtext{NP}\xspace & \ensuremath{\Sigma_2^\poly}\xspace (\mathtext{NP}\xspace)\hspace*{-\tabespace} & \ensuremath{\Sigma_2^\poly}\xspace & \ensuremath{\Sigma_2^\poly}\xspace &
\\
\hline\hline
\end{tabular}
\end{table}
\subsection{Answer Set Checking}\label{subsec:check}
Starting with \textbf{Check}\xspace for (non-disjunctive) programs \ensuremath{P}\xspace including monotone or
anti-monotone aggregate expressions only,
we have that the task stays in \mathtext{P}\xspace for all \begin{rev}aggregate\end{rev} semantics.
An intuitive explanation is that all but the \mathtext{GZ}\xspace-answer set semantics coincide
for such programs and that a construction, e.g., by means of $\tpc{\mathtext{DPB}\xspace}{\ensuremath{P}\xspace}{X}{Y}$,
for some $Y\subseteq X$, can focus on concluding head atoms of rules $r\in\ensuremath{P}\xspace$
such that $Y\models \body{r}$ or $X\models \body{r}$, respectively.
\begin{rev}For $\tpc{\mathtext{GZ}\xspace}{\ensuremath{P}\xspace}{X}{Y}$, also the additional condition $\atoms{A}\cap Y = \atoms{A}\cap X$
needs to be checked for each aggregate expression $A\in\body{r}$.
Regardless of the particular semantics, all relevant checks can be accomplished in polynomial time:
$X\models \ensuremath{P}\xspace$ to make sure that $X$ is a model of~\ensuremath{P}\xspace,
$Y\models \body{r}$ or $X\models \body{r}$ for rules $r\in\ensuremath{P}\xspace$, and possibly
$\atoms{A}\cap Y = \atoms{A}\cap X$ for aggregate expressions $A\in\body{r}$.\end{rev}
The strong condition $\atoms{A}\cap Y = \atoms{A}\cap X$ for $(Y,X)\sat{\mathtext{GZ}\xspace} A$
also circumvents elevated complexity of \textbf{Check}\xspace under \mathtext{GZ}\xspace-answer set semantics
when turning to programs with convex or arbitrary, i.e., possibly non-convex, aggregate expressions.
In case of convex aggregate expressions, which include monotone as well as anti-monotone
aggregate expressions,
the \textbf{Check}\xspace task remains tractable for $\ensuremath{\Delta}\xspace\in\{\mathtext{FFLP}\xspace,\mathtext{LPST}\xspace,\mathtext{MR}\xspace\}$,
given that the three semantics coincide, and for an aggregate expression~$A$, checking
$Y\models A$ and $X\models A$ is sufficient to conclude that
$(Y,X)\sat{\mathtext{LPST}\xspace} A$ as well as $(Y,X)\sat{\mathtext{MR}\xspace} A$.
Unlike that, \textbf{Check}\xspace becomes more complex, i.e., \mathtext{coNP}\xspace-complete,
for \mathtext{DPB}\xspace-answer sets of programs with convex aggregate expressions, where
\citeN{dematr04a} show \mathtext{coNP}\xspace-hardness by reduction from deciding whether
a propositional formula in disjunctive normal form is a tautology.
Notably, the logic program given in this reduction does not refer to
(sophisticated) aggregates, and the simultaneous availability of
monotone and anti-monotone
aggregate expressions of the form $\mathtext{sum}\xspace\lits{1:p}>0$ or $\mathtext{sum}\xspace\lits{1:p}<1$
to express (negated) propositional atoms~$p$ is already sufficient.
This complexity does also not increase any further in the presence of
non-convex aggregate expressions, as for disproving $X$ to be a
\mathtext{DPB}\xspace-answer set of \ensuremath{P}\xspace, it is sufficient to check that $X\ensuremath{\not\models}\xspace \ensuremath{P}\xspace$,
or otherwise to determine a collection of (not necessarily distinct) interpretations
$Y_1\subseteq X,\dots,Y_{|X|}\subseteq X$ such that
$Z\subseteq Y$ and $Z\subset X$ hold for
$Y= Y_1\cap \dots\cap Y_{|X|}$ and
\begin{alignat*}{1}
Z=\left( \mbox{$\bigcup$}_{r\in\ensuremath{P}\xspace,Y_1 \models\body{r}}\head{r} \right)\cap \dots\cap
\left( \mbox{$\bigcup$}_{r\in\ensuremath{P}\xspace,Y_{|X|}\models\body{r}}\head{r} \right)\cap X\text{.}
\end{alignat*}
In the latter case, we have that
$\tpc{\mathtext{DPB}\xspace}{\ensuremath{P}\xspace}{X}{Y}\subseteq Y$ and
$\tpc{\mathtext{DPB}\xspace}{\ensuremath{P}\xspace}{X}{Y}\subset X$ for
$Y = Y_1\cap \dots\cap Y_{|X|}\subseteq X$,
which in turn implies that $\tpu{\mathtext{DPB}\xspace}{\ensuremath{P}\xspace}{X}{\infty}\subseteq\tpc{\mathtext{DPB}\xspace}{\ensuremath{P}\xspace}{X}{Y}\subset X$.
Moreover, when $\tpu{\mathtext{DPB}\xspace}{\ensuremath{P}\xspace}{X}{\infty}\subset X$, note that
at most $|X\setminus\tpu{\mathtext{DPB}\xspace}{\ensuremath{P}\xspace}{X}{\infty}|\leq |X|$ many
interpretations $\tpu{\mathtext{DPB}\xspace}{\ensuremath{P}\xspace}{X}{\infty}\subseteq Y\subseteq X$
are needed to show that none of the atoms in $X\setminus\tpu{\mathtext{DPB}\xspace}{\ensuremath{P}\xspace}{X}{\infty}$
belongs to $\tpc{\mathtext{DPB}\xspace}{\ensuremath{P}\xspace}{X}{\tpu{\mathtext{DPB}\xspace}{\ensuremath{P}\xspace}{X}{\infty}}$,
so that \textbf{Check}\xspace under \mathtext{DPB}\xspace-answer set semantics stays in \mathtext{coNP}\xspace
for programs with arbitrary aggregate expressions.
For $\ensuremath{\Delta}\xspace\in\{\mathtext{FFLP}\xspace,\mathtext{LPST}\xspace,\mathtext{MR}\xspace\}$,
arbitrary aggregate expressions make a difference regarding the complexity of the \textbf{Check}\xspace task.
Concerning \mathtext{FFLP}\xspace-answer sets, membership in \mathtext{coNP}\xspace is immediate as checking that
$X\ensuremath{\not\models}\xspace \ensuremath{P}\xspace$ or $Y\models \reduct{\ensuremath{P}\xspace}{X}$, for some $Y\subset X$, is tractable.
The \mathtext{coNP}\xspace-hardness can be established by a reduction from disjunctive programs to
programs with nested implications due to \citeN{ferraris11a}, which replaces a
disjunctive rule like $p\vee q\leftarrow \top$ by two rules
$p\leftarrow \underline{(p\leftarrow q)}$ and $q\leftarrow \underline{(q\leftarrow p)}$.
(Note that rule bodies with nested implications are underlined to avoid any ambiguity with rules.)
These nested implications are satisfied by the empty interpretation~$\emptyset$,
become unsatisfied by $\{q\}$ or $\{p\}$, respectively, and are satisfied by
the remaining interpretations, in particular, the extended interpretation $\{p,q\}$.
Such satisfaction can in turn be captured in terms of non-convex aggregate expressions like
$\mathtext{sum}\xspace\lits{1:p,-1:q}\geq 0$ and $\mathtext{sum}\xspace\lits{-1:p,1:q}\geq 0$ for $\underline{(p\leftarrow q)}$
or $\underline{(q\leftarrow p)}$, respectively, and various other representations, e.g.,
$\mathtext{max}\xspace\lits{1:p,-1:q}\neq -1$ or $\mathtext{avg}\xspace\lits{0:x,-1:p,1:q}\geq 0$, where $x\leftarrow \top$
is used as an auxiliary fact, yield the same effect.
This shows that \textbf{Check}\xspace under \mathtext{FFLP}\xspace-answer set semantics is \mathtext{coNP}\xspace-complete for programs
including non-convex aggregate expressions \begin{rev}\cite{alvfab13a}\end{rev}.
Turning to \mathtext{LPST}\xspace-answer sets, an interpretation $Y\subset X$ disproves a model $X$
of \ensuremath{P}\xspace to be an \mathtext{LPST}\xspace-answer set of \ensuremath{P}\xspace, if for each rule $r\in\ensuremath{P}\xspace$
with $\head{r}\nsubseteq Y$,
we find an aggregate expression $A\in\body{r}$ along with some $Y\subseteq Z\subseteq X$
such that $Z\ensuremath{\not\models}\xspace A$.
As the problem of checking the existence of such a counterexample $Y$ belongs to \mathtext{NP}\xspace,
the complementary \textbf{Check}\xspace task for \mathtext{LPST}\xspace-answer sets is a member of \mathtext{coNP}\xspace.
The \mathtext{coNP}\xspace-hardness though depends on the complexity of deciding whether
$(Y,X)\sat{\mathtext{LPST}\xspace} A$ for an aggregate expression~$A$,
which is intractable if and only if\xspace deciding the satisfiability
of the complement of~$A$, obtainable by inverting the comparison operator of~$A$,
e.g.,
$\mathtext{agg}\xspace\lits{w_1:p_1,\dots,w_n:p_n}=\ensuremath{w_0}\xspace$
when $A$ is of the form $\mathtext{agg}\xspace\lits{w_1:p_1,\dots,w_n:p_n}\neq\ensuremath{w_0}\xspace$,
is \mathtext{NP}\xspace-complete.
As discussed in Section~\ref{subsec:satisfiability},
such elevated complexity applies to $\mathtext{agg}\xspace\in\{\mathtext{sum}\xspace,\linebreak[1]\mathtext{times}\xspace,\linebreak[1]\mathtext{avg}\xspace\}$
in combination with the (complementary) comparison operator~$=$.
Hence, \textbf{Check}\xspace for \mathtext{LPST}\xspace-answer sets is only \mathtext{coNP}\xspace-complete
when \ensuremath{P}\xspace includes aggregate expressions
$\mathtext{agg}\xspace\lits{w_1:p_1,\linebreak[1]\dots,\linebreak[1]w_n:p_n}\neq\ensuremath{w_0}\xspace$
with $\mathtext{agg}\xspace\in\{\mathtext{sum}\xspace,\linebreak[1]\mathtext{times}\xspace,\linebreak[1]\mathtext{avg}\xspace\}$,
while it drops to \mathtext{P}\xspace otherwise,
even in the presence of other forms of non-convex aggregate expressions like
$\mathtext{avg}\xspace\lits{w_1:p_1,\linebreak[1]\dots,\linebreak[1]w_n:p_n}\geq\ensuremath{w_0}\xspace$ or
$\mathtext{min}\xspace\lits{w_1:p_1,\linebreak[1]\dots,\linebreak[1]w_n:p_n}\neq\ensuremath{w_0}\xspace$.
\begin{example}\label{ex:checklpst}
Consider the program~$\ensuremath{P}\xspace_5$ as follows:\pagebreak[1]
\begin{alignat}{1}
\label{eq12:r20}\tag{$r_{20}$}
& x_1 \leftarrow \mathtext{sum}\xspace\lits{1:p} > 0
\\
\label{eq12:r21}\tag{$r_{21}$}
& x_2 \leftarrow \mathtext{sum}\xspace\lits{1:p} > 0
\\
\label{eq12:r22}\tag{$r_{22}$}
& x_3 \leftarrow \mathtext{sum}\xspace\lits{1:p} > 0
\\
\label{eq12:r23}\tag{$r_{23}$}
& p \leftarrow \mathtext{sum}\xspace\lits{2 : x_1, 2 : x_2, 3 : x_3} \neq 5
\end{alignat}
For deciding whether the interpretation $X=\{x_1,x_2,x_3,p\}$
is an \mathtext{LPST}\xspace-answer set of $\ensuremath{P}\xspace_5$,
starting from $\tpu{\mathtext{LPST}\xspace}{\ensuremath{P}\xspace_5}{X}{0}=\emptyset$,
we need to check the condition of $(\emptyset,X)\sat{\mathtext{LPST}\xspace} \body{$\ref{eq12:r23}$}$
that $Z\models \mathtext{sum}\xspace\lits{2 : x_1,\linebreak[1] 2 : x_2,\linebreak[1] 3 : x_3} \neq 5$ for every $Z\subseteq X$.
This condition fails if and only if\xspace the complementary aggregate expression
$A = \mathtext{sum}\xspace\lits{2 : x_1,\linebreak[1] 2 : x_2,\linebreak[1] 3 : x_3} = 5$
is satisfiable, i.e.,
when $\eval{A}{Z} = 5$ for some $Z\subseteq X$.
As $Z_1=\{x_1,x_3\}$ and $Z_2=\{x_2,x_3\}$ are such that
$\eval{A}{Z_1} = \eval{A}{Z_2} = 5$, the complementary aggregate expression~$A$
is satisfiable, so that $(\emptyset,X)\unsat{\mathtext{LPST}\xspace} \body{$\ref{eq12:r23}$}$ and
$\tpu{\mathtext{LPST}\xspace}{\ensuremath{P}\xspace_5}{X}{\infty}=\tpu{\mathtext{LPST}\xspace}{\ensuremath{P}\xspace_5}{X}{0}=\emptyset$ disproves $X$
to be an \mathtext{LPST}\xspace-answer set of $\ensuremath{P}\xspace_5$.
When we replace the rule \ref{eq12:r23} by
\begin{alignat}{1}
\label{eq12:r23p}\tag{$r_{23}'$}
& p \leftarrow \mathtext{sum}\xspace\lits{2 : x_1, 2 : x_2, 3 : x_3} \neq 6
\end{alignat}
to obtain $\ensuremath{P}\xspace_5'$,
there is no interpretation $Z\subseteq X$ such that
$\eval{\mathtext{sum}\xspace\lits{2 : x_1, 2 : x_2, 3 : x_3} = 6}{Z} =\nolinebreak 6$.
In turn, we have that
$Z\models \mathtext{sum}\xspace\lits{2 : x_1,\linebreak[1] 2 : x_2,\linebreak[1] 3 : x_3} \neq 6$
for every $Z\subseteq X$,
which means that the condition of
$(\emptyset,X)\sat{\mathtext{LPST}\xspace} \body{$\ref{eq12:r23p}$}$ applies and
$\tpu{\mathtext{LPST}\xspace}{\ensuremath{P}\xspace_5'}{X}{1}=\tpc{\mathtext{LPST}\xspace}{\ensuremath{P}\xspace_5'}{X}{\emptyset}=\{p\}$.
Given that $\eval{\mathtext{sum}\xspace\lits{1:p} > 0}{\linebreak[1]Z}=1$
for all interpretations $\{p\}\subseteq Z$,
we get $(\{p\},X)\sat{\mathtext{LPST}\xspace} \body{r}$ for every $r\in\ensuremath{P}\xspace_5'$,
which leads to
$\tpu{\mathtext{LPST}\xspace}{\ensuremath{P}\xspace_5'}{X}{\infty}=
\tpu{\mathtext{LPST}\xspace}{\ensuremath{P}\xspace_5'}{X}{2}=
\tpc{\mathtext{LPST}\xspace}{\ensuremath{P}\xspace_5'}{X}{\{p\}}=
\{x_1,x_2,x_3,p\}= X$.
This shows that $X$ is an \mathtext{LPST}\xspace-answer set of $\ensuremath{P}\xspace_5'$.
The programs $\ensuremath{P}\xspace_5$ and $\ensuremath{P}\xspace_5'$ illustrate that the \textbf{Check}\xspace task
for \mathtext{LPST}\xspace-answer sets can be used to decide whether an
instance of the \mathtext{NP}\xspace-complete \emph{subset sum} problem
is (un)satisfiable,
as programs following the same scheme along with an interpretation
consisting of all atoms capture the complement of \emph{subset sum}
for arbitrary multisets of weights and bounds.
Moreover, Section~\ref{subsec:satisfiability} discusses reductions
of \emph{subset sum} and the likewise \mathtext{NP}\xspace-complete \emph{subset product} problem
to the satisfiability of aggregate expressions with \mathtext{avg}\xspace or \mathtext{times}\xspace, respectively,
so that their complementary aggregate expressions with $\neq$ as comparison operator
also make the \textbf{Check}\xspace task \mathtext{coNP}\xspace-complete.%
\end{example}
For a program \ensuremath{P}\xspace with arbitrary aggregate expressions and a given model $X$ of \ensuremath{P}\xspace,
the \textbf{Check}\xspace task of deciding whether $X$ is an \mathtext{MR}\xspace-answer set of \ensuremath{P}\xspace
can be accomplished by \begin{rev}guessing\end{rev}, for each aggregate expression
$A\in\bigcup_{r\in\reduct{\ensuremath{P}\xspace}{X}}\body{r}$,
an interpretation $Z_A\subseteq X$ such that $Z_A\models A$.
Given that $X\models A$, such an interpretation $Z_A$ exists for
every $A$ under consideration and can be used to witness that
$(Y,X)\sat{\mathtext{MR}\xspace} A$ for interpretations $Z_A\subseteq Y\subseteq X$.
Checking whether $Z_A\subseteq Y$ instead of taking the condition of $(Y,X)\sat{\mathtext{MR}\xspace} A$
as such, in order to approximate
$\tpc{\mathtext{MR}\xspace}{\ensuremath{P}\xspace}{X}{Y}$ for some $Y\subseteq X$,
yields a tractable immediate consequence operator,
whose least fixpoint matches $\tpu{\mathtext{MR}\xspace}{\ensuremath{P}\xspace}{X}{\infty}$ for well-chosen
interpretations $Z_A$.
This shows that the \textbf{Check}\xspace task for \mathtext{MR}\xspace-answer sets stays in \mathtext{NP}\xspace
also in the presence of non-convex aggregate expressions.
For establishing \mathtext{NP}\xspace-hardness,
the complexity of checking the existence of some $Z\subset\atoms{A}\cap X$ such that
$Z\models A$ for an aggregate expression $A$ with $X\models A$ matters, as the
construction of $\tpu{\mathtext{MR}\xspace}{\ensuremath{P}\xspace}{X}{\infty}$ gets tractable and
the complexity of \textbf{Check}\xspace drops to \mathtext{P}\xspace when the satisfiability of
aggregate expressions (by some smaller interpretation) can be
determined in polynomial time.
As the discussion in Section~\ref{subsec:satisfiability} shows,
deciding satisfiability is \mathtext{NP}\xspace-hard only for aggregate expressions with
\mathtext{sum}\xspace, \mathtext{times}\xspace, or \mathtext{avg}\xspace along with
the comparison operator~$=$,
so that any other (non-convex) aggregate expressions do not make the \textbf{Check}\xspace task
\mathtext{NP}\xspace-complete.
However, for an aggregate expression $A$ of the form
$\mathtext{times}\xspace\lits{w_1:p_1,\linebreak[1]\dots,\linebreak[1]w_n:p_n}=\ensuremath{w_0}\xspace$ such that
$\ensuremath{w_0}\xspace=0$, only singletons $Z=\{p\}$ with $\eval{A}{Z}=0$
are relevant as subsets $Z\subset\atoms{A}\cap X$ such that $Z\models A$.
Otherwise, if $w_0\neq 0$,
we have to guarantee that
$\eval{A}{X\setminus Z}=1$,
so that a linear collection of ($\subseteq$-minimal) subsets $Z\subset \atoms{A}\cap X$
with $Z\models A$ is obtained
by excluding atoms $p\in X$ such that $\eval{A}{\{p\}}=1$ together with
a maximum even number of atoms $p\in X$ such that $\eval{A}{\{p\}}=-1$.
As there are at most $|\atoms{A}\cap X|$ relevant $Z\subset \atoms{A}\cap X$
in either case, aggregate expressions with \mathtext{times}\xspace do not yield \mathtext{NP}\xspace-completeness
of the \textbf{Check}\xspace task for \mathtext{MR}\xspace-answer sets.
The next example illustrates that this is different for
aggregate expressions with \mathtext{sum}\xspace or \mathtext{avg}\xspace
along with the comparison operator~$=$.
\begin{example}\label{ex:checkmr}
Let us investigate the model $X=\{x_1,x_2,x_3,p\}$ of the following program~$\ensuremath{P}\xspace_6$:\pagebreak[1]
\begin{alignat}{1}
\label{eq13:r24}\tag{$r_{24}$}
& x_1 \leftarrow \top
\\
\label{eq13:r25}\tag{$r_{25}$}
& x_2 \leftarrow \top
\\
\label{eq13:r26}\tag{$r_{26}$}
& x_3 \leftarrow \top
\\
\label{eq13:r27}\tag{$r_{27}$}
& p \leftarrow \mathtext{sum}\xspace\lits{2 : x_1, 2 : x_2, 3 : x_3, -2 : p} = 5
\end{alignat}
In order to decide whether $X$ is an \mathtext{MR}\xspace-answer set of $\ensuremath{P}\xspace_6$, we need to
construct $\tpu{\mathtext{MR}\xspace}{\ensuremath{P}\xspace_6}{X}{\infty}$,
where
$\tpu{\mathtext{MR}\xspace}{\ensuremath{P}\xspace_6}{X}{1}=\tpc{\mathtext{MR}\xspace}{\ensuremath{P}\xspace_6}{X}{\emptyset}=\{x_1,x_2,x_3\}$
in view of the facts
\ref{eq13:r24}, \ref{eq13:r25}, and \ref{eq13:r26}.
Then, the condition of $(\{x_1,x_2,x_3\},X)\sat{\mathtext{MR}\xspace} \body{$\ref{eq13:r27}$}$
is fulfilled if there is some interpretation
$Z\subseteq \{x_1,x_2,x_3\}$ such that
$\eval{\mathtext{sum}\xspace\lits{2 : x_1,\linebreak[1] 2 : x_2,\linebreak[1] 3 : x_3,\linebreak[1] -2 : p} = 5}{Z} = 5$.
This is the case for $Z=\{x_1,x_3\}$ (and $Z=\{x_2,x_3\}$), so that
\begin{alignat*}{1}
\tpu{\mathtext{MR}\xspace}{\ensuremath{P}\xspace_6}{X}{\infty}=\tpu{\mathtext{MR}\xspace}{\ensuremath{P}\xspace_6}{X}{2}=\tpc{\mathtext{MR}\xspace}{\ensuremath{P}\xspace_6}{X}{\{x_1,x_2,x_3\}}=
\{x_1,x_2,x_3,p\}=X\text{.}
\end{alignat*}
When we replace the rule \ref{eq13:r27} by
\begin{alignat}{1}
\label{eq13:r27p}\tag{$r_{27}'$}
& p \leftarrow \mathtext{sum}\xspace\lits{2 : x_1, 2 : x_2, 3 : x_3, -1 : p} = 6
\end{alignat}
in the modified program $\ensuremath{P}\xspace_6'$,
there is no $Z\subseteq \{x_1,x_2,x_3\}$ such that
$\eval{\mathtext{sum}\xspace\lits{2 : x_1,\linebreak[1] 2 : x_2,\linebreak[1] 3 : x_3,\linebreak[1] -1 : p} = 6}{Z} = 6$,
so that
$\tpu{\mathtext{MR}\xspace}{\ensuremath{P}\xspace_6'}{X}{\infty}=\tpu{\mathtext{MR}\xspace}{\ensuremath{P}\xspace_6'}{X}{1}=\{x_1,x_2,x_3\}$
disproves $X$ to be an \mathtext{MR}\xspace-answer set of $\ensuremath{P}\xspace_6'$.
Both programs $\ensuremath{P}\xspace_6$ and $\ensuremath{P}\xspace_6'$
are devised such that the construction of
$\tpu{\mathtext{MR}\xspace}{\ensuremath{P}\xspace_6}{X}{\infty}$ or $\tpu{\mathtext{MR}\xspace}{\ensuremath{P}\xspace_6'}{X}{\infty}$, respectively,
involves checking whether an instance of the \emph{subset sum} problem is satisfiable.
If so,
the weight associated with the atom $p$ to be concluded
is set such that the desired bound is obtained by summing up all weights.
As programs following the same scheme along with an interpretation
consisting of all atoms can be used to decide arbitrary instances
of \emph{subset sum},
the \textbf{Check}\xspace task for \mathtext{MR}\xspace-answer sets is \mathtext{NP}\xspace-complete in the
presence of non-convex aggregate expressions of the form
$\mathtext{sum}\xspace\lits{w_1:p_1,\linebreak[1]\dots,\linebreak[1]w_n:p_n}=\ensuremath{w_0}\xspace$.
Rules like \ref{eq13:r27} and \ref{eq13:r27p} can also be adjusted
to use the aggregation function \mathtext{avg}\xspace instead of \mathtext{sum}\xspace by introducing
an additional fact $x\leftarrow \top$ and taking
the inverse of the original bound as weight for~$x$:\pagebreak[1]%
\begin{alignat}{1}
\label{eq13:r28}\tag{$r_{28}$}
& p \leftarrow \mathtext{avg}\xspace\lits{2 : x_1, 2 : x_2, 3 : x_3, -5 : x, -2 : p} = 0
\\
\label{eq13:r28p}\tag{$r_{28}'$}
& p \leftarrow \mathtext{avg}\xspace\lits{2 : x_1, 2 : x_2, 3 : x_3, -6 : x, -1 : p} = 0
\end{alignat}
The condition of
$(\{x_1,x_2,x_3,x\},X\cup\{x\})\sat{\mathtext{MR}\xspace} \body{$\ref{eq13:r28}$}$ or
$(\{x_1,x_2,x_3,x\},X\cup\{x\})\sat{\mathtext{MR}\xspace} \body{$\ref{eq13:r28p}$}$, respectively,
then again amounts to deciding the satisfiability of an underlying instance of
\emph{subset sum}.
Hence, we have that the \textbf{Check}\xspace\ task for \mathtext{MR}\xspace-answer sets is likewise \mathtext{NP}\xspace-complete for
programs including non-convex aggregate expressions of the form
$\mathtext{avg}\xspace\lits{w_1:p_1,\linebreak[1]\dots,\linebreak[1]w_n:p_n}=\ensuremath{w_0}\xspace$.%
\end{example}
\subsection{Answer Set Existence}\label{subsec:exist}
The \textbf{Exist}\xspace reasoning task addresses
the decision problem of whether a program \ensuremath{P}\xspace has some
\ensuremath{\Delta}\xspace-answer set for $\ensuremath{\Delta}\xspace\in\{\mathtext{FFLP}\xspace,\linebreak[1]\mathtext{GZ}\xspace,\linebreak[1]\mathtext{LPST}\xspace,\linebreak[1]\mathtext{MR}\xspace,\linebreak[1]\mathtext{DPB}\xspace\}$,
i.e., a decision problem similar to \textbf{Check}\xspace but having no fixed interpretation $X\subseteq \ensuremath{\mathcal{P}}\xspace$.
The summary of completeness properties for particular complexity classes
is provided in Table~\ref{tab:complexity},
where completeness now also applies for \mathtext{P}\xspace in view of the well-known \mathtext{P}\xspace-completeness of
deciding whether the $\subseteq$-minimal model of a positive program
includes some atom of interest \begin{rev}\cite{daeigovo01a}\end{rev}.
In fact, when using (monotone) aggregate expressions of the form $\mathtext{sum}\xspace\lits{1:p}>0$
to represent propositional atoms~$p$ in the bodies of rules, all \ensuremath{\Delta}\xspace-answer set semantics
reproduce the $\subseteq$-minimal model of a positive program as the unique \ensuremath{\Delta}\xspace-answer set.
Given that our notion of non-disjunctive programs syntactically allows for constraints,
a program does not necessarily have a
($\subseteq$-minimal) model though, even when all aggregate expressions are monotone,
which makes the \textbf{Exist}\xspace task non-trivial and thus \mathtext{P}\xspace-complete.
While going beyond the simple form $\mathtext{sum}\xspace\lits{1:p}>0$ of monotone aggregate expressions
lets the \mathtext{GZ}\xspace-answer set semantics diverge from the other aggregate semantics,
as observed on Example~\ref{ex:gz},
such additional syntactic freedom does not increase the computational complexity
any further because the \ensuremath{\Delta}\xspace-answer set semantics,
for $\ensuremath{\Delta}\xspace\in\{\mathtext{FFLP}\xspace,\linebreak[1]\mathtext{LPST}\xspace,\linebreak[1]\mathtext{MR}\xspace,\linebreak[1]\mathtext{DPB}\xspace\}$,
still coincide and the constructions by means of different immediate consequence operators
remain tractable.
Regarding anti-monotone and convex aggregate expressions,
the rows for the \textbf{Exist}\xspace task in Table~\ref{tab:complexity}
follow the pattern of \textbf{Check}\xspace,
where \mathtext{P}\xspace-membership or \mathtext{coNP}\xspace-completeness, respectively, of \textbf{Check}\xspace leads to
\mathtext{NP}\xspace- or \ensuremath{\Sigma_2^\poly}\xspace-completeness of \textbf{Exist}\xspace.
For \mathtext{NP}\xspace-hardness,
anti-monotone aggregate expressions of the form $\mathtext{sum}\xspace\lits{1:p}<1$ are sufficient,
as they allow for representing negated propositional atoms~$p$ in rule bodies,
which directly lead to elevated complexity of deciding whether some
(standard) answer set exists \cite{martru91c}.
Likewise, the \ensuremath{\Sigma_2^\poly}\xspace-hardness of \textbf{Exist}\xspace for \mathtext{DPB}\xspace-answer sets
follows from the simultaneous availability of
monotone and anti-monotone
aggregate expressions of the form $\mathtext{sum}\xspace\lits{1:p}>0$ or $\mathtext{sum}\xspace\lits{1:p}<1$,
as the reduction from quantified Boolean formulas (with one quantifier alternation)
by \citeN{dematr04a} shows.
The additional availability of non-convex aggregate expressions
in programs with arbitrary aggregate expressions
does not increase the complexity of \textbf{Exist}\xspace beyond \mathtext{NP}\xspace for
\mathtext{GZ}\xspace- as well as \mathtext{MR}\xspace-answer sets.
Regarding \mathtext{GZ}\xspace-answer sets,
the strong condition $\atoms{A}\cap Y = \atoms{A}\cap X$ for $(Y,X)\sat{\mathtext{GZ}\xspace} A$
is unaffected by the monotonicity of an aggregate expression~$A$ \cite{alvleo15a},
as already observed on the tractability of the \textbf{Check}\xspace task.
The latter reasoning task happens to be in \mathtext{NP}\xspace for \mathtext{MR}\xspace-answer sets,
so that deciding whether a program including non-convex aggregate expressions
has some \mathtext{MR}\xspace-answer set does not involve orthogonal combinatorial problems.
Unlike that, the \ensuremath{\Sigma_2^\poly}\xspace-hardness of \textbf{Exist}\xspace for \mathtext{DPB}\xspace-answer sets is
established already for programs with convex aggregate expressions,
and non-convex aggregate expressions do not make a difference here
because neither determining candidate models $X$ of a program \ensuremath{P}\xspace
nor checking whether $\tpu{\mathtext{DPB}\xspace}{\ensuremath{P}\xspace}{X}{\infty}=X$ becomes more complex
in their presence.
The complexity of \textbf{Exist}\xspace for \mathtext{FFLP}\xspace-answer sets correlates to the monotonicity
of aggregate expressions,
given the same consideration as for \textbf{Check}\xspace that (proper) disjunctive rules can be
captured in terms of non-disjunctive programs including non-convex aggregate expressions
\cite{ferraris11a}.
This yields \ensuremath{\Sigma_2^\poly}\xspace-completeness of the \textbf{Exist}\xspace task
for \mathtext{FFLP}\xspace-answer sets of programs with non-convex aggregate expressions
regardless of their particular
aggregation functions, comparison operators,
weights and bounds \cite{alvfab13a}.
While the complexity of \textbf{Exist}\xspace is in general the same for \mathtext{LPST}\xspace-answer sets,
the \ensuremath{\Sigma_2^\poly}\xspace-hardness again depends on the complexity of deciding the satisfiability
of the complement of a (non-convex) aggregate expression~$A$.
That is, the complexity drops to \mathtext{NP}\xspace without aggregate expressions
$\mathtext{agg}\xspace\lits{w_1:p_1,\linebreak[1]\dots,\linebreak[1]w_n:p_n}\neq\ensuremath{w_0}\xspace$
such that $\mathtext{agg}\xspace\in\{\mathtext{sum}\xspace,\linebreak[1]\mathtext{times}\xspace,\linebreak[1]\mathtext{avg}\xspace\}$
because the underlying \textbf{Check}\xspace task for \mathtext{LPST}\xspace-answer sets gets tractable when
programs do not involve aggregate expressions of this form.
As further detailed in the next example,
aggregate expressions with \mathtext{sum}\xspace or \mathtext{avg}\xspace along with the comparison operator~$\neq$
allow for expressing the \ensuremath{\Sigma_2^\poly}\xspace-complete \emph{generalized subset sum} problem
\cite{bekalaplry02a}, so that the same complexity is obtained for
\mathtext{LPST}\xspace-answer sets of programs including such non-convex aggregate expressions.
Although we are unaware of literature addressing the complexity of a
corresponding generalized version of the \emph{subset product} problem,
the \mathtext{coNP}\xspace-hardness of the \textbf{Check}\xspace\ task
suggests that \textbf{Exist}\xspace remains \ensuremath{\Sigma_2^\poly}\xspace-hard with
\mathtext{times}\xspace as well.
\begin{example}\label{ex:exist}
As checked in Example~\ref{ex:subsum} and Example~\ref{ex:mr},
the interpretation $X=\{y_1,x_2,z_1,z_2,p\}$
is the unique \ensuremath{\Delta}\xspace-answer set, for $\ensuremath{\Delta}\xspace\in\{\mathtext{FFLP}\xspace,\mathtext{LPST}\xspace,\mathtext{DPB}\xspace\}$, of
the program~$\ensuremath{P}\xspace_3$:\pagebreak[1]%
\begin{alignat}{1}
\tag{\ref{eq6:r6}}
& x_1 \leftarrow \mathtext{sum}\xspace\lits{1:y_1} < 1
\\
\tag{\ref{eq6:r7}}
& y_1 \leftarrow \mathtext{sum}\xspace\lits{1:x_1} < 1
\\
\tag{\ref{eq6:r8}}
& x_2 \leftarrow \mathtext{sum}\xspace\lits{1:y_2} < 1
\\
\tag{\ref{eq6:r9}}
& y_2 \leftarrow \mathtext{sum}\xspace\lits{1:x_2} < 1
\\
\tag{\ref{eq6:r10}}
& z_1 \leftarrow \mathtext{sum}\xspace\lits{1:p} > 0
\\
\tag{\ref{eq6:r11}}
& z_2 \leftarrow \mathtext{sum}\xspace\lits{1:p} > 0
\\
\tag{\ref{eq6:r12}}
& p \leftarrow \mathtext{sum}\xspace\lits{1:y_1,2:y_2,2:z_1,3:z_2} \neq 5
\\
\tag{\ref{eq6:r13}}
& \bot \leftarrow \mathtext{sum}\xspace\lits{1:p} < 1
\end{alignat}
In fact, $\{y_1,y_2\}\cap X=\{y_1\}$ represents the single solution
to the instance
\begin{alignat*}{1}
\exists y_1 y_2 \forall z_1 z_2
(1\cdot y_1+\linebreak[1]
2\cdot y_2+\linebreak[1]
2\cdot z_1+\linebreak[1]
3\cdot z_2 \neq 5)
\end{alignat*}
of the \emph{generalized subset sum} problem.
The rules \ref{eq6:r6}, \ref{eq6:r7}, \ref{eq6:r8}, and \ref{eq6:r9}
make use of the auxiliary atoms $x_1$ and $x_2$ to express
exclusive choices between $x_1$ and $y_1$ as well as $x_2$ and~$y_2$,
where the chosen atoms $y_i$ stand for a solution candidate.
If the candidate is indeed a solution, any truth assignment of the atoms $z_i$
leads to a weighted sum that is different from the bound,
which is $5$ for our instance.
In this case,
we have that $Z\models \body{$\ref{eq6:r12}$}$
for every interpretation $\{y_1,y_2\}\cap X\subseteq Z \subseteq X$,
so that the head atom $p$ must necessarily be true and is also concluded by
the operators $\tpx{\mathtext{LPST}\xspace}{\ensuremath{P}\xspace_3}{X}$ as well as $\tpx{\mathtext{DPB}\xspace}{\ensuremath{P}\xspace_3}{X}$.
The remaining rules \ref{eq6:r10} and \ref{eq6:r11} establish that the
atoms $z_i$ follow from $p$, which makes sure that a potential counterexample, i.e.,
some truth assignment of the atoms $z_i$ such that the weighted sum matches the given bound,
corresponds to a smaller interpretation $Y\subset X$ disproving $X$ to be a \ensuremath{\Delta}\xspace-answer set of~$\ensuremath{P}\xspace_3$.
Finally, the constraint \ref{eq6:r13} expresses that
$p$ must be true, while its provability relies on~\ref{eq6:r12},
and thus eliminates any solution candidate that would directly give the bound as weighted sum
when all of the atoms $z_i$ are assigned to false.
Introducing
an additional fact $x\leftarrow \top$ and replacing \ref{eq6:r12} by%
\begin{alignat}{1}
\label{eq6:r12p}\tag{$r_{12}'$}
& p \leftarrow \mathtext{avg}\xspace\lits{1:y_1,2:y_2,2:z_1,3:z_2,-5:x} \neq 0
\end{alignat}
leads to a modified program $\ensuremath{P}\xspace_3'$ including a non-convex aggregate expression with
\mathtext{avg}\xspace instead of \mathtext{sum}\xspace.
This aggregate expression takes the inverse of the original bound as weight for a
necessarily true atom~$x$,
so that the average happens to be $0$ if and only if\xspace
the weighted sum over the remaining (true) atoms matches the bound.
Hence, we have that \ensuremath{\Delta}\xspace-answer sets $X\cup\{x\}$ of $\ensuremath{P}\xspace_3'$ correspond to
\ensuremath{\Delta}\xspace-answer sets $X$ of $\ensuremath{P}\xspace_3$ for $\ensuremath{\Delta}\xspace\in\{\mathtext{FFLP}\xspace,\mathtext{LPST}\xspace,\mathtext{DPB}\xspace\}$.
Given that programs following the scheme of $\ensuremath{P}\xspace_3$ or~$\ensuremath{P}\xspace_3'$, respectively,
allow for expressing arbitrary instances of \emph{generalized subset sum},
we conclude that the \textbf{Exist}\xspace task for the three aggregate semantics of interest, in particular,
\mathtext{LPST}\xspace-answer sets of programs with non-convex aggregate expressions as used in $\ensuremath{P}\xspace_3$
and~$\ensuremath{P}\xspace_3'$, is \ensuremath{\Sigma_2^\poly}\xspace-hard.
Such elevated complexity is not obtained for \mathtext{GZ}\xspace- and \mathtext{MR}\xspace-answer sets,
and as discussed in Example~\ref{ex:mr},
the program $\ensuremath{P}\xspace_3$ does not have any \mathtext{GZ}\xspace-answer set although the corresponding instance of
\emph{generalized subset sum} is satisfiable,
while $X$ and two more interpretations that do not represent solutions
are \mathtext{MR}\xspace-answer sets of~$\ensuremath{P}\xspace_3$.
\end{example}
Finally, note that
the computational complexity of the \textbf{Check}\xspace and \textbf{Exist}\xspace reasoning tasks
is a common subject of investigation for specific logic programs.
In this regard, the comparably low complexity for \mathtext{GZ}\xspace-answer sets does not
come as a surprise, as avoiding so-called vicious circles \cite{gelzha19a}
circumvents elevated complexity due to (sophisticated) aggregate expressions.
Hardness properties concerning \mathtext{DPB}\xspace-answer sets are immediate consequences of
the simultaneous availability of monotone and anti-monotone aggregate expressions,
given the computational complexity of the so-called ultimate semantics \cite{dematr04a},
and the complexity of reasoning tasks for \mathtext{FFLP}\xspace-answer sets has been thoroughly
studied in the corresponding literature \cite{alvfab13a,fapfle11a,ferraris11a}.
For \mathtext{LPST}\xspace-answer sets,
the elevated complexity due to aggregate expressions of the form
$\mathtext{sum}\xspace\lits{w_1:p_1,\linebreak[1]\dots,\linebreak[1]w_n:p_n}\neq\ensuremath{w_0}\xspace$ or
$\mathtext{avg}\xspace\lits{w_1:p_1,\linebreak[1]\dots,\linebreak[1]w_n:p_n}\neq\ensuremath{w_0}\xspace$
has been put forward by \citeN{sonpon07b}, and we here add
$\mathtext{times}\xspace\lits{w_1:p_1,\linebreak[1]\dots,\linebreak[1]w_n:p_n}\neq\ensuremath{w_0}\xspace$
to these considerations.
To our knowledge,
the computational complexity of reasoning tasks for \mathtext{MR}\xspace-answer sets has
not been investigated in depth, and the \mathtext{NP}\xspace-hardness of \textbf{Check}\xspace
for programs with aggregate expressions
$\mathtext{sum}\xspace\lits{w_1:p_1,\linebreak[1]\dots,\linebreak[1]w_n:p_n}=\ensuremath{w_0}\xspace$ or
$\mathtext{avg}\xspace\lits{w_1:p_1,\linebreak[1]\dots,\linebreak[1]w_n:p_n}=\ensuremath{w_0}\xspace$
was unrecognized before.
\section{Discussion}\label{sec:discussion}
As the variety of proposals investigated in Section~\ref{sec:answersets} shows,
the design of a general semantics of aggregates and efficient implementations
thereof have been long-standing challenges.
The intricacy results from two particularities:
unlike for conjunctions of literals,
aggregate expressions can yield a non-convex satisfiability pattern,
and the handling of (explicit) negation by the \ensuremath{\mathtext{not}}\xspace connective requires additional care.
In the following, we discuss such phenomena,
related rewriting methods and first-order semantics
used to implement or generalize aggregates, respectively,
and further extensions of logic programs to custom aggregate expressions.
The pioneering \textsc{smodels} system \cite{siniso02a} handles
\emph{weight constraints}
$\mathtext{sum}\xspace\lits{w_1:\nolinebreak \ensuremath{\ell}\xspace_1,\linebreak[1]\dots,\linebreak[1]w_n:\ensuremath{\ell}\xspace_n}\geq\ensuremath{w_0}\xspace$
such that each $\ensuremath{\ell}\xspace_i$, for $1\leq i\leq n$,
is a literal of the form
$\ensuremath{\ell}\xspace_i=p$ or $\ensuremath{\ell}\xspace_i=\naf{p}$ over some atom $p\in\ensuremath{\mathcal{P}}\xspace$.
While negative weights $w_i$ can be supplied in the input,
weighted literals $w_i:\ensuremath{\ell}\xspace_i$
are transformed according to\pagebreak[1]
\begin{alignat*}{1}
\nwt{w_i:\ensuremath{\ell}\xspace_i} = \left\{
\begin{array}{@{}l@{\,}l@{}}
w_i:\ensuremath{\ell}\xspace_i
& \text{, if $w_i \geq 0$,}
\\
-w_i:\opp{\ensuremath{\ell}\xspace_i}
& \text{, if $w_i < 0$,}
\end{array}
\right.
\end{alignat*}
where $\opp{\ensuremath{\ell}\xspace_i}=\naf{p}$, if $\ensuremath{\ell}\xspace_i=p$,
or $\opp{\ensuremath{\ell}\xspace_i}=p$, if $\ensuremath{\ell}\xspace_i=\naf{p}$, denotes the complement of a literal~$\ensuremath{\ell}\xspace_i$,
in the mapping to
$\mathtext{sum}\xspace[\nwt{w_i:\ensuremath{\ell}\xspace_i} \mid 1\leq i\leq n]\geq\ensuremath{w_0}\xspace-\sum_{1\leq i\leq n,w_i<0}w_i$,
based on the idea that sanctioning some literal by a negative weight is in terms of
satisfiability the same as associating its complement with the corresponding positive amount.
Given that the reduct adopted by \textsc{smodels} evaluates negative literals,
the transformed weight constraints
without negative weights become
monotone in the context of checking the provability of true atoms.
Hence, deciding whether a given interpretation is an answer set
gets tractable, which diverges from the \mathtext{coNP}\xspace-completeness of
\mathtext{FFLP}\xspace-answer set checking for programs with non-convex aggregate expressions
(cf.\ Table~\ref{tab:complexity}),
as already established in the absence of negative literals built by means of the \ensuremath{\mathtext{not}}\xspace connective.
This complexity gap brings about peculiarities, considering that $\{p\}$ is
an answer set produced by \textsc{smodels} as well as a
\ensuremath{\Delta}\xspace-answer set, for $\ensuremath{\Delta}\xspace\in\{\mathtext{FFLP}\xspace,\linebreak[1]\mathtext{LPST}\xspace,\linebreak[1]\mathtext{MR}\xspace,\linebreak[1]\mathtext{DPB}\xspace\}$,
of a program with just the rule $p\leftarrow \mathtext{sum}\xspace\lits{0:p}\geq 0$.
When the rule is changed to $p\leftarrow \mathtext{sum}\xspace\lits{1:p,-1:p}\geq 0$,
we have that $\{p\}$ remains a \ensuremath{\Delta}\xspace-answer set,
while \textsc{smodels}
transforms the rule to
$p\leftarrow \mathtext{sum}\xspace\lits{1:p,1:\naf{p}}\geq 1$
and takes
$p\leftarrow \mathtext{sum}\xspace\lits{1:p}\geq 1$
as reduct relative to the unique model $\{p\}$ \begin{rev}---
In practice, negative weights are eliminated by the front-end
\textsc{lparse} \cite{lparseManual} during grounding, which then
passes the transformed weight constraints
on to \textsc{smodels} or other ASP solvers\end{rev}.
This yields the empty interpretation~$\emptyset$ as a smaller model
disproving $\{p\}$,
so that the transformation by \textsc{smodels} leads to different semantics of the rules
$p\leftarrow \mathtext{sum}\xspace\lits{0:p}\geq 0$ and
$p\leftarrow \mathtext{sum}\xspace\lits{1:p,-1:p}\geq 0$.
A common issue about transformations of logic programs, in general, and of aggregate expressions,
in particular, is that satisfiability-preservation does not necessarily yield equitable
provability of atoms.
For guaranteeing replaceability regardless of the specific program context,
strong equivalence \cite{lipeva01a}
needs to be established, and \begin{rev}\citeN{bojani20a}, \citeN{ferraris11a}, and \citeN{gehakalisc15a}\end{rev}
investigate this concept for aggregate expressions.
According to \cite{ferlif02a},
a weight constraint
$\mathtext{sum}\xspace\lits{w_1:\ensuremath{\ell}\xspace_1,\dots,w_n:\ensuremath{\ell}\xspace_n}\geq\ensuremath{w_0}\xspace$ with positive weights $w_i$, for $1\leq i\leq n$,
is equivalent to
\begin{alignat*}{1}
\mbox{$\bigvee$}_{I\subseteq\{1,\dots,n\},\sum_{i\in I}w_i\geq\ensuremath{w_0}\xspace}\mbox{$\bigwedge$}_{i\in I}\ensuremath{\ell}\xspace_i\text{,}
\end{alignat*}
where the disjunction can be understood as a shorthand for several alternative rule bodies.
Similar unfoldings of aggregate expressions have been
investigated \begin{rev}by \citeN{pedebr03a} and \citeN{sopoel06a},\end{rev} and yield
semantic correspondences to \mathtext{LPST}\xspace-answer sets \cite{sonpon07b}.
More compact rewritings of weight constraints to aggregate-free rules,
devised for increasing the range of applicable solving systems,
are based on sequential weight counters \cite{ferlif02a} or merge-sorting \cite{bogeja14a},
inspired by corresponding encodings of pseudo-Boolean constraints
in propositional logic \cite{baboro09a,homast12a,rouman09a}.
In general, when the joint use of positive and negative weights makes a weight constraint non-convex,
the more sophisticated formula
\begin{alignat*}{1}
\mbox{$\bigwedge$}_{I\subseteq\{1,\dots,n\},\sum_{i\in I}w_i<\ensuremath{w_0}\xspace}
\left(\mbox{$\bigwedge$}_{i\in I}\ensuremath{\ell}\xspace_i
\rightarrow
\mbox{$\bigvee$}_{i\in \{1,\dots,n\}\setminus I}\ensuremath{\ell}\xspace_i
\right)
\end{alignat*}
has been shown to be semantic-preserving \cite{ferraris11a}.
This scheme introduces nested implications, which
lead to elevated complexity of reasoning tasks, as discussed in Section~\ref{subsec:check}.
Such complex constructs are not directly supported by the ASP systems
\textsc{clingo} and \textsc{dlv},
whose propagation procedures \cite{fapfledeie08a,gekakasc09a}
are designed for (anti\nobreakdash-)monotone aggregate expressions ---
A convex aggregate expression can be
decomposed into the conjunction
of a monotone and an anti-monotone aggregate expression
\cite{liutru06a}, e.g.,
by syntactically taking the comparison operators $\leq$ and $\geq$
to represent~$=$.
Reasoning on non-convex aggregate expressions can still be accomplished by means of a
rewriting to disjunctive rules with monotone aggregate expressions \cite{alfage15a},
where (proper) disjunctive rules are needed only if a non-convex aggregate expression
occurs in positively recursive rules, which are necessary to express a \ensuremath{\Sigma_2^\poly}\xspace-hard
problem like \emph{generalized subset sum} in Example~\ref{ex:exist}.
Since this rewriting is implemented in the grounding procedure of \textsc{clingo}
\cite{gekasc15a},
any disjunctive ASP solver that handles recursive monotone aggregate
expressions, e.g., used to encode \emph{company controls},
can be applied to reason on non-convex aggregate expressions as well.
\begin{rev}
The input language of \textsc{clingo} \cite{gehakalisc15a}, however, excludes the
aggregation functions \mathtext{times}\xspace and \mathtext{avg}\xspace,
which are also not part of the \emph{ASP-Core-2}\xspace specification
of a common first-order language for ASP systems \cite{cafageiakakrlemarisc19a}\end{rev}.
Moreover, \textsc{clingo} rewrites aggregate expressions with \mathtext{min}\xspace or \mathtext{max}\xspace to aggregate-free rules,
so that only \mathtext{count}\xspace and \mathtext{sum}\xspace effectively lead to
monotone aggregate expressions that use the \mathtext{sum}\xspace aggregation function at the ground level.
Current ASP solvers deal with weight constraints
$\mathtext{sum}\xspace\lits{w_1:\ensuremath{\ell}\xspace_1,\dots,w_n:\ensuremath{\ell}\xspace_n}\geq\ensuremath{w_0}\xspace$ with positive weights~$w_i$,
and grounding (components of) systems like \textsc{clingo} \cite{gekasc15a},
\textsc{dlv} \cite{cadofupeza20a}, and \textsc{lparse} \cite{lparseManual}
establish such a format, using transformations like those given \begin{rev}by \citeN{alfage15a}\end{rev}.
In the context of non-disjunctive programs,
translational approaches to propositional logic \cite{jannie11a} rely on
the aforementioned rewritings to aggregate-free rules \cite{ferlif02a,bogeja14a},
and even more compact, linear representations in terms of pseudo-Boolean constraints
or integer programming \cite{gejari14c} enable the use of corresponding back-end solvers
to compute answer sets.
The ASP systems \textsc{clingo}, \textsc{dlv}, and \textsc{smodels}
incorporate propagation procedures
\cite{fapfledeie08a,gekakasc09a,siniso02a}
that extend Boolean constraint propagation \cite{rouman09a}
from pseudo-Boolean constraints to logic programs.
Their restrictions are that
\textsc{smodels} handles non-disjunctive programs only,
aggregate expressions must be non-recursive for \textsc{dlv},
and \textsc{clingo} does not use compact data structures for aggregate expressions
in positively recursive rules such that their head atoms occur together in some
(proper) disjunctive rule head
(i.e., the program part under consideration is not head-cycle-free \cite{bendec94a}),
while more space-consuming rewriting to aggregate-free rules is performed otherwise.
Moreover,
the recent ASP solver \textsc{wasp} \cite{alamdolemari19a} implements a collective
propagation procedure \cite{aldoma18a} for aggregate expressions
$\mathtext{sum}\xspace\lits{w_1:\ensuremath{\ell}\xspace_1,\dots,w_n:\ensuremath{\ell}\xspace_n}\geq\ensuremath{w_0}\xspace$
with the same weighted literals $w_1:\ensuremath{\ell}\xspace_1,\dots,w_n:\ensuremath{\ell}\xspace_n$ and
different bounds \ensuremath{w_0}\xspace,
and the lazy-grounding ASP system \textsc{alpha} \cite{wetafr20a}
features an incremental on-demand rewriting \cite{bojawe19a} to aggregate-free rules.
While the semantics by \citeN{fapfle11a} and by \citeN{ferraris11a} agree
for the syntax of aggregate expressions considered in this survey, i.e.,
aggregates over propositional atoms,
the different reduct notions, which either eliminate falsified expressions and thus
negative literals or not, lead to distinct outcomes in the presence of \ensuremath{\mathtext{not}}\xspace.
For instance, the reduct of
$p\leftarrow \mathtext{sum}\xspace\lits{1: p,\linebreak[1]1:\naf{p}}\geq 1$
relative to the interpretation $\{p\}$ is
the rule itself according to \begin{rev}\citeN{fapfle11a}\end{rev},
and $p\leftarrow \mathtext{sum}\xspace\lits{1:p}\geq 1$ by \begin{rev}Ferraris' \citeyear{ferraris11a} definition\end{rev}.
Hence, either $\{p\}$ or $\emptyset$ is obtained as $\subseteq$-minimal model of the reduct,
so that the semantics disagree about whether $\{p\}$ is an answer set.
Similarly, $p\leftarrow \naf{\mathtext{sum}\xspace\lits{1: p}< 1}$ yields
the rule as such or $p\leftarrow \top$ as the reduct relative to $\{p\}$,
resulting in either $\emptyset$ or $\{p\}$ as $\subseteq$-minimal model.
That is, answer sets according to \begin{rev}\citeN{fapfle11a} and \citeN{ferraris11a}\end{rev}
can be mutually distinct when the \ensuremath{\mathtext{not}}\xspace connective is used in front of
aggregate expressions or propositional atoms subject to aggregation functions.
To circumvent such discrepancies, the
\emph{ASP-Core-2}\xspace \begin{rev}language specification\end{rev} \cite{cafageiakakrlemarisc19a} requires
aggregate-stratification \cite{fapfledeie08a},
which restricts occurrences of
aggregate expressions in a program to be non-recursive.
Under this condition,
apart from \mathtext{DPB}\xspace-answer sets that differ already for aggregate-free programs \cite{depebr01a,dematr04a},
the aggregate semantics investigated in Section~\ref{sec:answersets} agree,
and aggregate expressions may not increase the computational complexity of reasoning tasks.
\citeN{harlif19a} relax the aggregate-stratification condition and show that
answer sets according to \begin{rev}\citeN{fapfle11a} and \citeN{ferraris11a}\end{rev} coincide
when recursive aggregate expressions do not involve the \ensuremath{\mathtext{not}}\xspace connective, i.e.,
they are of the form~\eqref{eq:syntax:agg},
while no syntactic restrictions are imposed otherwise, e.g.,
for aggregate expressions occurring in constraints.
Notably, the correspondence in \cite{harlif19a} is established at the first-order level,
thus connecting prior first-order generalizations of the two semantics \cite{baleme11a,gehakalisc15a}
based on second-order logic or infinitary formulas, respectively.
Moreover, answer sets according to \begin{rev}\citeN{fapfle11a} and \citeN{ferraris11a}\end{rev}
can be characterized in terms of each other \cite{leemen09a,truszczynski10a},
so that their expressiveness is the same regardless of
semantic differences arising on the \ensuremath{\mathtext{not}}\xspace connective.
Beyond their use for a compact representation of properties on sets of atoms,
semantics for aggregate expressions have been taken as basis for defining
the answer sets of logic programs with further extensions,
such as description logic and higher-order logic programs with external atoms
\cite{shwaeifirekrde14a}.
Similar to aggregate expressions,
monotonicity properties of external atoms affect reasoning about them,
and dedicated solving techniques take advantage of so-called assignment-monotonicity
\cite{eikarewe18a}.
Extensions of ASP systems by theory propagators
\cite{cudorisc20a,jakaosscscwa17a,liesus17a}
likewise interpret specific atoms as custom aggregate expressions
and incorporate respective procedures for propagating their truth values.
In this broad sense, the notion of an aggregate includes any method of evaluating
atoms as a compound, where some frequently used aggregation functions, in particular,
the \mathtext{sum}\xspace aggregation function, are accommodated off-the-shelf in the modeling language of ASP.
While there is already a considerable body of work on aggregates, there clearly are numerous open issues to be addressed.
We would like to outline some of them, of course without any claim of completeness.
First of all, identifying sublanguages on which different semantics coincide is still a relevant topic. As mentioned earlier, most semantics agree on aggregate-stratified programs, and many also correspond for programs with convex aggregates.
Another issue is that encodings with unstratified aggregate occurrences are fairly rare at the moment, especially when considering ``real-world'' applications. We believe, however, that providing a meaningful semantics for language constructs is important also when there are no frequent applications for them. Nevertheless, potential application fields might lie, for instance, in the area of analysis of dynamic systems, e.g., addressing the location of fixpoints in biological systems.
A related question is whether the proposed languages are actually fit for various practical purposes. We believe that postulating formal properties that semantics for programs with aggregates should satisfy is important and still lacking. For example, formalizations of the Closed World Assumption \begin{rev}\cite{reiter77a}\end{rev} for programs with aggregates would be of interest. There is also work arguing that certain programs are not handled well by the existing semantics, yet suggestions as, e.g., \begin{rev}by \citeN{alvfab19}\end{rev} for ``repairing'' existing approaches to cover such cases do not seem satisfactory so far. Finally, we would like to mention that more implementations are needed. \begin{rev}Most\end{rev} proposed semantics have never been supported by any system, making comparisons difficult and applications impossible\begin{rev}, and merely \textsc{clingo} implements non-convex aggregate expressions in positively recursive rules (under \mathtext{FFLP}\xspace-answer set semantics). Hence, even\end{rev} implementations that are not at all geared towards efficiency would be useful. In summary, there is a substantial amount of room for future work on aggregates in Answer Set Programming.%
\section{Introduction}\label{sec:introduction}
Answer Set Programming (ASP) \cite{breitr11a,gelleo02a,lifschitz02a,martru99a,niemela99a} is a paradigm for Knowledge Representation and Reasoning.
ASP knowledge bases are encoded by means of logic rules interpreted according to the stable model semantics \cite{gellif88b,gellif91a}, that is, models of ASP programs are required to satisfy an additional stability condition guaranteeing that all true atoms in a model are necessary.
A strength of ASP is its high-level modeling language, capable of expressing all problems in the complexity classes \mathtext{NP}\xspace and \ensuremath{\Sigma_2^\poly}\xspace by means of declarative statements \cite{daeigovo01a,schlipf95a}\begin{rev}, depending on the availability of disjunctive rules or unrestricted aggregates\end{rev}.
The attractiveness of ASP also builds on the availability of powerful off-the-shelf solving systems, among them \textsc{clingo} \cite{gekakasc17a}, \textsc{dlv} \cite{alcadofuleperiveza17a}, and \textsc{idp} \cite{brblbocapojalaradeve15a}.
The language of ASP offers several constructs to ease the representation of practical knowledge.
Aggregate expressions received particular interest by ASP designers \begin{rev}\cite{baleme11a,depebr01a,fapfle11a,ferraris11a,gehakalisc15a,gelzha19a,liposotr10a,marrem04a,pedebr07a,siniso02a}\end{rev}, and the utility of their incorporation in the modeling language has been realized almost simultaneously with the inception of the first ASP solving systems.
In fact, aggregate expressions provide a natural syntax for expressing properties on sets of atoms collectively, which is often desired when modeling complex knowledge.
For example, aggregate expressions are widely used to enforce collective conditions on guessed relations. In \emph{graph k-colorability} \cite{garjoh79}, the guessed assignment of colors must be a total function, which can be enforced by means of the following constraint:
\begin{asp}
:- vertex(X), #count{C : assign_color(X,C)} != 1.
\end{asp}
In \emph{independent set} \cite{garjoh79}, the guessed set of nodes must not be smaller than a given bound $k \geq 1$, which can be enforced by the following constraint:
\begin{asp}
:- #count{X : in_independent_set(X)} < k.
\end{asp}
\begin{figure}
\figrule
\begin{subfigure}{.35\textwidth}
\centering
\tikzstyle{none} = [text centered]
\tikzstyle{line} = [draw]
\begin{tikzpicture
\node at (0,0) [none](a) {a};
\node at (-1,-1) [none](b) {b};
\node at (1,-1) [none](c) {c};
\node at (-1.5,-2) [none](d) {d};
\node at (-0.5,-2) [none](e) {e};
\node at (0.25,-2) [none](f) {f};
\node at (1,-2) [none](g) {g};
\node at (1.75,-2) [none](h) {h};
\path[line] (a) -- (b);
\path[line] (a) -- (c);
\path[line] (b) -- (d);
\path[line] (b) -- (e);
\path[line] (c) -- (f);
\path[line] (c) -- (g);
\path[line] (c) -- (h);
\end{tikzpicture}
\end{subfigure}
\begin{subfigure}{.5\textwidth}
\begin{asp}
tree(a).
tree(b). tree(c).
tree(d). tree(e).
tree(f). tree(g). tree(h).
child(a,b). child(a,c).
child(b,d). child(b,e).
child(c,f). child(c,g). child(c,h).
\end{asp}
\end{subfigure}
\begin{subfigure}{.125\textwidth}
\begin{asp}
nodes(a,8).
nodes(b,3).
nodes(c,4).
nodes(d,1).
nodes(e,1).
nodes(f,1).
nodes(g,1).
nodes(h,1).
\end{asp}
\end{subfigure}
\vspace{-0.8em}
\caption{A tree, its relational representation, and the number of nodes in each (sub)tree.}\label{fig:tree}
\figrule
\end{figure}
Aggregate expressions in constraints, as in the examples above, are frequent and leave no ambiguity in their intended semantics.
However, there are other frequent use cases in which aggregation functions are involved in inductive definitions, which open the possibility of using aggregation functions for reasoning about recursive data structures.
For example, the number of nodes in a tree (and its subtrees) can be determined by the following rule:
\begin{asp}
nodes(T,C+1) :- tree(T), C = #sum{C',T' : child(T,T'), nodes(T',C')}.
\end{asp}
Figure~\ref{fig:tree} shows a tree and the expected outcome for the \lstinline|nodes| relation.
Note that the sum is applied to a multiset, specifically to the multiset obtained by projecting on the first element the following set of tuples:
\lstinline|{(C',T') ${}\mid{}$ child(T,T') ${}\wedge{}$ nodes(T',C')}|.
For example, given \lstinline|nodes(d,1)| and \lstinline|nodes(e,1)|, for $\mathtt{T = b}$ the set is \lstinline|{(1,d), (1,e)}|, and therefore the sum aggregation is applied to the multiset $[1, 1]$.
As another example, consider the \emph{company controls} problem, originally proposed \begin{rev}by \citeN{mupira90a}\end{rev}, where a set of companies and their stock shares are given and the task is to determine the control relationships between companies.
The following rule encodes such knowledge:
\begin{asp}
controls(A,B) :- company(A), company(B),
#sum{S : own(A,B,S); S,C : controls(A,C), own(C,B,S), A != C} > 50.
\end{asp}
Figure~\ref{fig:company} shows an instance of this problem and the expected outcome.
Non-deterministic variants of this problem naturally emerge if some of the stock shares are not fixed and associated with a cost, and a holding company wants to understand whether its companies can exert an indirect control over other companies of interest.\footnote{\url{https://www.mat.unical.it/aspcomp2011/FinalProblemDescriptions/CompanyControlsOptimize}}
\begin{figure}
\figrule
\begin{subfigure}{.3\textwidth}
\centering
\tikzstyle{none} = [text centered]
\tikzstyle{line} = [draw, ->]
\begin{tikzpicture
\node at (0,0) [none](a) {a};
\node at (-1,-1) [none](b) {b};
\node at (1,-1) [none](c) {c};
\path[line] (a) -- node [midway, left] {80\%} (b);
\path[line] (a) -- node [midway, right] {30\%} (c);
\path[line] (b) -- node [midway, above] {30\%} (c);
\end{tikzpicture}
\end{subfigure}
\begin{subfigure}{.35\textwidth}
\begin{asp}
company(a). owns(a,b,80).
company(b). owns(a,c,30).
company(c). owns(b,c,30).
\end{asp}
\end{subfigure}
\begin{subfigure}{.25\textwidth}
\begin{asp}
controls(a,b).
controls(a,c).
\end{asp}
\end{subfigure}
\caption{Companies and their shares, their relational representation, and the control relationships.}\label{fig:company}
\figrule
\end{figure}
The possibility to mix guesses, inductive definitions, and aggregation functions opens the gates for several alternative interpretations of the expected outcome, and thus a general semantics of aggregates and its efficient implementation have been long-standing challenges.
Already in the propositional case, checking the satisfiability of an aggregate expression is an intractable problem in general, with the \mathtext{NP}\xspace-complete \emph{subset sum} and \emph{subset product}
problems \cite{garjoh79} as special cases.
The practical implication of such an intractability is the use of weakened propagation procedures,
meaning that ASP solvers \begin{rev}give up on\end{rev} the propagation of some deterministic inferences to achieve algorithmic efficiency, usually obtained by translational approaches \cite{alfage15a,alvleo15a,fapfledeie08a,ferlif02a,siniso02a}.
For example, an aggregate expression involving a sum and the equality comparison is split into a conjunction of two aggregate expressions that are true when the sum is no more and no less than the original bound.
In addition, satisfiability of aggregate expressions is in general a \emph{non-convex} function:
the expression \lstinline|#sum{1 : a; -1 : b} = 0| is true for $\emptyset$, false for \lstinline|{a}| and \lstinline|{b}|, and true again for \lstinline|{a,b}|, a pattern not shown by conjunctions of (possibly negated) atoms.
In fact, satisfiability of conjunctions of positive literals is a \emph{monotone} function (i.e., at most one transition from false to true, and no other transitions), satisfiability of conjunctions of negative literals is an \emph{anti-monotone} function (i.e., at most one transition from true to false, and no other transitions), and satisfiability of conjunctions of literals in general is a \emph{convex} function (i.e., at most one transition from false to true followed by at most one transition from true to false).
The general picture for aggregate expressions is shown in Figure~\ref{fig:convex} and further detailed in Section~\ref{subsec:monotonicity}.
\begin{figure}
\figrule
\centering
\tikzstyle{none} = [text centered]
\tikzstyle{set} = [draw, dashed, text centered]
\begin{tikzpicture}
\node at (0,0) [set](m) {
$
\begin{array}{rr}
\multicolumn{2}{r}{\textbf{monotone}} \\
\mathtext{sum}\xspace_+> & \mathtext{sum}\xspace_+\geq \\
\mathtext{sum}\xspace_-< & \mathtext{sum}\xspace_-\leq \\
\mathtext{times}\xspace_+> & \mathtext{times}\xspace_+\geq \\
\mathtext{min}\xspace< & \mathtext{min}\xspace\leq \\
\mathtext{max}\xspace> & \mathtext{max}\xspace\geq
\end{array}
$
};
\node at (4,0) [set](a) {
$
\begin{array}{rr}
\multicolumn{2}{r}{\textbf{anti-monotone}} \\
\mathtext{sum}\xspace_+< & \mathtext{sum}\xspace_+\leq \\
\mathtext{sum}\xspace_-> & \mathtext{sum}\xspace_-\geq \\
\mathtext{times}\xspace_+< & \mathtext{times}\xspace_+\leq \\
\mathtext{min}\xspace> & \mathtext{min}\xspace\geq \\
\mathtext{max}\xspace< & \mathtext{max}\xspace\leq
\end{array}
$
};
\node at (7.25,0) [none](c) {
$
\begin{array}{r}
\textbf{convex}\\
\mathtext{sum}\xspace_+= \\
\mathtext{sum}\xspace_-= \\
\mathtext{times}\xspace_+= \\
\mathtext{min}\xspace= \\
\mathtext{max}\xspace=
\end{array}
$
};
\node at (-1,-2.75) [none](n1) {
$
\begin{array}{r}
\mathtext{sum}\xspace_+\neq \\
\mathtext{sum}\xspace_-\neq \\
\mathtext{times}\xspace_+\neq \\
\mathtext{min}\xspace\neq \\
\mathtext{max}\xspace\neq
\end{array}
$
};
\node at (5,-2.75) [none](n2) {
$
\begin{array}{rrrrrr}
\multicolumn{6}{r}{\textbf{non-convex}} \\
\mathtext{sum}\xspace< & \mathtext{sum}\xspace\leq & \mathtext{sum}\xspace\geq & \mathtext{sum}\xspace> & \mathtext{sum}\xspace= & \mathtext{sum}\xspace\neq \\
\mathtext{times}\xspace< & \mathtext{times}\xspace\leq & \mathtext{times}\xspace\geq & \mathtext{times}\xspace> & \mathtext{times}\xspace= & \mathtext{times}\xspace\neq \\
\mathtext{times}\xspace_-< & \mathtext{times}\xspace_-\leq & \mathtext{times}\xspace_-\geq & \mathtext{times}\xspace_-> & \mathtext{times}\xspace_-= & \mathtext{times}\xspace_-\neq \\
\mathtext{avg}\xspace< & \mathtext{avg}\xspace\leq & \mathtext{avg}\xspace\geq & \mathtext{avg}\xspace> & \mathtext{avg}\xspace= & \mathtext{avg}\xspace\neq
\end{array}
$
};
\node [set, fit={(m) (a) (c)}, inner sep=3pt] {};
\node [set, fit={(n1) (n2)}] {};
\end{tikzpicture}
\vspace{1em}
\caption{
Aggregate expressions classified according to the monotonicity
of satisfiability.
Subscript signs denote restrictions on the sign of weights;
for example, $\mathtext{sum}\xspace_+$ is \mathtext{sum}\xspace with positive weights.
}\label{fig:convex}
\figrule
\end{figure}
Among the variety of semantics proposed for interpreting ASP programs with aggregates, two of them \cite{fapfle11a,ferraris11a} are implemented in widely-used ASP solvers \cite{fapfledeie08a,gekasc09c}.
The two semantics agree for programs without negation, and are thus referred indistinctly as \mathtext{FFLP}\xspace-answer sets in this survey.
Under this syntactic restriction, \mathtext{FFLP}\xspace-answer sets can be defined as $\subseteq$-minimal models of a program reduct obtained by deleting rules with false bodies, as in the aggregate-free case.
Other prominent semantics \begin{rev}\cite{depebr01a,gelzha19a,liposotr10a,marrem04a,pedebr07a}\end{rev} adopt constructive procedures for checking the provability of true atoms.
\begin{rev}
While some of these semantics were originally defined via a notion of reduct in the non-disjunctive case, they can be viewed as semantics based on different extensions of the immediate consequence operator \cite{emdkow76a,lloyd87}.
Although such extensions result in\end{rev} different answer sets in general, there are cases in which answer sets according to one definition are also answer sets according to other definitions;
details on such relationships are given in Section~\ref{subsec:relationships}.
Historically, aggregates appeared in database query languages and have been available almost since the inception of database systems.
However, these aggregate constructs usually lacked generality and formal definitions.
Notably, aggregates were not present in Relational Algebra and Relational Calculus of Codd's seminal papers \cite{codd70a,codd72a}.
It was only with Klug's work \cite{klug82a} in the 1980ies that aggregate expressions were cleanly integrated into Relational Algebra and Calculus.
This integration was further refined by \citeN{ozozma87a} a few years later, which also included the ability to specify set expressions.
While none of these languages
supported recursive definitions yet,
the Relational Calculus in these papers did, however, feature a clean formalism for defining ranges and therefore avoid unsafe queries, which can be seen as a direct precursor to safety notions in the \emph{ASP-Core-2}\xspace \begin{rev}language specification\end{rev} \cite{cafageiakakrlemarisc19a}.
Database query languages allowing for recursive definitions and aggregates were based on Datalog, essentially a deterministic fragment of ASP, in which every program is associated with a unique intended model, as for example the perfect model of Datalog programs with stratified negation \cite{apblwa87a}. Preserving the unique model property is non-trivial in presence of aggregate expressions because of nonmonotonicity of their satisfiability functions, which may lead to programs having no model, and also to programs having several equally-justifiable models.
Often in the literature, uniqueness of the intended model was guaranteed by imposing syntactic restrictions on the use of aggregates, usually resulting in some stratification of aggregations or monotonicity conditions\begin{rev}; see for example the papers by \citeN{mupira90a} and \citeN{ross94a}\end{rev}.
Other works in the literature extended the well-founded semantics to logic programs with aggregates \cite{kemstu91a,pedebr07a,gelder92a}, hence considering a third truth value to reason on undefined expressions whose
truth or falsity is taken as unknown.
Semantics for aggregate expressions were also given in terms of translation into aggregate-free (sub)programs, and then applying the well-founded or stable model semantics to the resulting programs.
Such translations first addressed extrema predicates only, that is, \lstinline|#min| and \lstinline|#max| aggregate expressions \cite{gagrza95a,sudram91a}, and were later also presented for monotonic versions of \lstinline|#count| and \lstinline|#sum| aggregate expressions \cite{maseza13a,zayadashcoin17a}.
The first attempt to define a variant of the stable model semantics that includes aggregates was given by \citeN{kemstu91a}. The proposed generalization of the Gelfond-Lifschitz reduct was to treat aggregate expressions in the same way as negated atoms. From today's point of view, this was of course bound to be problematic, as some aggregate expressions behave like positive rather than negative literals (and some aggregate expressions behave like neither of them). As a simple example, consider the program
\begin{asp}
a :- #sum{1 : a} > 0.
\end{asp}
which should intuitively be equivalent to
\begin{asp}
a :- a.
\end{asp}
but will have two answer sets according to \citeN{kemstu91a}: the expected $\emptyset$ plus the unexpected \lstinline|{a}| (as in that case the reduct results in \lstinline{a.}).
Still, this seminal work should be regarded as the starting point of what we discuss in the sequel.
The structure of this survey is as follows.
Section~\ref{sec:aggregates} introduces the language of logic programs with aggregate expressions to be studied (Section~\ref{subsec:syntax}), investigates the complexity of deciding satisfiability of aggregate expressions (Section~\ref{subsec:satisfiability}), and classifies aggregate expressions according to their monotonicity (Section~\ref{subsec:monotonicity}).
Contrary to this introduction, which used examples of symbolic programs with object variables, the main part of the survey focuses on a propositional language, where object variables are assumed to be eliminated as usual by a grounding procedure.
Section~\ref{sec:answersets} discusses model-based and construction-based answer set semantics for logic programs containing aggregates (presented in Section~\ref{subsec:model} or Section~\ref{subsec:construction}, respectively), and outlines semantic correspondences obtained for programs with aggregate expressions of particular monotonicity (Section~\ref{subsec:relationships}).
The computational complexity of common reasoning tasks is studied in Section~\ref{sec:complexity},
addressing
answer set checking (Section~\ref{subsec:check}) and answer set existence (Section~\ref{subsec:exist}).
Finally, Section~\ref{sec:discussion} discusses related work beyond the presented aggregate semantics
and properties,
including first-order semantics for symbolic programs with aggregates over object variables,
rewriting methods for turning programs containing (sophisticated) aggregates into simpler and often
aggregate-free representations,
and tools to extend logic programs by custom aggregates.
| {'timestamp': '2021-09-20T02:21:49', 'yymm': '2109', 'arxiv_id': '2109.08662', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08662'} | arxiv |
\section{Introduction}
Airbnb, one of the leading properties rental service providers, has rapidly gained popularity among people in need of lodging services, ever since its founding in 2008. An increasing number of travellers decide to choose Airbnb properties over traditional accommodations, such as hotels and hostels, when traveling \citep{guttentag2018tourists}. By now, Airbnb has over seven million listings across the globe in more than 220 countries and regions~\citep{airbnb}.
However, as Airbnb customers and property hosts are enjoying the convenience it provides, concerns about the safety and security of the listed properties keep rising. \citet{xu2017explore} found a positive correlation between the spatial distribution of Airbnb and the number of property crimes. This result suggests that Airbnb properties may be more prone to property crimes than non-rental properties. Moreover, multiple media reports have shown that some Airbnb guests are victims of crimes including theft, sexual assault, and kidnapping, among other things \citep{fox_news_2015, grind_shifflett_2019, bressington_2019}. Thus, when releasing data about Airbnb listings to the public, the data disseminator, which could be Airbnb itself or other holders of Airbnb data, should prioritize the task of privacy protection of each released Airbnb listing. Proper protection of Airbnb listings' sensitive information would prevent potential perpetrator from taking advantage of the released Airbnb data when committing crimes.
For the privacy protection purpose of releasing Airbnb listings data, our study considers the method of synthetic data, one of the leading approaches to providing privacy protection for the release of record-level data \citep{Rubin1993synthetic, Little1993synthetic}. To create synthetic data, data disseminators first build Bayesian statistical models and estimate them on the confidential record-level data. Next, synthetic values of sensitive variables are simulated from the posterior predictive distributions of the estimated Bayesian models. Data disseminators can then release the synthetic data to the public, after evaluating its utility (i.e., usefulness) and its privacy protection. We refer interested readers to \citet{Drechsler2011book} for a detailed description of the generation and evaluation of synthetic data for privacy protection. We note that government statistical agencies, such as the U.S. Census Bureau, has been creating synthetic data products for public release for more than a decade by now. For example, the OnTheMap Census product \citep{OnTheMap2008} and the synthetic Longitudinal Business Database \citep{SynLBD2011}, among others. There are also non-Bayesian methods for data synthesis, including classification and regression trees (CART), proposed by \citet{CART2005} and can be implemented using the synthpop R package \citep{synthpopR}.
In our case study, the New York Airbnb Open Dataset is considered as the confidential dataset to be protected \citep{bnbData}. Among the available variables in this confidential dataset, the number of available days an Airbnb property for listing and the average listing price of an Airbnb property are deemed sensitive, and therefore to be synthesized for privacy protection. The number of available days variable, in particular, has many zero-valued records and also has a minimum of 0 days and a maximum of 365 days. Such characteristics are usually not handled using popular all-purpose synthesis models, such as CART. To fully capture such features, we develop a Bayesian zero-inflated truncated Poisson regression model to synthesize the number of available days. As for the continuous variable of the average price of a listing, we create a Bayesian linear regression model for its synthesis. In each synthesis model, we utilize three predictors, the room type of an Airbnb listing, the neighborhood the listing is in, and the number of reviews the listing has on Airbnb, all of which are deemed insensitive and therefore kept un-synthesized. We build a sequential synthesis process \citep{SynLBD2011}, where the number of available days is synthesized first, and the average price is synthesized next. In the end, we create multiple synthetic datasets with number of days and average price synthesized while the remaining variables are un-synthesized, commonly known as partially synthetic data \citep{Little1993synthetic}.
Next, we evaluate the utility preservation performance of our simulated synthetic datasets through several data utility measures, including global utility measures such as the propensity score, the cluster analysis, and the empirical CDF, and analysis-specific utility measures such as the confidence interval overlap of quantities of interest \citep{woo2009global, Snoke2018JRSSA}. We also evaluate the privacy protection performance of the partial synthetic datasets through disclosure risk evaluations, where we consider both the identification disclosure risks and attribute disclosure risks \citep{hu2019bayesian}. Attribute disclosure risk refers to the risk that a data intruder correctly infers the true values of the sensitive variables in the synthetic dataset given access to external databases \citep{reiter2014JPC, hu2014disclosure, hu2019bayesian}. Identification disclosure risk occurs when a data intruder, with certain knowledge about records in the dataset, successfully establishes a one-to-one relationship between a confidential record with itself in the synthetic dataset \citep{reiter2009estimating}.
One important aspect and also an open question in risk evaluation of synthetic data is the assumptions made about intruder's knowledge. To explore uncertainties in these assumptions, we propose and explore innovative risk evaluation approaches that incorporate such uncertainties.
Through a series of evaluations, we have found that our partial synthesis of the New York Open Airbnb Data preserves the global utility and the analysis-specific utility of the confidential data at a high level, while the attribution and identification disclosure risks of the synthetic datasets are relatively low. When we introduce uncertainties to the intruder’s knowledge, the more uncertain the intruder’s knowledge is, the lower the identification disclosure risks are, an expected and important result.
We now proceed to introduce the New York Airbnb Open Dataset in our case study.
\subsection{The New York Airbnb Open Dataset}
Our New York Airbnb Open Dataset contains 16 different variables for a total of 48,900 Airbnb listings. We focus on five most relevant variables: neighborhood, room type, number of reviews, number of available days, and the average price. Detailed descriptions of these five variables are in Table \ref{tab:data description}. For the purpose of this study, we take a random sample of $n = 10,000$ records from the entire dataset, ensuring records in our selected dataset have valid entries for the five variables of interest.
\begin{table}[t]
\centering
\begin{tabular}{m{1.1in} m{0.8in} m{3.1in} | >{\centering}m{0.6in}}
\hline
Variable Name & Type & Description & Sensitive\tabularnewline
\hline
Neighborhood & Categorical & The borough a listing is located in & No\tabularnewline
RoomType & Categorical & A listing's space type & No \tabularnewline
ReviewsCount & Count & The number of reviews a listing received on Airbnb & No\tabularnewline
AvailableDays & Count & The number of days in a year a listing is available for renting on Airbnb, with many $0$s and a maximum value of $365$ & Yes \tabularnewline
Price & Continuous & The average price of a listing for one night & Yes\tabularnewline
\hline
\end{tabular}
\vspace{1mm}
\caption{Descriptions of the five selected variables from the New York Airbnb Open Dataset.}
\label{tab:data description}
\end{table}
Among these five variables, AvailableDays and Price are considered sensitive. Therefore, we build Bayesian models to synthesize these two variables, while using the other variables as predictors. Table \ref{tab:confidential data summary} shows key summary statistics for the confidential AvailableDays and Price values. As can be seen, the confidential AvailableDays variable has a large number of records with zero values. Moreover, it has a minimum of 0 days and a maximum of 365 days. For modeling purpose, we apply the log transformation on the Price variable and use the resulting LogPrice variable for our case study.
\begin{table}[H]
\centering
\begin{tabular}{>{\centering}p{1in} >{\centering}p{1in} >{\centering}p{1 in} >{\centering}p{1in} >{\centering}p{1in}}
\hline
& Mean & 25\% Quantile & Median & 75\% Quantile \tabularnewline
\hline
AvailableDays & 113.044 & 0 & 43 & 228 \tabularnewline
Price & 152.036 & 69 & 105 & 177 \tabularnewline
\hline
\end{tabular}
\vspace{1mm}
\caption{Summary statistics of the confidential AvailableDays and Price values.}
\label{tab:confidential data summary}
\end{table}
The remainder of this paper is organized as follows. Section \ref{BayesianSyn} presents the two Bayesian synthesis models we propose and our sequential synthesis process. Section \ref{Utility} evaluates the data utility of the synthetic datasets through both global and analysis-specific utility measures. Section \ref{Risk} assesses the attribute and identification disclosure risks of the synthetic datasets under certain assumptions of data intruder's knowledge. Uncertainties in these assumptions are also explored and investigated. We end the paper with a few concluding remarks in Section \ref{Conclusion}.
\section{Bayesian synthesis models and sequential synthesis}
\label{BayesianSyn}
We generate partially synthetic datasets for our selected sample of the New York Airbnb Open Dataset through a combination of a zero-inflated truncated Poisson regression model for AvailableDays and a linear regression model for Price. The model for Price is sequentially dependent on that for AvailableDays. In this section, we present the details of the synthesis models in Sections \ref{models:Poisson} and \ref{models:linear}. We describe the sequential synthesis process in Section \ref{models:sequential}.
\subsection{Zero-inflated truncated Poisson regression model for AvailableDays}
\label{models:Poisson}
Given its features of being a count variable and having a significant number of zeros with a minumum of 0 and a maximum of 365, we develop a zero-inflated truncated Poisson regression synthesis model to synthesize the sensitive AvailableDays. AvailableDays is likely to depend on Neighborhood, RoomType, and ReviewsCount, therefore we use three variables as predictors in the zero-inflated truncated Poisson regression model, which can be expressed as follows:
\begin{align}
Y_{days,i} &\sim q_i\cdot0 + (1-q_i)\cdot \textrm{Poisson}(\lambda_i)^{[0, \,365]}, \label{eq:1}\\
q_i &\sim \textrm{Bernoulli}(p_i), \label{eq:2}\\
\log(\lambda_i) &= \alpha_{1}X_{1i} + \alpha_{2}X_{2i} + \alpha_{3} \cdot \log{X_{3i}} + \epsilon_i, \label{eq:3}\\
\textrm{logit}(p_i) &= \beta_{1}X_{1i} + \beta_{2}X_{2i} + \beta_{3}\cdot \log{X_{3i}}, \label{eq:4}\\
\epsilon_i &\sim \textrm{Normal}(0, \tau), \label{eq:5}
\end{align}
\noindent where $Y_{days,i}$ is AvailableDays for record $i$, $q_i$ is binary following a Bernoulli distribution with parameter $p_i$, and $\lambda_i$ is the rate for the truncated Poisson distribution if AvailableDays for record $i$ is non-zero in Equation (\ref{eq:1}). The notation $\textrm{Poisson}(\lambda_i)^{[0, \,365]}$ refers to its truncation below at 0 and above at 365. As shown in Equation (\ref{eq:3}), $\log(\lambda_i)$ is modeled given the three predictors, $X_{1i}$ for RoomType, $X_{2i}$ for Neighborhood, and $X_{3i}$ for ReviewsCount, all for record $i$. The logit of the probability $p_i$ for AvailableDays being $0$ for record $i$ is expressed as a linear function with the same three predictors, shown in Equation (\ref{eq:4}). We give a $\textrm{Gamma}(0.001, 0.001)$ prior to the parameter $\tau$, the standard deviation of the normal error term $\epsilon_i$ in Equation (\ref{eq:3}). We give a $\textrm{Normal}(0,1)$ prior to the hyperparameters $\alpha_1,$ $\alpha_2$, $\alpha_3$, $\beta_1$, $\beta_2$, and $\beta_3$ in Equation (\ref{eq:3}) and (\ref{eq:4}).
These hyperparameters function in this hierarchical model setup to pool information across different combinations of RoomType, Neighbhorhood, and ReviewsCount.
\subsection{Linear regression model for log Price}
\label{models:linear}
To synthesize the sensitive Price variable, a linear regression model dependent on RoomType, Neighborhood, ReviewsCount, and AvailableDays is used to fit the log of Price in the confidential dataset. This linear regression model can be represented as the following:
\begin{align}
\log{(Y_{price,i})} &\sim \textrm{Normal}(\mu_i, \sigma_i), \label{eq:6}\\
\mu_i &= \gamma_{1}X_{1i} + \gamma_{2}X_{2i} + \gamma_{3}\cdot X_{3i} + \gamma_{4}\cdot Y_{days,i}, \label{eq:7}\\
\sigma_i &\sim t(1,1)^{+} \label{eq:8},
\end{align}
\noindent where $Y_{price,i}$ is the confidential Price for record $i$, $\mu_i$ is the mean for the normal distribution, $\sigma_i$ is the standard deviation of the normal distribution in Equation (\ref{eq:6}). Equation (\ref{eq:7}) shows the expression of mean $\mu_i$, where $X_{1i}, X_{2i}, X_{3i}$ are RoomType, Neighborhood, and ReviewsCount respectively, while $Y_{days,i}$ is the confidential AvailableDays for record $i$. The notation $t(1,1)^{+}$ refers to the $t(1, 1)$ distribution on the positive real line for the standard deviation $\sigma_i$ in Equation (\ref{eq:8}). We give a $\textrm{Normal}(0,2)$ prior to the hyperparameters $\gamma_1,$ $\gamma_2$, $\gamma_3$, and $\gamma_4$ in Equation (\ref{eq:7}).
Moreover, Equation (\ref{eq:7}) indicates that we sequentially synthesize $Y_{days,i}$ first and $Y_{price,i}$ next. We proceed to describe the details of this sequential synthesis process.
\subsection{The sequential synthesis process}
\label{models:sequential}
As mentioned previously, our sequential synthesis process synthesizes AvailableDays first and Price second. Moreover, AvailableDays is used as an additional predictor for the linear regression synthesis model for log Price (Equation (\ref{eq:7})). Such a sequential synthesis process requires fitting the synthesis models on the confidential data. Moreover, the synthesized values of variables are used in the synthesis steps of other variables where the synthesized variables serve as predictors (e.g., \citet{SynLBD2011}). In this section, we describe how we create $m > 1$ synthetic datasets and how our sequential synthesis works.
We use Just Another Gibbs Sampler (JAGS; \citet{JAGS}) for Markov Chain Monte Carlo (MCMC) estimation of the zero-inflated truncated Poisson regression model for AvailableDays and the linear regression model for Price. To synthesize $m$ synthetic datasets, we generate $m$ sets of posterior parameter draws from $m$ independent MCMC iterations. For each set of posterior parameter draws, $\ell = 1, \cdots, m$, we first simulate the synthetic AvailableDays, denoted as $\tilde{Y}_{days,i}^{\ell}$, for the $i^{th}$ record in the $\ell^{th}$ synthetic dataset using Equation (\ref{eq:1}). Next we use the synthesized $\tilde{Y}_{days,i}^{\ell}$ to generate the mean $\tilde{\mu}_i^{\ell}$ for log Price using,
\begin{equation} \label{eq:9}
\tilde{\mu}_i^{\ell} = \gamma_{1}^{\ell}X_{1i} + \gamma_{2}^{\ell}X_{2i} + \gamma_{3}^{\ell}\cdot X_{1i} + \gamma_{4}^{\ell}\cdot \tilde{Y}_{days,i}^{\ell},
\end{equation}
where $\gamma_1^{\ell}, \cdots, \gamma_4^{\ell}$ refer to $\ell^{th}$ set of posterior parameter draws of these parameters. The resulting mean $\tilde{\mu}_i^{\ell}$ is then used to synthesize the synthetic Price variable $\tilde{Y}_{price,i}^{\ell}$ for the $i^{th}$ record in the $\ell^{th}$ synthetic dataset using Equation (\ref{eq:6}) and exponentiation. We repeat this process for every record $i$ in the New York Airbnb Open Dataset sample and the resulting $\ell^{th}$ synthetic dataset contains un-synthesized $(\bm X_1, \bm X_2, \bm X_3)$ as well as synthesized AvailableDays and Price $(\bm{\tilde{Y}}_{days}^{\ell}, \bm{\tilde{Y}}_{price}^{\ell})$.
This entire process is then repeated for $m$ times to create $m$ synthetic datasets, \\ $\{(\bm X_1, \bm X_2, \bm X_3, \bm{\tilde{Y}}_{days}^{1}, \bm{\tilde{Y}}_{price}^{1}), \cdots, (\bm X_1, \bm X_2, \bm X_3, \bm{\tilde{Y}}_{days}^{m}, \bm{\tilde{Y}}_{price}^{m})\}$. In our case study, we choose $m = 20$ to adequately capture the uncertainty in the synthesis process as well as within reasonable computation time.
\section{Utility evaluation}
\label{Utility}
Data utility of synthetic data refers to how well the released synthetic data preserves the characteristics of the confidential data for analysis purposes. There are generally two types of utility measures: 1) global utility, which focuses on measuring the distance between the confidential data and the synthetic data; 2) analysis-specific utility, which emphasizes on how close the inferential results a user would obtain from the synthetic data are to those from the confidential data \citep{woo2009global, Snoke2018JRSSA}. In our investigation, we attempt both types of utility to provide a comprehensive evaluation of the utility performance of our synthesis.
Before presenting the detailed evaluation in Sections \ref{utility:global} and \ref{utility:specific}, we first visually inspect the synthetic data utility by plotting the synthetic AvailableDays and Price value compared to their corresponding confidential values. Figure \ref{fig:hist_avail} shows comparisons of histograms of the AvailableDays variable distribution for the confidential dataset and three synthetic datasets. In most bins in the histograms, the confidential AvailableDays has a similar count value with the synthetic values. However, in some bins, especially those towards the right tail of the distribution, the confidential AvailableDays deviates slightly from the synthetic values. Other synthetic datasets show similar results and are omitted for readability and brevity.
\begin{figure}[htb!]
\centering
\includegraphics[scale = 0.19]{Original_vs_Synthetic_AvailableDays_histogram_3syn.png}
\caption{Histograms comparing the confidential AvailableDays distribution and the synthetic AvailableDays distributions from three synthetic datasets. The bin-width is 25 days.}
\label{fig:hist_avail}
\end{figure}
As for Price, Figure \ref{fig:denplot_price} shows comparisons of density plots of the confidential Price distribution and the synthetic Price distributions from three synthetic datasets. The three synthetic Price distributions are highly similar to each other, all of which largely follow the confidential distribution of the confidential Price variable despite having lower peaks. It is also worth noting that some local features in the right tail of the confidential distribution are not adequately captured by the synthetic data distributions. Other synthetic datasets show similar results and are omitted for readability and brevity.
\begin{figure}[htb!]
\centering
\includegraphics[scale = 0.19]{Original_vs_Synthetic_Price_Line_3syn.png}
\caption{Density plots comparing the confidential Price distribution and the synthetic Price distributions from three synthetic datasets.}
\label{fig:denplot_price}
\end{figure}
Overall, the synthetic AvailableDays and Price distributions largely preserve the characteristics of their corresponding confidential distributions. In general, we observe a decrease in distribution similarity for Price compared to AvailableDays. This can be partly attributed to the fact that we use the synthetic AvailableDays values to sequentially synthesize the Price variable. Therefore, we expect to observe a decrease in utility for synthetic Price values in our detailed evaluation presented in the sequel.
We now proceed to the global utility and analysis-specific utility evaluations. All results are based on evaluation of $m = 20$ generated synthetic datasets.
\subsection{Global utility}
\label{utility:global}
For global utility evaluation, we consider three different measures: 1) the propensity score measure; 2) the cluster analysis measure; and 3) the empirical CDF measure \citep{woo2009global, Snoke2018JRSSA}. All results are based on $m = 20$ synthetic datasets.
The resulting data utility measure scores for both the synthetic AvailableDays and Price variables are shown in Table \ref{tab:Data Utility}, where each column corresponds to a measure: 1) $U_p$ is the propensity score utility measure (multivariate); 2) $U_c$ is the cluster analysis utility measure (multivariate); 3) $U_m$ and $U_a$ are the maximum absolute difference and squared average difference measures of the empirical CDF utility measure (univariate), respectively.
\begin{table}[t]
\centering
\begin{tabular}{>{\centering}p{1in} >{\centering}p{1in} >{\centering}p{1 in} >{\centering}p{1in} >{\centering}p{1in}}
\hline
& $U_p$ & $U_c$ & $U_m$ & $U_a$ \tabularnewline
\hline
AvailableDays & \multirow{2}{*}{0.00014} & \multirow{2}{*}{$4.63\cdot 10^{-5}$} & 0.03140 & 0.00028 \tabularnewline
Price & & & 0.05090 & 0.00040 \tabularnewline
High Utility & $\approx 0$ & $\approx 0$ & $\approx 0$ & $\approx 0$\tabularnewline
Low Utility & $\approx 1/4$ & large $U_c$ & large $U_m$ & large $U_a$\tabularnewline
\hline
\end{tabular}
\vspace{1mm}
\caption{Summary of the results of the propensity score, cluster analysis, and empirical CDF global utility measures of the $m = 20$ synthetic datasets for the New York Airbnb Open Data sample.}
\label{tab:Data Utility}
\end{table}
The propensity score measure aims at distinguishing the confidential and synthetic datasets using a classification algorithm. The reported propensity score is the average of the squared distance from the estimated propensity score for each record from a constant $c$, the percentage of synthetic values in the merged dataset of the confidential and synthetic values \citep{woo2009global, Snoke2018JRSSA}. In our evaluation, we calculate the propensity score measure on each synthetic dataset using a logistic regression as the classification algorithm, where the main effects of all variables are used as predictors. Since each synthetic dataset has the same size as the confidential dataset (a feature of partial synthesis; therefore $c = 1/2$), a propensity score measure close to 0 suggests high degree of similarity between the synthetic and confidential data, which implies high data utility, whereas a propensity score measure close to $1/4$ indicates low data utility. We take the average measure across the $m = 20$ synthetic datasets and the resulting value is $U_p = 0.00014$. This result suggests that the synthetic datasets are similar to the confidential dataset and thus the synthetic dataset has high data utility.
The cluster analysis measure groups the merged dataset of the confidential dataset and a synthetic dataset into multiple clusters using a clustering algorithm \citep{woo2009global}. This measure evaluates data utility based on comparing the number of confidential records and synthetic records in each cluster. The reported $U_c$ is the weighted sum of differences in proportions of synthetic records in each cluster and those of synthetic records in the entire merged dataset (which is $1/2$ in our case study). Therefore, a $U_c$ measure close to $0$ indicates the clustering algorithm cannot distinguish the synthetic data from the confidential data in each cluster, suggesting higher data utility. In our evaluation, we use the the unweighted pair group method with arithmetic mean (UPGMA, \citet{sokal1958statistical}) method as our clustering algorithm and report the average $U_c$ value across $m = 20$ synthetic datasets. The reported $U_c = 4.63\cdot 10^{-5}$, as shown in Table \ref{tab:Data Utility}, is very small and close to $0$. Therefore, the cluster analysis utility measure indicates high data utility of our simulated synthetic datasets.
Last but not least, the empirical CDF measure compares the empirical cumulative distribution functions (CDF) between the confidential and the synthetic data. The utility of one synthetic dataset is evaluated by whether the empirical CDF measure can discriminate the confidential dataset from this synthetic dataset \citep{woo2009global}. The empirical CDF utility has two components: 1) $U_m$, the maximum absolute difference between the empirical CDFs of the confidential dataset and the synthetic dataset; 2) $U_a$, the average squared difference between the two empirical CDFs. Both $U_m$ and $U_a$ are non-negative. Small $U_m$ and $U_a$ values indicate high similarity between the the two empirical CDFs, suggesting high synthetic data utility. Conversely, large $U_m$ and $U_a$ values indicate low data utility. As with the propensity score measure, we report the average $U_m$ and $U_a$ values across $m = 20$ synthetic datasets. As shown in Table \ref{tab:Data Utility}, the $U_m$ measure values for the AvailableDays and Price variables are $U_m = 0.03140$ and $U_m=0.05090$ respectively. The $U_a$ measure values for these two variables are $U_a = 0.00028$ and $U_a = 0.00040$ respectively. Both the maximum absolute difference and the average difference between the empirical CDFs of the confidential and synthetic datasets are close to $0$, suggesting that the confidential and the synthetic data have similar CDFs, indicating a high degree of data utility.
In summary, our global utility measures of propensity score, cluster analysis, and empirical CDFs all suggest a high level of utility preservation of our synthetic datasets for the New York Airbnb Open Data sample. We next present analysis-specific utility measures on several quantities of interest.
\subsection{Analysis-specific utility}
\label{utility:specific}
To further evaluate the data utility of the synthetic datasets, we perform analysis-specific utility measures to compare a number of quantities of interest, including the mean estimate, several extreme quantile estimates, and some regression coefficient estimates. Since our synthetic datasets are partially synthetic, we obtain the point estimate and 95\% confidence interval estimates of the mean and regression coefficients following the partial synthesis combining rules \citep{reiter2003SM, Drechsler2011book}. For quantile estimates, we use bootstrapping methods \citep{HuSavitskyWilliams2021JSSAM}.
After calculating the 95\% confidence interval estimates from the confidential data and the synthetic data, we use the interval overlap measure to quantify their distance \citep{karr2006framework, Snoke2018JRSSA}. Specifically, for the $\ell^{th}$ synthetic dataset, we calculate the interval overlap measure, $I^{\ell}$, for a quantity of interest, such as the mean, as the following:
\begin{equation}\label{eq:10}
I^{\ell} = \frac{U_i^{\ell} - L_i^{\ell}}{2(U_c - L_c)} + \frac{U_i^{\ell} - L_i^{\ell}}{2(U_s^{\ell} - L_s^{\ell})},
\end{equation}
where $U_c$ and $L_c$ are the upper and lower bound of the $95\%$ confidence interval obtained from the confidential dataset, $U_s^{\ell}$ and $L_s^{\ell}$ are the upper and lower bound of the $95\%$ confidence interval obtained from the $\ell^{th}$ synthetic dataset. Moreover, $U_i^{\ell} = \min(U_c, U_s^{\ell})$, and $L_i^{\ell} = \max(L_c, L_s^{\ell})$, where subscript $i$ refers to intersection (of the two confidence intervals). Finally, we report the average $I = 1 / m \sum_{\ell = 1}^{m} I^{\ell}$ as the interval overlap for the quantity of interest. An $I$ value close to $1$ indicates that a high degree of overlap, suggesting high data utility of the synthetic datasets. In contrast, an $I$ value close to $0$ or even negative indicates little or no overlap, suggesting poor data utility of the synthetic datasets.
We first consider the point estimate, the 95\% confidence interval, and the interval overlap measures for AvailableDays and Price, where we report those for the mean, the 25\% quantile, and the 90\% quantile, shown in Figures \ref{fig:mean_CI}, \ref{fig:Q25_CI}, and \ref{fig:Q90_CI} respectively. In each figure, panel A is for AvailableDays and panel B is for Price. In each panel, we include the point estimate (box with a cross) and the 95\% confidence interval (the vertical bars) of the confidential data (black and left) and of the synthetic data (yellow and right). Moreover, we add the interval overlap measure $I$ for each quantity in the panel.
\begin{figure}[htb!]
\centering
\includegraphics[scale = 0.095]{mean_CI.png}
\caption{The point estimate, $95\%$ confidence interval, and interval overlap of the means of the confidential and synthetic datasets. Panel \textbf{A} shows the estimand for AvailableDays and panel \textbf{B} shows the estimand for Price.}
\label{fig:mean_CI}
\end{figure}
\begin{figure}[htb!]
\centering
\includegraphics[scale = 0.095]{Q25_CI.png}
\caption{The point estimate, $95\%$ confidence interval, and interval overlap of the $25\%$ quantiles of the confidential and synthetic datasets. Panel \textbf{A} shows the estimand for AvailableDays and panel \textbf{B} shows the estimand for Price.}
\label{fig:Q25_CI}
\end{figure}
\begin{figure}[htb!]
\centering
\includegraphics[scale = 0.095]{Q90_CI.png}
\caption{The point estimate, $95\%$ confidence interval, and interval overlap of the $90\%$ quantiles of the confidential and synthetic datasets. Panel \textbf{A} shows the estimand for AvailableDays and panel \textbf{B} shows the estimand for Price.}
\label{fig:Q90_CI}
\end{figure}
Overall, the point estimates of the three quantities of interest are close between the confidential data and the synthetic data for AvailableDays, and the 95\% confidence interval overlap measures are close to 1 as well, suggesting high level of utility preservation. Those for Price are slightly worse, which are expected since Price is synthesized after AvailableDays is synthesized according to the sequential synthesis process. These results suggest that when using the synthetic data, users would obtain point estimates and 95\% confidence interval estimates for key quantities of AvailableDays and Price that are close to those from the confidential data.
\begin{figure}[htb!]
\centering
\includegraphics[scale = 0.095]{Regression_CI.png}
\caption{The point estimate, $95\%$ confidence interval, and interval overlap of selected regression coefficients from a linear regression analysis from the confidential and synthetic datasets. Panel \textbf{A} shows the ReviewsCount coefficient and panel \textbf{B} shows the AvailableDays coefficient.}
\label{fig:regression_CI}
\end{figure}
We also consider regression analysis types of analysis-specific utility measures. Specifically, we examine the regression coefficients of the effects of Neighborhood, RoomType, ReviewsCount, and AvailableDays on the response variable, Price. Recall that both AvailableDays and Price are synthesized, therefore this regression analysis utility measure takes into account all synthesized variables. As with the mean estimates, partial synthesis combining rules are applied in obtaining the regression coefficients from the $m = 20$ synthetic datasets. For each coefficient, we have a point estimate and a 95\% confidence interval estimate. Given the confidence interval estimates from the confidential data and the synthetic data, we calculate the interval overlap measure. Selected results are displayed in Figure \ref{fig:regression_CI}.
The point estimates of the coefficients for ReviewsCount and AvailableDays given the synthetic data are close to those given the confidential data. In both cases, the interval overlap measures are almost 1, indicating an extremely high level of utility. Results for the other regression coefficients show similarly high utility with interval overlap measures above $0.9$ for most of them. These are omitted for brevity.
\begin{comment}
Another analysis-specific data utility measure we examined is the regression coefficients from a linear regression using the Neighborhood, RoomType, ReviewsCount, and AvailableDays variables as predictors to predict the Price variable. We chose to use a linear regression to fit the Price variable because the synthetic Price variable is generated using a linear regression dependent on the same set of predictors. The combining rules were used to generate the point estimates and the $95\%$ confidence intervals of the regression coefficients, and Equation $\ref{eq:10}$ was used to calculated the interval overlap between the confidential and synthetic datasets. The linear regression models for the confidential and synthetic Price variable can be represented as,
\begin{align}
\textrm{Price}_{c,i} &\sim \gamma_{0} + \gamma_{1}X_{1i} + \gamma_{2}X_{2i} + \gamma_{3}\cdot X_{3i} + \gamma_{4}\cdot Y_{days,i} \label{eq:11} \\
\textrm{Price}_{s,i} &\sim \gamma_0 + \gamma_{1}X_{1i} + \gamma_{2}X_{2i} + \gamma_{3}\cdot X_{3i} + \gamma_{4}\cdot \bar{Y}_{days,i}, \label{eq:12}
\end{align}
where $\textrm{Price}_{c,i}$ is the confidential Price variable for record i, $\textrm{Price}_{s, i}$ is the synthetic Price variable for record i, $X_{1i}$ is the encoded RoomType for record i, $X_{2i}$ is the encoded Neighborhood for record i, $X_{3i}$ is the ReviewsCount for record i, $Y_{days,i}$ is the confidential AvailableDays for record i, and $\bar{Y}_{days,i}$ is the synthetic AvailableDays for record i.
\end{comment}
In summary, our analysis-specific utility measures on key quantities of interest, such as means, quantiles, and regression coefficients, all suggest a high level of utility preservation of the generated synthetic datasets for the New York Airbnb Open Data sample. Combined with the results of global utility evaluation in Section \ref{utility:global}, we conclude that the synthetic datasets generated from our proposed sequential synthesis models are able to preserve important characteristics of the confidential New York Airbnb Open Data sample. We now proceed to evaluate the disclosure risks associated with these synthetic data.
\section{Disclosure risk evaluation}
\label{Risk}
The utility evaluation results presented in Section \ref{Utility} demonstrate a high level of utility preservation of our synthetic datasets. However, synthetic data should only be considered for public release if their level of privacy protection is satisfactory. In this section, we assess the disclosure risks associated with our simulated synthetic datasets. Since our synthesis is partial synthesis of AvailableDays and Price, we consider attribute disclosure risk and identification disclosure risk, both of which exist in partially synthetic data \citep{hu2019bayesian}.
\subsection{Attribute disclosure risk}
Attribute disclosure risk refers to the risk that a data intruder correctly infers the confidential values of sensitive, synthesized variables given the released synthetic data and other information from external databases. In our case study, AvailableDays and Price are synthesized whereas RoomType, Neighborhood, and ReviewsCount are kept un-synthesized. If an intruder has access to information on records' information on some or all of these three un-synthesized variables, attribute disclosure could occur.
In our evaluation, we measure the attribute disclosure risk by estimating the probabilities that the confidential values of the sensitive, synthesized variables are correctly guessed among a number of reasonable guesses generated by the data intruder with certain knowledge. We consider the worst case scenario where when evaluating the risk for record $i$, the intruder has the exact knowledge of how synthetic data are generated and that the intruder knows the confidential values of the synthesized variables for all records except for the $i^{th}$ record. If the attribute disclosure risk is acceptable under the worst case scenario, it should also be acceptable in scenarios with less intruder knowledge \citep{reiter2014JPC, hu2014disclosure, hu2019bayesian}.
For record $i$ in one synthetic dataset, we come up with 10 plausible guesses that are close to each synthetic variable. Including the confidential value, we have 11 guesses for confidential AvailableDays, $Y_{days, i}$, and another 11 guesses for confidential Price, $Y_{price, i}$ for record $i$, resulting in $11 \times 11 = 121$ different combinations of guesses for the confidential pair $(Y_{days, i}, Y_{price, i})$. We then estimate the probability that the intruder will correctly guess the confidential pair among the 121 plausible guesses, given the released synthetic datasets, and the worst case scenario knowledge we assume. The higher the estimated probability (i.e., closer to 1), the higher the attribute disclosure risk for that record, and vice versa. As with some of the utility evaluation, we perform the probability estimation on each synthetic dataset and take their average to report a final probability for each record.
Figure \ref{fig:AR_prob} shows the density plot of the estimated probabilities across all $n = 10,000$ records in the New York Airbnb Open Data sample. The vertical dashed line corresponds to $p = 1/121$, the probability of randomly guessing the confidential pair correctly out of 121 combinations. As can be seen, a majority of the Airbnb listings have an estimated probability lower than random guessing (records have probability lower than 1/121). This result suggests that even under this worst case scenario where the intruder has a large amount of information when trying to guess the confidential pair, the synthetic data has provided a good amount of protection for a majority of the listings.
\begin{figure}[htb!]
\centering
\includegraphics[scale = 0.6]{AR_guess_rank_0.png}
\caption{Density plot for the estimated probabilities for the data intruder to correctly guess the confidential combination of AvailableDays and Price data among the total 121 combinations, for all $n = 10,000$ records. The vertical dashed line is the reference line for $p = 1/121$, which is the probability of correctly guessing the values randomly.}
\label{fig:AR_prob}
\end{figure}
\begin{figure}[htb!]
\centering
\includegraphics[scale = 0.6]{AR_hist_0.png}
\caption{Histogram for the rankings of estimated probabilities of the confidential pair of AvailableDays and Price among all 121 combinations. Rank = 1 indicates the most probable and rank = 121 indicates the least probable.}
\label{fig:AR_hist}
\end{figure}
In addition to the estimated probability, we record the ranking of the confidential pair being guessed correctly among the 121 combinations. The higher the ranking (i.e., closer to 1), the higher the attribute disclosure risk for that record. By contrast, the lower the raking (i.e., closer to 121), the lower the attribute disclosure risk for that record. Figure \ref{fig:AR_hist} presents a histogram of the rankings of all $n = 10,000$ Airbnb listings. As can be seen, most of the listings have their confidential pair ranked around 60 among the total 121 plausible combinations. There are some listings with relatively high rankings at around 6. If disseminators are not satisfied with the protection for these listings, more privacy protection can be provided.
Overall, these probability and ranking results indicate low attribute disclosure risks in our synthetic datasets, even under such an extremely conservative scenario. The risks would only get lower if less information is assumed known by the intruder. We next evaluate the identification disclosure risks of our synthetic datasets.
\subsection{Identification disclosure risk}
Identification disclosure occurs when a data intruder, with certain knowledge, correctly establishes a one-to-one relationship between a record in the confidential data and this record in the synthetic data. Given the nature of our synthesized variables, count for AvailableDays and continuous for Price, we follow the approaches in \citet{hornby2021TDP} when declaring a match between a record in the confidential data with another record in the synthetic data. Specifically, among all records sharing the same un-synthesized RoomType, Neighborhood, and ReviewsCount in the confidential and synthetic data, a match is declared for confidential record $i$ if for a synthetic record $j$, its synthetic AvailableDays value is within $5$ days from the confidential AvailableDays value of record $i$ \emph{and} if the log transformation of its synthetic Price value is within the $\pm 5\%$ range of the confidential $\log{\textrm{(Price)}}$ value of record $i$. As before, evaluation is performed on each synthetic dataset separately and results are combined by taking averages.
The identification disclosure risks of the synthetic dataset are evaluated based on three commonly-used measures, namely the expected match risk (EMR), true match rate (TMR), and flase match rate (FMR) \citep{reiter2009estimating, hu2019bayesian, DrechslerHu2021JSSAM}.
The EMR represents the expected number of records in the synthetic datasets to be correctly identified. The TMR refers to the percentage of true unique matches among all records, and the FMR measures the percentage of false unique matches respectively among all unique matches. Therefore, lower EMR, lower TMR, and higher FMR indicate lower identification risks, and vice versa.
In our case study, the identification risk evaluation results are $\textrm{EMR} = 125.5939$, $\textrm{TMR} = 0.0102$, $\textrm{FMR} = 0.9117$, and there are $s=1153$ unique matches. With $n = 10,000$ Airbnb listings in total, $\textrm{EMR} = 125.5939$ indicates that the average probability for a record to be correctly identified is $125.5939/10000 \approx 0.0126$. $\textrm{TMR} = 0.0102$ means that $0.0102 \times 10000 = 102$ listings are correct unique matches in the sample. Lastly, with 1153 unique matches, $1153 \times 0.9117 \approx 1051$ are false matches given $\textrm{FMR} = 0.9117$.
Overall these results suggest low identification risks associated with our synthetic datasets for the New York Airbnb Open Data sample. Note that this evaluation is based on the assumption that the intruder would have perfect knowledge of the un-synthesized variables, RoomType, Neighborhood, and ReviewsCount, which could be unrealistic in practice and potentially overstate the disclosure risk concerns. To evaluate the impact of uncertainties in intruder's knowledge, we proceed to incorporate scenarios of such uncertainties in the next section.
\subsection{Uncertainties in intruder's knowledge in identification disclosure risk evaluation}
To investigate how uncertainties in intruder's knowledge would influence the identification disclosure risks of the synthetic data, we consider adding normal noise to the ReviewsCount variable after applying a log transformation. This is to mimic uncertainties in intruder's knowledge about this ReviewsCount variable. Specifically, for record $i$,
\begin{equation}
\log(\textrm{ReviewsCount}^*_{i}) \sim \textrm{Normal}(\log(\textrm{ReviewsCount}_{i}), S),
\end{equation}
where $\textrm{ReviewsCount}^*_{i}$ represents the intruder's knowledge of the ReviewsCount value, $\textrm{ReviewsCount}_{i}$ is the confidential ReviewsCount value, and $S$ represents the level of uncertainties in intruder's knowledge, which is the standard deviation of the normally added noise. We experiment with $S$ from $\{0.00, 0.01, \cdots, 0.15\}$ and evaluate the identification disclosure risks under each different $S$ value as the uncertainty level of ReviewsCount. As before, results of EMR, TMR, and FMR are reported with each $S$ value. Moreover, we report the number of unique matches in each case.
\begin{figure}[htb!]
\centering
\includegraphics[scale = 0.19]{IR_final.png}
\caption{Identification disclosure risk for the synthetic datasets under different standard deviation value ($S$) of uncertainties in intruder knowledge of ReviewsCount. Panel \textbf{A} shows the impact of $S$ on EMR, panel \textbf{B} displays that on TMR, and panel \textbf{C} presents that on FMR. Panel \textbf{D} illustrates how the number of unique matches is influenced by $S$.}
\label{fig:IR}
\end{figure}
Results are presented in Figure \ref{fig:IR} for all different experimented $S$ values. Evidently, as the level of uncertainties increases (i.e., $S$ increases), both EMR and TMR decrease, while FMR increases. Therefore, in general, as data intruder's knowledge becomes more uncertain, the identification disclosure risks for the synthetic datasets decrease, a not-so-surprising result. These can be explained by the fact that the uncertainties in ReviewsCount make it more difficult for the intruder to establish a one-to-one relationship between two records, one in the confidential data and the other in the synthetic data. It is worth noting that while panel \textbf{D} in Figure \ref{fig:IR} shows that in general the number of unique matches in the synthetic datasets increases as $S$ increases, the FMR rises rapidly with as the amount of uncertainties in intruder knowledge increase. These results suggest that uncertainties in ReviewsCount increase the probability of a unique match to be a false match, and higher uncertainty level makes it harder for data intruder to correctly identify records in the confidential data with the released synthetic data.
\section{Conclusion}\label{Conclusion}
As synthetic data becomes more widely used by data disseminators, our study focuses on how to best disseminate a sample of the New York Airbnb Open Data, where the number of available days and the price of Airbnb listings are considered sensitive information to be protected. Given the features of number of available days, we propose a novel zero-inflated truncated Poisson regression model. Moreover, we utilize a sequential synthesis approach to further synthesize the price variable after synthesizing the available days. The resulting multiple partially synthetic datasets are evaluated for their utility and disclosure risk performances.
Multiple utility measures, including global utility and analysis-specific utility, are evaluated for our synthetic New York Airbnb Open Data samples. Overall, our synthetic datasets preserve a high level of utility that can be hugely beneficial for users when conducting analyses. Attribute disclosure risk and identification disclosure risk are evaluated for our synthetic datasets under certain intruder's knowledge assumptions. Overall, there exist low disclosure risks in our synthetic datasets, making them suitable for public release.
An important methodological contribution of our work lies in our investigation of uncertainties in intruder's knowledge when evaluating identification disclosure risks. Specifically, we consider how the uncertainty level of intruder's knowledge of an un-synthesized variable impacts several summaries of identification disclosure risks. Our results show that as intruder's knowledge becomes more inaccurate (i.e., more uncertain), it is less likely for the intruder to correctly identify records in the confidential data with access to the released synthetic data and external information.
Extending the uncertainty evaluation to attribute disclosure risks is an important and highly relevant future work direction. As with identification disclosure risk evaluation, assumptions are made when evaluating attribute disclosure risks. Investigating the impact of intruder's knowledge uncertainty in attribute disclosure risks would shed light on how to most realistically evaluate disclosure risks in synthetic data.
| {'timestamp': '2021-09-20T02:16:31', 'yymm': '2109', 'arxiv_id': '2109.08511', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08511'} | arxiv |
\section{First Section}
\end{document}
\section*{Acknowledgments}
We would like to thank the anonymous reviewers for their feedback. This project was supported by NSF (Grant \#: CNS-2031377). Any opinions, findings, and conclusions or recommendations expressed in this paper are those of the authors and do not necessarily reflect the views of the funding agency.
\section{Existing Algorithms of Seed Distillation}
\clearpage
\input{tab/code-cov}
\clearpage
\section{Background and Motivation}
\label{sec:overview}
\subsection{Grey-box Fuzzing and Parallel Mode}
\label{susec:bcg}
In this research, we target grey-box fuzzing~\cite{manes2019art}, the most popular category of fuzzing. Grey-box fuzzing generally follows the \emph{feedback-scheduling-mutation} model presented in Fig.~\ref{fig:fsm}. This FSM model represents an iterative process, starting with a queue of seed inputs, or \emph{seeds}, that are typically generated from certain known test cases. In a round of fuzzing, the \emph{scheduling} picks a seed and feeds it to the \emph{mutation} process for deriving new inputs to test the target program, expecting to trigger un-handled crashes or exceptions. Both the scheduling and mutation processes are based on \emph{feedback} (e.g.,\xspace crashes and code coverage) obtained from the program executions on the previously generated inputs. The fuzzer also collects feedback to decide whether an input under test should be added to the seed queue.
To improve the efficiency of code coverage, many grey-box fuzzing tools~\cite{afltech,serebryany2015libfuzzer,angora} provide a parallel mode to run multiple instances concurrently. Their parallel mode mostly follows {\sc AFL}\xspace. They start identically-configured instances and run them in parallel. Depending on the implementation, different instances may either share the same seed queue~\cite{serebryany2015libfuzzer} or carry separate seed queues but periodically exchange seeds~\cite{afltech}. In the latter case, each instance borrows from other instances all the seeds that bring new code coverage. While intuition suggests that more fine-grained synchronizations can benefit the effectiveness of the above parallel fuzzing, none of the existing tools carry such synchronizations.
\input{tab/study}
\subsection{Motivating Study \label{subsec:motivation}}
\label{susec:motivation}
Sharing seeds across instances is an intentional design of {\sc AFL}\xspace~\cite{aflparal12:online}. The goal is that ``hard-to-hit but interesting test cases'' can be used by all instances to guide their work. However, intuition suggests that such a design can lead different instances to mutate the same seeds, which may eventually reduce the effectiveness of concurrency. To validate this intuition and thus, motivate our research, we perform an empirical study based on {\sc AFL}\xspace.
In our study, we run {\sc AFL}\xspace on four popular benchmark programs ({\sc Objdump}, {\sc Readelf}, {\sc Libxml}, {\sc Nm-new}) with 2 parallel instances for 24 hours. We trace the mutation process to understand which seeds are mutated by which instances. We repeat the tests five times and report the average results in Fig.~\ref{fig:study:overlap}. As shown by the results, different instances are indeed mutating overlapped seeds despite many seeds are never mutated, in particular when the fuzzing time is limited. Consider the results after 6 hours as an example. On average, nearly 20\% of the seeds are never mutated. However, over 42\% of the seeds receive multiple rounds of mutations. When we increase the fuzzing time, we observe even higher rates of overlaps but still a group of non-mutated seeds.
Although we observe overlaps among mutated seeds and the overlaps indeed delay the mutations to all seeds, they may not necessarily impede the efficiency of code coverage. This is because {\sc AFL}\xspace's mutation involves random operations. In this regard, running multiple rounds of mutations to the same seed --- especially when the seed has higher potential --- may produce code coverage comparable to applying the mutations to different seeds. To verify this possibility, we run another experiment. Specifically, we randomly collect 1,000 seeds produced in the above test of each program and equally split the seeds into group \texttt{A} and group \texttt{B}. First, we run {\sc AFL}\xspace to mutate group \texttt{A} for multiple rounds and we calculate the increase of code coverage after each round of mutations, where we use control flow edges as the metric of code coverage and we consider the edges covered by the original 1,000 seeds as the baseline. Then, we repeat the experiment but replace the same $X$\% of group \texttt{A} with un-mutated seeds from group \texttt{B} in each round. For example, when we set $X$ to 10, we run the original group \texttt{A} in the first round but in every following round, we replace a fixed subset of 50 seeds with other non-muted ones from group \texttt{B}. Such an experiment enables us to simulate fuzzing scenarios where a different extent of overlapped mutations happen.
\begin{figure}[t!]
\renewcommand{\arraystretch}{0.5}
\begin{tabular}{cccc}
\includegraphics[width=0.24\linewidth]{fig/objdump_mut_new.pdf} &
\includegraphics[width=0.24\linewidth]{fig/readelf_mut_new.pdf} &
\includegraphics[width=0.24\linewidth]{fig/libxml_mut_new.pdf} &
\includegraphics[width=0.24\linewidth]{fig/tiff2ps_mut_new.pdf} \\
\centering{\hspace{0.6cm}(a) \sc objdump} & {\hspace{0.7cm}(b) \sc readelf} &
\centering{\hspace{0.6cm}(c) \sc libxml} & {\hspace{0.6cm}(d) \sc tiff2ps} \\
\end{tabular}
\vspace{0.5em}
\caption{Impacts of overlapped mutations to edge coverage. The baseline of ``Edge Coverage Increase'' is the edges covered by the original 1,000 seeds; ``Overlapping Rate'' indicates the portion of overlapped seeds between two consecutive rounds of mutations. Results from the first round are omitted since the first round is identical under different settings, i.e.,\xspace mutating the initial 500 seeds. \emph{Please note that the x-axis decreases from left to right.}}
\label{fig:study-code-cov}
\vspace{-1em}
\end{figure}
Fig.~\ref{fig:study-code-cov} presents the results of the above experiment under different settings. With all the four programs, we observe a trend that fewer overlaps among the mutated seeds lead to a higher increase of code coverage. This empirically demonstrates that running {\sc AFL}\xspace's mutations on different seeds can cover more edges than running the mutations on the same seeds. We believe such results align with {\sc AFL}\xspace's design: {\sc AFL}\xspace distributes mutation energies in a round according to the potential of a seed (based on metrics such as number of edges covered by the seed) and assigns more mutation cycles to seeds with higher potential, which eventually helps allocate sufficient mutations in a single round to exhaust the edges that can be derived from a seed.
To sum up, our empirical study shows that the parallel mode of {\sc AFL}\xspace (and likely, many other fuzzing tools) can indeed bring overlaps, which further impedes the efficiency of code coverage. It is, therefore, necessary to investigate and develop better solutions of parallel fuzzing.
\iffalse
\begin{figure}[t!]
\renewcommand{\arraystretch}{0.5}
\begin{tabular}{cc}
\includegraphics[width=0.45\linewidth]{fig/objdump_24h.pdf} &
\includegraphics[width=0.46\linewidth]{fig/readelf_24h.pdf} \\
\centering{\hspace{0.6cm}(a) \sc objdump} & {\hspace{0.7cm}(b) \sc readelf} \\
\includegraphics[width=0.45\linewidth]{fig/libxml_24h.pdf} & \includegraphics[width=0.46\linewidth]{fig/tiff2ps_24h.pdf} \\
\centering{\hspace{0.6cm}(c) \sc libxml} & {\hspace{0.6cm}(d) \sc tiff2ps} \\
\end{tabular}
\caption{The change of code coverage with the rate of overlaps between the mutations by different instances. The tests are done with 2 instances across 24 hours.}
\label{fig:study-2}
\vspace{-1.2em}
\end{figure}
\begin{figure}[t!]
\renewcommand{\arraystretch}{0.5}
\begin{tabular}{cc}
\includegraphics[width=0.45\linewidth]{fig/objdump_study.pdf} &
\includegraphics[width=0.46\linewidth]{fig/readelf_study.pdf} \\
\centering{\hspace{0.6cm}(a) \sc objdump} & {\hspace{0.7cm}(b) \sc readelf} \\
\includegraphics[width=0.45\linewidth]{fig/libxml_study.pdf} & \includegraphics[width=0.46\linewidth]{fig/nm_study.pdf} \\
\centering{\hspace{0.6cm}(c) \sc libxml} & {\hspace{0.6cm}(d) \sc nm-new} \\
\end{tabular}
\caption{Results of parallel fuzzing in 24 hours.}
\label{fig:study-5}
\vspace{-1.2em}
\end{figure}
\begin{table}[t!]
\scriptsize
\centering
\caption{Results of multiple mutation rounds. {\tt Cov} indicates the code coverage after current mutation round. {\tt Rate} represents the code coverage increasing rate after mutation.}
\label{tab:multi-mut:increase}
\begin{tabular}{p{1.2cm}|p{0.4cm}p{0.4cm}|p{0.4cm}p{0.6cm}|p{0.4cm}p{0.6cm}|p{0.4cm}p{0.6cm}}
\toprule[0.5pt]
\toprule[0.5pt]
\multirow{3}{*}{\bf{\normalsize{\em Program}}} & \multicolumn{8}{c}{\bf{\normalsize{\em Mut. Rounds \& Cov. Increase Rate }}} \\\cline{2-9}
& \multicolumn{2}{c|}{Round 1}
& \multicolumn{2}{c|}{Round 2}
& \multicolumn{2}{c|}{Round 3}
& \multicolumn{2}{c}{Round 4}\\
\cline{2-9}
& {\tt Cov}
& Rate
& {\tt Cov}
& Rate
& {\tt Cov}
& Rate
& {\tt Cov}
& Rate\\\hline
{\sc Objdump} & 18778 & - & 19103 & 1.731\% & 19331 & 1.193\% & 19454 & 0.636\% \\
\rowcolor{mygray}
{\sc Tiff2ps} & 16122 & - & 16341 & 1.358\% & 16391 & 0.306\% & 16407 & 0.097\% \\
{\sc Libxml} & 27282 & - & 27350 & 0.229\% & 27379 & 0.106\% & 27384 & 0.018\% \\
\rowcolor{mygray}
{\sc Nm-new} & 6619 & - & 6706 & 1.314\% & 6742 & 0.573\% & 6761 & 0.32\% \\
\hline
{\bf Ave. } & {\bf 17200} & - & {\bf 17375} & {\bf 1.02\%} & {\bf 17460} & {\bf 0.489\%} & {\bf 17501} & {\bf 0.234\%} \\
\bottomrule[0.5pt]
\bottomrule[0.5pt]
\end{tabular}
\end{table}
\fi
\section{Conclusion}
\label{sec:conclusion}
This paper focuses on the problem of parallel fuzzing. It presents a study to understand the limitations of the parallel mode in the existing grey-box fuzzing tools. Motivated by the study, we propose a general model to describe parallel fuzzing. This model distributes mutually-exclusive yet similarly-weighted tasks to different instances, facilitating concurrency and also fairness across instances. Guided by our model, we present a novel solution to improve the parallel mode in {\sc AFL}\xspace. During fuzzing, our solution periodically distributes seeds that carry non-overlapped and similarly-weighted tasks to different instances, maximally meeting the requirements of our model. We have implemented our solution on top of {\sc AFL}\xspace and we have evaluated our implementation with {\sc AFL}\xspace on 9 widely used benchmark programs. Our evaluation shows that our solution can significantly reduce the overlaps and hence, accelerate the code coverage.
\section{Applications of Our Model}
\label{sec:app}
\subsection{Existing Solutions}
\begin{wrapfigure}{r}{0.5\textwidth}
\vspace{-2.5em}
\begin{center}
\centering
\includegraphics[width=1\linewidth]{fig/cfg-ase.pdf}
\caption{An example of two seeds that cover overlapped sets of edges. The \emph{upper} part presents the CFG; the \emph{lower} part shows the two seeds.}
\label{fig:aflpaths}
\vspace{-1em}
\end{center}
\vspace{-1em}
\end{wrapfigure}
In the literature, two solutions of improving parallel fuzzing, {\sc P-FUZZ}\xspace~\cite{song2019p} and {\sc PAFL}\xspace~\cite{liang2018pafl}, fit into our model. Both {\sc P-FUZZ}\xspace and {\sc PAFL}\xspace consider \emph{a fuzzing task is to run a round of mutations to a unique seed} and they distribute a similar amount of unique seeds to each instance. However, the two solutions take two opposite principles to define the uniqueness of a seed. {\sc P-FUZZ}\xspace aims for conservativeness. It follows {\sc AFL}\xspace and considers a seed that brings new code coverage at its birth to be unique. Such a principle preserves all seeds produced by {\sc AFL}\xspace but can leave behind many overlaps. Consider Fig.~\ref{fig:aflpaths}, where {\tt Seed-1} is born before {\tt Seed-2}, as an example. {\sc P-FUZZ}\xspace will consider both seeds unique and mutate both seeds. However, {\tt Seed-2} covers all the edges of {\tt Seed-1} and thus, they actually overlap based on {\sc AFL}\xspace's definition. Moreover, mutating {\tt Seed-2} can likely produce the same code coverage as mutating both seeds, further illustrating the overlap.
In contrast, {\sc PAFL}\xspace aims for effectiveness. It considers a seed unique only when the seed covers certain less-frequently visited edges. In this way, {\sc PAFL}\xspace can massively reduce overlaps. However, it does not guarantee that the unique seeds can cover all the code covered by the original seeds. As such, it can skip certain code regions and lose the opportunities to cover code that can be derived from those code regions.
\begin{figure}[tb]
\centering
\includegraphics[width=\linewidth]{fig/workflow.pdf}
\caption{Workflow of our solution to optimize parallel fuzzing.}
\label{fig:workflow}
\vspace{-1em}
\end{figure}
\subsection{Our Solution}
\label{subsec:codepartition}
In this paper, we propose a new solution following our model. Similar to {\sc P-FUZZ}\xspace and {\sc PAFL}\xspace, we consider a fuzzing task is to run a round of mutations to a unique seed. However, as we will explain shortly, we adopt a strategy that achieves an effectiveness-and-conservativeness balance to define the uniqueness of a seed. Our solution follows the workflow in Fig.~\ref{fig:workflow} to periodically distribute the tasks. In each round of task distribution, we pull seeds from all instances, partition them into un-overlapped while similarly-weighted sub-sets, and finally assign them back to each instance. In the rest of this section, we describe the design details and explain how they meet $\mathbb{P}_1$ - $\mathbb{P}_3$.
\noindent\textbf{Defining fuzzing tasks.} In our solution, we consider the entire set of tasks are to mutate seeds that cover all the (control flow) edges reached by the original seeds. In this way, we approximate the fuzzing goals of {\sc AFL}\xspace and largely preserve the fuzzing space of {\sc AFL}\xspace (i.e.,\xspace produce similar effects as mutating every seed). To determine the uniqueness of a seed, we consider the edges and their hit counts\footnote{\label{note1}A hit count in each of the following ranges is mapped to a unique value: \texttt{[1], [2], [3], [4, 7], [8, 15], [16, 31], [32, 127], [128, $\infty$)}} covered by the seed as criteria. But different from {\sc P-FUZZ}\xspace, we consider \emph{a seed is unique only if the seed covers one or more edges that other seeds do not cover}. This principle avoids the overlaps that {\sc P-FUZZ}\xspace may incur. Referring back to the example in Fig.~\ref{fig:aflpaths}, when {\tt Seed-1} and {\tt Seed-2} both exist at the moment of task distribution, we will consider {\tt Seed-1} non-unique since {\tt Seed-2} encapsulates all the edges of {\tt Seed-1}. In the following, we describe how to pick unique seeds while running task distribution.
\begin{algorithm}[t!]
\caption{\textsc{Task distribution}}
\label{alg:taskdistribute}
\Input{Seed sets from all instances $\mathcal{D}=\{\vec{S}_1,\vec{S}_2, ..., \vec{S}_n\}$}
\Output{Seeds distributed to different instances $\mathcal{D'}=\{\vec{S}'_1,\vec{S}'_2, ..., \vec{S}'_n\}$}
Initialize $\mathcal{D'}$: $\vec{S}'_1=\emptyset$, $\vec{S}'_2=\emptyset$,... $\vec{S}'_n=\emptyset$
\For{each $\vec{S}_i\in\mathcal{D}$}{
Obtain edges covered by seeds in $\vec{S}_i$, notated as $\vec{E}_i$\; \tcc{hit counts of edges are considered}
}
$\vec{E}=\bigcap_{i=1}^{n} \vec{E}_{i}$\;
Organize $\vec{E}$ into a control flow graph $CFG$\; \tcc{different hit counts of the same edge are represented as different edges}
Copy $CFG$ as $CFG'$ and topologically sort $CFG'$\;
\For{the deepest leaf node $L_i$ in $CFG'$}{
$k=random(1, n)$\;
Pick a seed $s$ from $\vec{S}_k$ which covers $L_i$, maximizes $|edge(s) \bigcap edge(CFG')|$, and has the minimal age\;
Add $s$ to $\vec{S}'_k$\;
Remove $edge(s)$ from $CFG'$\;
}
\For{each $\vec{S}_i\in\mathcal{D}$}{
\For{each $s\in\vec{S}_i$}{
\If{$edge(s)-edge(CFG)\neq\emptyset$ and $edge(s)-edge(\vec{S}'_i)\neq\emptyset$}{
Add $s$ to $\vec{S}'_i$\;
}
}
}
\Return{$\mathcal{D}'$}\;
\end{algorithm}
\noindent\textbf{Distributing fuzzing tasks.} In each round of task distribution, we pull all the seeds from each instance and re-run them with dynamic tracing. We gather the edges covered by each instance, notated as $\vec{E}_{i}$ for the $i^{th}$ instance. We then compute the intersections among the edges from all instances (i.e.,\xspace $\bigcap_{i=1}^{n} \vec{E}_{i}$), and we notate the intersections as $\vec{E}$. By intuition, we can then randomly, evenly partition $\vec{E}$ into multiple sub-sets, assign each sub-set to a unique instance, and then pick seeds that visit those assigned edges for the instance to mutate. Such an idea, however, has a major problem. When we pick a seed to cover a particular edge, we will concurrently cover many other edges, which may essentially bring overlaps back. Consider the Fig.~\ref{fig:edge-split} as an example. By random distribution, we may sequentially pick {\tt Seed-2}, {\tt Seed-3}, and {\tt Seed-4}, and distribute them to different instances. According to our definition, this would create an edge-overlap between {\tt Seed-2} and {\tt Seed-3 + Seed-4}, not satisfying our definition of uniqueness.
\begin{figure}[tb]
\centering
\includegraphics[width=\linewidth]{fig/edge-split.pdf}
\caption{An example of edge-coverage-based task distribution between 2 instances. The \emph{left} part shows the CFG aggregated by the overlapped edges. The \emph{middle} part show the seeds produced by {\sc AFL}\xspace, sorted in time order. The \emph{right} part presents the task distribution results.}
\label{fig:edge-split}
\vspace{-1em}
\end{figure}
In this work, we design a greedy algorithm, shown in Algorithm~\ref{alg:taskdistribute}, to provide \emph{edge-coverage-based task distribution}. We aggregate the edges in $\vec{E}$ into a topologically sorted control flow graph, notated as $CFG$ (line {\sf 1-6}). We then recursively process the leaf edges on $CFG$ (i.e., edges that end with leaf nodes on $CFG$). For the leaf edge with the largest depth, we randomly pick a fuzzing instance and elaborately pick a seed $s$ from that instance to cover the leaf edge (line {\sf 9-10}). To be specific, we select the seed that covers the maximal number of edges remaining on the $CFG$. If multiple seeds satisfy this condition, we pick the youngest one. We distribute $s$ to the fuzzing instance where $s$ comes from (line {\sf 11}) and remove all edges covered by $s$ from $CFG$ (line {\sf 12}). We repeat this process until all edges on the $CFG$ are removed. After that, we preserve the seeds that visit edges in $\neg \vec{E}$ (line {\sf 14-20}). To better illustrate our distribution algorithm, we present an example in Fig.~\ref{fig:edge-split}, showing both the fuzzing progress and the distribution results. It is worth noting that when we pick a seed for leaf node {\tt 4$\to$8}, we favor {\tt Seed-4} over {\tt Seed-2} because {\tt Seed-4} is more recently derived. This prevents the pick of {\tt Seed-2} and avoids the overlap we mentioned before.
The above algorithm involves multiple heuristics, which strive for fewer overlaps and better efficiency. First, we prefer seeds that cover more non-distributed edges (line {\sf 10}). The motivation is to quickly consume the distribution space and thus, minimize the number of required seeds and reduce the potential of overlaps. Second, we favor newer seeds. The rationale is that seeds newly generated have a higher chance to cover new edges than the older seeds. Thus, they have a lower chance of bringing in overlaps. Third, we prioritize edges that have larger depths on the control flow graph. This is to reduce the search space when picking seeds, exploiting the observation that deeper edges are typically reached by fewer seeds.
Despite our greedy algorithm may not perfectly meet $\mathbb{P}_1$ - $\mathbb{P}_3$, it represents the best effort. First, we distribute disjoint sub-sets of overlapped edges to different instances. We further incorporate a set of heuristics to avoid overlaps when we pick seeds. As we will demonstrate in \S~\ref{sec:eval}, this combined effort can indeed effectively reduce overlaps (way more than {\sc P-FUZZ}\xspace). Second, every edge (in $\vec{E}$ or $\neg \vec{E}$) is distributed to at least one instance. This preserves all the fuzzing tasks according to our definition, satisfying $\mathbb{P}_2$. Finally, we evenly distribute the non-overlapped edges in a random manner. This aids each instance to receive approximately equivalent workloads and, therefore, facilities the fulfillment of $\mathbb{P}_3$.
\noindent\textbf{Scheduling task distribution.} Our design needs to periodically re-run the task distribution. However, a low frequency of re-distribution may not timely avoid the accumulated overlaps while a high frequency can lead to a waste of computation cycles since fuzzing may not have produced many overlaps. In our design, we adjust the scheduling of task distribution based on the increase of edge coverage. We start the first round of distribution after the first hour, and we re-run it once the new edge coverage exceeds 10\%.
\iffalse
\subsection{Path-coverage-based Task Distribution}
\label{subsec:pathpartition}
Our first solution is inspired by our motivating study presented in \S~\ref{susec:motivation}. Our insight is to optimize parallel fuzzing by preventing different instances from exploring the same tasks. In the following, we in turn explain our definition of fuzzing tasks and our distribution mechanisms.
\noindent\textbf{Defining fuzzing tasks.} As introduced above, we define a fuzzing task is to {\em run a round of mutations to a unique seed}. The challenge of enforcing the definition is to determine the ``uniqueness'' of a seed. An intuitive idea is to check whether a seed has a unique sequence of bytes. This idea, however, can be ineffective due to its over-sensitivity. More specifically, many seeds with different byte sequences can follow the same path, which are commonly considered ``identical'' for fuzzing~\cite{ptrix}. Following the above byte-sequence-based idea, one will preserve all those seeds and leave over tremendous overlaps.
In our design, we take a less sensitive while way more effective approach. We use the path followed by a seed to decide its uniqueness. But instead of considering the full execution path, we borrow {\sc AFL}\xspace's idea to define the path of a seed --- we consider the sequence of edges between consecutive basic blocks (BBLs), where the orders and hit counts\footnote{\label{note1}A hit count in each of the following ranges is mapped into an identical value: \texttt{[1], [2], [3], [4, 7], [8, 15], [16, 31], [32, 127], [128, $\infty$)}} of edges are taken into account. For the simplicity of presentation, we call paths defined in this way \emph{{\sc AFL}\xspace-paths}.
It is worth noting that the above {\sc AFL}\xspace-path based approach over-approximates how {\sc AFL}\xspace determining seeds' uniqueness. Consider Figure~\ref{fig:aflpaths} as an example. {\tt Seed-1} and {\tt Seed-2} follow different {\sc AFL}\xspace-paths but {\tt Seed-2} covers all the edges of {\tt Seed-1}. By design, {\sc AFL}\xspace thinks a seed is non-unique if all of its edges are covered by other seeds. As such, if {\sc AFL}\xspace first encounters {\tt Seed-2}, it will later deem {\tt Seed-1} to be non-unique. On the contrary, our approach, by checking the {\sc AFL}\xspace-paths, will consider both seeds as unique ones.
\noindent\textbf{Distributing fuzzing tasks.} Following the above definition, we periodically gather all the fuzzing tasks and distribute them to different instances. Technical details are covered below.
In a round of task distribution, we pull all the seeds from each instance and re-run the seeds with dynamic tracing, producing the set of {\sc AFL}\xspace-paths covered by the instance (notated as $A_{i}$ for the $i^{th}$ instance). By calculating the intersections among the {\sc AFL}\xspace-paths from all instances (i.e.,\xspace $\bigcap_{i=1}^{n} A_{i}$ where $n$ is the number of instances), we obtain the set of overlapped {\sc AFL}\xspace-paths (notated as $A$). We then evenly divide $A$ and distribute a unique sub-set to each instance. Furthermore, non-overlapped paths (e.g.,\xspace $A_{i} - A$) are kept unchanged and returned to the original instance (e.g.,\xspace the $i^{th}$ instance). To technically distribute an {\sc AFL}\xspace-path to an instance, we pick a seed that follows the {\sc AFL}\xspace-path, and for the ease of implementation, we always pick the seed from the instance's original queue (see \S~\ref{sec:impl}). Finally, we identify all the seeds that are never picked and prevent them from being mutated.
In a general sense, the above path-coverage-based task distribution can adequately meet $\mathbb{P}_1$ - $\mathbb{P}_3$. First, all overlapped {\sc AFL}\xspace-paths (i.e.,\xspace $A$) are exclusively distributed to different instances. This complies with $\mathbb{P}_1$. Admittedly, an {\sc AFL}\xspace-path that is shared by some but not all instances can still be concurrently assigned to more than one instance. However, such cases are less often based on our observation and they can be properly handled by adopting further local distributions. Second, every {\sc AFL}\xspace-path, regardless of an overlapped one or a unique one, is distributed to at least one instance. This ensures that all {\sc AFL}\xspace-paths are preserved, meeting the requirement of $\mathbb{P}_2$. Finally, while we do not explicitly consider the workload attached to an {\sc AFL}\xspace-path, we resort to evenly and randomly distributing the overlapped {\sc AFL}\xspace-paths to different instances. From a statistic point of view, this can largely ensure each instance receives approximately equivalent workloads. As such, our design should well satisfy $\mathbb{P}_3$.
\noindent\textbf{Scheduling task distribution.} Our design requires to periodically re-run the task distribution. However, a low frequency of re-distribution may not timely avoid the accumulated overlaps while a high frequency can lead to a waste of computation cycles since fuzzing may not produce many overlaps between two distribution rounds. In our design, we adjust the scheduling of task distribution based on the increases of {\sc AFL}\xspace-paths. We start the first round of distribution after the first hour, and we re-run it once the amount of new paths exceeds 10\%.
\fi
\section{Discussion}
\label{sec:discuss}
In this section, we discuss some of the limitations in our work and the potential future directions.
\subsection{Threats to Validity.} The validity of our research faces three threats. First, our research is motivated by the intuition that overlapped mutations can reduce the efficiency of code coverage. Whether such an intuition is correct or not threatens the foundation of our research. To mitigate this threat, as presented in \S~\ref{sec:overview}, we provide empirical evidence to support the fidelity of our intuition through empirical experiments with real-world programs. Second, {\sc AFL-EDGE}\xspace skips seeds during task distribution, which by theory may reduce the fuzzing space. To validate this threat, we perform extensive experiments to show that {\sc AFL-EDGE}\xspace largely preserves the edge coverage of {\sc AFL}\xspace and thus, avoids hurting the fuzzing space (see \S~\ref{subsec:eval:result}). Finally, {\sc AFL-EDGE}\xspace and {\sc AFL}\xspace may detect different bugs and {\sc AFL-EDGE}\xspace may miss the bugs detected by {\sc AFL}\xspace. While we provide no theoretical proofs, our empirical evaluation with both real-world programs and standard benchmarks, as shown in \S~\ref{subsec:eval:bugs}, argues against such a threat.
\subsection{More fine-grained Task Distributions are Needed.} {\sc AFL-EDGE}\xspace considers a round of mutations to a seed as an individual task. This represents a coarse-grained definition of fuzzing tasks, which can still result in over-laps. For example, we cannot avoid overlapped mutations by different instances to different seeds. For further improvements, an example idea is to adopt more fine-grained definitions of tasks (e.g.,\xspace defining fuzzing tasks based on mutations ~\cite{ye2019program}).
\subsection{Workloads Need to be Considered.} {\sc AFL-EDGE}\xspace does not explicitly consider the workloads of different tasks. Instead, it relies on random distribution, expecting to achieve probabilistic equivalent workload assignment. This strategy can be further improved by estimating the workload attached to a seed. For instance, we can do such an estimation based on the size of the seed and the execution complexity of the seed (following the idea of {\sc AFL-CMIN}\xspace~\cite{aflaflcm94:online} and {\sc QSYM}\xspace~\cite{qsyminsu}). We may also customize the estimation based on how the fuzzing tools determine the mutation cycles.
\iffalse
\jun{Talk about some points you want to discuss}
\yuchen{-------------------Edit Starts Here-------------------}
In the designing and development of task distribution fuzzing, we get the following lessons.
\begin{enumerate}[topsep=\parskip]
\item \textbf{Concurrent mode optimizations are not prominently increasing the performance of parallel fuzzing.} One of the keys to improving code coverage in fuzzing is to abandon the redundant input seeds, to restrict fuzzers' randomness and guide fuzzing instances to increase the code coverage and the probability to trigger more crashes. If we do not utilize potentially synchronized seed Candidates' bitmap information efficiently between parallel fuzzing instances, only synchronizing input seeds will cause repeat code coverage for each fuzzer. To reduce the cost and repetitive rate of synchronizing, discard certain input seeds based on bitmaps' information is necessary.
\item \textbf{To improve parallel mode fuzzing's code coverage with filtered synchronizing input seeds.} Not only in industry but research environment, companies or researchers always have sufficient resources and time to fuzzing their products. Running parallel fuzzing with input seeds filtering by utilizing afl-cmin tool is an efficient and scalable way to improve fuzzing work.
\item \textbf{Letting different fuzzing instances to process diverse tasks will make the reinforced approach of parallel fuzzing take effect.} When different fuzzing instances get the synchronized input seeds from other fuzzers under the same sync-directory, they tend to go through similar code paths and coverage caused by the alike guided fuzzing algorithm. This action will occasion different fuzzers to perform narrowly. A general parallel fuzzing work focuses on task distribution and results merging. To optimize single fuzzing tasks in parallel mode, we also divide the fuzzing task into several branches by cases that have similar size(number of basic blocks) and hit count under the same switch and assign each code branch to a single fuzzing instance.
\end{enumerate}
\fi
\section{A General Model of Parallel Fuzzing}
\label{sec:model}
In this section, we propose a model to describe parallel fuzzing. The model is inclusive of the parallel mode in existing fuzzing tools and we envision it is general enough to apply to other solutions of parallel fuzzing.
Formally, a parallel fuzzing system consists of $n$ instances \{$F_1$, $F_2$, ..., $F_n$\}. These instances together work on a set of $m$ tasks \{$T_1$, $T_2$, ..., $T_m$\}, with the $i^{th}$ instance distributed to focus on a subset of tasks \{$T_{i1}$, $T_{i2}$, ..., $T_{im_{i}}$\} ($m_{i}\le m$). Depending on the definition of tasks, \{$T_1$, $T_2$, ..., $T_m$\} can require different amounts of workload to be completed, notated as \{$W_1$, $W_2$, ..., $W_m$\}. To improve the efficiency of parallel fuzzing, the system would desire to meet the following three properties.
\begin{ditemize}
\item ($\mathbb{P}_1$) Different instances should work on disjoint subsets of tasks. This is to avoid overlaps and increase the extent of concurrency. Formally, given any two instances $F_i$ and $F_j$ ($i\ne j$), the fuzzing system needs to ensure:
\vspace{-1.2em}
\begin{equation}
\begin{aligned}
\label{eqn:no-overlap}
\{T_{i1}, T_{i2}, ..., T_{im_{i}}\} \cap \{T_{j1}, T_{j2}, ..., T_{jm_{j}}\} = \emptyset \end{aligned}
\end{equation}
\item ($\mathbb{P}_2$) All the instances together should cover all the tasks. Formally, that means:
\vspace{-1.2em}
\begin{equation}
\begin{aligned}
\label{eqn:coverall}
\bigcup_{i=1}^{n} \{T_{i1}, T_{i2}, ..., T_{im_{i}}\} = \{T_1, T_2, ..., T_m\}
\end{aligned}
\end{equation}
Otherwise, the pursuit of parallel fuzzing can cause the loss of certain tasks and, essentially, miss the code that can be covered by those tasks.
\item ($\mathbb{P}_3$) Different tasks should be assigned with a similar workload. Formally, the fuzzing system should maintain the following relation between any two instances $F_i$ and $F_j$ ($i\ne j$):
\vspace{-1.2em}
\begin{equation}
\begin{aligned}
\label{eqn:workload}
\sum_{n=1}^{m_i} W_{in} \approx \sum_{n=1}^{m_j} W_{jn}
\end{aligned}
\end{equation}
Otherwise, certain instances can receive under-loaded tasks and end with plenty of idle cycles, which in principle also harms concurrency.
\end{ditemize}
While the above model is general, it overlooks the fact that different tasks can bring different benefits, in particular code coverage~\cite{chen2019savior}. To this end, Equation~\ref{eqn:no-overlap} should be amended to allow overlaps of tasks that carry higher returns such that these tasks have a higher chance to be picked and completed. To incorporate this consideration, we find that it is not mandatory to modify our model. Instead, we can replicate high-return tasks and consider their replicas as unique ones. This will achieve similar effects as allowing overlaps of those tasks.
\iffalse
\jun{Give a model of task distribution for concurrent fuzzing}
\yuchen{-------------------Edit Starts Here-------------------}
After deciding the base fuzzers, we design a suitable architecture to choose the qualified cases under the same switch and implement a script to split the code into different branches. As presented in Figure 3, inspired by the seed synchronization mechanism of AFL, we propose a parallel fuzzing framework to enhance the single fuzzing approaches to parallel mode. The main idea is fuzzers run in parallel and synchronize the "interesting" seeds with other fuzzing instances regularly. Our script will collect all the switch information of target binary as well as subordinate cases with source code locations and sizes(number of basic blocks), then the task distribution algorithm we implement will determine several split points based on that information. In addition, our script will also discard specific input seeds ground on a particular code branch hit information for each slave instance. With this guidance, each slave fuzzer will be assigned different code branches to process and only synchronize with the coverage increasing seeds that in the queue, but not in discard\_seeds. This enhanced parallel fuzzing approach has clear performance benefits on improving testing coverage, reporting bugs, and retaining target binary's functionality simultaneously.
\begin{figure}[htp]
\centering
\includegraphics[width=8.7cm]{task-distributed.png}
\caption{Model of Task Distribution}
\label{fig:cfg}
\end{figure}
\setlength{\intextsep}{5pt}
\fi
\section{Implementation}
\label{sec:impl}
We have implemented our solution, called {\sc AFL-EDGE}\xspace, on top of {\sc AFL}\xspace (2.52b) and LLVM with around 100 lines of C code, 400 lines of C++ code, 300 lines of shell scrips, and 200 lines of Python code. All code will be released upon publication.
\subsection{Collecting Edge Coverage.} The task distribution of {\sc AFL-EDGE}\xspace needs code coverage information of existing seeds. To support the need, we implement an LLVM pass to instrument the target program. Following a seed, the instrumented code will sequentially record each edge and output the final list at the end. To avoid collisions, we assign each basic block a unique 64-bit ID and concatenate the IDs of two connected basic blocks to represent the edge between them.
\subsection{Distributing Fuzzing Tasks.} {\sc AFL-EDGE}\xspace requires to distribute seeds across fuzzing instances. To avoid intruding on the normal fuzzing process, we implement the task distributor as a standalone component. It follows the algorithm in \S~\ref{subsec:codepartition} to determine the seeds that are assigned to each instance and saves the seeds in a file. Following the metadata organization of {\sc AFL}\xspace, the seed file is added to the corresponding instance's working directory.
\subsection{Confining Fuzzing Tasks.} Our design requires an instance to only mutate the sub-group of assigned seeds. Technically, we customize {\sc AFL}\xspace to read the list of seeds assigned by the distributor and maintain them in a allow-list. When {\sc AFL}\xspace schedules seeds for mutations, we only pick candidates on the allow-list. Such an implementation avoids introducing extra inconsistency to the fuzzing process. Considering that our distributor iteratively updates the seed list, the customized {\sc AFL}\xspace periodically checks the seed file and updates the allow-list accordingly.
\section{Evaluation}
\label{sec:eval}
In this section, we evaluate {\sc AFL-EDGE}\xspace, centering around three questions.
\begin{ditemize}
\item \emph{($\mathbb{Q}_1$) Can {\sc AFL-EDGE}\xspace reduce the overlaps among fuzzing instances?}
\item \emph{($\mathbb{Q}_2$) Can {\sc AFL-EDGE}\xspace improve the efficiency of code coverage?}
\item \emph{($\mathbb{Q}_3$) Can {\sc AFL-EDGE}\xspace preserve the fuzzing capacity of {\sc AFL}\xspace?}
\end{ditemize}
\subsection{Experimental Setup}
\label{subsec:eval:setup}
\input{tab/config}
\noindent\textbf{Benchmarks.} To answer the above questions, we prepare a group of 9 real-world benchmark programs. Details about the programs are presented in Table~\ref{tab:eval-setup}. All these programs have been intensively tested in both industry~\cite{ossfuzz} and academia~\cite{stephens2016driller,qsyminsu,vuzzer}. In addition, they carry diversities in both functionality and complexity.
\noindent\textbf{Baselines.} We run {\sc AFL}\xspace as the baseline of our evaluation.
To compare {\sc AFL-EDGE}\xspace with the existing solutions, we also run {\sc P-FUZZ}\xspace~\cite{song2019p} and {\sc PAFL}\xspace~\cite{liang2018pafl} on top of {\sc AFL}\xspace
. Because the implementations of {\sc P-FUZZ}\xspace and {\sc PAFL}\xspace are not publicly available, we re-implemented the two solutions following the algorithms presented in their publications~\cite{song2019p,liang2018pafl}.
\noindent\textbf{Configurations.} Specific configurations of the fuzzing process (e.g.,\xspace seeds and program options) are listed in Table~\ref{tab:eval-setup}. To understand the impacts of the number of instances, we run each fuzzing setting respectively with 2, 4, and 8 {\sc AFL}\xspace secondary instances. We do not run a primary instance because it involves deterministic mutations which bring disadvantages to vanilla {\sc AFL}\xspace. For consistency, we conduct all the experiments on Amazon EC2 instances (Intel Xeon E5 Broadwell 96 cores, 186GB RAM, and Ubuntu 18.04 LTS), and we sequentially run all the tests to avoid interference. Each test is run for 24 hours. To minimize the effect of randomness in fuzzing, we repeat each test 5 times and report the average results.
\subsection{Analysis of Results}
\label{subsec:eval:result}
In Table~\ref{tab:afl:stat}, we present the results with {\sc AFL}\xspace at the end of 24 hours. We elaborate on the results as follows, seeking answers to $\mathbb{Q}_1$ - $\mathbb{Q}_3$.
\noindent\textbf{Effectiveness of overlap reduction.} The direct goal of {\sc AFL-EDGE}\xspace is to reduce the overlaps among instances. To measure this goal, we consider the number of seeds that are disabled from each instance as the metric. As shown in Table~\ref{tab:afl:stat} (the column for \textit{overlap reduction rate}), {\sc AFL-EDGE}\xspace can effectively reduce the potential overlaps in the parallel mode of {\sc AFL}\xspace. To be specific, {\sc AFL-EDGE}\xspace can prevent 60.0\%, 60.3\%, and 57.1\% of the seeds from being repeatedly mutated when we respectively run 2, 4, and 8 parallel instances.
\input{tab/afl-stat3}
In comparison to existing solutions, {\sc AFL-EDGE}\xspace reduces more overlaps than {\sc P-FUZZ}\xspace but fewer than {\sc PAFL}\xspace. Such results well comply with the designs of the three tools. {\sc P-FUZZ}\xspace preserves all the seeds produced by {\sc AFL}\xspace while {\sc PAFL}\xspace aggressively skip seeds. In contrast, {\sc AFL-EDGE}\xspace keeps seeds necessary to cover all the edges, pursuing a trade-off between conservativeness and effectiveness. As we will show later, while {\sc AFL-EDGE}\xspace's strategy reduces fewer seeds in comparison to {\sc PAFL}\xspace, it does not necessarily hurt code coverage and it can better preserve the fuzzing capacity (or more precisely, {\sc AFL-EDGE}\xspace can cover more code that {\sc AFL}\xspace covers).
\noindent\textbf{Improvements to code coverage efficiency.} To understand whether the overlap reduction by {\sc AFL-EDGE}\xspace can indeed benefit code coverage, we measure the number of edges covered in the tests. In Table~\ref{tab:afl:stat} (the column of \textit{edge coverage increase}), we present the increase of edge coverage brought by {\sc AFL-EDGE}\xspace to {\sc AFL}\xspace at the end of a 24-hour test.
In summary, {\sc AFL-EDGE}\xspace can consistently improve the efficiency of edge coverage of {\sc AFL}\xspace, regardless of the benchmark and the number of instances. Specifically, {\sc AFL-EDGE}\xspace increases the edge coverage by 10.0\%, 10.2\%, and 9.5\%, respectively with 2, 4, and 8 instances. Another key observation is that the benefits brought by {\sc AFL-EDGE}\xspace often decrease with the number of instances. We believe the reason is that the fuzzers can get closer to saturation when more parallel instances are running. Therefore, the gap between {\sc AFL}\xspace and {\sc AFL-EDGE}\xspace shrinks at the end.
To further verify that the improvements by {\sc AFL-EDGE}\xspace are statistically significant, we perform Mann Whitney U-test~\cite{mcknight2010mann} on the five rounds of runs~\cite{evaluatefuzz}. The p-values of the hypothesis test are presented in Table~\ref{tab:afl:stat} (the column of \textit{p-value}). In nearly all the cases, the p-values are smaller than 0.05, supporting that the improvements brought by {\sc AFL-EDGE}\xspace are significant from a statistical perspective.
Finally, {\sc AFL-EDGE}\xspace presents better overall performance than both {\sc P-FUZZ}\xspace and {\sc PAFL}\xspace. When applied to {\sc AFL}\xspace, {\sc AFL-EDGE}\xspace increases the edge coverage by 9.5\% - 10.2\%, outperforming {\sc P-FUZZ}\xspace and {\sc PAFL}\xspace in most of the cases.
On the one hand, {\sc AFL-EDGE}\xspace reduces more overlaps than {\sc P-FUZZ}\xspace and thus, produces higher code coverage efficiency. On the other hand, {\sc PAFL}\xspace in principle reduces more overlaps than {\sc AFL-EDGE}\xspace, which indeed leads to higher edge coverage than {\sc AFL-EDGE}\xspace in several cases (e.g.,\xspace running {\sc AFL}\xspace on {\sc TIFF2PS} with 4 or 8 instances). However, in many other cases, {\sc PAFL}\xspace can accidentally block valuable seeds and become unable to cover the related edges, eventually resulting in a lower edge coverage. This can be further supported by that {\sc PAFL}\xspace even produces lower edge coverage than {\sc AFL}\xspace in certain cases (e.g.,\xspace running {\sc AFL}\xspace on {\sc READELF} with 4 or 8 instances).
\begin{figure}[t!]
\renewcommand{\arraystretch}{0.5}
\begin{tabular}{cccc}
\includegraphics[width=0.24\linewidth]{fig/objdump_overlap.pdf} &
\includegraphics[width=0.24\linewidth]{fig/readelf_overlap.pdf} &
\includegraphics[width=0.24\linewidth]{fig/libxml_overlap.pdf} & \includegraphics[width=0.24\linewidth]{fig/tiff2pdf_overlap.pdf} \\
\centering{\hspace{0.6cm}(a) \sc objdump} & {\hspace{0.7cm}(b) \sc readelf} &
\centering{\hspace{0.6cm}(c) \sc libxml} & {\hspace{0.7cm}(d) \sc tiff2pdf}
\end{tabular}
\caption{Overlap of code coverage between {\sc AFL-EDGE}\xspace/{\sc P-FUZZ}\xspace and {\sc AFL}\xspace in the 120-hour tests.}
\label{fig:code-cov-overlap-120h}
\end{figure}
\noindent\textbf{Effectiveness of preserving fuzzing capacity.} As discussed in \S~\ref{sec:app}, {\sc AFL-EDGE}\xspace can skip certain seeds produced by {\sc AFL}\xspace. This may alter the fuzzing behaviors and, more concerningly, hurt the fuzzing capacity (i.e.,\xspace missing edges that can be covered by vanilla {\sc AFL}\xspace). To understand the impacts of {\sc AFL-EDGE}\xspace to the fuzzing capacity, we perform another analysis where we examine whether {\sc AFL-EDGE}\xspace and {\sc AFL}\xspace are exploring different edges. Technically, we measure how many of the edges covered by {\sc AFL}\xspace are also covered by {\sc AFL-EDGE}\xspace. We show the results in Table~\ref{tab:afl:stat} (the column of \textit{edge overlap rate}). In summary, {\sc AFL-EDGE}\xspace can prevalently cover more than 95\% of the edges that are covered by {\sc AFL}\xspace. Considering the existence of randomness, we believe such results strongly support that {\sc AFL-EDGE}\xspace largely preserves the behaviors of the vanilla tools and does not significantly affect the fuzzing capacity.
In comparison to existing solutions (see Table~\ref{tab:afl:stat}), {\sc AFL-EDGE}\xspace can preserve as much edge coverage as {\sc P-FUZZ}\xspace. This further proves that {\sc AFL-EDGE}\xspace well maintains the fuzzing space since {\sc P-FUZZ}\xspace does not skip seeds and thus, its results represent the best efforts. Further, {\sc AFL-EDGE}\xspace outperforms {\sc PAFL}\xspace in covering the edges reached by {\sc AFL}\xspace (96.2\% v.s.\xspace 91.8\%). This is because {\sc AFL-EDGE}\xspace keeps seeds to cover all the original code to avoid losing fuzzing capacity while {\sc PAFL}\xspace more aggressively skips seeds.
To validate the above observations in longer-term fuzzing, we extend the tests of {\sc AFL-EDGE}\xspace to 120 hours. We also run this test with {\sc P-FUZZ}\xspace as a comparison. As shown in Fig.~\ref{fig:code-cov-overlap-120h}, {\sc AFL-EDGE}\xspace consistently preserves the edges covered by {\sc AFL}\xspace across the 120 hours, producing results comparable to {\sc P-FUZZ}\xspace. We note that in certain cases, {\sc AFL-EDGE}\xspace even slightly outperforms {\sc P-FUZZ}\xspace. This is mostly because {\sc AFL-EDGE}\xspace has a higher efficiency of edge coverage than {\sc P-FUZZ}\xspace and therefore, reaches more edges that {\sc AFL}\xspace covers.
\input{tab/interval}
\noindent\textbf{Impacts of frequency of task distribution.} Recall that {\sc AFL-EDGE}\xspace needs to periodically distribute tasks (\S~\ref{sec:app}). Our hypothesis is that the frequency of distribution can affect the effectiveness of our solution and we dynamically adjust this frequency based on the growth of edges. To validate our hypothesis and demonstrate the utility of our dynamic approach, we perform another experiment where we run one round of distribution per 1 hour, 2 hours, and 4 hours. In Table~\ref{tab:dis:freq}, we present the results. It shows that the frequency of distribution truly makes a difference and our dynamic adjustment indeed outperforms solutions with a fixed frequency.
\input{tab/CMIN-comparison-results}
\noindent\textbf{Effectiveness of seed distribution.} In our algorithm of task distribution algorithm (Algorithm~\ref{alg:taskdistribute}), the core idea is to pick a subset of seeds that cover the original edges, commonly known as {\em seed distillation}. Past efforts have developed several other seed distillation algorithms, including AFL-CMIN~\cite{aflaflcm94:online} (notated as \emph{Size-Weighted}) and its variants (including ~\cite{Abdelnur2010Spectral}, notated as \emph{Unweighted}; ~\cite{seedoptimize,woo2013black-box}, notated as \emph{Time-Weighted}). Details of the algorithms are as follows.
\begin{itemize}
\item \noindent\textbf{Unweighted Algorithm} This algorithm always picks a seed whose edges overlap with the non-covered edges the most. It repeats until all edges are covered.
\item \noindent\textbf{Time-Weighted} This algorithm iterates each non-covered edge and picks the seed with the shortest execution time to cover the edge, repeating this process until all edges are covered.
\item \noindent\textbf{Size-Weighted (AFL-CMIN)} This algorithm iterates each non-covered edge and picks the seed with the smallest size to cover the edge, repeating this process until all edges are covered.
\end{itemize}
We conduct an experiment to compare our algorithm with the existing algorithms: we run these algorithms on 1,000 random seeds from each of our benchmark programs and count the number of picked seeds. As shown in Table~\ref{tab:seedistill}, our algorithm reduces more seeds than all the existing algorithms in every benchmark program, demonstrating better effectiveness. Note that we skipped some other algorithms (e.g.,\xspace ~\cite{hayes2019moon}) as they cannot ensure all original edges (or hit counts of edges) are preserved.
\subsection{Evaluation of Bug Finding}
\label{subsec:eval:bugs}
In the course of evaluation, the fuzzing tools also trigger many crashes. We triage these crashes with AddressSanitizer~\cite{asan} and then perform a manual analysis to understand the root causes. As shown in Table~\ref{tab:crash-table}, {\sc AFL-EDGE}\xspace triggers 6,792 unique crashes and 14 previously unknown bugs, outperforming both {\sc P-FUZZ}\xspace and {\sc PAFL}\xspace. Moreover, all the bugs detected by {\sc AFL}\xspace and {\sc P-FUZZ}\xspace are also detected by {\sc AFL-EDGE}\xspace.
We also extended the evaluation of bug finding with the LAVA vulnerability benchmark~\cite{dolan2016lava}. However, we omitted the reporting of the results. Basically, our tests with {\sc AFL}\xspace only trigger 1 LAVA bug, regardless of the parallel fuzzing solutions. The major reason is that all LAVA bugs require a four-byte unit in the input to match a random integer value, which is hard to be satisfied by {\sc AFL}\xspace's mutations.
\input{tab/bug}
\section{Introduction}\label{sec:introduction}
Thanks to its direct and easy application to production-grade software without human aids, fuzzing is gaining tremendous popularity for security testing. In today's business sectors, software systems are having shorter testing cycles~\cite{Top10Sof73:online}, and therefore, the efficiency of code coverage becomes a critically desired property of fuzzing.
To escalate code coverage efficiency, there are two orthogonal strategies, one improving algorithms of fuzzing tools and one launching many fuzzing instances in parallel. The research community has intensively investigated the first strategy. Efforts along this line have revolutionized fuzzing from being program-structure-agnostic and black-box~\cite{aitel2002introduction,beizer1995black,myers2011art} to be program-structure-aware and grey-box/white-box~\cite{afltech,serebryany2015libfuzzer,sage,qsyminsu,stephens2016driller}, which significantly improved fuzzing efficiency by overcoming common barriers of code coverage.
However, the second strategy has been less studied and insufficiently developed. Existing fuzzing tools (\emph{e.g.},~\cite{serebryany2015libfuzzer,angora}) primarily follow American Fuzzy Lop (AFL)~\cite{afltech} to implement their parallel mode. Technically speaking, they run multiple identical instances in parallel. Depending on the implementation, different instances may either share the same group of seed inputs (or \emph{seeds})~\cite{angora,serebryany2015libfuzzer} or use separate groups of seed inputs but make periodical exchanges~\cite{afltech}. This type of parallel fuzzing, due to lack of synchronizations, leads different instances to run overlapped tasks, impeding the effectiveness of concurrency.
In this paper, we focus on unveiling the limitations of the parallel mode in existing fuzzing tools and presenting new solutions to overcome those limitations. We start with an empirical study of the parallel mode in {\sc AFL}\xspace. By tracing the exploration of all instances across the fuzzing process, we discover that different instances are indeed running overlapped tasks despite many tasks remain unaccomplished (\S~\ref{subsec:motivation}).
We further demonstrate that this type of task overlapping can lead to reduced efficiency of code coverage.
Motivated and inspired by our empirical study, we propose a general model to describe parallel fuzzing. At the high level, the model enforces three desired properties. First, it distributes mutually-exclusive tasks to different instances, preventing the occurrence of overlaps. Second, it ensures every single task to be covered by at least one instance. This avoids the loss of fuzzing tasks and the code covered by those tasks. Finally, it assigns to each instance tasks with a similar amount of workload. Otherwise, some instances will be overloaded while the other instances are under-loaded, which can eventually degrade concurrency.
Guided by the model above, we develop a solution, called {\sc AFL-EDGE}\xspace, towards facilitating the parallel mode in {\sc AFL}\xspace. Our solution defines \emph{a task} is to \emph{run a round of mutations to a unique seed} and considers the control-flow edges (or \emph{edges}) covered by a seed to determine its uniqueness. During the course of fuzzing, {\sc AFL-EDGE}\xspace periodically distributes seeds that carry non-overlapped and similarly-weighted tasks to different instances, meeting the properties of our model. {\sc AFL-EDGE}\xspace also enforces that all the unique seeds will cover the same set of edges as the original seeds. We envision that, in this way, {\sc AFL-EDGE}\xspace can properly preserve the fuzzing capacity of {\sc AFL}\xspace.
We have implemented {\sc AFL-EDGE}\xspace on top of {\sc AFL}\xspace, and we have evaluated {\sc AFL-EDGE}\xspace with {\sc AFL}\xspace using 9 widely adopted benchmark programs. Our evaluation shows that {\sc AFL-EDGE}\xspace can significantly reduce the overlaps and hence, benefit the code coverage. Depending on the number of instances we launch, we can averagely reduce 57.1\% - 60.3\% of the overlaps and bring a 9.5\% - 10.2\% increase in code coverage with {\sc AFL}\xspace.
Our evaluation also demonstrates that, compared to the state-of-the-art solutions of improving parallel fuzzing~\cite{liang2018pafl,song2019p}, our solution not only brings higher improvement to efficiency of edge coverage but also better preserves the capacity of the fuzzing tools. As a side benefit, {\sc AFL-EDGE}\xspace triggers over 6K unique crashes, corresponding to 14\xspace new bugs.
Our main contributions are as follows.
\vspace{-1em}
\begin{itemize}
\item We present a general model to describe parallel fuzzing.
\item We develop a solution to improve the parallel mode in {\sc AFL}\xspace, following the guidance of our model.
\item We have implemented our solution on top of {\sc AFL}\xspace, which can seamlessly run with other fuzzing tools that also use {\sc AFL}\xspace. Source code of our implementation will be made publicly available upon publication.
\item We evaluated our solution with {\sc AFL}\xspace on 9 widely used benchmark programs. It shows that our solution can effectively reduce the overlaps and increase the code coverage of {\sc AFL}\xspace.
\end{itemize}
\section{Related Works}
\label{sec:related}
\subsection{Improvements to Algorithms of Grey-box Fuzzing.} Past research has brought three categories of algorithmic improvements to grey-box fuzzing. The first category explores new kinds of {\em feedback} to facilitate seed scheduling and mutation. AFL~\cite{afltech}
considers code branches covered in a round of execution as feedback, which is further refined by Steelix~\cite{li2017steelix}, CollAFL~\cite{collafl}, and PTrix~\cite{ptrix} with more fine-grained, control-flow related information. TaintScope~\cite{taintscope}, Vuzzer~\cite{vuzzer}, GREYONE~\cite{GREYONE}, REDQUEEN~\cite{aschermann2019redqueen}, and Angora~\cite{angora} use taint analysis to identify data flows that can affect code coverage.
The second category of research investigates how to use the above types of feedback to improve code coverage. FairFuzz~\cite{lemieux2018fairfuzz}, GREYONE~\cite{GREYONE}, and ProFuzzer~\cite{profuzzer} rely on the feedback to mutate the existing inputs and derive new ones that have a higher probability of reaching new code. AFLFast~\cite{aflfast}, DigFuzz~\cite{zhao2019send}, and MOPT~\cite{lyu2019mopt} consider the feedback as guidance to schedule inputs for mutation and prioritizes those with higher potentials of leading to new code.
The last category aims at improving {\em mutations} to remove common barriers that prevent fuzzers from reaching more code. Majundar et al.\xspace~\cite{majumdar2007hybrid} introduce the idea of hybrid fuzzing, which
runs concolic execution to solve complex conditions that are
difficult for pure fuzzing to satisfy. The idea was followed and improved
by many other works~\cite{pak2012hybrid,stephens2016driller,zhao2019send,qsyminsu}. TFuzz transforms target programs
to bypass complex conditions and forces the execution to reach new code. It then uses a validator to reproduce the inputs that meet the conditions in the original program. Angora~\cite{angora} assumes a black-box function at each condition and uses gradient descent to find satisfying inputs, which is later improved by NEUZZ~\cite{neuzz}.
Differing from the above works, our research aims to improve the efficiency of the parallel mode of fuzzing, an orthogonal strategy to facilitate the efficiency of code coverage.
\subsection{Improvements to Execution Speed of Fuzzing.} Beyond algorithmic improvements, other research aims to improve the efficiency of fuzzing by accelerating the fuzzing execution. PTrix~\cite{ptrix}, Honggfuzz~\cite{honggfuzz}, and kAFL~\cite{kafl} use Intel PT~\cite{intel-pt} to efficiently collect control flow data from the
target program. UnTracer~\cite{nagy2019full}, instead of tracing every round of execution, instruments the target programs such that the tracing only starts when new code is reached. RetroWrite~\cite{dinesh2019retrowrite} proposes static binary rewriting to trace code coverage in binary code without heavy dynamic instrumentation.
\subsection{Improvements to Parallel Fuzzing.} There are two lines of efforts towards better parallel fuzzing in the literature. Xu~et al.\xspace~\cite{xu2017designing} design new primitives to mitigate the contention in the file system and extend the scalability of the \textit{fork} system call. These new primitives speed up the execution of the target programs when many instances are running in parallel. This line of efforts facilitates parallel fuzzing from a system perspective, which is orthogonal to our approach. Following the other line, {\sc P-FUZZ}\xspace~\cite{song2019p}, {\sc PAFL}\xspace~\cite{liang2018pafl} and Ye~et al.\xspace~\cite{ye2019program} propose to distribute fuzzing tasks to different instances to avoid overlaps. We omit the details of {\sc P-FUZZ}\xspace and {\sc PAFL}\xspace since they have been discussed in \S~\ref{sec:app} and evaluated in \S~\ref{sec:eval}. The idea of~\cite{ye2019program} is to assign seeds that cover less-visited branches to different instances and further confine the mutations to focus on those branches. In comparison to {\sc AFL-EDGE}\xspace, such an idea may skip the exploration of certain code regions and hurt the related fuzzing space. Further, this idea is essentially a variant of {\sc PAFL}\xspace, and thus, we do not compare it with {\sc AFL-EDGE}\xspace in our evaluation.
\iffalse
\yuchen{-------------------Edit Starts Here-------------------}
To build up the overall fuzzer performance, several research areas that closely related to coverage-guided fuzzing are improving the test case mutation strategy because these improvements increase the vulnerabilities triggering rate of coverage-increasing test cases and fuzzing system optimizations. We overview several works in each area and refer those research results back to coverage-guided tracing.
\subsection{Coverage-Guided Fuzzing}
As afl-fuzz\cite{zalewski2017american} demonstrated its performance on world-famous applications, coverage-guided fuzzing's popularity is getting a progressively increasing extent. AFL notably prioritizes the input seeds, which have a higher probability of triggering new code paths and finding application vulnerabilities by assessing the code coverage information while executing and monitoring the target binary, to process mutational test cases and to expand the code coverage quickly. In addition, AFLFast\cite{bohme2017coverage} utilizes a Markov chain mode to process the low reach-ability code paths, and according to research, CollAFL\cite{gan2018collafl} also can provide the accurate code coverage information to mitigate the path collisions and prioritize the input seeds for fuzzing instances.
However, every fuzzing has a fundamental limitation that it can not explore new code paths beyond the restricted input seeds(e.g., rare branches). To surmount such limitation, FairFuzz\cite{lemieux2018fairfuzz} detects the rare branches and blocks the input seeds mutations by using program analysis and a novel mutation mask creation algorithm to achieves high branch coverage at a faster rate. Steelix\cite{li2017steelix} utilizes the static analysis and binary instrumentation on target binary to provide coverage information and comparison progress information, then drive the fuzzer directly to improve code coverage and bug detection capability. Angora\cite{chen2018angora} adopts several vital techniques, scalable byte-level taint tracking, gradient descent search, context-sensitive code branch count, and input length exploration to increase code coverage by solving path constraints without the additional symbolic execution. VUzzer\cite{rawat2017vuzzer} develops aware-flow and control-flow features based on mutation techniques by performing static and dynamic program analysis to infer the fundamental properties of the application, whereas the above approaches can only handle certain types of constraints.
On the contrary, since QSYM\cite{yun2018qsym} depends on symbolic execution, it could satisfy all kinds of constraints. On top of a recent study, T-Fuzz\cite{peng2018t}, transforms the target binary itself to increase the coverage of interesting code paths. This enhanced approach is combined with QSYM to improve the efficiency of the fuzzing program.
\subsection{Input Seeds Mutation}
For the type of coverage-guided fuzzers, test cases mutation in the fuzzing loop is important. As we mentioned before, AFL utilizes deterministic checks and random algorithms to mutate the input seeds and generate new test cases for each fuzzing instance. In conclusion, the sources of input seeds and the mutation policies are two key factors to impact the mutation effect, thereby influencing the fuzzing efficiency.
Recent researches have shown that high-quality input seeds that can improve the code coverage and trigger new code paths could generate more "interesting" test cases. Skyfire\cite{wang2017skyfire}, a data-driven seed generation technique, utilizes the analysis of existing test cases to generate well-distributed and highly-structured input seeds for fuzzing target binary. DIFUZE\cite{corina2017difuze} an interface-aware fuzzing tool, leverages the static analysis of valid input seeds to generate practical test cases and fuzz the kernel drivers automatically. IMF\cite{han2017imf} is a model-based approach to kernel fuzzing, and it can analyze kernel API call sequences from standard application executions to deduce an API model, then it will utilize the model to generate test cases in a fuzzing program to find deep kernel bugs.
The other pivotal impact factor of mutation is the mutation policies. Laf-intel\cite{besler2016circumventing} is used to split up comparisons into multiple smaller ones to guide AFL towards the correct value by utilizing split-compares-pass, compare-transform-pass, and split-switches-pass. VUzzer\cite{rawat2017vuzzer} deduces the "interesting" seeds by applying dynamic analysis on target binary for mutating to improve fuzzing coverage. Honggfuzz\cite{swiecki6honggfuzz} develops a similar mutation algorithm to recognize those "interesting" test cases during program execution and shows promising improvements in efficiency.
\subsection{Input Seeds Selection}
According to some recent studies Directed-Greybox\cite{bohme2017directed} fuzzing and AFLFast\cite{bohme2017coverage} fuzzing, which are showed that one of the important optimizations for coverage-based fuzzers is the seed selection policy. With a decent seed selection algorithm, fuzzing instances could improve the fuzzing speed, code path exploration, and crashes triggering.
Original AFL will process the inputs seeds that have a smaller size and execution time, to fuzz more test cases in a limited time range. Based on several pieces of research we did, VUzzer\cite{rawat2017vuzzer} will prioritize the input seeds that can trigger deeper code paths and neglects error-handling blocks and "high-frequency" paths by deprioritizing the test cases that can exercise debugging paths so that rare paths can also be tested. In addition, Honggfuzz\cite{swiecki6honggfuzz} will select the input seeds sequentially, and LibFuzzer\cite{serebryany2015libfuzzer} is linked with the library under test, and prioritizes the test cases that can hit more new basic blocks to maximize the code coverage. On the contrary, AFLfast prioritizes the input seeds that cover "low-frequency" paths by using the Markov chain, so the hard-to-reach paths could be covered thoroughly without machine resource wasting on those coverage-increasing paths.
The input seed selection algorithm could also enhance the fuzzing instance’s performance in some specific respects. For example, SlowFuzz\cite{petsios2017slowfuzz} could generate input seeds that match the theoretical worst-case performance for well-known algorithms and also prioritizes those seeds, which consume more system resources, such as CPU or memory, to generate a vast number of test cases that increase the probability of triggering different algorithmic complexity vulnerabilities in real-world applications. QTEP\cite{wang2017qtep} leverages code inspection techniques by static analysis to detect fault-prone source code, then prioritizes seeds to increase the probability of triggering application vulnerabilities while fuzzing the target binary.
However, fuzzing instance may fail to elect the optimal seeds during the selecting phase, due to the code coverage information is not accurate. Moreover, some fuzzers even utilize the code coverage information to drive fuzzing progress towards repeated code paths. This paper proposes the new selecting technique afl-cmin to address this issue.
\fi
| {'timestamp': '2021-09-20T02:20:50', 'yymm': '2109', 'arxiv_id': '2109.08635', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08635'} | arxiv |
\section{Introduction}
\label{sec:ssnas_imbalanced_intro}
Deep neural networks (DNNs) have demonstrated success in significant tasks, like image recognition~\citep{He_2016_CVPR} and text processing~\citep{devlin-etal-2019-bert}. Their stellar performance can be attributed to the following three pillars: a) well-curated datasets, b) tailored network architectures devised by experienced practitioners, c) specialized hardware, i.e. GPUs and TPUs. The adoption of DNNs by practitioners in different fields relies on a critical question: \\ \emph{Are those pillars still holding ground in real-world tasks?}
The first obstacle is that well-curated datasets (e.g., uniform number of samples over the classes) might be hard or even impossible to obtain in different fields, e.g., medical imaging. Similarly, when downloading images from the web, the amount of images of dogs/cats is much larger than the images of `Vaquita' fish. One mitigation of such imbalanced classes is the development of the Neural Architecture Search (NAS)~\citep{zoph2016neural}, which enabled researchers to build architectures that can then generalize to similar tasks. Obtaining the annotations required for NAS methods is both a laborious and costly process. To that end, self-supervised learning (SSL) has been proposed for extracting representations~\citep{bengio2013representation}. One major drawback of both NAS and SSL is that they require substantial computational resources, making their adoption harder.
In this work, we propose a novel framework that combines NAS with self-supervised learning and handling imbalanced datasets. Our method relies on recent progress with self-supervised learning~\citep{zbontar2021barlow} and self-supervised NAS~\citep{kaplan2020self}. Specifically, the proposed method designs a network architecture using only unlabelled data, which are also (naturally) imbalanced, e.g., like data automatically downloaded from the web. We pay particular attention to the resources required, i.e., every component of the proposed framework is designed to run on a single GPU, e.g., on Google Colab. We evaluate our method using both a long-tailed distribution and naturally imbalanced datasets for medical imaging. In both settings, we notice that the proposed method results in accuracy that is similar to or better than well-established handcrafted DNNs with a fraction of the parameters of those networks, i.e., up to $27\times$ less parameters.
\section{Preliminaries}
\label{sec:background}
\subsection{Neural Architecture Search}
\label{sec:nas}
Neural Architecture Search (NAS) can be roughly separated into three components~\citep{elsken2019neural}: search space, search strategy, and performance estimation strategy. The first component defines the set of architectures to be explored; the second one determines how to explore the search space; the third one designs a way to estimate the performance in each step. The first approaches on NAS used evolutionary algorithms \citep{real2017large, real2019regularized} or reinforcement learning \citep{zoph2016neural} and outperform handcrafted neural architectures. One major drawback was the immense computational resources required for running NAS. The first papers that focus on the reduction of the computational cost construct a supernet that covers all possible operations and train exponentially many sub-networks simultaneously ~\citep{pham2018efficient, liu2018darts}. This approach indeed reduces the computational cost and is improved by the recent works. Specifically, \citep{cai2018proxylessnas} samples architecture paths during the search phase such that only one is trained each step. This allows training architecture of the same depth as the final model which eliminates the depth gap in performance. Similarly, \citep{Xu2020PC-DARTS} samples a small subset of channels and replace the rest with skip-connections. Both methods require less memory and reduce search time by using larger batches. However, it is shown that such approaches are unfair in the choice of operations which leads to deteriorating of sub-network performance \citep{chu2019fairnas, fairdarts} Another approach \citep{Liu_2020_CVPR} is based on growing and trimming candidate architectures which is combined with memory-efficient loss.
In our work, we stick to the first approach. We avoid the depth gap using the same depth final networks and induce fair competition between operations leveraging \citep{fairdarts}.
The seminal work of \emph{DARTS}~\citep{liu2018darts} constructs a differentiable search space using a cell-based approach. The final architecture is constructed by stacking cells. Each cell is a directed acyclic graph (DAG) with $N$ nodes. Each edge represents a candidate operation $o_{ij}$ with input $x_i$ and output $x_j$, where $x_j = \sum_{i < j} o_{ij}(x_i)$. This neural network is referred to a supernet or a parent network. Such a search space would be discrete, hence a softmax relaxation between the candidate operations $\mathcal{O} = \{o_{ij}^1, o_{ij}^2, ..., o_{ij}^M\}$ is used:
\begin{equation*}
\overline{o}_{ij} = \sum_{o \in \mathcal{O}} \frac{\exp\left(\alpha_{o_{ij}}\right)}{\sum_{o^{'} \in \mathcal{O}} \exp\left(\alpha_{o_{ij}^{'}}\right)} o(x),
\label{eq:darts_softmax}
\end{equation*}
where $\alpha_{o_{ij}}$ is operation mixing weights. Then, NAS is reduced to learning these weights. The final discrete architecture is obtained by $o_{ij} = \argmax_{o \in \mathcal{O}} \alpha_{o_{ij}}$.
The following bi-level optimization problem describes the objective:
\begin{equation*}
\min_{\alpha} \ell_{val}\left(\omega^{*}(\alpha), \alpha\right)
\mbox{ s.t. }\omega^{*}(\alpha) = \argmin_\omega \ell_{train}(\omega, \alpha).
\end{equation*}
where $\omega$ denotes normal neural network weights, $\mathcal{L}_{val}$ and $\mathcal{L}_{train}$ are loss functions computed based on batches from validation and train sets correspondingly.
It is hard to solve this task directly. Thus, we approximate $\omega^{*}(\alpha)$ using only a single training step
$
\ell_{val}\left(\omega^{*}(\alpha), \alpha\right) \approx \ell_{val}\left(\omega - \xi \nabla_{\omega} \ell_{train}\left(\omega, \alpha\right), \alpha\right).
$
\paragraph{FairDARTS~\citep{fairdarts}}
DARTS has the significant overhead of maintaining the supernet during training. To mitigate that, during the search phase a shallow network is assumed, which is then duplicated to obtain the full network for evaluation. However, the weights obtained by a shallow neural network are not appropriate for deep models \citep{9010638}. Specifically, skip connections are frequently selected as the operation $o_{ij}$. Additional drawback is lack of weights significantly outperforming others. The recent work of FairDARTS~\citep{fairdarts} mitigates those issues using the following two modifications: (a) it replaces the softmax operation with a sigmoid function to avoid the competition with skip connections as a candidate operation, (b) it encourages sparsity in the architecture weights by using the following zero-one loss: $\ell_{0-1} = - \frac{1}{N} \sum_{i=1}^N (\sigma(\alpha_i) - 0.5)^2$, where $\alpha_i,\quad 1 \leq i \leq N$, are architecture weights. The final loss for the architecture weights is $\ell_{total} = \ell_{val}(\omega^*(\alpha), \alpha) + \omega_{0-1} \ell_{0-1}$, where $\omega_{0-1}$ controls the strength of the zero-one loss.
\subsection{Barlow Twins}
\label{sec:barlow}
Supervised learning has demonstrated success in a number of domains, but requires a massive amount of annotations, while it ignores the enormous amount of unlabelled data that can provide complementary information. The effort to utilize unsupervised learning has been decades old process \citep{radford2015unsupervised, Doersch_2015_ICCV, bengio2013representation}, with the concept of self-supervised learning as a popular method of learning. The idea is to devise one task that the "target label" is known, and use losses developed for supervised learning. For instance, predicting the next word in a sentence enables utilizing the virtually unlimited text on the internet for unsupervised training; this is precisely the method used in the recent successful GPT \citep{radford2019language} and BERT models \citep{devlin-etal-2019-bert}. Similarly, in visual computing a host of tasks has been used for self-supervised learning~\cite{noroozi2016unsupervised, gidaris2018unsupervised, chen2020simple}.
By analogy to other successful self-supervised methods \citep{chen2020simple, chen2020exploring, caron2020unsupervised} Barlow Twins \citep{zbontar2021barlow} creates a pair of images for every original image. The pair is created by applying two randomly sampled transformations (e.g., random crop, horizontal flip, color distortion in pixels, etc). Similar pairs of images are created for every sample in the mini-batch. The model extracts the representations $z^A$ and $z^B$ of the two corresponding distorted versions of the original mini-batch. The idea is then to make the cross-correlation between $z^A$ and $z^B$ close to the identity. Specifically, the objective function is $\ell_{\mathcal{BT}} = \sum_{i} (1 - \mathcal{C}_{ii})^2 + \lambda \sum_i \sum_{j \neq i} \mathcal{C}_{ij}^2,$ where $\lambda$ is a positive coefficient, $\mathcal{C}$ is a cross-correlation matrix of the outputs size computed between two outputs:
\begin{equation*}
\mathcal{C}_{ij} = \frac{\sum_b z_{b,i}^A z_{b,j}^B}{\sqrt{\sum_b \left(z_{b,i}^A\right)^2}\sqrt{\sum_b \left(z_{b,j}^B\right)^2}},
\end{equation*}
where $b$ indexes batch samples and $i, j$ index the vector dimension of the outputs. In other words, the model is encouraged to differentiate the two distinct images in each pair. The advantages of Barlow Twins is that this decorrelation removes redundant information about samples in the output units. Unlike other recent self-supervised methods, Barlow Twins does not require large batches which is important when there are constrained resources (e.g., a single GPU).
\section{Experiments}
\label{sec:ssnas_imbalanced_experiments}
Below, we conduct an empirical validation of the proposed method in both a long-tailed distribution and a naturally imbalanced medical dataset. Furthermore, we validate whether the learned architecture can be used for transfer learning in the crucial domain of medical imaging, where we utilize a recent COVID-19 X-ray dataset. Our empirical evidence confirms that the proposed method can achieve similar performance with well-established networks using a fraction of their parameters.
\paragraph{Training details.} We apply a first-order version of FairDARTS to accelerate search. A supernet has 3 cells with 4 nodes each. The search space is the same as in \citep{liu2018darts, kaplan2020self}.
We use SGD with learning rate $0.025$, momentum $0.9$, and weight decay $3 \times 10^{-4}$ with cosine annealing learning rate scheduler \citep{loshchilov2016sgdr}. A batch size of $32$ is used, while we train the architecture for $100$ epochs. The experiments are performed on NVIDIA Tesla K40c.
In fine-tuning step, the focal loss is applied with $\gamma=2$ and $\alpha_t = 1$. We use light data augmentation: random image cropping and horizontal flipping. The training is run for $600$ epochs or until convergence. The rest parameters are the same.
\subsection{Evaluation on a long-tailed distribution}
We evaluate the proposed method on the long-tailed version of CIFAR-10 dataset \citep{krizhevsky2009learning}. To this end, we reduce the number of samples for each class according to an exponential function $n^{lt}_{c} = \beta^{c + 1} n_{c}, \quad 0 \leq c < |C|,$ where $\beta \in (0, 1)$, $n_{c}$ and $n^{lt}_{c}$ are numbers of samples in each class before and after transformation correspondingly, $C$ is a set of classes. The test set stays unchanged. We define the imbalance factor $\rho$ of a dataset as the number of training samples in the largest class divided by the smallest one. The imbalanced dataset is used for both architecture search and subsequent fine-tuning. No label is used for the architecture search.
In Table \ref{tab:ssnas_experiments_cifar10}, we summarize the results of our experiments and compare them against the previous representative works on long-tailed distributions: ResNet-32 + Focal loss \citep{lin2017focal}, ResNet-32 + Sigmoid (SGM) and Balanced Sigmoid (BSGM) Cross Entropy losses \citep{cui2019class}, LDAM-DRW \citep{cao2019learning}, smDragon and VE2 + smDragon \citep{samuel2021generalized}, SSNAS \citep{kaplan2020self}.
To provide a fair comparison to SSNAS method, we implement it in a common framework with common hyper-parameters. Notably, NAS-based methods require orders of magnitude less parameters. Though, SSNAS result in an increased error for the reduced parameters.
Our method significantly improves the results of other methods achieving it with much fewer parameters.
\begin{table}
\caption{Image classification on CIFAR-10 LT ($\rho = 10$). The number of parameters is reported in millions ($\times 10^6$). }
\centering
\vskip 0.1in
\scalebox{0.935}{
\begin{tabular}{lccc}
\toprule
Method & \# Params & Error ($\downarrow$) \\
\midrule
ResNet-32 + Focal & 21.80 & 13.34 \\
ResNet-32 + SGM & 21.80 & 12.97\\
ResNet-32 + BSGM & 21.80 & 12.51\\
LDAM-DRW & 21.80 & 11.84\\
smDragon & 21.80+ & 12.17\\
VE2 + smDragon & 21.80+ & 11.84\\
\midrule
SSNAS~\citep{kaplan2020self} & 0.83 & 18.84 \\
Our method & \textbf{0.81} & \textbf{10.91} \\
\bottomrule
\end{tabular}
}
\vskip -0.1in
\label{tab:ssnas_experiments_cifar10}
\end{table}
\subsection{Evaluation on naturally imbalanced datasets}
We assess the performance of the method on \emph{ChestMNIST} \citep{chest} which is a naturally imbalanced dataset.
The dataset contains 78,468 images of chest X-ray scans. There are 14 non-exclusive pathologies. The results are presented in Table \ref{tab:ssnas_experiments_chest}. The accuracy of models for comparison (ResNet \citep{He_2016_CVPR}, auto-sklearn \citep{feurer2019auto}, AutoKeras \citep{jin2019auto}, and Google Auto ML) are reported from \citep{medmnist}. The proposed method is able to achieve the best seen before result wherein it keeps a tiny number of parameters. The smaller number of parameters for SSNAS is caused by a lot of skip-connections.
\begin{table}
\caption{Image classification on ChestMNIST. The number of parameters is reported in millions ($\times 10^6$). The resolution of input images are indicated in the parenthesis.}
\vskip 0.1in
\begin{center}
\begin{tabular}{lccc}
\toprule
Method & \# Params & Accuracy ($\uparrow$)\\
\midrule
ResNet-18 (28) & 11.68 & 94.7 \\
ResNet-18 (224) & 11.68 & \textbf{94.8} \\
ResNet-50 (28) & 25.56 & 94.7 \\
ResNet-50 (224) & 25.56 & 94.7 \\
auto-sklearn (28) & - & 64.7 \\
AutoKeras (28) & - & 93.9\\
Google Auto ML (28) & - & 94.7 \\
\midrule
SSNAS (28) & \textbf{0.57} & 94.7 \\
Our method (28) & 0.82 & \textbf{94.8} \\
\bottomrule
\end{tabular}
\end{center}
\vskip -0.1in
\label{tab:ssnas_experiments_chest}
\end{table}
As typically done in NAS, we evaluate the optimized architecture on transfer learning using \emph{COVID-19 X-ray} dataset \citep{OZTURK2020103792}. This dataset consists of chest images and naturally imbalanced with $\rho=4$. This dataset represents several difficulties that arise in real-world settings: (a) there is an imbalance factor $\rho=4$, (b) the images are slightly different since they are collected from different sources, (c) there is noise in some images since there are some overlaid labels which are not related to the task in hand (see Appendix \ref{sec:appendix_a}).
Unfortunately, because such datasets are recent, we have the only model to compare which is DarkCovidNet \citep{OZTURK2020103792}. Table \ref{tab:ssnas_experiments_covid} shows that our architecture is successfully transferred to another task achieving slightly better results DarkCovidNet but with smaller resolution and number of parameters.
\begin{table}
\caption{Image classification on COVID-19 X-ray. The number of parameters is reported in millions ($\times 10^6$). The resolution of input images are indicated in the parenthesis.}
\vskip 0.1in
\begin{center}
\begin{tabular}{lccc}
\toprule
Method & \# Params & Accuracy ($\uparrow$) \\
\midrule
DarkCovidNet (224) & 1.16 & 98.08 \\
\midrule
SSNAS (224) & \textbf{0.57} & \textbf{98.40} \\
SSNAS (28) & \textbf{0.57} & 98.08 \\
Our method (224) & 0.82 & \textbf{98.40} \\
Our method (28) & 0.82 & \textbf{98.40} \\
\bottomrule
\end{tabular}
\end{center}
\vskip -0.1in
\label{tab:ssnas_experiments_covid}
\end{table}
\section{Conclusion}
In this paper, we propose a NAS framework which is well-suited for scenarios with real-world tasks, where the data are naturally imbalanced and do not have label annotations. Our framework designs an architecture based on the provided unlabelled data using self-supervised learning. To evaluate our method, we conduct experiments on a long-tailed version of CIFAR-10 as well as ChestMNIST and COVID-19 X-ray which are medical datasets that are naturally imbalanced. For all the experiments, we show that the proposed approach provides more compact architecture while maintaining an accuracy on par with strong performing baselines. We expect our method to provide a reasonable framework for practitioners from different fields that want to capitalize on the success of deep neural networks but do not necessarily have well-curated datasets. In addition, our method is suitable for researchers on a constrained budget (e.g., using only the publicly-available Google Colab).
\section{Methodology}
\label{sec:method}
We propose a new NAS-based approach for real-world datasets, which might not have available labels or they might be imbalanced. The approach consists of two steps: architecture search and subsequent fine-tuning.
Our method is build on top of FairDARTS. This allows eliminating the shortcomings of DARTS as mentioned in Section \ref{sec:nas}. We also replace the supervised loss with a self-supervised one. As \cite{NEURIPS2020_e025b627} shows, it is also beneficial for learning imbalanced datasets. Namely, the recent Barlow Twins loss which does not require labels. Additionally, we use the supernet with only 3 cells for all steps. This is beneficial for three reasons. Firstly, the training process is efficient and affordable even for slow GPUs, while it produces small but powerful architectures. Secondly, the designed architecture is appropriate for the final model as its depth is unchanged. Thirdly, the learned weights in the first step are fully utilized in the second step (i.e., unlike other NAS methods that the weight values are typically discarded). To fine-tune the designed model, we add on the top another layer which projects the output matrix into the output classes and train it with the focal loss (see Appendix \ref{sec:handle_imbalance}) in a supervised manner. We do not freeze weights of the rest of the network. Furthermore, we apply the logit adjustment (see Appendix \ref{sec:handle_imbalance}) to improve learning of rare classes. The ablation study on imbalance handling techniques is in Appendix \ref{sec:appendix_d}.
Our work shares some similarities with the recent Self-Supervised Neural Architecture Search (SSNAS)~\citep{kaplan2020self}, which we describe next. SSNAS consists of three steps. In the first step, DARTS is used to determine a cell architecture by a shallow neural network. SSNAS assumes the unlabelled data and uses SimCLR \citep{chen2020simple} for determining the architecture. In the next step, SSNAS stacks the constructed cells from the previous step to obtain the architecture, which is sequentially trained with the same self-supervised loss. In the last step, the architecture is fine-tuned using an annotated dataset. Despite the similarities, our method differs from SSNAS in four critical ways: (a) Using DARTS has several drawbacks as aforementioned, while DARTS is not robust to initialization and it requires several runs, (b) SimCLR should be used with large batches, while Barlow Twins exhibits better performance and can be executed with a smaller batch size, (c) we use a smaller supernet which improves training time and produces more efficient architectures, (d) we skip the self-supervised pretraining step without occurring a loss in performance (this step required a $\approx 30\%$ overhead in the training time). Lastly, our method is specifically developed for imbalanced datasets by leveraging the logit adjustment and the focal loss.
\section{Related work}
\section{Acknowledgements}
\label{sec:ssnas_acks}
This project was sponsored by the Department of the Navy, Office of Naval Research(ONR) under a grant number N62909-17-1-2111, by Hasler Foundation Program: Cyber Human Systems (project number 16066). This project has received funding from the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation programme (grant agreement number 725594). The project was also supported by 2019 Google Faculty Research Award.
\section{Handling imbalanced datasets}
\label{sec:handle_imbalance}
\setcounter{figure}{0}
\setcounter{table}{0}
\renewcommand\thefigure{A\arabic{figure}}
\renewcommand\thetable{A\arabic{table}}
\paragraph{Logit adjustment.} In many real-world applications, gathering balanced datasets is difficult or even impossible. For instance, in medical analysis, a small group of the patients has a specific pathology that the majority of the population does not have. In such settings, doing predictions on imbalanced datasets is crucial.
In \citep{menon2020long}, the authors propose the logit adjustment for the loss function to handle imbalance which corrects the output of the model before softmax operation. Specifically, they introduce the logit adjusted softmax cross-entropy loss:
\begin{equation*}
\ell\left(y, f(x)\right) = - \log \frac{e^{f_y(x) + \tau\log\pi_y}}{\sum_{y^{'}\in [L]} e^{f_{y^{'}}(x) + \tau\log\pi_{y^{'}}}},
\end{equation*}
where $L$ is a number of classes, $f_y(x)$ is a logit of the given class, $\pi_y$ is empirical frequencies of classes. Therefore, we induce the label-dependent prior offset which requires a larger margin for rare classes.
\paragraph{Focal loss.} The focal loss~\citep{lin2017focal} is frequently used in imbalanced datasets \citep{sambasivam2021predictive, dong2021recognition}. The idea behind the focal loss is to give a lower weight to easily classified samples.In a binary case, we introduce $p_t = \mathbbm{1}[y = 1]p + \mathbbm{1}[y = -1](1-p)$,where $y \in \{-1, 1\}$ are labels, $p$ is model's estimated probability, and $\mathbbm{1}[\cdot]$ is an indicator function. The cross-entropy loss is then $\mbox{CE}(p_t) = - \log p_t$. To tackle the imbalance problem, the focal loss adds a modulating factor to the weighted cross-entropy $\mbox{FL}(p_t) = -\alpha_t (1-p_t)^\gamma \log p_t,$ where $\alpha_t$ are loss weights which can be inverse class frequencies, $\gamma$ is a tunable parameter. If a sample is misclassified and $p_t$ is small, the loss is unaffected. However, when $p_t \to 1$ then $(1-p_t)^\gamma \to 0$ which gives less weight to this sample.
\section{Ablation study}
\label{sec:appendix_d}
\setcounter{figure}{0}
\setcounter{table}{0}
\renewcommand\thefigure{B\arabic{figure}}
\renewcommand\thetable{B\arabic{table}}
To show effectiveness of components responsible for handling imbalance, we analyse the performance of all combinations of the Focal loss and the logit adjustment as well as their absence. In the latter case, we use simply the cross-entropy loss. The results are summarized in Table \ref{tab:ablation}. The best result is achieved by combination of the focal loss and logit adjustment. Removing the latter slightly deteriorates the performance while abscence of the focal loss is significant.
\begin{table}
\caption{Ablation study on imbalance handling techniques for image classification on CIFAR-10 LT ($\rho = 10$). CE = Cross-Entropy loss, FL = Focal loss.}
\vskip 0.1in
\begin{center}
\begin{tabular}{lcc}
\toprule
Method & Error ($\downarrow$) \\
\midrule
CE & 13.21 \\
CE + Logit adj. & 13.05 \\
FL & 11.78 \\
FL + Logit adj. & 10.91 \\
\bottomrule
\end{tabular}
\end{center}
\vskip -0.1in
\label{tab:ablation}
\end{table}
\section{COVID-19 X-ray dataset}
\label{sec:appendix_a}
\setcounter{figure}{0}
\setcounter{table}{0}
\renewcommand\thefigure{C\arabic{figure}}
\renewcommand\thetable{C\arabic{table}}
In Figure \ref{fig:covid19}, we show four representative samples of the COVID-19 X-ray dataset. All images are collected from different sources, while some images contain unrelated content overlaid on image. Likewise, the light intensity, the resolutions, and the image formats might differ from image to image which makes learning harder.
\begin{figure}[ht]
\vskip 0.2in
\begin{center}
\subfloat{\includegraphics[width=0.24\textwidth]{figures/00001315_006.png}\hspace{2pt}}
\subfloat{\includegraphics[width=0.24\textwidth]{figures/00001576_001.png}} \\
\subfloat{\includegraphics[width=0.24\textwidth]{figures/ciaa199.pdf-001-b.png}\hspace{2pt}}
\subfloat{\includegraphics[width=0.205\textwidth]{figures/figure1-5e71be566aa8714a04de3386-98-left.jpeg}}
\caption{The samples of COVID-19 X-ray dataset. \textit{Top row:} no findings. \textit{Bottom row:} COVID-19.}
\label{fig:covid19}
\end{center}
\vskip -0.2in
\end{figure}
| {'timestamp': '2021-09-21T02:42:55', 'yymm': '2109', 'arxiv_id': '2109.08580', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08580'} | arxiv |
\section{Introduction}
\glsresetall
The radio environment represents the main propagation means that has been deeply analyzed to make wireless communications efficient and reliable. In particular, such a black-box model has been lumped together with advance coding solutions to properly tackle uncontrolled fading issues while still facilitating reasonably-stable channels. Recently, \glspl{ris} appear as the revolutionary and emerging technology bringing the ability of controlling---with passive devices---such propagation environment, via, e.g, backscattering or phase-shifting the incoming electromagnetic waves: this overcomes the traditional adversary perception of the channel thereby turning it into an optimization variable and, in turn, tunable parameter~\cite{DiRenzo2020,Wu2020,Mur20,Cal21,Mur21}.
Manipulating the geometry of the radio propagation has recently drawn vast interest in the scientific community for the design of localization and mapping solutions~\cite{Wymeersch2020,Wymeersch2020VTM,He2020b,Fascista2020}. State-of-the-art \gls{ris}-aided localization employs \glspl{ris} in two alternative ways: \textit{i)} receive mode~\cite{Hu2018}, namely provided with a limited number of RF chains, and \textit{ii)} reflection mode~\cite{Ma2021}. The former techniques aim at localizing a target \gls{ue} fronting the \gls{ris}, e.g., by leveraging on the near-field wavefront curvature~\cite{Guidi2021}. Whereas, the latter category builds upon the reconfigurability of the \glspl{ris} by suitably optimizing the reflection coefficients and allowing a fully passive \gls{ris} design, which is arguably their most attractive operational mode. Indeed, this allows lightening the manufacturing cost and boiling down the overall complexity as well as maximizing deployment flexibility. In this regard, \glspl{ris} can deliver remarkable improvements of one order of magnitude in terms of \gls{peb} with respect to a non-\gls{ris} scenario, given a proper phase design~\cite{elzanaty2020}. Moreover, a \gls{ris} provides better \gls{peb} and \gls{oeb} than a single scatter point~\cite{He2020}.
Existing \gls{ris}-aided reflection mode localization algorithms leverage on direct maximum-likelihood estimate of the
\gls{ue} position, which is known to be computationally expensive~\cite{elzanaty2020}, or fingerprinting solutions based on \gls{rss} measurements at the \gls{ue}-side. Indeed, \glspl{ris} can exacerbate the \gls{rss} differences among different locations, thus improving the localization accuracy~\cite{Zhang2021}. In this regard, the performance of fingerprinting can be enhanced by the aid of \gls{ml} techniques via feature selection, which prunes the large state space of the \gls{ris} and reduces the overall complexity of the position estimation~\cite{nguyen2020}. However, the above-mentioned techniques lack of practical assumptions on the unknown \gls{ue} location. Since proper phase shift configuration of \glspl{ris} operating in reflection mode requires the \gls{ue} position, which is exactly the
quantity to be estimated, a chicken-egg problem raises.
In this paper, we propose a novel two-stage \gls{ris}-aided localization algorithm denoted as PAPIR{}, namely PAssive PosItioning with \gls{ris}, which retrieves the \gls{toa} and the \gls{doa} of reference signals sent by the \gls{ue} to estimate its position. We assume the \gls{ris} to be in reflection mode and we optimize its reflection coefficients based on some (possibly) coarse prior information on the \gls{ue} position. To the best of our knowledge, this is the first work presenting a practical and efficient solution able to localize a \gls{ue} with realistic assumptions on its position. We present a thorough numerical evaluation to assess the performance of the proposed scheme in terms of localization accuracy.
\noindent\textbf{Notation.} We use $\mathbb{C}^{n}$ and $\mathbb{C}^{m\times n}$ to represent the sets of $n$-dimensional complex vectors and $m\times n$ complex matrices, respectively. Vectors are denoted by default as column vectors. We let $(\cdot)^{\vvh{}}$, $(\cdot)^{\vvt{}}$, and $(\cdot)^*$ to denote the Hermitian, transpose, and conjugate operators, respectively. $\norm{\cdot}$ is the $\mathrm{L}2$-norm of a vector, whereas $\vv{I}_N$ and $\otimes$ are the $N$-dimensional identity matrix and the Kronecker product, respectively.
\section{System Model}
We consider the scenario depicted in Fig.~\ref{fig:scenario} where an \gls{ap} equipped with $M$ antennas performs the localization of a target single-antenna \gls{ue} with the aid of a \gls{ris} consisting of $N$ elements. Specifically, the \gls{ue} transmits uplink reference signals to the \gls{ap} who then processes the received signal and estimates the \gls{ue} position. We model the \gls{ap} as a \gls{ula}, while the \gls{ris} is assumed to be a \gls{pla} with $N_x$ and $N_y$ elements along the $x$ and $y$ axis, respectively, with $N=N_xN_y$. The \gls{ap} is located at the origin of our reference system and the \gls{ris} array center has coordinates $\vv{p}_{\scriptscriptstyle{\mathrm{R}}} \in \mathbb{R}^3$, while only a given \gls{pdf} of the position of the \gls{ue} $\vv{p} \in \mathbb{R}^3$ is known and given by $f_{\scriptscriptstyle{\vv{p}}}(\vv{p})$. We assume that there is no direct link between the \gls{ue} and the \gls{ap}, so that communication between the two must be established via the path reflected upon the \gls{ris}. The latter is decomposed into the \gls{los} channel $\vv{h}(\vv{p}) \in \mathbb{C}^{N }$ through which the \gls{ris} reflects the impinging signal towards the \gls{ap} for a given \gls{ue} position $\vv{p}$, and the \gls{ap}-\gls{ris} \gls{los} link denoted by $\vv{G} \in \mathbb{C}^{N \times M}$. We assume that all channels follow a quasi-static flat-fading model and thus remain constant over the transmission time of the reference signals. \change{Moreover, we employ millimeter wave frequencies, which are characterized by sparse multipath even in complex propagation conditions such as dense urban or indoor environments.} Let $\psi_{\scriptscriptstyle{\mathrm{D}}}$ and $\psi_{\scriptscriptstyle{\mathrm{A}}}$ indicate the \gls{aod} from the \gls{ris} and the \gls{aoa} at the \gls{ap}, respectively. Hence, the \gls{los} \gls{ris}-\gls{ap} channel $\vv{G}$ is defined as
\begin{equation}
\vv{G} \triangleq \sqrt{\gamma_{\scriptscriptstyle{\mathrm{G}}}} \, \vv{b}(\psi_{\scriptscriptstyle{\mathrm{D}}}) \vvh{a(\psi_{\scriptscriptstyle{\mathrm{A}}})},
\label{eq:G}
\end{equation}
where $\gamma_{\scriptscriptstyle{\mathrm{G}}} \triangleq d_{\scriptscriptstyle{\mathrm{G}}}^{-\beta}$ is the channel power gain with $d_{\scriptscriptstyle{\mathrm{G}}}$ the distance between the \gls{ris} and the \gls{ap} and $\beta$ the pathloss exponent, $\vv{b}(\psi_{\scriptscriptstyle{\mathrm{D}}}) \in \mathbb{C}^{N }$ is the \gls{pla} response vector at the \gls{ris} for the steering angle $\psi_{\scriptscriptstyle{\mathrm{D}}}$, and $\vv{a}(\psi_A)\in \mathbb{C}^{M }$ is the \gls{ula} response vector at the \gls{ap} for the steering angle $\psi_A$. The former is given by
\begin{align}
\vv{b}(\psi_{\scriptscriptstyle{\mathrm{D}}}) \triangleq \, & \vv{b}_z (\psi_{\scriptscriptstyle{\mathrm{D}},z}, \psi_{\scriptscriptstyle{\mathrm{D}},x}) \otimes \vv{b}_x (\psi_{\scriptscriptstyle{\mathrm{D}},z}, \psi_{\scriptscriptstyle{\mathrm{D}},x}) \label{eq:pla}\\
= \,&[1, e^{j2\pi\delta\sin(\psi_{\scriptscriptstyle{\mathrm{D}},z})\cos(\psi_{\scriptscriptstyle{\mathrm{D}},x})}, \dots, \nonumber\\
&e^{j2\pi\delta(N_y -1)\sin(\psi_{\scriptscriptstyle{\mathrm{D}},z})\cos(\psi_{\scriptscriptstyle{\mathrm{D}},x})}]^\mathrm{T} \nonumber \\
&\otimes[1, e^{j2\pi\delta\sin(\psi_{\scriptscriptstyle{\mathrm{D}},x})\cos(\psi_{\scriptscriptstyle{\mathrm{D}},z})}, \dots, \nonumber \\
&e^{j2\pi\delta(N_x -1)\sin(\psi_{\scriptscriptstyle{\mathrm{D}},x})\cos(\psi_{\scriptscriptstyle{\mathrm{D}},z})}]^\mathrm{T},
\end{align}
where $\psi_{\scriptscriptstyle{\mathrm{D}},z}$ and $\psi_{\scriptscriptstyle{\mathrm{D}},x}$ are the azimuth and elevation \gls{aod}, respectively, and \change{$\delta=0.5$} is the antenna spacing-wavelength ratio. In a similar way, the \gls{ula} response at the \gls{ap} is defined as s
\begin{equation}
\vv{a}(\psi_A) \triangleq [1, e^{j2\pi\delta\cos(\psi_A)}, \dots, e^{j2\pi\delta(M-1)\cos(\psi_A)}]^\mathrm{T}.
\end{equation}
Note that the coordinates of the \gls{ris} position $\vv{p}_{\scriptscriptstyle{\mathrm{R}}} = [p_{\scriptscriptstyle{\mathrm{R}},x},p_{\scriptscriptstyle{\mathrm{R}},y},p_{\scriptscriptstyle{\mathrm{R}},z}]^{\mathrm{T}}$ are expressed as $p_{\scriptscriptstyle{\mathrm{R}},x} = \norm{\vv{p_{\scriptscriptstyle{\mathrm{R}}}}}\cos(\psi_{\scriptscriptstyle{\mathrm{D}},z})\cos(\psi_{\scriptscriptstyle{\mathrm{D}},x})$, $p_{\scriptscriptstyle{\mathrm{R}},y} = \norm{\vv{p_{\scriptscriptstyle{\mathrm{R}}}}}\cos(\psi_{\scriptscriptstyle{\mathrm{D}},z})\sin(\psi_{\scriptscriptstyle{\mathrm{D}},x})$, and $p_{\scriptscriptstyle{\mathrm{R}},z} = \norm{\vv{p_{\scriptscriptstyle{\mathrm{R}}}}}\sin(\psi_{\scriptscriptstyle{\mathrm{D}},z})$, respectively. \change{The \gls{ue}-\gls{ris} channel for a given (unknown) \gls{ue} position $\vv{p}$ reads as}
\begin{equation}\label{eq:h_ue}
\vv{h}(\vv{p}) \triangleq \sqrt{\gamma} \, \vv{b}(\theta),
\end{equation}
where $\gamma \triangleq d^{-\beta}$ is the channel power gain with $d = \norm{\vv{p}_{\scriptscriptstyle{\mathrm{R}}} - \vv{p}}$ the Eucledian distance between the \gls{ue} and the \gls{ris}, and $\vv{b}(\theta)$ is the \gls{pla} response vector of the \gls{ris} for the steering angle $\theta$, i.e., the \gls{aoa} of the \gls{los} \gls{ue}-\gls{ris} path, as in Eq.~\eqref{eq:pla}. Note that both $d$ and $\theta$ are random variables, which are obtained via proper transformation of the \gls{ue} position $\vv{p}$, and are thus characterized by the \gls{pdf} of the \gls{ue} distribution $f_{\scriptscriptstyle{\vv{p}}}(\vv{p})$.
The received uplink signal at the \gls{ap} in time slot $n$ is thus defined as
\begin{equation}\label{eq:y}
\vv{y}(\vv{p},n) \triangleq \sqrt{P}\, \vvh{G} \vv{\Phi}(n)^{\mathrm{H}} \vv{h}(\vv{p}) \, s(n) + \vv{n}(n)\in \mathbb{C}^{M },
\end{equation}
where $P$ is the transmit power at the \gls{ue}, $\vv{\Phi}(n) = \mathrm{diag}[\alpha_1(n) e^{j\phi_1(n)}, \dots, \alpha_N(n) e^{j\phi_N(n)}]$ with $\phi_i(n) \in [0, 2\pi]$ and $|\alpha_i(n)|^2 \leq 1$, $\forall i$ indicates the phase shifts and amplitude attenuation introduced by the \gls{ris} in time slot $n$ (to be optimized), while $s(n)\in \mathbb{C}$ is the (known) transmit signal with $|s(n)|^2=1$, $\forall n$, and $\vv{n}(n)\in \mathbb{C}^{M }$ is the additive white Gaussian noise term distributed as $\mathcal{CN}(0,\sigma^2\vv{I}_M)$, $\forall n$. For the sake of simplicity, we assume that the reflections at the \gls{ris} are ideal, i.e., that the amplitude attenuations $\{\alpha_i(n)\}_{i=1}^N$ and the phase shifts $\{\phi_i(n)\}_{i=1}^N$ can be independently optimized\footnote{\change{In real prototypes, amplitude attenuations and phase shifts are dependent and affect the RIS beamforming performance~\cite{Abeywickrama2020}. However, this issue is out of the scope of this work.}}. Lastly, we define the received sum \gls{snr} at the \gls{ap} antennas in time slot $n$ as
\begin{equation}\label{eq:snr}
\mathrm{SNR}(\vv{p},n) \triangleq P\, \frac{\norm{\vvh{G} \vv{\Phi}(n)^{\mathrm{H}} \vv{h}(\vv{p})}^2}{\sigma^2},
\end{equation}
\change{where $\vv{G}$ is fully defined by knowing the coordinates of the AP and the RIS as per Eq.~\eqref{eq:G}, $\vv{\Phi}$ is set during the RIS optimization phase and $\vv{h}$ is a byproduct of the localization procedure.}
\begin{figure}[t!]
\centering
\vspace{5.3mm}
\includegraphics[clip,width=\linewidth]{scenario.pdf}
\caption{Localization scenario}
\label{fig:scenario}
\end{figure}
\section{RIS-Aided Localization}
Given the model for the channel between the \gls{ue} and the \gls{ris} in Eq.~\eqref{eq:h_ue}, the problem of determining the \gls{ue} location reduces to the estimation of the steering angle $\theta$ and the distance from the \gls{ris} $d$. In this paper, we propose to suitably configure the \gls{ris} to reflect the incoming signal from the \gls{ue} to the \gls{ap}, who then performs \gls{doa} estimation to determine $\theta$, and \gls{toa} estimation to obtain $d$. In this respect, we optimize the \gls{ris} configuration $\vv{\Phi}(n)$ at each time slot $n$ in order to maximize the \gls{snr} at the \gls{ap} antennas in Eq.~\eqref{eq:snr} for any given position of the target \gls{ue} $\vv{p}$. Notably, $\vv{p}$ is exactly the quantity we aim at estimating to perform the localization of the \gls{ue}, thus giving rise to a chicken-egg problem. Therefore, we exploit the prior statistical information about the \gls{ue} position, which is given by $f_{\scriptscriptstyle{\vv{p}}}(\vv{p})$, and design an efficient iterative algorithm, denoted as PAPIR{}, aiming at obtaining a \gls{ris} configuration that is robust against the uncertainty in the \gls{ue} position. Specifically, we adopt the minimum received SNR among the possible \gls{ue} positions as objective function.
\subsection{DoA Estimation}
The task of optimizing the \gls{ris} configuration for any given pdf of the \gls{ue} position $f_{\scriptscriptstyle{\vv{p}}}(\vv{p})$ is particularly challenging. Indeed, $f_{\scriptscriptstyle{\vv{p}}}(\vv{p})$ provides only coarse information on the desired direction of reflection at the \gls{ris}, thus leading to low received SNR and ultimately poor estimation accuracy. To circumvent this problem, we propose to divide the total three-dimensional area of possible \gls{ue} positions $\mathcal{A}^{(n)}$ identified by $f_{\scriptscriptstyle{\vv{p}}}(\vv{p})$ into a set of $N_A$ subareas $\{\mathcal{A}^{(n)}_1,\ldots,\mathcal{A}^{(n)}_{N_A}\}$ of equal size $|\mathcal{A}^{(n)}|/N_A$ with a given degree of overlap $\Delta$ between two adjacent areas such that
\begin{equation}
\mathcal{A}^{(n)}=\bigcup_{\ell=1}^{N_A} \mathcal{A}^{(n)}_{\ell}.
\end{equation}
The \gls{ap} probes each of the subareas by suitably configuring the \gls{ris}, thus producing $N_A$ \gls{doa} estimates $\{\hat{\theta}_1,\ldots,\hat{\theta}_{N_A}\}$.
The \gls{ap} then defines the next probing space $\mathcal{A}^{(n+1)}$ as the area defined by the union of the subareas corresponding to the $N_A-1$ \gls{doa} estimates that maximize the likelihood of the \gls{ue} position, which is defined by the pdf $f_{\scriptscriptstyle{\vv{p}}}(\vv{p})$.\footnote{Without loss of generality, we assume that $N_A\geq 3$.} This procedure is repeated until the difference among the \gls{doa} estimates of two consecutive iterations of PAPIR{} is less than a given threshold $\epsilon$. Note that both $\epsilon$ and $N_A$ regulate a trade-off between accuracy and estimation time and thus need to be properly designed. Let $f_{\scriptscriptstyle{\vv{p}}}^{(n)}(\vv{p})$ be the pdf of \gls{ue} positions corresponding to $\mathcal{A}^{(n)}_{\ell}$, with $\ell = n\;\mathrm{mod}\; N_A$. Hence, at each time slot $n$, the \gls{ris} is configured to maximize the minimum SNR among the possible \gls{ue} positions in the area identified by $f_{\scriptscriptstyle{\vv{p}}}^{(n)}(\vv{p})$, which decreases in size between consecutive probing spaces. This allows us to perform increasingly more selective beamforming, which will give rise to a very sharp increase in SNR when the \gls{ris} is pointing in the direction of the \gls{ue}, compared to when it is pointing in the incorrect direction.
Let us focus on a specific time slot $n$: here, to ease the notation we drop the time index $n$ and we define $\vv{v} \triangleq [\alpha_1 e^{-j\phi_1}, \dots, \alpha_N e^{-j\phi_N}]^{\mathrm{T}}$, with $\vv{\Phi} = \mathrm{diag}(\vv{v}^{\mathrm{H}})$, and the equivalent uplink channel $\vv{H}(\vv{p}) \triangleq \mathrm{diag}(\vvh{h(p)})\vv{G}$ such that we can reformulate the \gls{snr} in Eq.~\eqref{eq:snr} as
\begin{equation}
\mathrm{SNR}(\vv{p}) = P\, \frac{\norm{\vv{v}^{\mathrm{H}} \vv{H}(\vv{p}) }^2}{\sigma^2}.
\end{equation}
Hence, we formulate the following optimization problem
\begin{problem}[Statistical \gls{ris} beamforming]\label{problem:max_snr}
\begin{align}
\displaystyle \max_{\vv{v}} & \displaystyle \min_{\vv{p} \sim f_{\scriptscriptstyle{\vv{p}}}(\vv{p})} P \ \frac{\norm{\vv{v}^{\mathrm{H}} \vv{H}(\vv{p}) }^2}{\sigma^2} \\
\displaystyle \textup{s.t.} & \ \ \displaystyle |v_i|^2 \leq 1 \quad \forall i, \label{eq:phi_con}
\end{align}
\end{problem}
whose solution provides the \gls{ris} configuration maximizing the minimum receive SNR over the possible \gls{ue} positions $\vv{p}$, which are determined by $f_{\scriptscriptstyle{\vv{p}}}(\vv{p})$. However, note that Problem~\ref{problem:max_snr} is highly complex to tackle due to the non-convex maximization of a quadratic function in $\vv{v}$ and the general expression of the \gls{ue} distribution $f_{\scriptscriptstyle{\vv{p}}}(\vv{p})$. In this regard, we propose to employ Monte Carlo sampling and \gls{sdr} in order to find a simple yet effective solution to the above problem.
Let us draw $T$ sample points $\{\vv{p}_t\}_{t=1}^T$ from $f_{\scriptscriptstyle{\vv{p}}}(\vv{p})$ and let $\vv{V}\triangleq \vv{v}\vvh{v}$, and $\overline{\vv{H}}(\vv{p})\triangleq\vv{H}(\vv{p})\vvh{H(p)}$, such that Problem~\ref{problem:max_snr} is reformulated as
\begin{problem}[Statistical \gls{ris} beamforming with SDR]\label{problem:max_snr_SDR}
\begin{align}
\max_{\vv{V}\succeq\vv{0}} & \min_{\{\vv{p}_t\}_{t=1}^T} \mathrm{tr}(\vv{\overline{H}}(\vv{p}_t)\vv{V}) \\
\textup{s.t.} & \ \ \mathrm{diag}(\vv{V}) \leq 1 \\
& \ \ \mathrm{rank}(\vv{V})=1\label{eq:rank_constraint},
\end{align}
\end{problem}
where we omit the scaling factor $P/\sigma^2_n$ as it is irrelevant for the optimization. Problem~\ref{problem:max_snr_SDR} can be solved in its relaxed form, i.e., when ignoring the non-convex rank constraint in Eq.~\eqref{eq:rank_constraint}, by employing canonical semidefinite programming such as CVX. Let $\vv{V}^{\star}$ denote the optimal solution of the relaxed version of Problem~\ref{problem:max_snr_SDR}, then we can recover a suboptimal solution to Problem~\ref{problem:max_snr}, namely $\vv{v}^{\star}$, by Gaussian randomization.
Given the \gls{ris} configuration, i.e., $\vv{\Phi}=\mathrm{diag}(\vvh{(v^{\star})})$, the \gls{doa} of the \gls{ue} $\theta$ is estimated via a suitable MUSIC-based processing at the \gls{ap} which is detailed as follows. However, the MUSIC procedure cannot be directly applied to the received signal $\vv{y}$ in Eq.~\eqref{eq:y} since it would estimate the \gls{doa} of the equivalent uplink channel $\vvh{G}\vvh{\Phi}\vv{h}$, which includes the target \gls{doa} $\theta$ plus the effect of the phase shift applied at the \gls{ris} and the channel path towards the \gls{ap} $\vv{G}$. Moreover, the receive signal $\vv{y}$ is a vector of dimension $M$ whereas the estimation target $\vv{h}(\vv{p})$ is a vector of dimension $N$.\footnote{Note that we assume $M<N$, i.e., that the number of \gls{ap} antennas is less than the number of \gls{ris} elements.} To this end, we firstly equalize the received signal $\vv{y}$ by employing \gls{mmse} filtering as
\begin{align}
\vv{x}(\vv{p}) & = \frac{1}{\sqrt{P}}\ \vv{W} \vv{y}(\vv{p})s^* \label{eq:x}\\
& = \vv{W}\vvh{G}\vvh{\Phi}\vv{h}(\vv{p}) + \overline{\vv{n}} \in \mathbb{C}^{N }
\end{align}
where we set
\begin{align}\label{eq:W}
\vv{W} \triangleq \left(\vv{\Phi}\vv{G}\vvh{G}\vvh{\Phi}+\frac{\sigma_n^2}{P}\vv{I}_N\right)^{-1}\vv{\Phi}\vv{G} \in \mathbb{C}^{N\times M},
\end{align}
with the equivalent noise term $\overline{\vv{n}} \triangleq \frac{1}{\sqrt{P}} \ \vv{W}\vv{n} s^*$. Note that such filtering procedure results in projecting the receive signal onto the subspace spanned by the \gls{ue} channel $\vv{h}(\vv{p})$. Moreover, it does not alter the rank of said subspace, which remains equal to $1$. Hence, the filtered signal $\vv{x}(\vv{p})$ can be fed to the MUSIC procedure, which estimates the direction of arrival $\hat{\theta}$ by exploiting the orthogonality between the subspace corresponding to $\vv{h}(\vv{p})$ and the noise subspace.
\subsection{ToA Estimation}
The \gls{toa} is calculated
by exploiting the ideal autocorrelation property of the transmit sequences. To this end, we set the sequence $\{s(n)\}_{n}$ to a Constant-Amplitude Zero-Autocorrelation (CAZAC) sequence such as the Zadoff-Chu
(ZC). Without loss of generality, we assume that the total transmission time $L$ is an odd number such that we set
\begin{align}
s(n) = e^{-j\pi \frac{n(n+1)}{L}}, \quad n=1,\ldots,L.
\end{align}
Hence, we have that the autocorrelation of the transmit signal at lag $m$ is given by
\begin{align}
R_{ss}(m)& \triangleq \sum_{n=1}^Ls(n)s^*(n+m) = D(m)
\end{align}
where $D(m)$ is the Dirac delta function. The \gls{toa} of the transmit sequence is thus estimated as $\tau = m^{\star} / \Delta f$, where $m^{\star}$ is the lag corresponding to the peak in the cross-correlation matrix of the received signal with the transmit sequence $\vv{R}_{\vv{y}s}$ and $\Delta f$ is the sampling frequency.\footnote{In general, the estimation precision of the \gls{toa} can be improved by upsampling both the received signal and the transmit sequence before computing the cross-correlation matrix between the two.} Note that since the reflection upon the \gls{ris} is instantaneous and does not increase the total \gls{toa}, the distance from the \gls{ue} to the \gls{ris} $d$ is estimated as $\hat{d} = \tau c - d_{\scriptscriptstyle{\mathrm{G}}}$, where $c$ is the speed of light. Finally, the proposed PAPIR{} procedure is formalized in Algorithm~\ref{alg:A1}. \change{Its complexity is dictated by the solution of the relaxed version of Problem~\ref{problem:max_snr_SDR}, i.e., standard semidefinite programming, whose convergence is guaranteed thanks to the convex nature of the problem at hand. Overall, the proposed method is observed to converge in less than $10$ iterations each one having a complexity of $\mathcal{O}(\sqrt{N}(N^6+N^3))$.}
\begin{algorithm}[t!]
\caption{PAPIR: Passive Positioning with \gls{ris}}\label{alg:A1}
\begin{algorithmic}[1]
\State Data: $f_{\scriptscriptstyle{\vv{p}}}(\vv{p})$, $\mathcal{A}$, $N_A$, $\Delta$, $\Delta f$, $d_{\scriptscriptstyle{\mathrm{G}}}$, $\epsilon$ and $T$
\State Set $\mathcal{A}^{(1)} = \mathcal{A}$, $\epsilon>0$, and $n=\ell=1$
\State Initialize $\hat{\theta}^{(0)} \neq \hat{\theta}^{(1)}$
\State Divide $\mathcal{A}^{(1)}$ into $N_A$ equal subareas $\{\mathcal{A}^{(1)}_1,\ldots,\mathcal{A}^{(1)}_{N_A}\}$ with $\Delta$ overlap
\While { $|\hat{\theta}^{(n-1)}-\hat{\theta}^{(n)}|>\epsilon$ }
\For {$\ell=1,\ldots,N_A$}
\State Calculate $f_{\scriptscriptstyle{\vv{p}}}^{(n)}(\vv{p})$ over the subarea $\mathcal{A}^{(n)}_{\ell}$
\State Draw $T$ points $\{\vv{p}_t\}_{t=1}^T$ according to $f_{\scriptscriptstyle{\vv{p}}}^{(n)}(\vv{p})$
\State Obtain $\vv{V}^{\star}$ by solving the relaxed version of Problem~\ref{problem:max_snr_SDR}
\State Obtain $\vv{v}^{\star}$ from $\vv{V}^{\star}$ via Gaussian randomization
\State Set $\vv{\Phi} = \mathrm{diag}((\vv{v}^{\star})^{\mathrm{H}})$ and collect $\vv{y}$
\State Set $\vv{W}$ as in Eq.~\eqref{eq:W} and $\vv{x}$ as in Eq.~\eqref{eq:x}
\State Estimate $\hat{\theta}_{\ell}$ via MUSIC on the signal $\vv{x}$
\EndFor
\State Define $\mathcal{A}^{(n+1)}$ as the union of the subareas corresponding to the $N_A -1$ $\{\hat{\theta}_{\ell}\}_{\ell=1}^{N_A}$ that maximize the likelihood
\State Set $\hat{\theta}^{(n+1)}$ as the one that maximizes the likelihood among the avaialable $\{\hat{\theta}_{\ell}\}_{\ell=1}^{N_A}$
\State Divide $\mathcal{A}^{(n+1)}$ into $N_A$ equal subareas $\{\mathcal{A}^{(n+1)}_1,\ldots,\mathcal{A}^{(n+1)}_{N_A}\}$ with $\Delta$ overlap
\State $n \gets n+1$
\EndWhile
\State Calculate $\vv{R}_{\vv{y}s}$
\State Set $m^{\star}$ as the lag corresponding to the peak in $\vv{R}_{\vv{y}s}$
\State Set $\tau = m^{\star}/\Delta f$
\State Fix $\hat{\theta}=\hat{\theta}^{(n)}$ and $\hat{d} = \tau c - d_{\scriptscriptstyle{\mathrm{G}}}$
\end{algorithmic}
\end{algorithm}
\section{Numerical Results}
In this section, we test the localization performance of PAPIR{} in a realistic scenario, in which we assume the \gls{ris} to be a squared structure with $N_x = N_y$ elements. \change{For ease of presentation, we consider the \gls{ap}, the \gls{ris} and the \gls{ue} to be on the horizontal plane $z = 0$.} The simulation parameters are listed in Table~\ref{tab:parameters}, unless otherwise stated.
\begin{table}[h!]
\caption{Simulation settings}
\label{tab:parameters}
\centering
\resizebox{\linewidth}{!}{%
\begin{tabular}{cc|cc|cc}
\textbf{Parameter} & \textbf{Value} & \textbf{Parameter} & \textbf{Value} & \textbf{Parameter} & \textbf{Value}\\
\hline
\rowcolor[HTML]{EFEFEF}
$M$ & 4 & $N_x$, $N_y$ & 4 & $d_{\scriptscriptstyle{\mathrm{G}}}$ & 50 m\\
$\psi_{D,x}$ & 225\textdegree & $\psi_{D,z}$ & 0 & $\psi_A$ & 45\textdegree \\
\rowcolor[HTML]{EFEFEF}
$P$ & 20 dBm & $\sigma$ & -80 dBm & $\beta$ & 2\\
$\epsilon$ & $0.5^{\circ}$ & $N_A$ & 3 & $\delta$ & 0.5 \\
\rowcolor[HTML]{EFEFEF}
$\Delta f$ & 30.72 MHz & $T$ & 10$^3$ & $\Delta$ & 0.2\\
\end{tabular}%
}
\end{table}
\begin{figure}[t!]
\centering
\includegraphics[clip,width=\linewidth]{algorithm_over_time.pdf}
\caption{One instance of PAPIR{} \gls{doa} estimation.}
\label{fig:time_evolution}
\end{figure}
Fig.~\ref{fig:time_evolution} shows three iterations of an instance of PAPIR{} \gls{doa} estimation. In this example, the \gls{ue} is at coordinates $\vv{p}$ = $[d \cos(\theta), d \sin(\theta), 0]^\mathrm{T}$, where $\theta \equiv \theta_x$ and $\theta_z = 0$, with $\theta_x = 300^\circ$ and $d = 70$ m. As expected, the narrower the probe areas the sharper the peaks in the respective MUSIC pseudospectrum. In particular, the last iteration returns an estimate $\hat{\theta}$ with a corresponding absolute \gls{doa} error of less than one tenth of a degree. It is worth pointing out that the pseudospectrum peak is not necessarily associated to a high estimation accuracy due to its dependency on the beamforming optimization at the \gls{ris}, whose antenna diagrams are respectively depicted in Fig.~\ref{fig:polarplot}. Not surprisingly, the beamformers become iteratively more selective, although their overall shape is not regular, especially in the first iterations. This further motivates the choice of leveraging the prior statistical information on the \gls{ue} position rather than the amplitude of the MUSIC pseudospectrum peaks, which may be affected by beamforming artifacts.
Moreover, we investigate the PAPIR{} overall localization accuracy in terms of \gls{rmse}. To this aim, we assume that the \gls{ue} position is uniformly distributed as $f_{\scriptscriptstyle{\vv{p}}} (\vv{p}) = \mathcal{U}[260^\circ,320^\circ]\times\mathcal{U}[20 \, \mathrm{m},80\, \mathrm{m}]$ and sample such distribution by drawing $T$ points. Note that we average our simulation results over $10^3$ Monte Carlo runs. In Fig.~\ref{fig:error_montecarlo}, we depict the \gls{rmse} performance against different numbers of \gls{ris} elements $N \in \{16,32,64\}$ over the iterations of the PAPIR{} algorithm. Although the \gls{rmse} decreases with the number of iterations for any $N$, the relative gain obtained by increasing $N$ appears to have a diminishing trend, which suggests the existence of a sweet spot in the \gls{ris} configuration for this particular localization problem.
\section{Conclusions}
In this paper we presented PAPIR{}, a practical localization system leveraging on \glspl{ris},
which estimates \gls{ue} positions by performing statistical beamforming, \gls{doa} and \gls{toa} estimation on a given three-dimensional search space.
To the best of our knowledge, PAPIR{} is the first two-stage localization solution employing a fully-passive single-\gls{ris} in reflection mode. PAPIR{} takes advantage of prior statistical information on the \gls{ue} position to optimize the \gls{ris} reflection coefficients as to probe a given search space, which is iteratively updated on the basis of the likelihood of the \gls{ue} position.
\section{Acknowledgements}
This work has been supported by EU H2020 RISE-6G project (grant number 101017011).
\bibliographystyle{IEEEtran}
| {'timestamp': '2021-09-20T02:17:14', 'yymm': '2109', 'arxiv_id': '2109.08532', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08532'} | arxiv |
\section{Appendix}
\subsection{Minimum Description Length}
\label{sec:mdl}
Minimum Description Length (MDL) measures the description length of labels given a set of representations. MDL captures the amount of effort required to achieve a certain probing accuracy, characterizing either complexity of probing model, or amount of data required.
Estimating MDL involves a dataset $\{(x_1, y_1), \ldots, (x_n, y_n)\}$, where $x_i$'s are data representations from a model and $y_i$'s are task labels. Now, a sender Alice wants to transmit labels $\{y_1, \ldots, y_n\}$ to a receiver Bob, when both of them have access to the data representations $x_i$'s. In order to transmit the labels efficiently, Alice needs to encode $y_i$'s in an optimal manner using a probabilistic model $p(y|x)$. The minimum codelength (\textit{Shannon-Huffman code}), required to transmit the labels losslessly is: $\mathcal{L}_p(y_{1:n}| x_{1:n}) = - \sum\limits_{i=1}^{n} \log_2 p(y_i | x_i)$.
There are two ways of evaluating MDL for transmitting the labels $y_{1:n}$ (a) \textit{variational code} - transmit $p(y|x)$ explicitly and then use it to encode the labels (b) \textit{online code} - encodes the model and labels without explicitly transmitting the model. In our experiments, we evaluate the online code for estimating MDL. In the online setting, the labels are transmitted in blocks in $n$ timesteps $\{t_0, \ldots, t_n\}$.
Alice encodes the first block of labels $y_{1:t_1}$ using a uniform code. Bob learns a model $p_{\theta_1}(y|x)$ using the data $\{(x_i, y_i)\}^{t_1}_{i=1}$, Alice then transmits the next block of labels $y_{t_1 + 1:t_2}$ using $p_{\theta_1}(y|x)$. In the next iteration, the receiver trains a new model using a larger chunk of data $\{(x_i, y_i)\}^{t_2}_{i=1}$, which encodes $y_{t_2 + 1:t_3}$. This continues till the whole set of labels $y_{1:n}$ is transmitted. The total codelength required for transmission using this setting is given as:
\begin{equation}
\begin{aligned}
\mathcal{L}_{online}(y_{1:n}|x_{1:n}) = t_1 \log_2 C - \\
&\hspace{-4.5cm}\sum^{n-1}_{i=1} \log_2 p_{\theta_i} (y_{t_i+1:t_{i+1}} |x_{t_i+1:t_{i+1}} )
\end{aligned}
\label{eqn:mdl}
\end{equation}
\noindent where $y_i \in \{1, 2, \ldots, C\}$. The online codelength $\mathcal{L}_{online}(y_{1:n}|x_{1:n})$ is shorter if the probing model is able to perform well using fewer training instances, therefore capturing the effort needed to achieve a prediction performance.
\begin{comment}
\section{Theoretical Analysis}
\textbf{Proposition}: \textit{Minimizing the entropy and} $\delta$\textit{-loss components of $\mathcal{L}_s$ is equivalent to increasing the bias discriminator loss $\mathcal{L}_d$.}
\noindent\underline{Proof}:
The bias discriminator loss can be written as :
\begin{equation}
\mathcal{L}_d(o_i, z_i) = - \log \frac{e^{o_i^k}}{Z_1}
\label{eqn:bias_ce}
\end{equation}
\noindent where $o_i^k$ is the raw logit assigned to the true output class $z_i = k$ and $Z_1$ is a positive constant. Using $o_i^k = \log Z_1 - \mathcal{L}_d$ from Equation \ref{eqn:bias_ce}, $\delta$-loss can be written as:
\begin{equation}
\begin{aligned}
\delta(o_i) &= m_i^T \mathrm{softmax}_{gumble}(o_i)
\\ &= \frac{e^{o_i^k/\tau}}{Z_2 + e^{o_i^k/\tau}}
\\ &= \frac{1}{1 + Z_3 e^{\frac{\mathcal{L}_d}{\tau}}}
\end{aligned}
\label{eqn:delta-2}
\end{equation}
\noindent where $ Z_3 = Z_2 e^{-\frac{\log Z_1}{\tau}} > 0$ and $Z_2$ is a positive constant.
Taking derivative w.r.t $\mathcal{L}_d$ we get,
\begin{equation}
\frac{\partial \delta}{\partial \mathcal{L}_d} = \frac{-Z_3 e^\frac{\mathcal{L}_d}{\tau}} {\tau \bigg(1 + Z_3 e ^ \frac{\mathcal{L}_d}{\tau} \bigg) ^ 2}
\label{eqn:diff}
\end{equation}
From Equation \ref{eqn:diff}, we have $ \frac{\partial \delta}{\partial \mathcal{L}_d} < 0$ which shows
that $\delta$ is a monotonically decreasing function of $\mathcal{L}_d$. Therefore, minimizing $\delta$-loss increases bias discriminator loss $\mathcal{L}_d$.
Next, we show the same holds true for entropy loss. Let us write down Bias discriminator cross entropy ($\mathcal{L}_d$) as:
\begin{equation}
\begin{aligned}
\mathcal{L}_d(o_i, v_i) &= H(o_i, v_i) \\
&= D_{KL}(o_i, v_i) + H(o_i)
\end{aligned}
\end{equation}
\noindent where $v_i$ is the target distribution, a one-hot vector $\{v_i \in \mathbb{R}^{K}, v_i^k = 1 \lvert z_i = k\}$. We try to maximize the entropy of output distribution $o_i$. As $H(o_i)$ increases, $D_{KL}(o_i, v_i)$ value also increases since $v_i$ is a one-hot vector. Therefore, $\mathcal{L}_d$ increases as we minimize the Scrubber loss component $-H(o_i)$.
\end{comment}
\subsection{Theoretical Analysis}
\label{sec:prop1}
\textbf{Proposition}. \textit{Minimizing $\delta$-loss is equivalent to increasing the Bias discriminator loss $\mathcal{L}_d$.}
\noindent \underline{Proof}: The $\delta$-loss function can be written as:
\begin{equation}
\begin{aligned}
\delta(o_i) &= m_i^T \mathrm{softmax}_{gumble}(o_i)
\\ &= \frac{\exp{(\frac{\log o_i^k + g_k}{\tau})}}{\sum\limits_{j} \exp{(\frac{\log o_i^j + g_j}{\tau})}}
\end{aligned}
\label{eqn:delta-2}
\end{equation}
\noindent where $o_i^j$ is the raw logit assigned to the $j^{th}$ output class, the true output class is $k = z_i$ and $g_j, g_k$ are i.i.d samples from Gumble(0,1) distribution. The cross entropy loss of the bias discriminator $\mathcal{L}_d$ can be written as:
\begin{equation}
\begin{aligned}
\mathcal{L}_d = -\log \frac{\exp(o_i^k)}{\sum\limits_j \exp(o_i^j)}
\end{aligned}
\label{eqn:Ld}
\end{equation}
The gumble softmax generates a peaked version of the normal softmax distribution. But the individual gumble softmax logit values (Equation~\ref{eqn:delta-2}) are still proportional to vanilla softmax logits (Equation~\ref{eqn:Ld}): $\delta(o_i) \propto \frac{\exp{o_i^k}}{\sum_j \exp{o_i^j}}$. Then, bias discriminator loss $\mathcal{L}_d$ can be written as:
\begin{equation}
\mathcal{L}_d \propto -\log \delta(o_i)
\label{eqn:propto}
\end{equation}
Therefore, minimizing $\delta(o_i)$ increases $\mathcal{L}_d$.
\begin{table}[t!]
\centering
\resizebox{0.33\textwidth}{!}{
\input{tables/runtime}
}
\caption{Runtime for each dataset.}
\label{tab:runtime}
\end{table}
\begin{table*}[t!]
\centering
\resizebox{0.8\textwidth}{!}{
\input{tables/mdl-norm}
}
\caption{Probing performance of representations retrieved from different settings in terms of $\overrightarrow{\mathrm{MDL}}$.}
\label{tab:mdl-norm}
\end{table*}
\subsection{Implementation Details}
\label{sec:impl-details}
All experiments are conducted in PyTorch framework using Nvidia GeForce RTX2080 GPU with 12GB memory. We use an off-the-shelf MLPClassifer from \textit{sklearn}\footnote{https://scikit-learn.org/} as our \textit{probing network} $q$. \textsc{AdS} has a total of 110M parameters (all 4 modules combined). The average runtime per epoch for each dataset is reported in Table~\ref{tab:runtime}.
\subsection{Measuring Fairness in Representations}
MDL scales linearly with the dataset size (Equation~\ref{eqn:mdl}), therefore making it hard to compare across different datasets. In order to make it comparable, we measure a normalized description length measure for transmitting 1000 labels:
\begin{equation}
\overrightarrow{\mathrm{MDL}} = \frac{1000 \times \mathrm{MDL}}{\lvert\mathcal{D}\rvert}
\end{equation}
\noindent $\lvert\mathcal{D}\rvert$ is the dataset size.
Performance using this measure are reported in Table~\ref{tab:mdl-norm} for all datasets. In all experiments we report the MDL required for transmitting the labels in the training set.
\section{Introduction}
Automated systems are increasingly being used for real-world applications like filtering college applications \cite{basu2019predictive}, determining credit eligibility \cite{ghailan2016improving}, making hiring decisions \cite{chalfin2016productivity}, etc. For such tasks, predictive models are trained on data coming from human decisions, which are often biased against certain demographic groups \cite{mehrabi2019survey, blodgett2020language, shah2019predictive}.
Biased decisions based on demographic attributes can have lasting economic, social and cultural consequences.
Natural language text is highly indicative of demographic attributes of the author \cite{koppel2002automatically, burger2011discriminating, nguyen2013old, verhoeven2014clips, weren2014examining, rangel2016overview, verhoeven2016twisty, blodgett2016demographic}. Language models can often encode such demographic associations even without having direct access to them. Prior works have shown that intermediate representations in a deep learning model encode demographic associations of the author or person being spoken about \cite{blodgett2016demographic, elazar2018adversarial, elazar2021amnesic}. Therefore, it is important to ensure that decision functions do not make predictions based on such representations.
In this work, we focus on removing demographic attributes encoded in data representations during training text classification systems. To this end, we present ``\textbf{Ad}versarial \textbf{S}crubber'' (\textsc{AdS}) to remove information pertaining to \textit{protected attributes} (like gender or race) from intermediate representations during training for a \textit{target task} (like hate speech detection).
Removal of such features ensures that any prediction model built on top of those representations will be agnostic to demographic information during decision-making.
\textsc{AdS} can be used as a plug-and-play module during training any text classification model
to learn fair intermediate representations. The framework consists of 4 modules:
Encoder, Scrubber, Bias discriminator and Target classifier. The Encoder generates contextual representation of an input text. Taking these encoded contextual representations as input, the Scrubber tries to produce fair representations for the target task. The Bias discriminator and Target classifier predict the protected attribute and target label respectively from the Scrubber's output.
The framework is trained end-to-end in an adversarial manner \cite{goodfellow2014generative}.
We provide theoretical analysis to show that under certain conditions Encoder and Scrubber converge without leaking information about the protected attribute. We evaluate our framework on {5} dialogue datasets, 2 Twitter-based datasets and a Biographies dataset with different target task and protected attribute settings. We extend previous evaluation methodology for debiasing by measuring Minimum Description Length (MDL) \cite{voita2020information} of labels given representations, instead of probing accuracy.
MDL provides a finer-grained evaluation benchmark for measuring debiasing performance. We compute MDL using off-the-shelf classifiers\footnote{We use MLPClassifier modules from \href{https://scikit-learn.org/stable/}{scikit-learn}.} making it easier to reproduce. Upon training using \textsc{AdS} framework, we observe a significant gain in MDL for protected attribute prediction as compared to fine-tuning for the target task.
Our contributions are:
\begin{itemize}[noitemsep, topsep=0.3pt]
\setlength\itemsep{0.3em}
\item We present \textbf{Ad}versarial \textbf{S}crubber (\textsc{AdS}), an adversarial framework to learn fair representations for text classification.
\item We provide theoretical guarantees to show that Scrubber and Encoder converge without leaking demographic information.
\item We extend previous evaluation methodology for adversarial debiasing by framing performance in terms of MDL.
\item Experimental evaluations on 8 datasets show that models trained using \textsc{AdS} generate representations where probing networks achieve near random performance on protected attribute inference while performing similar to the baselines on target task.
\item We show that \textsc{AdS} is scalable and can be used to remove multiple protected attributes simultaneously.
\end{itemize}
\section{Related Work}
Contextual representations learned during training for a target task can be indicative of features unrelated to the task.
Such representations can often encode undesirable demographic attributes, as observed in unsupervised word embeddings \cite{bolukbasi} and sentence embeddings \cite{may2019measuring}. Prior work has analysed bias in different NLP systems like machine translation \cite{park2018reducing, stanovsky2019evaluating, font2019equalizing, saunders-byrne-2020-reducing}, NLI \cite{rudinger2017social}, text classification \cite{dixon2018measuring, kiritchenko2018examining, sap2019risk, liu2021authors}, language generation \cite{sheng2019woman} among others.
Debiasing sensitive attributes for fair classification was introduced as an optimization problem by \citet{zemel2013learning}. Since then, adversarial training \cite{goodfellow2014generative} frameworks have been explored for protecting sensitive attributes for NLP tasks \cite{zhang2018mitigating, li2018towards, elazar2018adversarial, liu2020mitigating}.
Our work is most similar to \citet{elazar2018adversarial}, which achieves \textit{fairness by blindness} by learning intermediate representations which are oblivious to a protected attribute.
We compare the performance of \textsc{AdS} with \citet{elazar2018adversarial} in our experiments.
\begin{figure}[t!]
\centering
\includegraphics[width=0.37\textwidth]{figures/model.pdf}
\caption{Architecture of the Adversarial Scrubber (\textsc{AdS}). Encoder receives an input $x$ to produce $e$. Scrubber uses $e$ to produce $u$. Bias discriminator $d$ and Target classifier $c$ infer protected attribute $z$ and target task label $y$ from $u$.}
\label{fig:dynamic-model}
\end{figure}
\begin{algorithm*}[t!]
\caption{\textsc{AdS} Training algorithm}
\input{tables/algorithm}
\label{alg:training}
\end{algorithm*}
\section{Adversarial Scrubber}
\textsc{AdS} takes text documents $\{x_1, x_2, \ldots, x_n\}$ as input from a dataset $\mathcal{D}$ with corresponding target labels $\{y_1, y_2, \ldots, y_n\}$. Every input $x_i$ is also associated with a \textit{protected attribute} $z_i \in \{1, 2, ... K\}$.
Our goal is to construct a model $f(x)$ such that it doesn't rely on $z_i$ while making the prediction $y_i = f(x_i)$.
The framework consists of 4 module
: (i) Encoder $h(\cdot)$ with weights $\theta_h$, (ii) Scrubber $s(\cdot)$ with weights $\theta_s$, (iii) Bias discriminator $d(\cdot)$ with weights $\theta_d$ and (iv) Target classifier $c(\cdot)$ with weights $\theta_c$ as shown in Figure~\ref{fig:dynamic-model}. The Encoder receives a text input $x_i$, and produces an embedding $e_i = h(x_i)$, which is forwarded to the Scrubber. The goal of the Scrubber is to produce representation $u_i = s(h(x_i))$, such that $y_i$ can be easily inferred from $u_i$ by the Target classifier, $c$, but $u_i$ does not have the information required to predict the protected attribute $z_i$ by the Bias discriminator $d$. Our setup also includes a Probing network $q$, which helps in evaluating the fairness of the learned representations.
In the rest of this section, we describe \textsc{AdS} assuming a single Bias discriminator. However, \textsc{AdS} can easily be extended to incorporate multiple discriminators for removing several protected attributes (discussed in Section~\ref{sec:multi-disc}).
\noindent\textbf{Scrubber}: The Scrubber receives the input
representation $h(x_i)$ from Encoder and generates representation $u_i = s(h(x_i))$. The goal of the Scrubber is to produce representations such that the Bias discriminator finds it difficult to predict the protected attribute $z_i$. To this end, we consider two loss functions:\\[-1em]
\noindent\underline{Entropy loss}: In the Entropy loss, the Encoder and Scrubber parameters are jointly optimized to \textit{increase} the entropy of the prediction probability distribution, $H(d(u_i))$.\\[-1em]
\noindent\underline{$\delta$-loss}:
The $\delta$-loss function penalizes the model if the discriminator assigns a high probability to the correct protected-attribute class. For every input instance, we form an output mask $m_i \in \mathbb{R}^{1 \times K}$ where $K$ is the number of \textit{protected attribute classes}. $m_i^{(k)} = 1$ if $z_i = k$ and $0$ otherwise.
The Encoder and Scrubber \textit{minimizes}
the $\delta$-loss
defined as:
\begin{equation}
\delta(d(u_i)) = m_i^T \mathrm{softmax}_{gumble}(d(u_i))
\label{delta}
\end{equation}
\noindent where $\mathrm{softmax}_{gumble}(\cdot)$ is the gumble softmax function \cite{jang2016categorical}. In our experiments, we use a combination of the entropy and $\delta$ losses.\\[-1em]
\noindent\textbf{Target classifier}: The Target classifier predicts the target label $y_i$ from $u_i$ by optimizing the cross entropy loss: $\mathcal{L}_c(c(u_i), y_i)$.
The Scrubber, Target classifier, and Encoder parameters are updated simultaneously to minimize the following loss:
\begin{equation}
\begin{aligned}
\mathcal{L}_s(e_i, y_i) = \mathcal{L}_c(c(u_i), y_i) -\lambda_1 H(d(u_i)) \\+ \lambda_2 \delta(d(u_i))
\end{aligned}
\label{eqn:gen-loss}
\end{equation}
\noindent where $\lambda_1$ and $\lambda_2$ are positive hyperparameters.\\[-1em]
\noindent\textbf{Bias discriminator}: The Bias discriminator, which predicts the protected attribute $z_i$, is trained to reduce the cross-entropy loss for predicting $z_i$ denoted as $\mathcal{L}_d (d(u_i), z_i)$. The discriminator output is $d(u_i) \in \mathbb{R}^{K}$, where $K$ is the number of protected attribute classes.\\[-1em]
\noindent\textbf{Training}: The Bias discriminator and Scrubber (along with Target classifier and Encoder) are trained in an iterative manner as shown in Algorithm~\ref{alg:training}.
First, the Bias discriminator is updated using gradients from the loss in Equation~\ref{eqn:disc-grad}. Then, the Encoder, Scrubber and Target classifier are updated simultaneously using the gradients shown in Equation~\ref{eqn:gen-grad}. \\[-1em]
\noindent\textbf{Probing Network}:
\citet{elazar2018adversarial} showed that in an adversarial setup even when the discriminator achieves random performance for predicting $z$, it is still possible to retrieve $z$ using a separately trained classifier.
Therefore, to evaluate the amount of information related to $y$ and $z$ present in representations $u$, we use a probing network $q$.
{After \textsc{AdS} is trained, we train $q$ on representations $h(x)$ and $s(h(x))$, to predict $y$ and $z$ ($q$ is trained to predict $y$ and $z$ separately). We consider an \textit{information leak} from a representation, if $z$ can be predicted from it with above random performance. If the prediction performance of $q$ for $z$ is significantly above the random baseline, it means that there is information leakage of the protected attribute and it is not successfully guarded. }
\section{Theoretical Analysis}
\noindent\textbf{Proposition 1.} \textit{Minimizing $\mathcal{L}_s$ is equivalent to increasing Bias discriminator loss $\mathcal{L}_d$.} \\[-0.5em]
\noindent \underline{Proof}: Entropy and $\delta$-loss components of $\mathcal{L}_s$ tries to increase the bias discriminator loss. The discriminator cross-entropy loss $\mathcal{L}_d$ can be written as:
\begin{equation}
\begin{aligned}
\mathcal{L}_d(v_i, o_i) &= H(v_i, o_i) \\
&= D_{KL}(v_i, o_i) + H(v_i)
\end{aligned}
\label{eqn:prop-1-1}
\end{equation}
\noindent where $o_i = d(u_i)$, the Bias discriminator output probability distribution and $v_i$ is a one-hot target distribution $\{v_i \in \mathbb{R}^{K}, v_i^k = 1 \lvert z_i = k\}$.
As $H(o_i)$ increases (Equation~\ref{eqn:gen-loss}), $D_{KL}(o_i, v_i)$ value also increases (since $v_i$ is a one-hot vector), thereby increasing $\mathcal{L}_d(o_i, v_i)$ (in Equation~\ref{eqn:prop-1-1}). Therefore, $\mathcal{L}_d$ increases as we minimize the Scrubber loss component $-H(o_i)$.
The same holds true for the $\delta$-loss component. $\delta(o_i)$ reduces the probability assigned to the true output class which increases the cross entropy loss $\mathcal{L}_d$ (detailed proof provided in Appendix~\ref{sec:prop1} due to space constraint). Minimizing the entropy and $\delta$-loss components of the Scrubber loss $\mathcal{L}_s$ increases $\mathcal{L}_d$ for a fixed Bias discriminator. Therefore, assuming our framework converges to $(\theta_s^*, \theta_h^*, \theta_d^*)$ using gradient updates from $\mathcal{L}_s$ we have:
\begin{equation}
\mathcal{L}_d(\theta_s^*, \theta_h^*, \theta_d^*) \geq \mathcal{L}_d(\theta_s, \theta_h, \theta_d^*)
\label{eqn:prop-1}
\end{equation}
\noindent where $(\theta_s, \theta_h)$ can be any Scrubber and Encoder parameter setting.
\vspace*{5pt}
\noindent\textbf{Proposition 2.} \textit{Let the discriminator loss $\mathcal{L}_d$ be convex in $\theta_d$, and continuous differentiable for all $\theta_d$. Let us assume the following:}
\noindent\textit{ (a) $\theta_h^{(0)}$ and $\theta_s^{(0)}$ are Encoder and Scrubber parameters when the Scrubber output representation $s(h(x))$ does not have any information about $z$ (one trivial case would be when $s(h(x)) = \vec{0}$, if $\theta_s = \vec{0} \lor \theta_h = \vec{0}$)}.
\noindent\textit{ (b) $\theta_d^{(0)}$ minimizes $\mathcal{L}_d$ when $s(h(x))$ does not have any information about $z$ (this is achieved when $d(\cdot)$ always predicts the majority baseline for $z$). $\forall (\theta_s, \theta_h)$, the following holds true:}
\begin{equation*}
\small
\mathcal{L}_d(\theta_s, \theta_h, \theta_d^{(0)}) = \mathcal{L}_d(\theta_s^{(0)}, \theta_h^{(0)}, \theta_d^{(0)})
\end{equation*}
\noindent\textit{(c) the adversarial framework converges with parameters $\theta_s^*, \theta_h^*$ and $\theta_d^*$.}
\noindent \textit{Then, $\mathcal{L}_d(\theta_s^*, \theta_h^*, \theta_d^{*}) = \mathcal{L}_d(\theta_s^*, \theta_h^*, \theta_d^{(0)})$ which implies that the Bias discriminator loss does not benefit from updates of $\theta_s$ and $\theta_h$.}\\[-0.5em]
\noindent \underline{Proof}: As the Bias discriminator converges to $\theta_d^*$, we have:
\begin{equation}
\mathcal{L}_d(\theta_s^*, \theta_h^*, \theta_d^*) \leq \mathcal{L}_d(\theta_s^*, \theta_h^*, \theta_d^{(0)})
\label{eqn:disc-conv}
\end{equation}
\noindent$\theta_h$ and $\theta_s$ are updated using gradients from $\mathcal{L}_s$ (Equation~\ref{eqn:gen-loss}). Since the Encoder and the Scrubber parameters converge to $\theta_h^*$ and $\theta_s^*$ respectively, from {Proposition 1} (Equation~\ref{eqn:prop-1}) we have:
\begin{equation}
\mathcal{L}_d(\theta_s^*, \theta_h^*, \theta_d^*) \geq \mathcal{L}_d(\theta_s^{(0)}, \theta_h^{(0)}, \theta_d^{*})
\label{eqn:gen-conv}
\end{equation}
\noindent We can show that:
\begin{equation}
\begin{aligned}
\mathcal{L}_d(\theta_s^*, \theta_h^*, &\theta_d^{(0)})
\\&\geq \mathcal{L}_d(\theta_s^*, \theta_h^*, \theta_d^*) \hspace{1.4cm}\hfill{\text{ (Equation~\ref{eqn:disc-conv})}}\\
&\geq \mathcal{L}_d(\theta_s^{(0)}, \theta_h^{(0)}, \theta_d^*) \hspace{1cm}\hfill{\text{ (Equation~\ref{eqn:gen-conv})}}\\
&\geq \mathcal{L}_d(\theta_s^{(0)}, \theta_h^{(0)}, \theta_d^{(0)}) \hspace{0.3cm}\hfill\text{ (Assumption 2b)}\\
&= \mathcal{L}_d(\theta_s^{*}, \theta_h^{*}, \theta_d^{(0)}) \hspace{0.8cm}\hfill\text{ (Assumption 2b)}\\
\end{aligned}
\end{equation}
\noindent Therefore, $\mathcal{L}_d(\theta_s^*, \theta_h^*, \theta_d^*) =\mathcal{L}_d(\theta_s^{*}, \theta_h^{*}, \theta_d^{(0)})$.
\vspace*{5pt}
\noindent \textbf{Proposition 3.} \textit{Let us assume that the Bias discriminator $d(\cdot)$ is strong enough to achieve optimal accuracy of predicting $z$ from $s(h(x))$ and assumptions in Proposition 2 hold true. Then, Encoder and Scrubber converge to ($\theta_h^*, \theta_s^*$) without leaking information about the protected attribute $z$.}\\[-0.5em]
\noindent \underline{Proof}: An optimal Bias discriminator $d(\cdot)$ minimizes the prediction entropy, thereby increasing the entropy and $\delta$-loss. Given $(\theta_h^{(0)}, \theta_s^{(0)})$, the Scrubber loss $\mathcal{L}_s$ is maximized for an optimal $\theta_d^{(0)}$ (From Proposition 1, $\mathcal{L}_s(\theta_s^{(0)}, \theta_h^{(0)}, \theta_d^{(0)}) \geq \mathcal{L}_s(\theta_s^{(0)}, \theta_h^{(0)}, \theta_d)$, since $\mathcal{L}_d$ is decreasing with $\delta(o_i)$ and $-H(o_i)$). Then, for any other discriminator $\theta_d^*$ we have:
\begin{equation}
\mathcal{L}_s(\theta_s^{(0)}, \theta_h^{(0)}, \theta_d^{*}) \leq \mathcal{L}_s(\theta_s^{(0)}, \theta_h^{(0)}, \theta_d^{(0)})
\label{eqn:gen-loss-d}
\end{equation}
\noindent Following assumption 2b,do where $\theta_d^{(0)}$ is the optimal Bias discriminator we can show that:
\begin{equation}
\begin{aligned}
\mathcal{L}_s(\theta_s^{(0)}, \theta_h^{(0)}, &\theta_d^{(0)})
\\&\geq \mathcal{L}_s(\theta_s^{(0)}, \theta_h^{(0)}, \theta_d^{*}) \hspace{0.5cm}\hfill{\text{(Equation~\ref{eqn:gen-loss-d}})}
\\& \geq \mathcal{L}_s(\theta_s^{*}, \theta_h^{*}, \theta_d^{*}) \hspace{0.7cm}\hfill{\text{($\mathcal{L}_s$ converges)}}
\end{aligned}
\label{eqn:converge}
\end{equation}
\noindent Therefore, $\mathcal{L}_s(\theta_s^{*}, \theta_h^{*}, \theta_d^{*}) \leq \mathcal{L}_s(\theta_s^{(0)}, \theta_h^{(0)}, \theta_d^{(0)})$.
\noindent From $(\theta_s^{(0)}, \theta_h^{(0)}, \theta_d^{(0)})$, our framework converges to $(\theta_s^{*}, \theta_h^{*}, \theta_d^{*})$ as the Scrubber loss $\mathcal{L}_s$ decreases (Equation~\ref{eqn:converge}). Then, from Proposition 2 we have
$$\mathcal{L}_d(\theta_s^*, \theta_h^*, \theta_d^*) \geq \mathcal{L}_d(\theta_s^{(0)}, \theta_h^{(0)}, \theta_d^{(0)}) $$
\noindent As $\mathcal{L}_d$ does not decrease, and $d(\cdot)$ is optimal it shows that no additional information about $z$ is revealed which the Bias discriminator can leverage to reduce $\mathcal{L}_d$. This shows that starting from $(\theta_s^{(0)}, \theta_h^{(0)}, \theta_d^{(0)})$ where assumptions in Proposition 2 hold, our framework converges to $(\theta_s^{*}, \theta_h^{*}, \theta_d^{*})$ without revealing information about $z$.
\section{Experiments}
In this section, we describe our experimental setup and evaluate \textsc{AdS} on several benchmark datasets.
\begin{table}[t!]
\centering
\resizebox{0.32\textwidth}{!}{
\input{tables/dataset-stats}
}
\caption{ Dataset statistics. }
\label{tab:data_stats}
\end{table}
\subsection{Dataset}
We evaluate \textsc{AdS} on 5 dialogue datasets, 2 Twitter-based datasets and a Biographies dataset.
\noindent(a) \textbf{Multi-dimensional bias in dialogue systems}:
We evaluate \textsc{AdS} on 5 dialogue datasets: Funpedia, ConvAI2, Wizard, LIGHT and OpenSub, introduced by \citeauthor{dinan2020multi} (\citeyear{dinan2020multi}).
These datasets are annotated with multi-dimensional gender labels: the gender of the person being {spoken about}, the gender of the person being {spoken to}, and gender of the {speaker}. We consider the \textit{gender} of the person being \textit{spoken about} as our {protected attribute}. The {target task} in our setup is \textit{sentiment classification}. For obtaining the target label, we label all instances using the rule-based sentiment classifier VADER \cite{hutto2014vader}, into three classes: positive, negative and neutral. The dialogue datasets: Funpedia, Wizard, ConvAI2, LIGHT and OpenSub were downloaded from ``md\_gender'' dataset in huggingface library.\footnote{https://huggingface.co/datasets/md\_gender\_bias} We use the same data split provided in huggingface for these dataset.
\noindent (b) \textbf{Tweet classification}: We experiment on two Twitter datasets.
First, we consider the DIAL dataset \cite{blodgett2016demographic}, where each tweet is annotated with ``\textit{race}'' information of the author, which is our {protected attribute} and the {target task} is \textit{sentiment classification}. We consider two race categories: non-Hispanic blacks and whites.
Second, we consider the PAN16 \cite{rangel2016overview} dataset where each tweet is annotated with the author's \textit{age} and \textit{gender} information both of which are {protected attributes}. The {target task} is \textit{mention detection}. We use the implementation\footnote{https://github.com/yanaiela/demog-text-removal} of \citet{elazar2018adversarial} to annotate both datasets.
\begin{figure*}[t!]
\centering
\includegraphics[width=\textwidth]{figures/evaluation.pdf}
\caption{Evaluation setup. We evaluate the performance of the probing network on 4 different representations. (a) {Pre-trained $h(x)$} obtained using pre-trained Encoder (b) w/o adversary $h(x)$ when the Encoder $h$ was fine-tuned on the target task (c) \textsc{AdS} $h(x)$ Encoder embeddings and (d) \textsc{AdS} - $s(h(x))$ embeddings from the Scrubber are representations obtained from \textsc{AdS}.}
\label{fig:eval}
\end{figure*}
\noindent (c) \textbf{Biography classification}:
We evaluate \textsc{AdS} on biographies dataset \cite{de2019bias}. The target task involves \textit{classification of biographies} into 28 different profession categories, and protected attribute is the \textit{gender} of the person. The dataset has been downloaded and processed from this open-sourced project.\footnote{https://github.com/Microsoft/biosbias} We use the same train-dev-test split of 65:10:25 as the authors.
All datasets used in our experiments are balanced. The dataset statistics are reported in Table~\ref{tab:data_stats}.
\begin{table}[t!]
\centering
\resizebox{0.5\textwidth}{!}{
\input{tables/hyperparameters}
}
\caption{Hyperparameter settings. Each entry for $z$/$y$ are shown the format ``Attribute Name ($c$)'', where $c$ is the number of classes for that attribute.}
\label{tab:setup}
\end{table}
\subsection{Implementation details}
We use a 2-layer feed-forward neural network with ReLU non-linearity as our Scrubber network $s$. We use BERT-base \cite{devlin2018bert} as our Encoder $h$. Bias discriminator $d$ and Target classifier $c$ take the pooled output of BERT \texttt{[CLS]} representation followed by a single-layer neural network. All the models were using AdamW optimizer with a learning rate of $2 \times 10^{-5}$. Hyperparameter details for different datasets are mentioned in Table~\ref{tab:setup}. $z$ and $y$ sections in the table report the protected attribute and the target task for each dataset. For each task we also report the number of output classes in paranthesis (e.g. Sentiment (3)). The implementation of this project is publicly available here: \href{https://github.com/brcsomnath/adversarial-scrubber}{https://github.com/brcsomnath/AdS}.
\subsection{Evaluation Framework}
\label{sec:eval-setup}
{In our experiments, we compare representations obtained from $4$ different settings as shown in Figure~\ref{fig:eval}. Figure~\ref{fig:eval}(a), (b) and (c) are our baselines.}
In Figure~\ref{fig:eval}(a), we retrieve $h(x)$ from pre-trained BERT model. In Figure~\ref{fig:eval}(b), we retrieve $h(x)$ from BERT fine-tuned on the target task. In Figure~\ref{fig:eval}(c), Encoder output $h(x)$ from \textsc{AdS} is evaluated. {In Figure \ref{fig:eval}(d), Scrubber output, $s(h(x))$ is evaluated. This represents our final setup \textsc{AdS} - $s(h(x))$.}
\subsection{Metrics}
{We report the F1-score (F1) of the probing network for each evaluation. However, previous work has shown that probing accuracy is not a reliable metric to evaluate the degree of information related to an attribute encoded in representations \cite{hewitt2019designing}. Therefore, we also report Minimum Description Length (MDL) \cite{voita2020information} of labels given representations. MDL captures the amount of effort required by a \textit{probing network} to achieve a certain accuracy. Therefore, it provides a finer-grained evaluation benchmark which can even differentiate between probing models with comparable accuracies. We compute the online code \cite{rissanen1984universal} for MDL. In the online setting, blocks of labels are encoded by a probabilistic model iteratively trained on incremental blocks of data (further details about MDL is provided in Appendix A.1). We compute MDL using sklearn's MLPClassifie
\footnote{We use default hyperparameters from \href{https://scikit-learn.org/stable/}{scikit-learn}} at timesteps corresponding to 0.1\%, 0.2\%, 0.4\%, 0.8\%, 1.6\%, 3.2\%, 6.25\%, 12.5\%, 25\%, 50\% and 100\% of each dataset as suggested by \citet{voita2020information}. A higher MDL signifies that more effort is required to achieve the probing performance. Hence, we expect the debiased representations to have higher MDL for predicting $z$ and a lower MDL for predicting $y$.}
\section{Results}
The evaluation results for all datasets are reported in Table~\ref{tab:dynamic-results}. For all datasets, we report performances in 4 settings described in Section~\ref{sec:eval-setup}.
\begin{table*}[t!]
\centering
\resizebox{\textwidth}{!}{
\input{tables/dialogue-results-1}
}
\resizebox{\textwidth}{!}{
\input{tables/dialogue-results-2}
}
\resizebox{\textwidth}{!}{
\input{tables/tweet-bios-results}
\label{tab:tab3}
}
\caption{Evaluation results for all datasets. Expected trends for a metric are shown in $\uparrow$- higher scores and $\downarrow$- lower scores. Statistically significant best probing performances for $z$ (lowest F1/highest MDL) and $y$ (highest F1/lowest MDL) are in bold.\footnote{MDL is not a normalized measure and varies depending on the size of the dataset.} \textsc{AdS} - $s(h(x))$ performs the best in guarding information leak of $z$ for all datasets. }
\label{tab:dynamic-results}
\end{table*}
\noindent\textbf{Dialogue and Biographies dataset}: First, we focus on the results on the dialogue and biographies datasets reported in Table~\ref{tab:dynamic-results} (first two rows). We observe the following:
(i) for pre-trained $h(x)$, MDL of predicting $z$ is lower than $y$ for these datasets. This means that information regarding $z$ is better encoded in the pre-trained $h(x)$, than the target label $y$.
(ii) In ``w/o adversary $h(x)$'' setup, the Encoder is fine-tuned on the target task (without debiasing), upon which MDL for $y$ reduces significantly (lowest MDL achieved in this setting for all datasets) accompanied by a rise in MDL for $z$. However, it is still possible to predict $z$ with a F1-score significantly above the random baseline,
(iii) ``\textsc{AdS} - $h(x)$'' setup achieves similar F1 score for predicting $y$, but still has a F1-score for $z$ significantly above the random baseline.
(iv) ``\textsc{AdS} - $s(h(x))$'' performs the best in terms of guarding the protected attribute $z$ (lowest prediction F1-score and highest MDL) by achieving near random F1-score across all datasets. It is also able to maintain performance on the target task, as we observe only a slight drop compared to the fine-tuning performance (``w/o adversary $h(x)$'' for predicting $y$).
\begin{table}[t!]
\centering
\resizebox{0.5\textwidth}{!}{
\input{tables/baselines}
}
\vspace{0.2cm}
\caption{Comparing \textsc{AdS} with existing baseline. The best and second best performances are in bold and underlined respectively. \textsc{AdS} - $s(h(x))$ achieve the best performance on both settings in the PAN16 dataset and is able to reduce $\Delta_z$ better than baseline on DIAL.}
\label{tab:baseline}
\end{table}
\noindent\textbf{DIAL \& PAN16}: Next, we focus on the Twitter-based datasets DIAL \& PAN16, where the target task is sentiment classification/mention detection and the protected attribute is one of the demographic associations (race/gender/age) of the author. The evaluation results are reported in Table~\ref{tab:dynamic-results} (third row). For these datasets, we observe that
(i) ``w/o adversary $h(x)$'' representations have higher F1 and lower MDL for predicting $z$, compared to ``Pre-trained $h(x)$''. This shows that fine-tuning on the target task $y$ encodes information about the protected attribute $z$.
(ii) ``\textsc{AdS} - $h(x)$'' performs similar to ``w/o adversary $h(x)$'' representations on the target task but still leaks significant information about $z$, unlike the previous datasets.
(iii) ``\textsc{AdS} - $s(h(x))$'' achieves the best performance in terms of guarding the protected variable $z$ (achieves almost random performance in PAN16 dataset), without much performance drop in the target task.
\noindent\textbf{Comparison with Prior Work}: We report two metrics following \citet{elazar2018adversarial}: (i) $\Delta_z$ - which denotes the performance above the random baseline for $z$ (50\% for both PAN16 and DIAL) (ii) Acc$_y$ - is the probing accuracy on the target task.
Our framework cannot be directly compared with \citet{elazar2018adversarial} as they have used LSTM Encoder. Therefore, we report the baseline Encoder performances as well. In Table~\ref{tab:baseline},
we observe that it possible to retrieve $z$ and $y$ from ``w/o adversary BERT'' with a higher performance compared to ``w/o adversary LSTM''. This indicates that BERT encodes more information pertaining to both $y$ and $z$ compared to LSTM.
In the DIAL dataset, \textsc{AdS} is able to reduce $\Delta_z$ by an absolute margin of 25\% compared to 9.7\% by \citet{elazar2018adversarial}, while the absolute drop in Acc$_y$ is 3.5\% compared to 3.6\% by \citet{elazar2018adversarial}. In PAN16 dataset, \textsc{AdS} achieves the best $\Delta_z$ and Acc$_y$ performance for both setups with protected attributes: age and gender respectively. \textsc{AdS} - $s(h(x))$ also achieves performance comparable to the ``w/o adversary BERT'' setup, which is fine-tuned on the target task. Therefore, \textsc{AdS} is successful in scrubbing information about $z$ from the representations of a stronger encoder compared to \citet{elazar2018adversarial}.
\begin{table}[t!]
\centering
\resizebox{0.5\textwidth}{!}{
\input{tables/multi-disc-setup}
}
\caption{Evaluation results of protecting multiple attributes using \textsc{AdS}. Statistically significant best performances are in bold. Expected trends for a metric are shown in $\uparrow$- higher scores and $\downarrow$- lower scores. ``\textsc{AdS} $s(h(x))$ - (both)'' achieves the best performance.\footnote{\label{ftn:change}Performance of ``\textsc{AdS} - $s(h(x))$'' varies from Table~\ref{tab:dynamic-results} as the dataset size and split in this setup are different.}}
\label{tab:multi-disc}
\end{table}
\subsection{Scrubbing multiple protected attributes}
\label{sec:multi-disc}
In this experiment, we show that using \textsc{AdS} it is possible to guard information about \textit{multiple} protected attributes. $\mathcal{L}_s$ in this setup is defined as:
\begin{equation*}
\begin{aligned}
\mathcal{L}_s(e_i, y_i) = \mathcal{L}_c(c(u_i), y_i) -\lambda_1 \sum\limits_{n=1}^{N} H(d_n(u_i)) \\+ \lambda_2 \sum\limits_{n=1}^{N} \delta(d_n(u_i))
\end{aligned}
\label{eqn:multi-gen-loss}
\end{equation*}
\noindent where $N$ is the number of protected attributes and $d_n(\cdot)$ is the Bias discriminator corresponding to the $n^{th}$ protected attribute $z_n$.
We evaluate on PAN16 dataset considering two protected attributes $z_1$ (age) and $z_2$ (gender). The target task is mention prediction.
{We consider the subset of PAN16 that contains samples with both gender and age labels. This subset } has 120K training instances and 30K test instances. Evaluation results are reported in Table~\ref{tab:multi-disc}. Similar to previous experiments, we observe that ``w/o adversary $h(x)$'' {(fine-tuned BERT)} leaks information about both protected attributes age and gender. We evaluate the information leak when ``\textsc{AdS} $s(h(x))$'' is retrieved from a setup with single Bias discriminator (age/gender). We observe a significant gain in MDL for the corresponding $z_n$ in both cases, indicating that the respective $z_n$ is being protected.
Finally, we train \textsc{AdS} using two Bias discriminators and ``\textsc{AdS} - $s(h(x))$ (both)'' representations achieve the best performance in guarding $z_1$ \& $z_2$, while performing well on the target task. This shows that \textsc{AdS} framework is scalable and can be leveraged to guard multiple protected attributes simultaneously.
\begin{table}[t!]
\centering
\resizebox{0.5\textwidth}{!}{
\input{tables/ablations}
}
\caption{Ablation experiments on Funpedia using F1-score (F1), Precision (P) and Recall (R). Expected trends for a metric are shown in $\uparrow$- higher scores and $\downarrow$- lower scores. \textsc{AdS} with both loss components performs the best in guarding $z$.}
\label{tab:ablations}
\end{table}
\subsection{Efficacy of different losses}
We experiment with different configurations of the Scrubber loss $\mathcal{L}_s$ to figure out the efficacy of individual components. We show the experimental results on the Funpedia dataset in Table~\ref{tab:ablations} (with $\lambda_1 = \lambda_2 = 1$). We observe that most leakage in $z$ (increase in prediction F1-score) occur when the entropy loss is removed. Removing $\delta$-loss also results in a slight increase in leakage accompanied by a gain in performance for predicting $y$. This shows that both losses are important for guarding $z$.
Empirically, we found that $\delta$-loss is not suitable for binary protected attributes.
{This is because during training when the Scrubber is encouraged to learn representations that do not have information about $z$, it learns to encode representations in a manner such that the Bias discriminator predicts the opposite $z$ class.} Hence, the information about $z$ is still present and is retrievable using a probing network $q$. For this reason, we use $\delta$-loss for only Funpedia ($\lambda_2$ values in Table~\ref{tab:setup}) where we considered 3 gender label classes
\begin{figure}[t!]
\centering
\subfloat[][ Pre-trained]{
\includegraphics[width=0.23\textwidth]{figures/bios-professor-pre-training.png}{
\label{subfig:pre-trained}}
}
\subfloat[][ After training]{ %
\includegraphics[width=0.23\textwidth]{figures/bios-professor-post-training-bert.png}{
\label{subfig:post-training}}
}
\vspace{5pt}
\caption{UMAP projection of Scrubber output representations $s(h(x))$ from Biographies corpus with profession as ``professor''. Blue and red labels indicate female and male biographies respectively. (a) Pre-trained BERT representations (b) BERT representations post training in \textsc{AdS}.}
\label{fig:embedding}
\end{figure}
\subsection{Visualization}
We visualize the UMAP \cite{mcinnes2018umap} projection of Encoder output representations, $h(x)$, in Figure~\ref{fig:embedding}. {Blue} and {red} labels indicate female and male biographies respectively. {Figure~\ref{subfig:pre-trained} and Figure~\ref{subfig:post-training} show representations before and after \textsc{AdS} training. } In Figure~\ref{subfig:pre-trained}, male and female labeled instances are clearly separated in space. This shows that text representations encode information relating to gender attributes. In Figure~\ref{subfig:post-training}, we observe that after training in our adversarial framework both male and female labeled instances are difficult to segregate. This indicates that post training in \textsc{AdS}, it is difficult to identify biography representations on the basis of gender.
\section{Conclusion}
In this work, we proposed \textbf{Ad}versarial \textbf{S}crubber (\textsc{AdS}) to remove demographic information from contextual representations. Theoretical analysis showed that under certain conditions, our framework converges without leaking information about protected attributes. We extend previous evaluation metrics to evaluate fairness of representations by using MDL.
Experimental evaluations on 8 datasets show that \textsc{AdS} is better at protecting demographic attributes than baselines. We show that our approach is scalable and can be used to remove multiple protected attributes simultaneously.
Future work can explore leveraging \textsc{AdS} towards learning fair representations in other NLP tasks.
\section{Acknowledgement}
This work was supported in part by grants NIH 1R01AA02687901A1 and NSF IIS2133595.
\section*{Ethical considerations}
We propose \textsc{AdS}, an adversarial framework to prevent text classification modules from taking biased decisions. \textsc{AdS} is intended to be used in scenarios, where the user is already aware of the input attributes they want to protect.
\textsc{AdS} can only be trained on data where protected attributes are annotated. It is possible that representations retrieved from \textsc{AdS}, contain sensitive information which were not defined as the protected variables. Even in such a scenario, \textsc{AdS} won't reveal information more than its already available in the dataset. One potential way of misusing \textsc{AdS} would to define relevant features for a task (e.g. experience for a job application) as a protected attribute, then the classification system may be forced to rely on sensitive demographic information for predictions. In such cases, it is possible to flag systems by evaluating the difference in True Positive Rate (TPR) when the protected attribute is changed ($\mathrm{GAP}^{\mathrm{TPR}}_{z, y}$ metric \cite{de2019bias}). All experiments were performed on publicly available data, where the identity of author was anonymous. We did not perform any additional data annotation.
| {'timestamp': '2021-09-20T02:19:51', 'yymm': '2109', 'arxiv_id': '2109.08613', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08613'} | arxiv |
\section{INTRODUCTION}
With the recent popularization of deep learning, scaling end-to-end reinforcement learning (RL) to control real robots directly from high-dimensional sensory data is made possible. In \cite{c1} and \cite{c2}, the deep neural network (DNN) is leveraged to approximate the Q-function with raw visual observation as input, while in \cite{c3} and \cite{c4}, the network is applied to directly learning the polic
, which can better adapt to continuous control scenarios. However, relying on DNN to extract informative features presents a series of challenges, in particular in terms of sample efficiency, which is critical within RL scale, considering the fact that RL agent itself already takes a great amount of exploration experience to converge. In addition, due to the curse of dimensionality \cite{c20}, directly training from raw images is lengthy in time and sometimes fails to converge, which limits RL performance to simple tasks like \emph{atari} \cite{c21}. Therefore, one important task in complex control scenarios is to learn how to efficiently gather the task-relevant state representation necessary to make informed decisions \cite{c5}. In robotics, defining such interesting features and designing a pragmatic state estimator usually requires a considerable amount of manual engineering. As a result, \emph{state representation learning} (SRL) is proposed in which the machine autonomously learns these features with as little supervision as possible, mapping observations in high dimensions to a low-dimensional state space.\par
Prevailing implementations usually achieve this through a decoupling strategy which consists of two stages: state representation learning, that builds a representative state space for the robotic environment from raw images, and then reinforcement learning. Results show that training via SRL exhibits better performance than direct end-to-end training for some RL algorithms, in terms of sample efficiency and final convergence \cite{c6}.
We can conduct SRL by optimizing objective functions corresponding to some robotic priors, such as the reconstruction model that consists of an auto-encoder \cite{c7} and the environmental model where both state representation and the transition function is learned altogether \cite{c8}. In \cite{c9}, the authors introduced some intrinsic priors specifically for robotic scenes. However, these approaches all separately feed samples to train the SRL model before RL. Since the SRL model does not update with the exploration collected by RL agent, the learned state estimator is prone to overfit. Besides, the actual performance of SRL can be only confirmed by a posterior RL training.\par
In this study, we propose a new algorithm called Policy Optimization via Abstract Representation (POAR), which integrates SRL into the state-of-art RL algorithm \emph{proximal policy optimization} (PPO) \cite{c3}. The algorithm is designed to update SRL and RL models simultaneously, where the learned representation can evolve to meet the demand of reinforcement learning and maintain a good physical interpretation. Moreover, we can check the learned abstract representation in real-time to monitor the course of training and diagnose the policy.\par
In addition, to better accustom RL algorithms to 3D robotic control scenarios, we introduce a new type of SRL prior which leverages expert demonstration. Internalizing demonstration to diminish searching space can efficiently tackle the cold-start problem in which explorations are lengthy and expensive, especially during early training stages \cite{c10}. To do so, we select the maximum mean discrepancy (MMD) \cite{c18} loss to optimize, which evaluates the similarity between learned states and expert
trajectories in distribution, in the hope that the agent can imitate the expert's behaviors.\par
Results in three simulation environments show that under certain conditions, POAR exhibits greater convergence rate and better final performance than PPO baselines and decoupling strategies. Our main contributions can be summarized as:
\begin{enumerate}
\item We propose a generic RL framework for high-dimensional input, which integrates SRL and RL where both models can evolve together to adapt to each other to learn a better state representation and policy.
\item By combining expert demonstration, the learned states adapt to resemble the robotic trajectory distribution in real space, and abate the cold-start dilemma.
\item We provide a real-time access to learned states to better monitor the SRL model and diagnose the current policy, which facilitates interpretablity in deep learning.
\item By increasing sample efficiency via various approaches, our model makes it possible to directly deploy the algorithm and train on real robots.
\end{enumerate}
\section{BACKGROUND}
\subsection{Reinforcement Learning (RL)}
Within RL scale, the agent interacts with the target environment, aiming to maximize the accumulative rewards received from the environment. At each time step $t$, the agent selects an action $a_t$ corresponding to the input representation of the environment's state $s_t$. As a consequence of its action, the agent receives a numerical reward $r_{t+1}$ and transits to the next state $s_{t+1}$.
\begin{figure}[ht!]
\centering
\includegraphics[width=0.4\textwidth]{Image/RL_environment.png}
\caption{The agent-environment interaction in reinforcement learning \cite{c11}}
\label{fig:2_RL_interaction}
\end{figure}
This process is shown in Fig. ~\ref{fig:2_RL_interaction} and can be reformulated as an infinite-horizon Markov decision process (MDP), defined by the tuple $(\mathcal{S}, \mathcal{A}, P, r)$, where $\mathcal{S}$ is a finite set of states, $\mathcal{A}$ is a finite set of actions, and $P : \mathcal{S}\times\mathcal{A} \times \mathcal{S} \rightarrow [0,1]$ is the transition probability distribution, $r: \mathcal{S} \rightarrow \mathbb{R}$ is the reward function. Let $\pi$ denote a stochastic policy $\pi : \mathcal{S} \times \mathcal{A} \rightarrow [0,1]$ that determines distribution of agent's action at each given state. The goal is to find an optimal control policy $\pi^*$ that maximizes the expected discounted reward $J(\pi) = \mathbb{E}_{s_0, a_0, \dots}\big[\sum_{t=0}^{T} \gamma^t r(s_t)\big]$, where $\gamma\in[0,1]$ denotes the discount factor.
\subsection{State Representation Learning (SRL)}
As discussed above, SRL learns a function:$f: \mathcal{O} \rightarrow \mathcal{S}$ that maps complex observations to informative low-dimensional states. While deep reinforcement learning algorithms have shown that it is possible to learn to control robots directly from observations, SRL can take advantage of low dimensional and informative representations, instead of raw images captured from camera, to solve tasks more efficiently \cite{c5}. \par
Since the most efficient state representation for each task varies, SRL is usually conducted in an unsupervised way, which demands for advanced priors of the tasks. In \cite{c12}, the authors classify the approaches into three mainstreams to incorporate human priors, namely \emph{task-specific}, \emph{generic}, and \emph{robotic priors}. \emph{Task-specific} refers to handcrafting features for each task, which involves manually defining the observation-state mapping. \emph{Generic} approach introduces some common priors that depict what a good representation is. For example, the authors in \cite{c7, c13} leverage an auto-encoder to find a reduced set of features that encode necessary information to reconstruct the observations. We note $\phi$ to be an encoder that encodes an observation $o_t$ to a latent state $s_t$, and $\psi$ a decoder to reconstruct the original observation from $s_t$. With $\theta$ being parameters of the functions, the optimization of encoder and decoder is implemented with DNN, we formulate this process as:
\[
\begin{split}
s_t = \phi(o_t; \theta_\phi)\\
\hat{o}_t = \psi(s_t; \theta_\psi)
\end{split}
\]\par
In the training process, by optimizing iteratively the loss function (\ref{equation_1}), we can derive a state estimator that encodes essential information of input observations.
\begin{equation}
\mathcal{L}_{reconstruct} = \frac{1}{2}(\lVert \hat{o}_t -o_t\rVert^2_2 + \lVert \hat{o}_{t+1} -o_{t+1}\rVert^2_2) \label{equation_1}
\end{equation}\par
We can also learn the observation-to-state mapping as part of learning some other functions such as the transition of the environment $\hat{s}_{t+1} = f(s_t, a_t; \theta_{fwd})$, where $s_t = \phi(o_t)$. Thus, by minimizing $\mathcal{L}_{forward} = \lVert \hat{s}_{t+1} -s_{t+1}\rVert^2_2$ we can learn the encoder $\phi$ together with the transitional function $f$. This approach is addressed as the \emph{forward model}, while \emph{inverse model} and \emph{reward model} are similar in concept but predict respectively the action $a_t$ that agent takes at $t$ and reward $r_{t+1}$ for next state using $s_t$ and $s_{t+1}$.
\begin{figure}[ht!]
\centering
\includegraphics[width = 0.36\textwidth]{Image/srl_split.png}
\caption{SRL: The whole state is used to reconstruct the observations but state space is split into three part for forward, inverse and reward model.}
\label{fig:state_representation}
\end{figure}\par
In robotics, to learn such state representation is rather intuitive, considering the physical priors we can benefit from. For example, robot operations are all deployed in real physical platform that could be considered as 2 or 3 dimension, while their intrinsic features are usually position, orientation, speed or acceleration. Authors in \cite{c9} thus introduce some \emph{robotic priors} that only pertain to tasks involving robots in real-world function.\par
We can either use the whole state to apply these different priors, termed \emph{srl combination}, or split the states and apply objective functions to different parts of the state space. One motivation to apply the \emph{srl split} model is that losses have different magnitudes and each prior have specialized functionality, optimization of all models on the same space often leads to collapse, leaving some features unlearned. Fig. \ref{fig:state_representation} shows an example of SRL with split dimension. We use the whole state to reconstruct the observations yet split state space into three parts for forward, inverse and reward model. This can make components specialize in encoding different featuring representations. \par
By conducting SRL with above models, we can extract efficient features into a lower dimension space. This process contributes on the one hand to accelerate the learning process so that it raises the possibility to train the RL agent directly on the robot. On the other hand, this low dimensionality offers an approach to interpret model extracted features, which increases the interpretability of machine learning results, especially for RL models.
\section{Policy Optimization via Abstract Representation (POAR)}
Although SRL is confirmed to succeed in extracting some important features from high-dimensional sensory data, the state estimator derived from decoupling strategy usually deteriorates over the course of training. This is because the SRL model is only pre-trained with randomly sampled frames, whose parameters stay the same throughout the rest of the training, leading to over-fitting. Therefore, we are inspired to integrate SRL priors together with \emph{domain resemblance prior} into the original PPO model, so as to update SRL throughout the training process. The design of POAR framework, \emph{domain resemblance prior} is introduced in section \ref{Sec:Framework}, section \ref{Sec:Loss_Function}. The general design of loss function and update strategy is explained in section \ref{Sec:General_design}.
\subsection{General Structure}
\label{Sec:Framework}
On the basis of the original framework of PPO, we integrate the SRL model and introduce a dynamic mechanism of parameter adjustment (discussed in section \ref{Sec:General_design}) to guarantee stability and convergence. We incorporate several effective priors in the model network, which takes advantage of the observation-action tuple $(o_t, a_t)$ that PPO agent collects each batch to calculate loss based on predictions.\par
The proposed end-to-end state representation learning and reinforcement learning algorithm POAR is illustrated in Fig. \ref{fig:poar_structure}. The detailed architecture and hyperparameters can be found in Appendix \ref{tab:hyperparameter_poar}.
\begin{figure}[ht!]
\centering
\includegraphics[width = 0.48\textwidth]{Image/poar.jpg}
\caption{The design of POAR, and end-to-end SRL-RL training pipeline}
\label{fig:poar_structure}
\vspace{-0.1in}
\end{figure}
In order to preserve the learned states to be representative for the physical meaning, we use two \emph{Adam} optimizers (adaptive moment estimation) \cite{c14} that update separately the RL and SRL models. We add $\mathcal{L}_{SRL}$ to assist in RL loss so that the states can evolve to meet the demand of reinforcement learning and maintain a good physical interpretability. By engaging RL loss to update SRL model, which pertains to learning the encoder $\phi$ together with another function $\pi^*$, the state estimator is thus more robust and task-relevant.\par
This framework guarantees the timely update of SRL model, by which we obtain an effective and active representation of states. With the help of \emph{domain resemblance prior}, our model can further boost the sample efficiency of RL training.
\subsection{Domain Resemblance Prior}
\label{Sec:Loss_Function}
Simulation results show that directly using the task-relevant coordinates of robots as states to train RL agent can generally obtain better result than training from raw images. Therefore, we conceive the coordinate itself as a representational state, and hope to learn a mapping from raw image to ground-truth coordinates. To further guide the policy, we leverage expert demonstration as prior knowledge. Thus we characterize portions of SRL states with robots' coordinates in real work space (2D or 3D) and make the learned states resemble the distribution of expert trajectories. Considering that it's not practical to provide accurate coordinate states for each camera frame when training a real-life robot, we apply \emph{Maximum Mean Discrepancy} (MMD) \cite{c18} to measure the distribution deviation between sampled exploration and demonstration trajectories:
\begin{equation}
\mathcal{L}_{dr}= \vert\vert\frac{1}{n}\sum_{i=1}^{n}\Phi(\mathcal{D}_{s})-\frac{1}{m}\sum_{j=1}^{m}\Phi(\mathcal{D}_{d})\vert\vert_{\mathscr{H}}^{2}
\label{MMD}
\end{equation}
where $\Phi(\cdot)$ maps the original data to the regenerated \emph{Hilbert} space \cite{c15}. By back-propagating the MMD loss, the learned states can not only restore distribution of coordinates in the real work space, but can also guide the RL agent to imitate expert's behaviors. We mainly use this prior to aid \emph{forward} model on the same state portion to build a more structural understanding of the environment space. In conclusion, domain resemblance prior can facilitate the reconstruction of observations and increase interpretability of the learned state estimator.
\subsection{Design of Loss Function and Update Strategy}
\label{Sec:General_design}
With the presence of \emph{Domain Resemblance} prior and other priors like \emph{forward}, \emph{inverse} and \emph{autoencoder}, the SRL model can now learn an efficient and task-relevant representation with strong physical meaning. Therefore the loss function can be defined as:
\[
\begin{split}
\mathcal{L}_{RL} & =\hspace{7.3ex} \mathcal{L}_{PPO} \hspace{6ex}\hspace{13.6ex} (Optimizer 1)
\\
\mathcal{L}_{SRL}& = \sum_{x\in\mathrm{SRL\, Model}} w_{x} \times \mathcal{L}_{x} \hspace{13.6ex}(Optimizer 2) \\
& = w_{iv}\mathcal{L}_{iv} + w_{fw}\mathcal{L}_{fw} + w_{rw}\mathcal{L}_{rw} + w_{ae}\mathcal{L}_{ae} + w_{dr}\mathcal{L}_{dr}
\end{split}
\]
where $w_{x}$ denotes the weights attributed to each model.\par
Nevertheless, a direct optimization on two losses will finally deteriorate the encoder part. The reinforcement learning and state representation loss can both be influenced by the encoder and gradients of RL loss are generally larger than that of SRL, which leads to the collapse (reduced to a point or strongly deformed) of states. Therefore, we reduce scales of RL gradients on encoder part for \emph{Optimizer 1}. Let denote $\theta$ as parameters, $\Theta_{SRL}$, $\Theta_{RL}$ as the sets of parameters respectively concerning SRL model and RL model. If $\theta \in \Theta_{SRL}\cap \Theta_{RL}$, then:
\begin{equation}
Grad_{\mathrm{Optimizer}_1} (\theta) = \alpha \times \frac{\partial\mathcal{L}_{RL}}{\partial\theta}
\end{equation}
where $\alpha$ is a hyperparameter to balance the trade-off on optimization of PPO and SRL model on encoder part. Later in section \ref{Sec:Ablation_Study} we present an ablation study on best choice of $\alpha$. Generally, the SRL model becomes optimal before the policy itself. And thanks to the actions' randomness at the early stage of training, the agent could fully update SRL model while exploring the environment. Once the SRL model is optimized, we would like to maintain its properties. The trick we apply here is to use a different learning rate decay strategy for two optimizers: the learning rate of PPO model $lr_1$ decays linearly to zero till the end while the learning rate of SRL model $lr_2$ exhibits an exponential decay slope that decreases much faster.
\begin{equation}
lr_{1} = lr^1_0 \times r; \quad lr_2 = lr^2_0 \times \max(\exp{(-\beta r)},\hspace{0.5ex} 0.001 r);
\end{equation}
where $r = 1- \frac{n-1}{N}$, $n$ is the current time steps and $N$ denotes the total number of time steps. $\beta$ denotes another hyperparameter to control the weight decay of SRL model's learning rate.
\section{CONCLUSIONS}
To summarize our contributions, we present a new framework to train RL agent together with the SRL model, as well as a \emph{domain resemblance prior} to leverage expert demonstration. With such features incorporated, our framework can efficiently handle with the tasks in high-dimensional robotic scenarios, and encourages the potential to train real-life robots from scratch. During training, POAR can provide real-time access to the current inferred states which helps to interpret RL with a real physical meaning, and we can thus monitor the course of training and diagnose the policy. In detail,
\begin{enumerate}
\item Our model integrates SRL into the training process of RL which allows SRL to adapt with RL. Learned in this way, the observation-state mapping can thus guarantee the high final rewards of RL, since over-fitting is overcome.
\item By reusing the interactions collected by RL for training SRL and leveraging expert demonstration to guide the agent, the cold-start problem is tackled and sample efficiency is substantially sped up.
\item Compared with the decoupling strategy, our model is more robust, almost all SRL models outperform the original PPO model in our setups. Hence, it is easier to tune the hyperparameter.
\end{enumerate}
In terms of future work, we would like to thoroughly test our algorithm on other standard RL environments to explore the general performance of POAR. Inspired by this framework, we could also develop other RL architectures based on A3C, ACER and deepq algorithms to further boost the sample efficiency of reinforcement learning.
\section{Experimental Results}
To compare the performance of POAR with the original PPO, we select robotic environments \emph{MobileRobot} which consists of a racing car navigating to reach a target in 2D and \emph{Omnirobot} which consists of a robot circling around the target in Mujoco\cite{c16} and our self-designed robot arm \emph{Jaka}, as illustrated in Fig. \ref{fig:Environments_Demonstration}. For the ease of operation, we perform experiments on a simulation platform \emph{RobotDrlSim} \cite{c17} developed by our lab. Please check the github repository \footnote{\url{https://github.com/BillChan226/POAR-SRL-4-Robot}} for the algorithm implementation and the simulator.
\begin{figure}[ht!]
\centering
\subfigure[\emph{MobileRobot}]{\includegraphics[width=0.108\textwidth]{Image/MobileRobot.jpg}}
\subfigure[\emph{Omnirobot}]{\includegraphics[width=0.108\textwidth]{Image/Omnirobot.jpg}}
\subfigure[\emph{Jaka}]{\includegraphics[width=0.098\textwidth]{Image/Jaka_Simulation.jpg}}
\subfigure[\emph{In Real-life}]{\includegraphics[width=0.109\textwidth]{Image/Jaka_Real.jpg}}
\caption{Dynamic environments to perform experiments.}
\label{fig:Environments_Demonstration}
\vspace{-0.1in}
\end{figure}
\subsection{Quantitative Analysis}
The robot in \emph{MobileRobot} aims to reach the yellow target with as few steps as possible, by which it receives a positive reward (+1), while receiving a negative penalty (-1) when it hits the boundaries. Based on three different random seeds, we compare POAR model with both split and combination optimization strategy to end-to end PPO baseline and decoupling SRL with split strategy presented in \cite{c6}.
\begin{figure}[ht!]
\centering
\subfigure[Performance comparison in \emph{MobileRobot}.] {\includegraphics[width=0.242\textwidth]{Image/MobileRobot_Task_compare.jpg}\label{Com1}}
\subfigure[Ablation study in \emph{Omnirobot}.]{\includegraphics[width=0.225\textwidth]{Image/study_on_alpha.jpg}\label{Com2}} \\
\caption{\subref{Com1}: Results which compare POAR with original PPO and decoupling SRL method. \subref{Com2}: A study on trade off parameter $\alpha$.}
\label{fig:MobileRobotStudy}
\vspace{-0.1in}
\end{figure}
The improvement in performance of POAR model regardless of optimization strategy is illustrated in Fig. \ref{Com1}. The decoupling strategy is sensitive to splitting dimension due to the lack of a good metric to evaluate the SRL model, leading to unstable performance and over-fitting. On the contrary, since POAR can update to adapt to the task while RL agent explores to learn, it exhibits better convergent accuracy.\par
\emph{Omnirobot} learns to circle the target by optimizing (\ref{equation:cc_reward}).
\begin{equation}
r_t = \lambda \times (1-\lambda(\lVert z_t\rVert-R)^2) \times \lVert z_t - z_{t-k}\rVert^2_2 + \lambda^2 r_{t, bumped}
\label{equation:cc_reward}
\end{equation}\par
A main difference that distinguishes "Circling" from "Reaching" task is that the robot is encouraged to move away from the position after k steps. In \emph{Omnirobot}, the robot learns not only how to circle the target but also how to avoid bumping into walls, namely to learn to follow a specific trajectory, which introduces more dynamical features. We carried out a set of thorough experiments to compare the most popular RL algorithms on this typical environment.
\begin{figure}[ht!]
\centering
\includegraphics[width = 0.46\textwidth]{Image/OmnirobotEnv_Circling_Task_all_algo.jpg}
\caption{Results compared with PPO2, ACER and A2C in \emph{Omnirobot}. Bright color domain denotes one standard deviation around mean value.}
\label{fig:poar_Omnirobot_results}
\vspace{-0.05in}
\end{figure}
The results are depicted in Fig. \ref{fig:poar_Omnirobot_results}. The legends of curve denote the weights assigned to different state representation models. For instance, \emph{a10r5f1d2} denotes $w_{autoencoder}, w_{reward}, w_{forward}, w_{domain} = 10, 5, 1, 2$.
Table \ref{tab:policy_regrets} is a quantitative analysis of Fig. \ref{fig:poar_Omnirobot_results}.
\begin{table}[ht!]
\scriptsize
\centering
\caption{Quantitative Analysis on sample efficiency and rewards}
\begin{tabular}{lcc}
\textbf{SRL model} & \textbf{Policy Regrets ($\pm$ std)} & \textbf{Rewards ($\pm$ std)}\\ \hline
PPO & 1.000 ($\pm$ 0.096) & 1333.638 ($\pm$ 565.189)\\ \hline
PPO with LSTM policy & 0.936 ($\pm$ 0.025) & 497.529 ($\pm$ 24.993)\\ \hline
ACER & 14.576 ($\pm$ 0.003) & -24220.244 ($\pm$ 73.846)\\ \hline
A2C & 14.506 ($\pm$ 0.015) & -24306.119 ($\pm$ 73.744)\\ \hline
SRL-comb decoupling & 0.078 ($\pm$ 0.019) & 1855.563 ($\pm$ 24.153)\\ \hline
SRL-split decoupling & 0.080 ($\pm$ 0.009) & 1845.733 ($\pm$ 46.225)\\ \hline
\textbf{SRL Split(Our)} & \textbf{0.164} ($\pm$ \textbf{0.028}) & \textbf{1909.470} ($\pm$ \textbf{3.371})\\ \hline
SRL Combination & 0.293 ($\pm$ 0.059) & 1787.086 ($\pm$ 101.075)\\ \hline
\end{tabular}
\label{tab:policy_regrets}
\vspace{-0.2in}
\end{table}
We can see that POAR outperforms the RL baselines in terms of sample efficiency according to \emph{Policy Regret}\footnote{Policy regret, defined as the difference between the cumulative reward of the optimal policy and that gathered by $\pi$. $\int$\emph{target reward} $- \mathbb{E}[r^{\pi}(s)] \mathrm{d}s$. A smaller policy regret means a better sample efficiency}, stability and final rewards. By comparing the deviation and the smoothness of the curves, we can denote that POAR is more robust. Surprisingly, PPO with LSTM policy \cite{c22} doesn't quite exhibit an excellent performance in this sequential task as expected, probably due to the curse of dimensionality. Contrarily, thanks to the fact that POAR is equipped with forward, inverse, reward and domain resemblance priors, it can thus efficiently model the environment space and capture the dynamical changes within time steps.
\vspace{-0.15in}
\begin{figure}[ht!]
\centering
\subfigure[\label{Com3}]{\includegraphics[width=0.243\textwidth]{Image/OmnirobotEnv_Circling_Task_decoupling.jpg}}
\subfigure[\label{Jaka}]{\includegraphics[width=0.233\textwidth]{Image/Jaka_Curve.jpg}} \\
\caption{\subref{Com3}: results in \emph{Omnirobot} which compare POAR with decoupling SRL strategy of split and combination weights attribution. \subref{Jaka}: results in \emph{Jaka} that demonstrates effectiveness of domain resemblance prior.}
\label{fig:Decoupling_Compare_Study}
\vspace{-0.1in}
\end{figure}
Fig. \ref{Com3} compares POAR to the decoupling strategy with both split and combination mode. During early training stages, decoupling strategies show a strong sample efficiency regardless of split or combination mode. However, they suffer from over-fitting over the state representation at the final stage of RL training, due to the lack of exploration. In addition, it is the abundant pre-sampling that guarantees the convergence rate at the beginning of training for decoupling strategies, otherwise the bias as illustrated in Fig. \ref{Decoupling_lack} can't be overcome. Thus generally, POAR exhibits better sample efficiency, since the sampled data is leveraged to train both SRL and RL models.\par
We also compare performance on a more complex and dynamic environment \emph{Jaka}, in which the robot tries to push the button on the ground. Results in Fig. \ref{Jaka} show that ground-truth coordinate is an informative enough state representation from which we can train an efficient agent. Thus it explains why the model with \emph{domain resemblance} can outperform the one without, since a more structural perception of the environment space is built into the states.
\subsection{Qualitative Analysis}
In this subsection we provide an access for human-in-the-loop inspection, namely by monitoring the state graph iteration to diagnose current policy and SRL model. Firstly we show in Fig. \ref{fig:Reconstruction} the reconstruction result of \emph{MobileRobot} by introducing \emph{domain resemblance} loss.
\begin{figure}[ht!]
\centering
\subfigure[Original image to encode]{\includegraphics[width=0.196\textwidth]{Image/Original_Image.jpg}}
\subfigure[Reconstructed image]{\includegraphics[width=0.195\textwidth]{Image/Reconstructed_Image.jpg}} \\
\caption{Reconstruction result in \emph{MobileRobot} by introducing domain resemblance prior.}
\label{fig:Reconstruction}
\vspace{-0.1in}
\end{figure}
With such priors engaged, the interpretation of latent states is further enforced. Fig. \ref{fig:2D} is a 2D projection, using PCA, of the state inferred by the SRL encoder, which we obtained via a policy at the beginning of training POAR (at episode 200). To better demonstrate and compare the rewards' distribution, we project the learned states obtained by decoupling strategy to a 3D space, as shown in Fig. \ref{Decoupling_lack}.
\vspace{-0.15in}
\begin{figure}[ht!]
\centering
\subfigure[POAR model]{\label{fig:2D}\includegraphics[width=0.193\textwidth]{Image/State1.jpg}}
\subfigure[Decoupling strategy]{\label{Decoupling_lack}\includegraphics[width=0.279\textwidth]{Image/learned_states.png}} \\
\caption{Comparison between POAR and decoupling stategy of learned states in \emph{MobileRobot}, respectively cast into 2D and 3D.}
\label{fig:Learned_States}
\vspace{-0.05in}
\end{figure}
States learned with decoupling strategy (Fig. \ref{Decoupling_lack}) is sparser and have some holes at which the state estimator can't offer the agent with sufficient information.
Similarly, Fig. \ref{fig:circular_state} presents the evolution of state graph with POAR in \emph{Omnirobot}.
\begin{figure}[ht!]
\centering
\begin{minipage}{0.15\textwidth}
\centering
\includegraphics[width=\textwidth, height=1\textwidth]{Image/50episode_state.png}
Episode 50
\end{minipage}
\begin{minipage}{0.15\textwidth}
\centering
\includegraphics[width=\textwidth, height=1\textwidth]{Image/1000episode.png}
Episode 1000
\end{minipage}
\begin{minipage}{0.15\textwidth}
\centering
\includegraphics[width=\textwidth, height=1\textwidth]{Image/3000episode_state.png}
Episode 3000
\end{minipage}
\caption{The evolution of state graph in \emph{Omnirobot} through the course of RL training with POAR model. Each episode consists of 250 time steps of interactions. We used split dimension with $dim_{reward}: 120, \, dim_{inverse}:50, \, dim_{forward}:50$. The weights assigned on such SRL model are: $w_{autoencoder}:1,\,w_{reward}:1,\, w_{inverse}:5, \, w_{forward}:5$.}
\vspace{-0.22in}
\label{fig:circular_state}
\end{figure}
At $1000^{th}$ episode, we can observe the square boundary shape and reward distribution. At $3000^{th}$ episode, we reach a policy that achieves reasonable rewards (1830 scores within an episode). From the state at last checkpoint, we have a better understanding of the agent’s behavior: there is a specific direction that accumulates more rewards at four corners, which incites agent to circle around the center.
\subsection{Ablation Study}
\label{Sec:Ablation_Study}
As is shown in Fig. \ref{Com2}, we study how $\alpha$, a hyperparameter that balances the trade off between RL and SRL loss, influences the training result. When $\alpha = 0.001$, the SRL model can best leverage the feedback from RL to improve itself, speeding up sample efficiency and improving stability.
Table \ref{tab:policy_regrets_mobile} shows how the performance of POAR varies with respect to different weights attribution. We can denote that almost all weight choices outperform the PPO baseline, in terms of sample efficiency and final rewards.
\begin{table}[ht!]
\scriptsize
\centering
\caption{Policy regret normalized by PPO and rewards in \textit{MobileRobot}.}
\begin{threeparttable}
\begin{tabular}{cccccc}
$\bm{w}_{a}$ & $\bm{w}_{r}$ & $\bm{w}_{i}$ & $\bm{w}_{f}$ & \textbf{Policy Regrets}& \textbf{Rewards ($\pm$ std)}\tnote{1} \\ \hline
1 & 0 & 0 &0 & 1.128 ($\pm$ 0.065) \\ \hline
1&0&1&5 & 0.880 ($\pm$ 0.019) & 237.94 ($\pm$ 4.06)\\ \hline
10&0&1&1 & 0.869 ($\pm$ 0.140) & 240.32 ($\pm$ 1.11)\\ \hline
1&0&10&1 & 0.907 ($\pm$ 0.049) & 239.99 ($\pm$ 2.69)\\ \hline
1&0&1&1 & 0.940 ($\pm$ 0.105) & 234.75 ($\pm$ 3.22)\\ \hline
1&0&1&10 & 1.012 ($\pm$ 0.076) & 237.20 ($\pm$ 0.65)\\ \hline
5&0&1&1 & 0.843 ($\pm$ 0.073) & 232.12 ($\pm$ 6.12)\\ \hline
1&0&5&1 & 0.814 ($\pm$ 0.067) & 239.75 ($\pm$ 3.18)\\ \hline
5&0&1&1 & 0.843 ($\pm$ 0.073) & 232.12 ($\pm$ 6.12)\\ \hline
1&5&2&1 & 2.406 ($\pm$ 0.042) & 94.90 ($\pm$ 1.04) $^d$\\ \hline
1&5&2&1 & \textbf{0.684} ($\pm$ \textbf{0.102}) & \textbf{236.21} ($\pm$ \textbf{3.19}) $^s$\\ \hline
1&5&2&1 & \textbf{0.562} ($\pm$ \textbf{0.228}) & \textbf{235.90} ($\pm$ \textbf{4.32}) $^c$\\ \hline
\\ \hline
PPO & (Baseline) & & & 1.000 ($\pm$ 0.063) & 234.242 ($\pm$ 3.867)\\ \hline
\end{tabular}
\begin{tablenotes}
\footnotesize
\item[1] $d$ denotes decoupling strategy; $s$ denotes split mode; $c$ denotes combination mode.
\end{tablenotes}
\end{threeparttable}
\label{tab:policy_regrets_mobile}
\vspace{-0.05in}
\end{table}
\begin{figure}[ht!]
\centering
\includegraphics[width = 0.43\textwidth]{Image/Deformed_States.jpg}
\caption{State graph with different SRL weight attribution in \emph{Omnirobot}.}
\label{fig:States_Comparison}
\vspace{-0.15in}
\end{figure}
Fig. \ref{fig:States_Comparison} shows inferred abstract state trained with SRL weights partition: $w_{reward}:5, \, w_{inverse}:2, \, w_{forward}:1$ and with the same split dimension strategy as Fig. \ref{fig:circular_state}. The bias on reward model encourages state to separate points with different rewards in higher dimension. Although it has a less physical meaning for robotic, yet, it has a better sample efficiency during training.
\section*{APPENDIX}
Hyperparameter settings please refer to Table \ref{tab:hyperparameter_poar}. All other hyperparameters that are not presented on the table are the same as the PPO2 implementation of \emph{baselines} \cite{c19}.
\begin{table}[h]
\centering
\begin{tabular}{lc}
\textbf{Hyperparameter} & \textbf{Value} \\ \hline
lr (Optimizer 1) & 5e-4 \\ \hline
lr (Optimizer 2) & 2.0e-4 \\ \hline
$\alpha$ & 0.001 \\ \hline
$\beta$ & 20\\ \hline
\end{tabular}
\caption{POAR hyperparameter settings}
\vspace{-0.25in}
\label{tab:hyperparameter_poar}
\end{table}
\section*{ACKNOWLEDGMENT}
This work was supported by Shanghai Agriculture Applied Technology Development Program, China (Grant No.C2019-2-2) and National Key Research and Development Program“Robotic Systems for agriculture(RS-Agri)” (2019YFE0125200).
\input{Content/References}
\end{document} | {'timestamp': '2021-09-20T02:21:10', 'yymm': '2109', 'arxiv_id': '2109.08642', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08642'} | arxiv |
\section{Introduction}
Information extraction in non-standard domains is a challenging problem due to the large number of complex terms and unusual document structures \cite{friedrich-etal-2020-sofc}. Despite this, pretrained transformer models demonstrated robustness across languages and domains. However, these models still show their best performance when applied to targets similar to their pretraining corpora which can limit their applicability in many situations \cite{gururangan-etal-2020-dont}.
One example for this is the Spanish clinical domain, where both, language and domain, can be considered a non-standard setting in the English-centric NLP community \cite{marimon2019automatic}.
In this paper, we explore possible enhancements of transformer models to overcome this domain and language gap in the context of the MEDDOPROF shared task~\cite{meddoprof-overview}.
In particular, we participate in the first two tasks of MEDDOPROF \cite{meddoprof-overview}, a challenge concerned with the extraction, classification and normalization of job-related expressions in Spanish clinical texts. The first task \textit{NER} requires the extraction of three different kinds of occupation and the second task \textit{CLASS} demands to classify each of the previously extracted occupations into four classes reflecting the holder of that job.
We approach this challenge as \textsc{\textbf{N}either \textbf{L}anguage \textbf{N}or \textbf{D}omain \textbf{E}xperts} (NLNDE)
and model them as sequence labeling tasks.
Our solution for these tasks is a neural sequence tagger based on multilingual transformer models.
In particular, we experiment with continuing the masked language modeling pretraining of the multilingual XLM-R model~\cite{conneau-etal-2020-unsupervised} on Spanish texts, transferring trained models between the two tasks \cite{lange2021share} and using strategic datasplits \cite{wecker-etal-2020-clusterdatasplit}.
Our results highlight the importance of domain- and language-adapted transformer models, as well as the advantages of combining several models trained on challenging datasplits with ensembling techniques.
Using these methods, our best models achieve \fscore-scores of 83.2 and 79.3 for the two tasks and outperform a fine-tuned XLM-R model by 4.2 and 5.3 \fscore points, respectively.
\section{Related Work}
The MEDODPROF challenge follows a series of shared tasks on Spanish clinical information extraction, including the MEDDOCAN shared task on medical document anonymization \cite{marimon2019automatic} and the PharmaCoNER shared task on concept extraction \cite{gonzalez-agirre-etal-2019-pharmaconer,lange-etal-2019-nlnde-pharmaconer}.
Main findings of all of these challenges were that transformer models become more commonly used \cite{gonzalez-agirre-etal-2019-pharmaconer,marimon2019automatic} as they begun to dominate the field of information extraction due to their general applicability across languages and domains.
For an overview of recent approaches to low-resource NLP, we refer the refer to \cite{hedderich-etal-2021-survey}.
As the inclusion of domain knowledge via domain-specific embeddings in these special settings is often beneficial \cite{friedrich-etal-2020-sofc,lange-etal-2019-nlnde-meddocan}, we explore domain- and language-adaptive pretraining of transformer models in this paper.
Several recent works have shown that this kind of adaptation boosts performance for downstream tasks in non-standard domains by, e.g.,
pretraining with masked language modeling (MLM) objectives on documents from the target domain \cite{beltagy-etal-2019-scibert,gururangan-etal-2020-dont}.
In addition, we analyze the effects of model transfer between the first tasks of the challenge, as model transfer between related tasks in similar domains can result in significant performance gains \cite{lange2021share}.
Further, there is a line of work now questioning traditional train-dev splits \cite{gorman-bedrick-2019-need} as well as random splits \cite{sogaard-etal-2021-need}. More challenging datasplits can be created by clustering the documents based on their similarity, where each split encodes unique information to a certain degree
\cite{wecker-etal-2020-clusterdatasplit}. We use this method to train ensembles of models on these splits in a cross-validation format, such that each model has observed slightly different training instances.
\begin{figure}
\centering
\includegraphics[width=\linewidth]{system.pdf}
\caption{Overview of the NLNDE system architecture. We mark the system variants S1-S4 referring to our different submissions.
T1 and T2 refer to task 1 and task 2 of the shared task, respectively.
}
\label{fig:system}
\end{figure}
\section{Approach}
This section provides an overview of the different methods we used for the two tasks. The complete overview of our system is given in Figure 1.
\newcommand{\textit{S1}\xspace}{\textit{S1}\xspace}
\newcommand{\textit{S2}\xspace}{\textit{S2}\xspace}
\newcommand{\textit{S3}\xspace}{\textit{S3}\xspace}
\newcommand{\textit{S4}\xspace}{\textit{S4}\xspace}
\newcommand{\textit{S5}\xspace}{\textit{S5}\xspace}
\subsection{Document Preprocessing}\label{sec:prep}
Tokenization can be challenging in non-standard domains, including the clinical domain \cite{lange2020cantemist}. We thus use the XLM-R subword tokenizer and perform sequence labeling on the subtoken level with spacy for sentence segmentation. Initial experiments showed possible improvements of up to 2 \fscore points compared to NER on token level.
\subsection{Domain- and Language-specific Masked Language Modeling}
We use XLM-R \cite{conneau-etal-2020-unsupervised} as the main component of our models. XLM-R is a pretrained multilingual transformer model for 100 languages, including Spanish. It shows superior performance in different tasks across languages, and can even outperform monolingual models in certain settings.
It was pretrained on a large-scale corpus, and Spanish documents made up only 2\% of this data, as provided in Table 1.
Thus, we explore further pretraining of this model and tune it towards Spanish documents by pretraining either on (1) a medium-size Spanish corpus with general domain documents \cite{jose_canete_2019_3247731} or (2) a smaller Spanish clinical corpus consisting of the MeSpEN resources \cite{villegas2018mespen} and publicly available Scielo articles.
Note that the clinical corpus was not part of the general-domain corpus.
We use masked language modeling for pretraining and trained for three epochs over the corpora, which roughly corresponds to 30k steps for the smaller clinical corpus and 685k steps for the general-domain corpus using a batch-size of 4.
Finally, we have three XLM-R variants that we compare in this paper:
\begin{enumerate}
\item Standard \textbf{XLM-R} pretrained on 100 languages by \cite{conneau-etal-2020-unsupervised}.
\item \textbf{Spanish XLM-R} based on standard XLM-R with further pretraining using Spanish documents from the general domain.
\item Spanish \textbf{Clinical XLM-R} based on standard XLM-R with further pretraining using Spanish documents from the clinical domain.
\end{enumerate}
\begin{table}[t]
\begin{minipage}{.5\linewidth}
\caption{Sizes of Pretraining Corpora.}
\centering
\begin{tabular}{ll} \toprule
Corpus & Size \\ \midrule
Original XLM-R corpus & 2.4 TB \\
-- Spanish Subcorpus & 53.3 GB \\ \midrule
Spanish Corpus & 17.3 GB \\
Spanish Clinical Corpus & 789.2 MB \\ \bottomrule
\end{tabular}
\label{tab:sizes}
\end{minipage}
\begin{minipage}{.5\linewidth}
\caption{Hyperparameters.}
\centering
\begin{tabular}{ll} \toprule
\multicolumn{2}{c}{\textit{XLM-R}} \\
Embedding size & 1024 \\
Max. sentence length & 300 \\
Context to left/right & 100 \\ \midrule
\multicolumn{2}{c}{\textit{Optimizer}} \\
Batch size & 16 \\
Learning rate & $2e-5$ \\
$\beta_1$, $\beta_2$ & 0.9, 0.999 \\
Weight decay & 0.0 \\\midrule
\multicolumn{2}{c}{\textit{Training}} \\
Epochs & 20 \\
Early stopping & training loss \\
& \textit{or} on dev. set \\
\bottomrule
\end{tabular}
\label{tab:hyper}
\end{minipage}
\end{table}
\subsection{Sequence Tagger}
For the sequence tagger, we use one of the XLM-R models, either the standard XLM-R or one of our adapted models, and apply a CRF layer on top \cite{lafferty-etal-2001-crf}.
We add this CRF layer to address the problem of longer multi-word annotations, as job descriptions often span several tokens or, in our case, subtokens (as explained in Section 3.1). In addition, a CRF prevents inconsistencies in the labels.
We split all sentences to a maximum length of 300 subtokens and add the context of up to 100 subtokens to the left/right to get cross-sentence information.
The labels are in BIOSE encoding, which is an extended BIO encoding with additional labels for the last token of an annotation (E-) and single-token annotations (S-)
Our model architecture is basically the same across all runs. We only exchange the transformer model. The models are trained using an AdamW optimizer for a maximum of 20 epochs. Our hyperparameters are given in Table 2.
\subsection{Strategic Datasplits}
We test two options to train the sequence taggers:
(1) Using all of the available training data and stop training according to the training loss. This method provides the model with the most input instances. However, the stopping criterion is not as meaningful as using the task's metric on a held-out validation set.
(2) Thus, as our second method, we split the data into train and validation sets. Then, we train the model using only the train-fraction of all the data and use the held-out validation data to determine the best model, which is then used to annotate the test data.
As an alternative to random splits, we follow \cite{wecker-etal-2020-clusterdatasplit} and create strategic datasplits by clustering the documents according to their similarity. This creates more challenging splits, as more distant documents are left out for validation.
For this, each document is represented as the average vector of the XLM-R embeddings for each token. This document representation is reduced to five dimensions using PCA. Finally, the documents are clustered into five equally-sized splits using $k$-Means clustering.
We train five models for each task and embedding with each having a different validation split. Our splits are visualized in Figure 2. We see that clusters 1, 2 and 4 are densely populated with highly similar documents, while clusters 3 and 5 contain more distinct documents.
To better understand the strategic datasplits, we analyzed whether the different medical topics included in the corpus correlate with the splits. However, we found that the strategic clusters incorporate more diverse information than just topic similarity as there is no substantial overlap between topics and datasplits.
\begin{figure}
\centering
\includegraphics[width=0.6\linewidth]{strategic_datasplits.pdf}
\caption{Our strategic datasplits in the two-dimensional space with PCA. }
\label{fig:splits}
\end{figure}
\subsection{Ensembling of Model Predictions}
In order to capture the different advantages of multiple models, we combine them using ensembling. This is particularly helpful when models carry different types of information. For example, the models trained using our strategic datasplits all have seen a slightly different training set, and, thus, combining them using ensembling should further improve performance.
We apply ensembling by majority voting. For this, we use hard voting that counts the labels by each model and does not consider the CRF probabilities. We convert the BIOSE labels to BIO labels for the ensembling process as the simpler BIO encoding leads to fewer conflicts.
Further, we apply postprocessing of the label sequence to correct inconsistencies in the resulting label sequence and enforce for 0.23\% of predictions for the test set that the first token of each annotations begins with \textit{B-}.
\subsection{Transfer Learning}
As the first two tasks of the challenge are related and can possibly benefit from each other, we explore the potential of model transfer between them. For example, having basic knowledge of what and which occupations (task 1) are mentioned in a text can be useful to determine whether occupations are related to the patient or to someone else (task 2).
For this, we first train models on the auxiliary task and then transfer the resulting model to the targeted main task. In our case, the auxiliary task is either task 1 or 2 and the other task is the main task.
\subsection{Submissions}
The following five runs are the NLNDE submissions to the MEDDOPROF shared task. We use the same model architectures for both tasks.
Note that all submissions, except for \textit{S1}\xspace are ensembles of multiple models based on the three different embeddings.
In Section~\ref{sec:results}, we compare these submissions with further model variations.
\begin{itemize}
\item [\textit{S1}\xspace]: The Spanish clinical XLM-R model trained on the complete training data.
\item [\textit{S2}\xspace]: All three XLM-R language models combined in one ensemble (3 models).
\item [\textit{S3}\xspace]: Ensemble of models trained using strategic datasplits (15 models).
\item [\textit{S4}\xspace]: Ensemble of models based on transfer learning from the auxiliary task to the main task (3 models).
\item [\textit{S5}\xspace]: The combination of all above models into one ensemble (21 models).
\end{itemize}
\section{Results}\label{sec:results}
Our official results for the first two tasks of the MEDDOPROF shared task are given in Table 3.
In addition, we include several other models to analyze the performance of each embedding, because most of our submissions are ensembles combining all three XLM-R embeddings.
The official evaluation metric is the \fscore-score and our best models are highlighted.
We find that the Spanish XLM-R trained on general-domain Spanish data is often the best transformer compared to the standard XLM-R and the clinical one, probably because it was trained on the largest amount of data. In addition, the extraction of occupations is not unique to the clinical domain and general-domain Spanish knowledge seems to be beneficial for this as well.
We find that model transfer (\textit{S4}\xspace) is only useful when transferring models from task 1 (the detection of occupations) to task 2 (the classification of occupations). Reusing models that already learned the detection of profession expressions as an auxiliary task improves the main task, e.g., by up to 2.9 \fscore points for XLM-R.
Training models on strategic datasplits (\textit{S3}\xspace) provides the best results overall, and is even better than the ensemble of all models (\textit{S5}\xspace). The strategic datasplits improved the ensemble model \textit{S2}\xspace by 0.4 and 2.3 \fscore points for task 1 and 2. Note that this submission unintentionally contained the Spanish general-domain XLM-R models with transfer learning in the ensemble. These were trained without our strategic datasplits. The corrected results are marked with "*".
The overall best model for task 1 is the ensemble of general-domain XLM-R trained using the strategic datasplits with an \fscore-score of 83.2. This model was not submitted as a run to the shared task, but shows the importance of the language-adaptive pretraining and the usefulness of strategic datasplits.
\definecolor{Gray}{gray}{0.85}
\newcolumntype{a}{>{\columncolor{Gray}}c}
\newcommand{\bestS}[1]{\underline{#1}}
\newcommand{\best}[1]{\textbf{#1}}
\newcommand{\bestB}[1]{\underline{\textbf{#1}}}
\begin{table}
\caption{Results on the official test set. Our best submission is highlighted with underlines and the overall best model in bold. }
\centering
\begin{tabular}{l|ccc|ccc} \toprule
& \multicolumn{3}{c}{Task 1} & \multicolumn{3}{|c}{Task 2} \\
& Precision & Recall & F1 & Precision & Recall & F1 \\ \midrule
\multicolumn{7}{c}{\textit{trained on all training instances}} \\
XLM-R & 83.9 & 75.7 & 79.6 & 76.9 & 71.3 & 74.0 \\
\textbf{clinical XLM-R (S1)} & 82.5 & 76.2 & 79.2 & 81.6 & 74.0 & 77.6 \\
Spanish XLM-R & 84.5 & 76.9 & 80.5 & 80.2 & 74.6 & 77.3 \\
\textbf{ensemble of all (S2)} & 85.1 & 77.7 & 81.2 & 80.6 & 73.7 & 77.0 \\ \midrule
\multicolumn{7}{c}{\textit{transfer training}} \\
XLM-R & 82.5 & 75.2 & 78.7 & 80.8 & 73.4 & 76.9 \\
clinical XLM-R & 81.7 & 75.2 & 78.3 & 81.0 & 72.6 & 76.6 \\
Spanish XLM-R (TSX) & 81.6 & 75.0 & 78.2 & 81.5 & 74.9 & 78.1 \\
\textbf{ensemble of all (S4)} & 83.8 & 76.6 & 80.0 & 81.9 & 74.3 & 77.9 \\ \midrule
\multicolumn{7}{c}{\textit{trained on strategic datasplits}} \\
XLM-R & 83.9 & 75.0 & 79.2 & 81.2 & 74.3 & 77.6 \\
clinical XLM-R & 83.8 & 76.6 & 80.0 & 80.7 & 75.4 & 77.9 \\
Spanish XLM-R & \best{86.3} & \best{80.4} & \best{83.2} & 82.5 & \best{75.9} & 79.1 \\
ensemble of all * & \best{86.3} & 78.7 & 82.3 & 82.1 & 75.5 & 78.7 \\
\textbf{ensemble of all} + TSX \textbf{(S3)} & \bestS{85.5} & \bestS{78.3} & \bestS{81.8} & \bestB{83.0} & \bestB{75.9} & \bestB{79.3} \\ \midrule \midrule
\textbf{ensemble of all models (S5)} & 84.7 & \bestS{78.3} & 81.4 & \bestB{83.0} & 75.7 & 79.2 \\ \bottomrule
\end{tabular}
\label{tab:res-ner}
\end{table}
\section{Conclusion}
In this paper, we described our submissions for the first two tasks of the MEDDOPROF competition. By utilizing domain- and language-adaptive pretraining, strategic datasplits and ensembling methods, we were able to improve already high-performing transformer-based models by up to 5.3 \fscore points and achieved competitive results in the competition as neither language nor domain experts. Future work will include the exploration of different clinical corpora with our newly trained Spanish XLM-R models.
\section*{Acknowledgments}
The authors would like to thank the anonymous reviewer for the helpful comments and the text mining group at the barcelona supercomputing center for the smooth organization of MEDDOPROF.
\bibliographystyle{splncs04}
| {'timestamp': '2021-09-20T02:19:35', 'yymm': '2109', 'arxiv_id': '2109.08597', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08597'} | arxiv |
\section{Introduction}\label{sect1}
\hspace{5mm} Classical modeling techniques in survival analysis, such as proportional hazards model or accelerated failure time model, assume every individual under study will inevitably experience the event of interest (e.g., death, relapse, etc.). However, owing to outstanding progress in medical science over the past few decades, there often exists a fraction of subjects who do not encounter the event of interest or recurrences, even when followed-up long enough. These individuals are termed as cured or immune or long-term survivors in the literature, and models in lifetime data analysis consisting of a cure fraction are called cure models. Thus, the population under study consists of a mixture of subjects, {\it viz.}, cured and susceptible (non-cured). If we assume $I$ to be a binary random variable (r.v.) indicating cured if $I=0$ and susceptible if $I=1$, then the population survival function $S_p(y)$ can be expressed as
\begin{flalign}\label{eqx1}
S_p(y) = P(Y>y) &=\sum_{i=0}^1 P(Y>y|I=i)P(I=i) =\pi_0+(1-\pi_0)S_u(y),
\end{flalign}
where $Y$ denotes time to event, $\pi_0=P(I=0)$ represents the cured fraction or rate, and $S_u(y)=P(Y>y|I=1)$ denotes the survival function of susceptible individuals. Note that $S_u(y)$ is a proper survival function whereas $S_p(y)$ is not, since $\lim_{y \to \infty}S_p(y)=\pi_0$. The application of cure models extends beyond survival analysis to many applied fields (\citealp*{maller1996survival}). One of the primary objectives is to estimate $\pi_0$ along with lifetime parameters of such cure models. However, estimating $\pi_0$ can be complicated, and the estimates are difficult to validate as the individuals who are cured are also censored, and the information on all censored individuals is missing. Further, the definition of `cure' is implicit, varies across studies, and not always well defined. \\
\hspace{5mm} One of the earliest developments can be found in the work of \cite{boag1949maximum} in which he introduced the cure model emphasizing on the information loss in conventional five year survival rate from a clinician's viewpoint. \cite{berkson1952survival} estimated the cure fraction using a least-squares method by considering a mixture cure model, followed by \cite{haybittle1965two} who estimated the proportion of treated cancer patients surviving to a specific time with respect to the normal population. \cite{farewell1982use} mapped covariates using a logit-link to the proportion of susceptible and the lifetime distribution as Weibull. \cite{larson1985mixture} considered the failure types to be distributed as multinomial and the conditional distribution of the failure time, given the type, as piecewise exponential under proportional hazards. A semi-parametric generalization of lifetime distribution of the susceptible individuals, as suggested by \cite{farewell1982use}, was proposed by \cite{kuk1992mixture} by introducing a Cox's proportional hazards model, where the regression parameters were estimated by maximizing a Monte Carlo approximation of marginal likelihood and baseline survival function by the EM algorithm (\citealp{dempster1977maximum}). \cite{sy2000estimation} further worked with the proportional hazards model, but used a Breslow-type and product-limit estimators for estimating the baseline hazard and baseline survival functions, respectively; \cite{peng2000nonparametric} improved on the estimation technique under similar assumptions of the model. A consideration of bounded cumulative hazard function was made by \cite{tsodikov2003estimating} as an alternative to a two-component mixture model and provided an extension to the proportional hazards regression model. As opposed to the mixture cure models, \cite{chen1999new} proposed a promotion time cure model considering the underlying biological process generating the failure times based on a Poisson distribution (\citealp{yakovlev1993stochastic, yakovlev1996stochastic}). By considering a Box-Cox transformation on the population survival function, an intermediate model between a promotion time and mixture cure model was discussed by \cite{yin2005cure}. A class of semi-parametric transformation models, with proportional hazards and proportional odds promotion time cure models, as special cases was suggested by \cite{zeng2006semiparametric}. A theoretical study on the existence, consistency and asymptotic normality of the semi-parametric maximum likelihood (ML) estimator under proportional hazards set-up was done by \cite{fang2005maximum}. \cite{rodrigues2009poisson} introduced a flexible COM-Poisson cure model under competing risks scenario, and this model was studied subsequently by \cite{balakrishnan2012algorithm, balakrishnan2013expectation, balakrishnan2014algorithm}.\\
\hspace{5mm} More pragmatic alternative to cure models, called destructive cure models, was introduced by \cite{rodrigues2011destructive} with the assumption that the initial competing causes undergo a process of destruction. Specifically, let $M$ be the initial number of latent competing causes related to the event of interest. In cancer studies, often the event of interest is patient's death which can be caused by one or more malignant metastasis-component (\citealp{yakovlev1996stochastic}) tumor cells. After chemotherapy or radiation, only a portion of initial metastasis-component cells remain active and undamaged, thereby, reducing the initial number of competing causes. Given $M=m$, we may consider $X_g$ as a Bernoulli random variable (r.v.), distributed independently of $M$, which takes 1 if the $g$-th competing cause is present (i.e., if the $g$-th malignant tumor cell remains undamaged after the treatment) with probability $p \in (0, 1)$ and 0 otherwise. Thus, if we define
\begin{equation}
D = \begin{cases} X_1+ \ldots+X_M &, \mbox{if } M>0, \\
0 &, \mbox{if } M=0, \end{cases}
\end{equation}
then $D$ represents the number of initial competing causes that are not destroyed. Obviously, $D \le M$ and the conditional distribution of $D$, given $M=m$, is known as the damaged distribution that follows a binomial distribution with parameters $m$ and $p$ if $m>0$, and $P(D=0|M=0)=1$. \cite{rodrigues2011destructive} discussed the destructive cure model by considering the distribution of $M$ as weighted Poisson. The probability mass function (pmf) of $M$ following a weighted Poisson distribution is given by
\begin{equation}
P(M=m; \eta, \phi)= \begin{cases} \frac{\Omega(m; \phi)}{\mathbb{E}_{\eta}[\Omega(M; \phi)]} p^*(m; \eta) &, m=0, 1, 2, \dots, \\ 0 &,\mbox{ otherwise,} \end{cases}
\end{equation}
where $\Omega(.; \phi)$ is a non-negative weight function characterized by $\phi$ with $\phi \in \mathbb{R}$, $p^*(.; \eta)$ is the pmf of a Poisson distribution with parameter $\eta > 0$, and $\mathbb{E}_{\eta}[.]$ is expectation taken with respect to the Poisson pmf. \cite{gallardo2016algorithm} developed an EM algorithm based technique for the same model for estimating the parameters for the three special cases, {\it viz.}, destructive length-biased Poisson, destructive exponentially weighted Poisson and destructive negative binomial cure models. An extension of this model was described by \cite{borges2012correlated} by creating a correlation structure between the initiated cells using the generalized power series distribution. A Bayesian method of inference was further proposed in the context of destructive weighted Poisson cure model by \cite{rodrigues2012bayesian}. Interested readers may refer to \cite{cancho2013destructive} and \cite{pal2015likelihood, pal2016destructive, pal2016likelihood} for some further discussions in this regard.\\
\hspace{5mm} Here, we consider the initial number of competing causes $M$ to have a weighted Poisson distribution with weight function $\Omega(m; \phi)$ as $m$, $e^{\phi m}$ and $\Gamma (m+\phi^{-1})$, following \cite{pal2015likelihood, pal2016destructive, pal2016likelihood}. The corresponding models are known as destructive length-biased Poisson (DLBP), destructive exponentially weighted Poisson (DEWP) and destructive negative binomial (DNB) cure models, respectively. Given $D=d$, let $W_j$ (latent) be the time-to-event associated with the $j$-th competing cause. Now, $W_j$s are assumed to be independently and identically distributed (i.i.d.) with common cumulative distribution function (cdf) $F(w)$ and common survival function $S(w)=1-F(w)=P(W_j > w)$, for all $j=1, \ldots, d$. In order to accommodate the proportion of individuals who will not encounter the event of interest, we introduce a degenerate r.v. $W_0$ such that $P(W_0=\infty)=1$. Thus, we only observe $Y=\min\{W_0, W_1, \dots, W_D\}$ and the population survival function in this case is given by $$S_p(y)=P(Y>y)=\sum_{d=0}^\infty P(D=d) \{S(y)\}^d=G_D(S(y)),$$
where $G_D(.)$ is the probability generating function of $D$ evaluated at $S(y)$. The population density function is defined as $f_p(y)=-\frac{dS_p(y)}{dy}$. Here, $f_p(.)$ is not a proper density function, but plays a significant role in likelihood-based estimation of model parameters. The novelty of the present work lies in the fact that the model considers a proportional hazards structure with
\begin{equation}\lambda(w;\bm \gamma, \bm x)=\lambda_0(w)e^{\bm \gamma' \bm x},\end{equation}
where $\lambda(w; \bm \gamma, \bm x)$ and $\lambda_0(w)$ are the respective hazard and baseline hazard functions related to $W_j$, for all $j=1, \dots, d$, $\bm x$ is a covariate vector with corresponding parameter vector $\bm \gamma$ of same dimension. By assuming proportional hazards structure, lifetime of each subject $i$ is linked to the specific characteristic $\bm x_i, i=1, \dots, n$, intrinsic to that individual. Thus, this model is a generalization of the one considered by \cite{pal2016destructive}, which assumes lifetime distribution to be the same across all subjects in the study. Further, the model considered here enables us to verify non-homogeneity in lifetime distribution across individuals by conducting a hypothesis test for $H_0: \bm \gamma=0$ vs. $H_a:\bm \gamma \ne 0$. Recently, \cite{balakrishnan2019destructive} have studied destructive cure model with non-homogeneous lifetimes by assuming a proportional odds structure under the cure rate scenario. Owing to the flexibility and robustness imparted by the shape and scale parameters, a Weibull distribution is widely used in survival analysis to model lifetimes, and for this reason we consider the baseline hazard function $\lambda_0(w)$ to be a Weibull hazard function. \\
\hspace{5mm} The rest of the paper proceeds as follows. Model assumptions and formulation are explained in Section \ref{sect2}. The form of the data and the likelihood function are described in Section \ref{sect3}, while the method of estimation of model parameters using EM algorithm and computation of asymptotic standard error (SE) of the estimates of parameters are provided in Section \ref{sect4}. The proposed model and inferential methods are applied to a real-life data set obtained from a cutaneous melanoma study, and this is discussed in Section \ref{sect5}. An extensive simulation study is carried out with various settings for examining the accuracy of the estimation method, and the pertinent details are given in Section \ref{sect6}. A model discrimination is performed and discussed in Section \ref{sect7}. Finally, some concluding remarks are made in Section \ref{sect8}.
\section{Model description}\label{sect2}
\subsection{Cure models}\label{sect2_1}
\hspace{5mm} As mentioned in the last section, $M$ is assumed to follow a weighted Poisson distribution with three candidate weight functions $m$, $e^{\phi m}$ and $\Gamma(m + \phi^{-1})$. The corresponding three models possess the following forms and properties.
\subsubsection{Destructive length-biased Poisson cure model}\label{subsect2.1.1}
\hspace{5mm}Assuming $\Omega(m; \phi)=m$, the pmf of $M$ is given by
\begin{equation}
P(M=m; \eta, \phi)= \begin{cases} \frac{e^{-\eta} \eta^{m-1}}{(m-1)!} &, m= 1, 2, \dots \\ 0 &,\mbox{ otherwise,} \end{cases}
\end{equation}
which is a shifted Poisson distribution, shifted by 1. Because $(D|M=m) \sim $ Bernoulli($m$, $p$), the unconditional pmf of $D$, i.e., the number of active competing causes, is given by
\begin{flalign}
P(D=d; \eta, \phi, p) = & \sum_{m=d}^\infty P(D=d|M=m)P(M=m)\nonumber \\
=& \sum_{m=d}^\infty \frac{m!}{(m-d)!d!}p^d(1-p)^{m-d}\frac{e^{-\eta} \eta^{m-1}}{(m-1)!}\nonumber \\
=& \frac{e^{-\eta p}(\eta p)^d}{d!}\left(1-p+ \frac{d}{\eta}\right),\text{ } d=0, 1, 2, ...
\end{flalign}
The cure rate is then given by \begin{equation}\label{eqxx7.5}\pi_0 = P(D=0)=e^{-\eta p}(1-p),\end{equation} while the population survival and density functions are
\begin{equation}\label{eqx8}
S_p(y)= e^{-\eta p F(y)}\{1-p F(y)\}
\end{equation}
and
\begin{equation}\label{eqx9}
f_p(y) = \eta p f(y)e^{-\eta p F(y)}\left\{1-p F(y)-\frac{pf(y)}{\eta}\right\},
\end{equation}
where $f(.)$ is the common probability density function (pdf) of $W_j$, for all $j=1, 2, \dots, d$.
\subsubsection{Destructive exponentially weighted Poisson cure model}\label{subsect2.1.2}
\hspace{5mm}Under this model, we assume $\Omega(m; \phi)=e^{\phi m}$ as the weight function, which gives the pmf of $M$ as
\begin{equation}
P(M=m; \eta, \phi)= \begin{cases}e^{-\eta e^{\phi}}\frac{(\eta e^{\phi})^m}{m!} &, m= 0, 1, 2, \dots \\ 0 &,\mbox{ otherwise.} \end{cases}
\end{equation}
This is readily seen to be a Poisson distribution with rate parameter $\eta e^{\phi}$. The unconditional distribution of the undamaged number of initial competing causes $D$ is given by
\begin{flalign}\label{eqx10}
P(D=d; \eta, \phi, p)=& \sum_{m=d}^\infty \frac{m!}{(m-d)!d!}p^d(1-p)^{m-d}e^{-\eta e^{\phi}}\frac{(\eta e^{\phi})^m}{m!}\nonumber \\
= & e^{-\eta p e^{\phi}}\frac{(\eta p e^{\phi})^d}{d!},\text{ } d=0, 1, 2, ...,
\end{flalign}
which is a Poisson distribution with rate parameter $\eta p e^{\phi}$. Consequently,
\begin{equation}\label{eqxx9.5}
\pi_0=e^{-\eta p e^{\phi}},
\end{equation}
\begin{equation}\label{eqx10.1}
S_p(y)=e^{-\eta p e^{\phi}F(y)}
\end{equation}
and
\begin{equation}\label{eqx11}
f_p(y)=\eta p e^{\phi}f(y)e^{-\eta p e^{\phi}F(y)}.
\end{equation}
Note that the model reduces to a destructive Poisson cure model if $\phi=0$. Furthermore, the choice of $p=1$ in (\ref{eqx10}) yields Poisson or promotion-time cure model.
\subsubsection{Destructive negative binomial cure model}\label{subsect2.1.3}
\hspace{5mm}Let us consider
\begin{equation} \label{eqx14}
P(M=m; \eta, \phi)= \begin{cases} \frac{\Gamma(m+\phi^{-1})}{\Gamma \phi^{-1}m!}\left(\frac{\phi \eta}{1+ \phi \eta}\right)^m (1+\phi \eta)^{-\phi^{-1}} &, m= 0, 1, 2, \dots \\ 0 &,\mbox{ otherwise,} \end{cases}
\end{equation}
where $M$ is a negative binomial r.v. with parameters $\phi^{-1}$ and $\frac{\phi \eta}{1+ \phi \eta}$. This is also a weighted Poisson distribution with parameter $\frac{\phi \eta}{1+ \phi \eta}$ and the weight function $\Omega(m; \phi)=\Gamma(m+ \phi^{-1})$, $\phi >0$.
Hence, the unconditional pmf of $D$ is given by
\begin{flalign}\label{eqx15}
P(D=d; \eta, \phi, p) =& \sum_{m=d}^\infty P(D=d|M=m)P(M=m)\nonumber \\
= & \frac{p^d}{d!} \left(\frac{\phi \eta}{1+\phi \eta}\right)^d (1+\phi \eta)^{-\phi^{-1}} \sum_{m=d}^{\infty}\frac{\Gamma(m+ \phi^{-1})}{(m-d)!\Gamma(\phi^{-1})} \left[\frac{(1-p) \phi \eta}{1+\phi \eta}\right]^{m-d} \nonumber \\
&= \frac{\Gamma(d+\phi^{-1})}{\Gamma \phi^{-1}d!}\left(\frac{p \phi \eta}{1+ p \phi \eta}\right)^d (1+p\phi \eta)^{-\phi^{-1}},\text{ } d=0, 1, 2, ...
\end{flalign}
Evidently, $D$ has a negative binomial distribution with parameters $\phi^{-1}$ and $\frac{p\phi \eta}{1+ p\phi \eta}$. The corresponding cure rate, population survival function and population density function are given by
\begin{equation}\label{eqx16}
\pi_0=(1+p \eta \phi)^{-\phi^{-1}},
\end{equation}
\begin{equation}\label{eqx17}
S_p(y)=(1+p \eta \phi F(y))^{-\phi^{-1}}
\end{equation}
and
\begin{equation}\label{eqx18}
f_p(y)=\eta pf(y) (1+p \eta \phi F(y))^{-(\phi^{-1}+1)}.
\end{equation}
Note that this destructive negative binomial cure model includes destructive geometric ($\phi=1$), negative binomial ($p=1$) and geometric ($\phi=1$ and $p=1$) cure models all as special cases. \\
\subsection{Modeling lifetimes}\label{subsect2.2}
\hspace{5mm}Given $D=d$, we assume the hazard function $\lambda(.; \bm x, \bm z, \bm \gamma_2, \bm \gamma_3)$ of $W_j$ ($j=1, \dots, d$) to follow proportional hazards structure, i.e.,
\begin{equation}\label{eqxx20}
\lambda(w; \bm x, \bm z, \bm \gamma_2, \bm \gamma_3) = \lambda_0(w)e^{\bm \gamma_2' \bm x+\bm \gamma_3' \bm z},
\end{equation}
where $\bm \gamma_2=(\gamma_{21}, \dots, \gamma_{2q_1})' \in \mathbb{R}^{q_1}$, $\bm \gamma_3=(\gamma_{31}, \dots, \gamma_{3q_2})'\in \mathbb{R}^{q_2}$, and $\bm x$ and $\bm z$ are respectively $q_1$ and $q_2$ dimensional covariate vectors, with $\lambda_0(w)$ being the baseline hazard function which does not depend on the covariates $\bm x$ and $\bm z$. The reasons for splitting the covariates into two parts, $\bm x$ and $\bm z$, and for considering $\bm \gamma_2$ and $\bm \gamma_3$ without the intercept terms are discussed in Section \ref{sect3}. In the literature, $\lambda_0(.)$ has been estimated by assuming either some well-known fully parametric distributions (\citealp{farewell1982use, balakrishnan2013lognormal, balakrishnan2013expectation, pal2016likelihood}), or by non-parametric methods (\citealp{kuk1992mixture, sy2000estimation, fotios}). In this article, we assume $\lambda_0(w)$ to be a Weibull hazard function of the form
$$\lambda_0(w)=\lambda_0(w; \gamma_0, \gamma_1)=\gamma_0 {\gamma_1}^{-\gamma_0} {w}^{\gamma_0-1}, w>0, $$ where $\gamma_0>0$ and $\gamma_1>0$ are the respective shape and scale parameters of the Weibull distribution. The Weibull distribution is closed under proportional hazards when the shape parameter remains constant. Moreover, a two-parameter Weibull distribution provides a great degree of flexibility to the lifetimes of susceptible individuals since it includes cases of decreasing ($\gamma_0 < 1$), constant ($\gamma_0=1$, i.e., exponential distribution) and increasing ($\gamma_0 > 1$) failure rates. Let us denote $\bm \gamma=(\gamma_0, \gamma_1, \bm \gamma'_2, \bm \gamma'_3)'$. Thence,
\begin{equation}\label{eqx21}
\lambda(w; \bm x, \bm z, \bm \gamma)= \gamma_0 \left(\gamma_1 e^{-\frac{\bm \gamma_2' \bm x+ \bm \gamma_3' \bm z}{\gamma_0}}\right)^{-\gamma_0} w^{\gamma_0-1}
\end{equation}
is also a Weibull hazard function with shape $\gamma_0$ and scale $\gamma_1e^{-\frac{\bm \gamma_2' \bm x+\bm \gamma_3' \bm z}{\gamma_0}}$. Consequently, for $w>0$,
\begin{flalign}\label{eqx22}
S(w)=S(w; \bm x, \bm z, \bm \gamma)&=\exp \left\{-w^{\gamma_0}\left(\gamma_1e^{-\frac{\bm \gamma_2' \bm x+\bm \gamma_3' \bm z}{\gamma_0}}\right)^{-\gamma_0} \right\},
\end{flalign}
\begin{flalign}\label{eqx23}
F(w)=F(w; \bm x, \bm z, \bm \gamma)&=1-\exp \left\{-w^{\gamma_0}\left(\gamma_1e^{-\frac{\bm \gamma_2' \bm x+\bm \gamma_3' \bm z}{\gamma_0}}\right)^{-\gamma_0} \right\}
\end{flalign}
and
\begin{flalign}\label{eqx24}
f(w)=f(w; \bm x, \bm z, \bm \gamma)=\gamma_0 \left(\gamma_1 e^{-\frac{\bm \gamma_2' \bm x+ \bm \gamma_3' \bm z}{\gamma_0}}\right)^{-\gamma_0} w^{\gamma_0-1} \exp \left\{-w^{\gamma_0}\left(\gamma_1e^{-\frac{\bm \gamma_2' \bm x+\bm \gamma_3' \bm z}{\gamma_0}}\right)^{-\gamma_0} \right\}
\end{flalign}
are the corresponding common cdf, survival function and pdf of each $W_j$, $j=1, \dots, d$.\\
\hspace{5mm} \cite{pal2016destructive, pal2016likelihood} proceeded by assuming the lifetime distribution of $W_j$s to be Weibull that is identical for all individuals. However, by linking the covariates to the lifetime distribution of $W_j$ using the model in (\ref{eqxx20}), a greater degree of flexibility is added to the model, as the lifetime of the susceptible is different for each individual depending on the values of covariates. Then, testing the hypothesis $H_0: (\bm \gamma_2', \bm \gamma_3') = \bm 0$ would enable us to infer on the homogeneity of the lifetime distributions across all subjects.\\
\section{Observed data and likelihood functions}\label{sect3}
\hspace{5mm} In clinical studies, right censoring occurs commonly due to patient's discontinuation, duration of study, or lost to follow-up. For this reason, we assume non-informative right censored data in our analysis. In general, for $i=1, \dots, n$, if we consider $Y_i$ to be the actual lifetime and $C_i$ to be the censoring time corresponding to the $i$-th individual, then time to event $T_i$ is defined as $$T_i=\min\{Y_i, C_i\}.$$ The censoring indicator is given by $\delta_i=I(T_i \le C_i)$ which takes value 1 when the actual lifetime is observed and 0 when the lifetime is right censored at time $C_i$ for the $i$-th individual. \\
\hspace{5mm} For $i=1, \dots, n$, two sets of covariates $\bm x_i=(x_{i1}, \dots, x_{iq_1})'$ and $\bm z_i=(z_{i1}, \dots, z_{iq_2})'$ are linked to the parameters $p$ and $\eta$ such that $\eta_i=e^{\bm \alpha' \bm z_i}$ is linked using a log-linear function while $p_i=\frac{e^{\bm \beta' \bm x_i}}{1+e^{\bm \beta' \bm x_i}}$ is linked using a logit function, where $\bm \alpha=(\alpha_1, \dots, \alpha_{q_2})'$ and $\bm \beta=(\beta_0, \beta_1, \dots, \beta_{q_1})'$ are now new model parameters. To circumvent the issue of non-identifiability of parameters associated with DEWP, DLBP or DNB cure models, $\bm \alpha$ is taken without an intercept term and covariate $\bm x_i$ is assumed to be disjoint of $\bm z_i$ in the sense that they have no common elements (see \citealp{li2001identifiability}). The observed data for $n$ individuals is then of the form $(t_i, \delta_i, \bm x_i', \bm z_i')'$, $i=1, \dots, n$. Thence, the observed data likelihood function can be expressed as
\begin{equation}\label{eqx25}
L(\bm \theta; \bm t, \bm \delta, \bm X, \bm Z) \propto \prod_{i=1}^n f_p(t_i; \bm x_i, \bm z_i, \bm \theta)^{\delta_i}S_p(t_i; \bm x_i, \bm z_i, \bm \theta)^{1-\delta_i},
\end{equation}where $\bm \theta=(\bm \alpha', \bm \beta', \bm \gamma', \phi)'$, $\bm \alpha = (\alpha_1, \dots, \alpha_{q_2})'$, $\bm \beta=(\beta_1, \dots, \beta_{q_1})'$, $\bm \gamma=(\gamma_0, \gamma_1, \bm \gamma'_2, \bm \gamma'_3)'$, $\bm \gamma_2=(\gamma_{21}, \dots, \gamma_{2q_1})'$, $\bm \gamma_3=(\gamma_{31}, \dots, \gamma_{3q_2})'$, $\bm t=(t_1, \dots, t_n)'$, $\bm \delta=(\delta_1, \dots, \delta_n)'$, $\bm X=(\bm x_1, \dots, \bm x_n)$ and $\bm Z=(\bm z_1, \dots, \bm z_n)$. In (\ref{eqx25}), $f_p(t_i; \bm x_i, \bm z_i, \bm \theta)=f_p(t_i)$ and $S_p(t_i; \bm x_i, \bm z_i, \bm \theta)=S_p(t_i)$ are given by (\ref{eqx8}), (\ref{eqx9}), (\ref{eqx10}), (\ref{eqx11}), (\ref{eqx17}), (\ref{eqx18}), (\ref{eqx22}), (\ref{eqx23}) and (\ref{eqx24}).\\
\section{Estimation of parameters and standard errors of estimates}\label{sect4}
\hspace{5mm}We implement the EM algorithm for estimating $(\bm \alpha', \bm \beta', \bm \gamma')'$ while $\phi$ is estimated using profile likelihood method. The missing data are introduced by defining indicators $I_i$ that take 0 if the $i$-th individual is cured and 1 otherwise. Note that $I_i=1$ for $i \in \Delta_1$, but $I_i$ is unobserved for $i \in \Delta_0$, with $\Delta_1=\{i: \delta_i=1\}$ and $\Delta_0=\{i: \delta_i=0\}$. For any $i=1, \dots, n$, $\pi_0=\pi_0(\bm \alpha, \bm \beta; \bm x_i, \bm z_i)$ can be obtained from (\ref{eqxx7.5}), (\ref{eqxx9.5}) and (\ref{eqx16}) for the three cure models described in Section \ref{sect2}. Further, let us denote $\bm I=(I_1,\ldots,I_n)'$. \\
\hspace{5mm}With the complete data denoted by $\{(t_i, \delta_i, \bm x_i', \bm z_i', I_i)',\text{ } i=1, \dots, n\}$, the complete data likelihood function is given by
\begin{equation}
\begin{aligned}\label{eqx26}
& L_c(\bm \theta; \bm t, \bm x, \bm z, \bm \delta, \bm I ) \\ & \propto \prod_{i \in \Delta_1} f_p(t_i; \bm x_i, \bm z_i, \bm \theta) \prod_{i \in \Delta_0} \pi_0(\bm \alpha, \bm \beta; \bm x_i, \bm z_i)^{1-I_i}\{(1-\pi_0(\bm \alpha, \bm \beta; \bm x_i, \bm z_i))S_u(t_i; \bm x_{i}, \bm z_i, \bm \theta)\}^{I_i}\\
\end{aligned}
\end{equation}and the complete data log-likelihood function is then
\begin{equation}
\begin{aligned}
\label{eqx27}
l_c(\bm \theta; \bm t, \bm x, \bm z, \bm \delta, \bm I) = &\quad \text{constant} + \sum_{i \in \Delta_1} \log f_p(t_i; \bm x_i, \bm z_i, \bm \theta) + \sum_{i \in \Delta_0} (1-I_i)\log \pi_0(\bm \alpha, \bm \beta; \bm x_i, \bm z_i) \\&+\sum_{i \in \Delta_0} I_i\log (1-\pi_0(\bm \alpha, \bm \beta; \bm x_i, \bm z_i)) +\sum_{i \in \Delta_0} I_i \log S_u(t_i; \bm x_{i}, \bm z_i, \bm \theta),
\end{aligned}
\end{equation}
where $S_u(t_i; \bm x_{i}, \bm z_i, \bm \theta)=\frac{S_p(t_i; \bm x_{i}, \bm z_i, \bm \theta)-\pi_0(\bm \alpha, \bm \beta; \bm x_i, \bm z_i)}{1-\pi_0(\bm \alpha, \bm \beta; \bm x_i, \bm z_i)}$ using (\ref{eqx1}). Now, the steps of the EM algorithm proceed as follows.\\
\hspace{5mm}{\it \bf E-step:} For a fixed value $\phi_0$ of $\phi$ and at the $(a+1)$-th iteration of the EM algorithm, we compute the expected value of $l_c(\bm \theta; \bm t, \bm x, \bm z, \bm \delta, \bm I)$, given the observed data ${\bm O}=\{ (t_i, \delta_i, \bm x_i', \bm z_i', I_{i^*})': i=1,\dots, n, {i^*} \in \Delta_1\}$ and the current parameter estimates $\hat{\bm \theta}^{*(a)}$ obtained from the $a$-th iteration, where $\bm \theta^{*}=(\bm \alpha', \bm \beta', \bm \gamma')'$. Therefore, from (\ref{eqx27}), we obtain
\begin{equation}
\begin{aligned}
\label{eq:4_2}
\mathbb{E}\left(l_c(\bm \theta; \bm t, \bm x, \bm z, \bm \delta, \bm I)\vert \hat{\bm \theta}^{*(a)}, \bm O\right) &= \text{constant} + \sum_{i \in \Delta_1} \log f_p(t_i; \bm x_i, \bm z_i, \bm \theta) + \sum_{i \in \Delta_0} \left(1-\xi_i^{(a)}\right)\log \pi_0(\bm \alpha, \bm \beta; \bm x_i, \bm z_i) \\&+\sum_{i \in \Delta_0} \xi_i^{(a)}\log \left(1-\pi_0(\bm \alpha, \bm \beta; \bm x_i, \bm z_i)\right) +\sum_{i \in \Delta_0} \xi_i^{(a)} \log S_u(t_i; \bm x_{i}, \bm z_i, \bm \theta),
\end{aligned}
\end{equation}where
\begin{equation}
\begin{aligned}
\xi_i^{(a)}=\mathbb{E}\left(I_i|\hat{\bm \theta}^{*(a)}, {\bm O}\right)=\frac{(1-\pi_0(\bm \alpha, \bm \beta; \bm x_i, \bm z_i))S_u(t_i; \bm x_{i}, \bm z_{i}, \bm \theta)}{S_p(t_i; \bm x_i, \bm z_i, \bm \theta)}\bigg \rvert_{\bm \theta^{*}=\hat{\bm \theta}^{*(a)}}.
\nonumber
\end{aligned}
\end{equation}
Define $Q\left(\bm \theta^{*}, \bm \xi^{(a)}\right)=\mathbb{E}\left(l_c(\bm \theta; \bm t, \bm x, \bm z, \bm \delta, \bm I ) \vert \hat{\bm \theta}^{*(a)}, \bm O\right)$, where $\bm \xi^{(a)}=\left(\xi_i^{(a)}: i \in \Delta_0\right)'$.\\
\hspace{5mm}{\it \bf M-step:} In the maximization step, we maximize $Q(\bm \theta^{*}, \bm \xi^{(a)})$ with respect to $\bm \theta^{*}$ for finding the ML estimate $\hat{\bm \theta}^{*(a+1)}$ of $\bm \theta^{*}$ at the $(a+1)$-th step of iteration. The numerical maximization is carried out using Nelder-Mead or Quasi-Newton method, for fixed $\phi_0$. Explicit expressions for $Q(\bm \theta^{*}, \bm \xi^{(a)})$, and the first-order and second-order partial derivatives of $Q(\bm \theta^{*}, \bm \xi^{(a)})$ are presented in Appendices \ref{A3}, \ref{B3} and \ref{C3}, respectively. The iterative process gets terminated at the $(a+1)$-th step if $$ \max_{1 \le k' \le p^*} \left| \frac{ \hat{\theta}_{k'}^{*(a+1)}-{\hat{\theta}_{k'}^{*(a)}}}{ {\hat{ \theta}_{k'}^{*(a)}}}\right| < \epsilon, \text{ }a=1,2, \dots,$$ for some pre-fixed tolerance value of $\epsilon$, where $\hat{\theta}^{*(a')}_{k'}$ is the $k'$-th component of $\hat{\bm \theta}^{*(a')}$ and $p^*$ denotes the dimension of $\bm \theta^*$. \\
\hspace{5mm} The estimation of $\phi$ is carried out using the profile likelihood approach since the likelihood function is relatively flat with respect to $\phi$. The {\it E-step} and {\it M-step} are then repeated for all $\phi \in \Phi$, where $\Phi$ denotes the admissible range of $\phi$. The value of $\phi \in \Phi$ that provides the maximum value of the observed log-likelihood function is accepted as the ML estimate $\hat \phi$ of $\phi$. For the DEWP cure model, we made use of the ranges $\Phi=\{-2.0, -1.9, \dots, 2.0\}$, while for the DNB cure model, $\Phi=\{0.10, 0.15, \dots, 7.00\}$.\\
\hspace{5mm} Under suitable regulatory conditions, it can be established that the ML estimator $\bm {\hat \theta}^*$ of ${\bm \theta}^*$ follows an asymptotic multivariate normal distribution with mean vector $\bm \theta^*$ and covariance matrix $\Sigma(\hat {\bm\theta}^*)$, with an estimate of $\Sigma(\hat {\bm \theta}^*)$ being
$$ \hat \Sigma(\hat {\bm \theta}^*)= \left\{-\frac{\partial ^2 \log L(\bm \theta; \bm t, \bm \delta, \bm X, \bm Z)}{\partial \bm \theta^* \partial \bm \theta^{*\bm '}}\right\}^{-1}\Bigg \vert_{ {\bm \theta}^*= \hat {\bm \theta}^*}.$$
For $\alpha' \in (0,1)$, $100(1-\alpha')\%$ confidence interval (C.I.) of the parameters can then be readily constructed by using the asymptotic normality of the ML estimators.
\section{Analysis of cutaneous melanoma data}\label{sect5}
\hspace{5mm} For the purpose of illustration of the models and the method of inference developed, we consider the data set `melanoma' available in the \texttt{timereg} package in R. The data set contains information from a historically prospective clinical study in the period 1962-1977 on malignant melanoma with $225$ patients (\citealp{andersen2012statistical}). The following variables are present in the data set: survival time since operation (in years), tumor thickness (in cm), censoring status ($1 \equiv$ died from the disease, $2\equiv$ alive at the end of the study, $3 \equiv$ died from unrelated causes), ulceration status ($1\equiv$ ulcer present, $0\equiv$ ulcer absent), sex ($1\equiv$ male, $0 \equiv$ female), age (in years) and year of operation. Out of $225$ patients, $20$ subjects did not have histological evaluation. Among the remaining $205$ patients, $57$ patients died before the end of $1977$ and the censoring proportion is thus $72.19\%$.\\
\hspace{5mm} The observed time (in years) refers to the time since operation till patient's death or the censoring time, with corresponding mean and standard deviation (s.d.) as $5.89$ and $3.07$ years, respectively. For our analysis, ulceration status $z$ (absent: $n=115$; present: $n=90$) and tumor thickness $x$ (in mm) are selected as covariates for the study. $44\%$ of the patients had ulceration status present at the beginning of the study. For this group, mean and s.d. of the tumor thicknesses are $4.34$ mm and $3.22$ mm, respectively. For the group with ulceration status as absent, the mean and s.d. of the tumor thicknesses are $1.81$ mm and $2.19$ mm, respectively. The histograms of the tumor thickness for both the groups show positively skewed distributions. Figure \ref{f:41} represents the Kaplan-Meier (KM) plot categorized by the ulceration status, which possibly indicates the presence of cure proportion in the data. \\
\begin{figure}
\centering
\includegraphics[width=10cm]{KM3.png}
\caption{KM plot categorized by the ulceration status}
\label{f:41}
\end{figure}
\hspace{5mm} Note that $\phi=0$ reduces DEWP cure model to the usual destructive Poisson (DP) cure model, studied originally by \cite{rodrigues2011destructive}. Similarly, we obtain exponentially weighted Poisson (EWP) and Poisson cure models by setting $p=1$ and $(p=1, \phi=0)$, respectively. Destructive geometric (DG), negative binomial (NB) and geometric cure models are obtained from the DNB cure model by considering $\phi=1$, $p=1$ and $(\phi=1, p=1)$, respectively. $p=1$ represents cases wherein no destructive mechanism of the malignant cells is involved. When $p=1$, we link both the covariates to $\eta$ using log-linear link function of the form $\eta=\exp(\beta_0+ \beta_1 x + \alpha z)$. \\
\hspace{5mm} In Table \ref{T:41}, the number of parameters fitted ($\tilde k$), maximized log-likelihood ($\hat l$) values, Akaike's Information Criterion (AIC) and Bayesian Information Criterion (BIC) values for all fitted models, including all sub-models, are presented. For $\hat \phi=5.2$, the DNB cure model provides the best fit to the data with highest maximized log-likelihood ($-199.108$) and minimum AIC ($414.216$) values. The estimate, standard error (SE), lower confidence limit (LCL) and upper confidence limit (UCL) of all parameters for the three main models are presented in Table \ref{T:42}. For validating heterogeneity among the lifetimes of susceptible individuals, we carry out a test of hypothesis $H_0: \gamma_2=\gamma_3=0$ vs. $H_1: \text{at least one inequality in } H_0$ for the DNB model with $\phi=5.2$. The resultant $p$-value of the test is $0.061$, indicating rejection of $H_0$ at 10\% level, and the corresponding maximized log-likelihood value for the reduced model is $-201.908$. Moreover, on testing $H_0:\phi=0$ for the full DNB model, we found the $p$-value to be $0.027$ which does reveal that DNB models provide a better fit than the DG model for this data. It can be observed from Table \ref{T:41} that incorporating destructive mechanism to the cure models have resulted in better log-likelihood, AIC and BIC values, which justifies the practicality of applying destructive cure models over regular cure models. \\
\begin{table}[htbp]
\caption{Maximized log-likelihood ($\hat l$), AIC and BIC values for some destructive cure models}
\centering
\begin{tabular*}{\textwidth}{l @{\extracolsep{\fill}} cccc} \hline
{ Fitted Model \qquad} & ${ {\tilde k}} $ & $ \hat { l}$ & { AIC} & { BIC}\\
\hline
DEWP ($\hat \phi = -0.7$) \qquad & 8 & -202.253 & 420.506 & 447.090\\
\quad DP & 7 & -203.433 & 420.865 & 444.126 \\
\quad EWP ($\hat\phi=-1.5$) & 8 & -205.054 & 426.108 & 452.693 \\
\quad Poisson & 7 &-205.054 & 424.108 & 447.370 \\
\hline
DLBP & 7 & -204.979 & 423.959 & 447.220 \\
\hline
DNB ($\hat \phi=5.2$) & 8 & {\bf -199.108} & {\bf 414.216} & 440.800\\
\quad DG &7 & -201.536 & 417.073 & {\bf 440.334}\\
\quad NB ($\hat \phi = 6.9$) &8 & -199.973 & 415.946 & 442.531\\
\quad Geometric &7 & -204.027 & 422.053 & 445.314\\
\hline
\end{tabular*}
\label{T:41}
\end{table}
\begin{table}[htbp]
\caption{ Estimate, SE, LCL and UCL for DEWP, DLBP and DNB cure models for the cutaneous melanoma data}
\begin{tabular*}{\textwidth}{ c @{\extracolsep{\fill}} c c c c c c c c c }
\hline
{Fitted Model} & { Measure} & $\alpha$ & $\beta_0$ & $\beta_1$ & $\gamma_0$ & $\gamma_1$ & $\gamma_2$ & $\gamma_3$ & $\phi$ \\
\hline
& EST & 0.761 & -1.985 & 1.265 & 1.845 & 7.423 & 0.112 & 0.305 & -0.7 \\
DEWP & SE & 0.218 &0.909 & 0.646 & 0.219 & 1.904 & 0.043 & 0.492 & -\\
& LCL & 0.333 & -3.768 & -0.002 & 1.414 & 3.689 & 0.027 &-0.660 & - \\
& UCL & 1.188 & -0.202 & 2.532 & 2.276 & 11.156 & 0.196 & 1.270 & -\\
\hline
& EST & 1.527 & -2.119 & 0.081 & 1.822 & 8.011 & 0.115 & 0.433 & - \\
DLBP & SE & 0.529 & 0.454 & 0.053 & 0.224 & 2.723 & 0.046 & 0.611 & - \\
& LCL & 0.489 & -3.009 & -0.023 & 1.382 & 2.672 & 0.024 & -0.765 & - \\
& UCL & 2.565 & -1.229 & 0.186 & 2.263 & 13.349 & 0.207 & 1.633 & - \\
\hline
& EST & 3.670 & -2.602 & 1.081 & 2.845 & 7.282 & 0.192 & -1.596 & 5.2 \\
DNB & SE & 1.205 & 0.925 & 0.537 & 0.328 & 1.342 & 0.071 & 1.236 & - \\
& LCL & 1.306 & -4.416 & 0.027 & 2.201 & 4.650 & 0.052 & -4.019 & - \\
& UCL & 6.033 & -0.788 & 2.136 & 3.489 & 9.913 & 0.332 & 0.826 & - \\
\hline
\end{tabular*}
\label{T:42}
\end{table}
\hspace{5mm} Table \ref{T:43} demonstrates the effects of using different link functions (L1-L4) on maximized log-likelihood value for the main three destructive cure models. Considering all four possible combinations, we found link L1 (see Section \ref{sect3}) provided large $\hat l$ consistently. Because the DNB cure model with $\hat \phi=5.2$ provided the best fit with link L1, we use this link for all our subsequent analyses.\\
\begin{table}[htbp]
\caption{Maximized log-likelihood values for destructive cure models with various link functions}
\begin{tabular*}{\textwidth}{ l @{\extracolsep{\fill}}c c c }
\hline
Link Function & Model & $\hat \phi$ & $ \hat { l}$ \\
\hline
\multirow{3}{*}{L1: $\eta=e^{\alpha z}, \frac{e^{\beta_0+\beta_1 x}}{1+e^{\beta_0+\beta_1 x}}^{**}$ } & DEWP &-0.7 & -205.253\\
& DLBP & - & -204.979 \\
& DNB & 5.2 & -199.108\\
\hline
\multirow{3}{*}{L2: $\eta=e^{\alpha x}, \frac{e^{\beta_0+\beta_1 z}}{1+e^{\beta_0+\beta_1 z}}$} & DEWP & -0.4 & -205.055 \\
& DLBP & - &-208.289 \\
& DNB & 6.9 & -199.962\\
\hline
\multirow{3}{*}{L3: $\eta=e^{\alpha_0 + \alpha_1 z}, \frac{e^{\beta x}}{1+e^{\beta x}}$ } & DEWP & -1.0 & -203.994\\
& DLBP & - & -206.786 \\
& DNB & 7.2 & -201.085\\
\hline
\multirow{3}{*}{L4: $\eta=e^{\alpha_0 + \alpha_1 x}, \frac{e^{\beta z}}{1+e^{\beta z}}$ } & DEWP & -0.2 & -205.302 \\
& DLBP & - & -206.667 \\
& DNB & 6.4 & -200.313\\
\hline
\end{tabular*}
\raggedright{ { \footnotesize $^{**}$This link is used for subsequent analyses.}}
\label{T:43}
\end{table}
\hspace{5mm} We choose three representative values of the tumor thickness: $0.320$, $1.940$ and $8.320$ mm corresponding to the $5$-th, $50$-th and $95$-th percentiles, and plot corresponding long-term survival functions stratified by the ulceration status (Figure \ref{f:42a}-\ref{f:42c}). The estimated survival function values are found to be higher for the group with ulceration status as absent and smaller tumor thickness values. Figure \ref{f:43} represents the estimated cure probabilities against tumor thickness values stratified by the ulceration status. A non-parametric test of difference suggests a significant difference ($p$-value $<2.2$ x $10^{-16}$) between cure probabilities of the two ulcer groups.
\begin{figure}
\centering
\begin{subfigure}[b]{0.45\textwidth}
\includegraphics[width=\textwidth]{SurvQ11.png}
\caption{Survival plots stratified by the ulceration status with tumor thickness = 0.320 mm}
\label{f:42a}
\end{subfigure}
\quad
\begin{subfigure}[b]{0.45\textwidth}
\includegraphics[width=\textwidth]{SurvQ21.png}
\caption{Survival plots stratified by the ulceration status with tumor thickness = 1.940 mm}
\label{f:42b}
\end{subfigure}
\begin{subfigure}[b]{0.55\textwidth}
\includegraphics[width=\textwidth]{SurvQ31.png}
\caption{Survival plots stratified by the ulceration status with tumor thickness = 8.320 mm}
\label{f:42c}
\end{subfigure}
\caption{Survival plots stratified by the ulceration status for different thickness levels}\label{f:42}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=10cm]{curecomb2.png}
\caption{Cure probability vs. tumor thickness stratified by the ulceration status}
\label{f:43}
\end{figure}
\section{Simulation study}\label{sect6}
\hspace{5mm} We now assess the performance of the proposed method of estimation and inference by using an extensive Monte Carlo simulation study. We generate data set in a way that mimics the real data on cutaneous melanoma discussed in the last section. For this purpose, we define a random variable $U$, where $U \sim$ Uniform $(0,1)$. If $U \le 0.44$, we assign a r.v. $Z = 1$, otherwise $Z=0$, where $Z$ denotes the ulceration status for each subject. For simulating the tumor thickness data, we plot histograms of tumor thickness ($X$) values of individuals from the cutaneous melanoma study. The histograms reveal positively skewed curves for both ulceration statuses; the means and standard deviations are as given in Section \ref{sect5}. Thus, for $Z=1$, we assume $X$ to follow Weibull distribution with shape and scale parameters as $\alpha_1$ and $\alpha_2$, respectively. $\alpha_1$ and $\alpha_2$ are estimated by the method of moments by equating $\alpha_2 \Gamma(1+1/\alpha_1)$ to 4.34 and $ \alpha_2^2\left[\Gamma\left(1+\frac{2}{\alpha_1}\right) - \left(\Gamma\left(1+\frac{1}{\alpha_1}\right)\right)^2\right]$ to $(3.22)^2$. We generate $X$ using the values of $\alpha_1$ and $\alpha_2$ determined this way. A similar approach is taken to generate $X$ for $Z=0$, where we assume $X$ to follow Weibull ($\alpha_3$, $\alpha_4$) with $\alpha_3$ and $\alpha_4$ being estimated from $\alpha_4 \Gamma(1+1/\alpha_3) = 1.81$ and $ \alpha_4^2\left[\Gamma\left(1+\frac{2}{\alpha_3}\right) - \left(\Gamma\left(1+\frac{1}{\alpha_3}\right)\right)^2\right] = (2.19)^2$. As mentioned before, we linked $\eta$ to $z$ using $\eta=e^{\alpha z}$ and $p$ to $x$ using $p=\frac{e^{ \beta_0 + \beta_1 x}}{1+e^{ \beta_0 + \beta_1 x}}$, wherein an intercept term is not taken in the link for $\eta$ to avoid non-identifiability. Note that $\eta=1$ whenever $z=0$. Also, a higher value of $\eta$ signifies greater number of initial competing causes ($M$). So, we assume $\eta$ to be more than 1 for $z=1$ since patients with the ulceration status as `present' are likely to have greater values of $M$. Following the work of \cite{pal2016likelihood}, we assume $\eta=3$ for $z=1$; thereby, we obtain the true value of $\alpha = 1.099$. In order to determine true values of $\beta_0$ and $\beta_1$, we use $x_{\min} = \min \{x\}=0.1$ mm and $x_{\max} = \max \{x\}=17.42$ mm. As the link $p=\frac{e^{ \beta_0 + \beta_1 x}}{1+e^{ \beta_0 + \beta_1 x}}$ is monotonically increasing in $x$, we set $p_{\min} =\min \{p\}$ and $p_{\max} = \max \{p\}$ and link them to $x_{\min}$ and $x_{\max}$, respectively. Two such choices of ($p_{\min}$, $p_{\max}$) are considered, {\it viz.}, (0.2, 0.6) and (0.3, 0.9), representing scenarios of lower and higher proportions of active number of competing causes. The true values of $\beta_0$ and $\beta_1$ change depending on the generated values of $x$ for each simulation. \\
\hspace{5mm}$M$ is generated from weighted Poisson distribution with parameter $\eta$. For exponentially weighted Poisson cure model, we set $\phi=0.2$ and $-0.5$, and for negative binomial cure model, we take $\phi=0.5$ and $5.2$. For the length-biased Poisson, $M$ is generated from Poisson ($\eta$) + 1 distribution. Given $M=m > 0$, $D$ is generated from binomial distribution with success probability $p$ and $m$ as the number of trials. If $M=0$, we set $D=0$. The true values of the lifetime parameters $(\gamma_0, \gamma_1, \gamma_2, \gamma_3)'$ are set to be $(1.657, 3.764, -0.005, 0.023)'$, which are indeed the parameter estimates obtained from the real data. If $D=d >0$, we generate $W_1, \ldots, W_d$ from Weibull distribution with shape $\gamma_0$ and scale $\gamma_1 \exp \left(-\frac{\gamma_2 x +\gamma_3 z}{\gamma_0}\right)$. We then define lifetime $Y=\min\{W_1, \ldots, W_d\}$ and the censoring time $C$ is assumed to be distributed exponentially with rate parameter $\psi$. Hence, the observed time $T$ is defined as $T=\min\{Y, C\}$. Again, if $D=0$, we simply assign $T=C$. To assess the effect of censoring on the proposed methodology, we consider three different scenarios: $\psi = 0.05, 0.15$ and $0.25$ representing low, medium and high censoring levels, respectively. On examining $\psi \in \{0.01, 0.02, \ldots, 1.50\}$ and comparing the proportion of censoring (i.e., no. of times $Y>C$) in 1000 replications, we observed that $\psi=0.05, 0.15$ and $0.25$ correspond to 52$\%$, 64$\%$ and 72$\%$ of censoring percentages, respectively. $\psi$ as low as 0.01 gives 45$\%$ of censoring whereas $\psi=1.50$ results in 95$\%$ of censored observations. We took the sample size as $n=400$, though similar results were produced for some other choices of $n$, but are not presented here for brevity.\\
\begin{table}[htbp]
\caption{EST, SE, bias, RMSE, 95$\%$ CI and CP for the destructive exponentially weighted Poisson cure model with $\phi=-0.5$ based on $n=400$}
\begin{tabular*}{\textwidth}{c @{\extracolsep{\fill}} c c c c c c c c c }
\hline
($p_{\min}, p_{\max}$) & $\psi$ & $\theta$ & True Value & EST & SE & BIAS & RMSE & 95$\%$ CI & CP \\
\hline
(0.2, 0.6)& 0.05& $\alpha$ & 1.099 & 1.095 & 0.268 & -0.004 & 0.375 & (0.570, 1.620) & 0.913 \\
&&$\beta_0$ & -1.387 & -1.472 & 0.298 & -0.086 & 0.616 & (-2.056, -0.889) & 0.598 \\
&&$\beta_1$ & 0.080 & 0.145 & 0.091 & 0.041 & 0.129 & (-0.032, 0.323) & 0.956 \\
&&$\gamma_0$ & 1.658 & 1.777 & 0.153 & 0.120 & 0.228 & (1.478, 2.077) & 0.906 \\
&&$\gamma_1$ & 3.765 & 3.822 & 0.526 & 0.057 & 0.716 & (2.790, 4.853) & 0.933 \\
&&$\gamma_2$ & -0.005 & -0.017 & 0.042 & -0.012 & 0.057 & (-0.098, 0.064) & 0.941 \\
&&$\gamma_3$ & 0.024 & -0.066 & 0.297 & -0.090 & 0.409 & (-0.649, 0.517) & 0.947 \\
&&$\phi$ & -0.500 & -0.466 & - & - & - & - & - \\
\hline
(0.3, 0.9)& 0.05& $\alpha$ & 1.099 & 1.088 & 0.210 & -0.011 & 0.293 & (0.677, 1.499) & 0.932 \\
&&$\beta_0$ & -0.849 & -1.039 & 0.308 & -0.191 & 0.635 & (-1.641, -0.436) & 0.548 \\
&&$\beta_1$ & 0.163 & 0.279 & 0.164 & 0.102 & 0.242 & (-0.042, 0.599) & 0.891 \\
&&$\gamma_0$ & 1.658 & 1.797 & 0.128 & 0.139 & 0.211 & (1.546, 2.047) & 0.833 \\
&&$\gamma_1$ & 3.765 & 3.839 & 0.430 & 0.074 & 0.598 & (2.995, 4.682) & 0.944 \\
&&$\gamma_2$ & -0.005 & -0.025 & 0.036 & -0.019 & 0.052 & (-0.096, 0.047) & 0.929 \\
&&$\gamma_3$ & 0.024 & -0.137 & 0.248 & -0.161 & 0.366 & (-0.623, 0.348) & 0.897 \\
&&$\phi$ & -0.500 & -0.406 & - & - & - & - & - \\
\hline
(0.2, 0.6)& 0.15& $\alpha$ & 1.099 & 1.093 & 0.329 & -0.006 & 0.447 & (0.449, 1.738) & 0.942 \\
&&$\beta_0$ & -1.386 & -1.515 & 0.365 & -0.129 & 0.636 & (-2.231, -0.799) & 0.755 \\
&&$\beta_1$ & 0.103 & 0.155 & 0.112 & 0.052 & 0.161 & (-0.065, 0.375) & 0.952 \\
&&$\gamma_0$ & 1.658 & 1.790 & 0.184 & 0.132 & 0.275 & (1.429, 2.151) & 0.911 \\
&&$\gamma_1$ & 3.765 & 3.789 & 0.721 & 0.024 & 0.989 & (2.375, 5.203) & 0.907 \\
&&$\gamma_2$ & -0.005 & -0.018 & 0.058 & -0.013 & 0.080 & (-0.132, 0.096) & 0.941 \\
&&$\gamma_3$ & 0.024 & -0.087 & 0.410 & -0.111 & 0.572 & (-0.892, 0.717) & 0.928 \\
&&$\phi$ & -0.500 & -0.451 & - & - & - & - & - \\
\hline
(0.3, 0.9)& 0.15& $\alpha$ & 1.099 & 1.079 & 0.258 & -0.02 & 0.355 & (0.574, 1.584) & 0.927 \\
&&$\beta_0$ & -0.848 & -1.026 & 0.399 & -0.178 & 0.683 & (-1.807, -0.245) & 0.729 \\
&&$\beta_1$ & 0.197 & 0.385 & 0.281 & 0.210 & 0.406 & (-0.166, 0.937) & 0.932 \\
&&$\gamma_0$ & 1.658 & 1.795 & 0.153 & 0.137 & 0.238 & (1.496, 2.094) & 0.877 \\
&&$\gamma_1$ & 3.765 & 3.830 & 0.595 & 0.066 & 0.812 & (2.665, 4.996) & 0.934 \\
&&$\gamma_2$ & -0.005 & -0.029 & 0.049 & -0.023 & 0.069 & (-0.124, 0.067) & 0.911 \\
&&$\gamma_3$ & 0.024 & -0.135 & 0.338 & -0.159 & 0.485 & (-0.797, 0.527) & 0.916 \\
&&$\phi$ & -0.500 & -0.435 & - & - & - & - & - \\
\hline
(0.2, 0.6)& 0.25& $\alpha$ & 1.099 & 1.072 & 0.413 & -0.027 & 0.563 & (0.262, 1.882) & 0.934 \\
&&$\beta_0$ & -1.387 & -1.489 & 0.470 & -0.103 & 0.732 & (-2.410, -0.569) & 0.841 \\
&&$\beta_1$ & 0.109 & 0.170 & 0.145 & 0.066 & 0.208 & (-0.115, 0.455) & 0.961 \\
&&$\gamma_0$ & 1.658 & 1.817 & 0.219 & 0.159 & 0.328 & (1.387, 2.246) & 0.903 \\
&&$\gamma_1$ & 3.765 & 3.789 & 0.990 & 0.025 & 1.332 & (1.850, 5.729) & 0.912 \\
&&$\gamma_2$ & -0.005 & -0.017 & 0.077 & -0.011 & 0.105 & (-0.168, 0.135) & 0.936 \\
&&$\gamma_3$ & 0.024 & -0.115 & 0.552 & -0.139 & 0.754 & (-1.198, 0.968) & 0.936 \\
&&$\phi$ & -0.500 & -0.455 & - & - & - & - & - \\
\hline
(0.3, 0.9)& 0.25& $\alpha$ & 1.099 & 1.115 & 0.335 & 0.016 & 0.453 & (0.459, 1.771) & 0.936 \\
&&$\beta_0$ & -0.847 & -1.037 & 0.483 & -0.190 & 0.769 & (-1.983, -0.091) & 0.839 \\
&&$\beta_1$ & 0.148 & 0.363 & 0.282 & 0.186 & 0.407 & (-0.190, 0.915) & 0.911 \\
&&$\gamma_0$ & 1.658 & 1.792 & 0.179 & 0.135 & 0.266 & (1.441, 2.143) & 0.911 \\
&&$\gamma_1$ & 3.765 & 3.820 & 0.821 & 0.056 & 1.097 & (2.212, 5.429) & 0.927 \\
&&$\gamma_2$ & -0.005 & -0.023 & 0.062 & -0.018 & 0.089 & (-0.145, 0.099) & 0.907 \\
&&$\gamma_3$ & 0.024 & -0.190 & 0.460 & -0.214 & 0.642 & (-1.09, 0.711) & 0.928 \\
&&$\phi$ & -0.500 & -0.439 & - & - & - & - & - \\
\hline
\end{tabular*}
\label{T:4}
\footnote*{\footnotesize{EST: Parameter Estimate, SE: Standard Error, BIAS: Bias in Estimation, RMSE: Root Mean Squared Error, CI: Confidence Interval, CP: Coverage Probability (Nominal Level of 95\%)} }
\end{table}
\begin{table}[h!]
\caption{EST, SE, bias, RMSE, 95$\%$ CI and CP for the destructive length-biased Poisson cure model based on $n=400$}
\begin{tabular*}{\textwidth}{c @{\extracolsep{\fill}} c c c c c c c c c }
\hline
($p_{\min}, p_{\max}$) & $\psi$ & $\theta$ & True Value & EST & SE & BIAS & RMSE & 95$\%$ CI & CP \\
\hline
(0.2, 0.6) & 0.05 & $\alpha$ & 1.099 & 1.060 & 0.252 & -0.039 & 0.341 & (0.567, 1.553) & 0.952 \\
&& $\beta_0$ & -1.386 & -1.392 & 0.163 & -0.005 & 0.220 & (-1.711, -1.072) & 0.957 \\
&& $\beta_1$ & 0.085 & 0.108 & 0.044 & 0.005 & 0.059 & (0.022, 0.194) & 0.954 \\
&& $\gamma_0$ & 1.658 & 1.792 & 0.106 & 0.135 & 0.186 & (1.584, 2.000) & 0.774 \\
&& $\gamma_1$ & 3.765 & 3.922 & 0.326 & 0.157 & 0.466 & (3.284, 4.560) & 0.926 \\
&& $\gamma_2$ & -0.005 & -0.028 & 0.033 & -0.023 & 0.048 & (-0.092, 0.036) & 0.892 \\
&& $\gamma_3$ & 0.024 & -0.139 & 0.207 & -0.163 & 0.316 & (-0.544, 0.266) & 0.874 \\
\hline
(0.3, 0.9) & 0.05 & $\alpha$ & 1.099 & 1.052 & 0.247 & -0.047 & 0.333 & (0.568, 1.536) & 0.961 \\
&& $\beta_0$ & -0.847 & -0.852 & 0.168 & -0.004 & 0.233 & (-1.181, -0.522) & 0.942 \\
&& $\beta_1$ & 0.205 & 0.186 & 0.064 & 0.012 & 0.087 & (0.062, 0.311) & 0.942 \\
&& $\gamma_0$ & 1.658 & 1.811 & 0.093 & 0.153 & 0.187 & (1.627, 1.994) & 0.653 \\
&& $\gamma_1$ & 3.765 & 3.995 & 0.287 & 0.231 & 0.438 & (3.433, 4.558) & 0.904 \\
&& $\gamma_2$ & -0.005 & -0.048 & 0.03 & -0.043 & 0.056 & (-0.108, 0.011) & 0.711 \\
&& $\gamma_3$ & 0.024 & -0.254 & 0.203 & -0.278 & 0.371 & (-0.652, 0.143) & 0.736 \\
\hline
(0.2, 0.6) & 0.15 & $\alpha$ & 1.099 & 1.062 & 0.333 & -0.037 & 0.435 & (0.409, 1.714) & 0.975 \\
&& $\beta_0$ & -1.386 & -1.399 & 0.208 & -0.013 & 0.273 & (-1.807, -0.992) & 0.964 \\
&& $\beta_1$ & 0.097 & 0.109 & 0.060 & 0.006 & 0.078 & (-0.009, 0.227) & 0.966 \\
&& $\gamma_0$ & 1.658 & 1.784 & 0.126 & 0.126 & 0.203 & (1.537, 2.031) & 0.848 \\
&& $\gamma_1$ & 3.765 & 3.895 & 0.448 & 0.130 & 0.599 & (3.017, 4.773) & 0.963 \\
&& $\gamma_2$ & -0.005 & -0.027 & 0.046 & -0.022 & 0.064 & (-0.116, 0.062) & 0.920 \\
&& $\gamma_3$ & 0.024 & -0.165 & 0.291 & -0.189 & 0.422 & (-0.736, 0.407) & 0.894 \\
\hline
(0.3, 0.9) & 0.15 & $\alpha$ & 1.099 & 1.045 & 0.346 & -0.054 & 0.447 & (0.367, 1.724) & 0.980 \\
&& $\beta_0$ & -0.849 & -0.852 & 0.216 & -0.004 & 0.286 & (-1.276, -0.428) & 0.956 \\
&& $\beta_1$ & 0.165 & 0.180 & 0.084 & 0.004 & 0.110 & (0.016, 0.344) & 0.939 \\
&& $\gamma_0$ & 1.658 & 1.806 & 0.111 & 0.148 & 0.200 & (1.589, 2.023) & 0.748 \\
&& $\gamma_1$ & 3.765 & 3.965 & 0.391 & 0.200 & 0.537 & (3.198, 4.732) & 0.957 \\
&& $\gamma_2$ & -0.005 & -0.045 & 0.040 & -0.040 & 0.065 & (-0.124, 0.034) & 0.827 \\
&& $\gamma_3$ & 0.024 & -0.283 & 0.295 & -0.307 & 0.475 & (-0.861, 0.294) & 0.856 \\
\hline
(0.2, 0.6) & 0.25 & $\alpha$ & 1.099 & 1.055 & 0.455 & -0.044 & 0.566 & (0.163, 1.947) & 0.986 \\
&& $\beta_0$ & -1.387 & -1.406 & 0.270 & -0.02 & 0.341 & (-1.936, -0.876) & 0.981 \\
&& $\beta_1$ & 0.093 & 0.108 & 0.081 & 0.005 & 0.102 & (-0.050, 0.266) & 0.962 \\
&& $\gamma_0$ & 1.658 & 1.784 & 0.147 & 0.127 & 0.225 & (1.496, 2.072) & 0.892 \\
&& $\gamma_1$ & 3.765 & 3.892 & 0.612 & 0.127 & 0.791 & (2.692, 5.091) & 0.973 \\
&& $\gamma_2$ & -0.005 & -0.029 & 0.062 & -0.023 & 0.082 & (-0.150, 0.092) & 0.950 \\
&& $\gamma_3$ & 0.024 & -0.150 & 0.408 & -0.174 & 0.539 & (-0.949, 0.649) & 0.961 \\
\hline
(0.3, 0.9) & 0.25 & $\alpha$ & 1.099 & 1.031 & 0.553 & -0.068 & 0.659 & (-0.053, 2.115) & 0.993 \\
&& $\beta_0$ & -0.847 & -0.839 & 0.284 & 0.009 & 0.356 & (-1.396, -0.282) & 0.979 \\
&& $\beta_1$ & 0.165 & 0.176 & 0.108 & 0.000 & 0.138 & (-0.037, 0.388) & 0.947 \\
&& $\gamma_0$ & 1.658 & 1.799 & 0.128 & 0.141 & 0.212 & (1.548, 2.050) & 0.830 \\
&& $\gamma_1$ & 3.765 & 3.995 & 0.547 & 0.230 & 0.716 & (2.923, 5.067) & 0.978 \\
&& $\gamma_2$ & -0.005 & -0.042 & 0.052 & -0.037 & 0.076 & (-0.143, 0.059) & 0.885 \\
&& $\gamma_3$ & 0.024 & -0.292 & 0.421 & -0.316 & 0.593 & (-1.117, 0.534) & 0.939 \\
\hline
\end{tabular*}
\label{T:5}
\footnote*{\footnotesize{EST: Parameter Estimate, SE: Standard Error, BIAS: Bias in Estimation, RMSE: Root Mean Squared Error, CI: Confidence Interval, CP: Coverage Probability (Nominal Level of 95\%)}}
\end{table}
\begin{table}[htbp]
\caption{EST, SE, bias, RMSE, 95$\%$ CI and CP for the destructive negative binomial cure model with $\phi=0.5$ based on $n=400$}
\begin{tabular*}{\textwidth}{c @{\extracolsep{\fill}} c c c c c c c c c }
\hline
($p_{\min}, p_{\max}$) & $\psi$ & $\theta$ & True Value & EST & SE & BIAS & RMSE & 95$\%$ CI & CP \\
\hline
(0.2, 0.6) & 0.05 & $\alpha$ & 1.099 & 1.061 & 0.246 & -0.038 & 0.352 & (0.580, 1.543) & 0.916 \\
&& $\beta_0$ & -1.386 & -1.432 & 0.248 & -0.045 & 0.337 & (-1.918, -0.946) & 0.949 \\
&& $\beta_1$ & 0.115 & 0.116 & 0.071 & 0.013 & 0.101 & (-0.022, 0.255) & 0.928 \\
&& $\gamma_0$ & 1.658 & 1.827 & 0.136 & 0.169 & 0.241 & (1.561, 2.093) & 0.786 \\
&& $\gamma_1$ & 3.765 & 3.917 & 0.441 & 0.153 & 0.620 & (3.052, 4.782) & 0.925 \\
&& $\gamma_2$ & -0.005 & -0.023 & 0.040 & -0.018 & 0.057 & (-0.102, 0.056) & 0.933 \\
&& $\gamma_3$ & 0.024 & -0.131 & 0.262 & -0.155 & 0.383 & (-0.645, 0.382) & 0.897 \\
&& $\phi$ & 0.500 & 0.369 & - & - & - & - & - \\
\hline
(0.3, 0.9) & 0.05 & $\alpha$ & 1.099 & 1.012 & 0.212 & -0.087 & 0.310 & (0.597, 1.426) & 0.894 \\
&& $\beta_0$ & -0.847 & -0.905 & 0.255 & -0.057 & 0.349 & (-1.404, -0.405) & 0.944 \\
&& $\beta_1$ & 0.159 & 0.194 & 0.107 & 0.017 & 0.159 & (-0.016, 0.403) & 0.869 \\
&& $\gamma_0$ & 1.658 & 1.837 & 0.117 & 0.180 & 0.229 & (1.607, 2.068) & 0.683 \\
&& $\gamma_1$ & 3.765 & 3.968 & 0.379 & 0.203 & 0.551 & (3.225, 4.710) & 0.924 \\
&& $\gamma_2$ & -0.005 & -0.028 & 0.036 & -0.023 & 0.053 & (-0.100, 0.043) & 0.916 \\
&& $\gamma_3$ & 0.024 & -0.215 & 0.231 & -0.239 & 0.382 & (-0.667, 0.238) & 0.806 \\
&& $\phi$ & 0.500 & 0.265 & - & - & - & - & - \\
\hline
(0.2, 0.6) & 0.15 & $\alpha$ & 1.099 & 1.059 & 0.310 & -0.040 & 0.430 & (0.452, 1.667) & 0.931 \\
&& $\beta_0$ & -1.387 & -1.450 & 0.312 & -0.063 & 0.417 & (-2.062, -0.838) & 0.959 \\
&& $\beta_1$ & 0.098 & 0.128 & 0.097 & 0.024 & 0.135 & (-0.062, 0.318) & 0.931 \\
&& $\gamma_0$ & 1.658 & 1.816 & 0.162 & 0.158 & 0.264 & (1.498, 2.133) & 0.855 \\
&& $\gamma_1$ & 3.765 & 3.873 & 0.615 & 0.109 & 0.833 & (2.669, 5.078) & 0.959 \\
&& $\gamma_2$ & -0.005 & -0.024 & 0.057 & -0.019 & 0.079 & (-0.136, 0.088) & 0.935 \\
&& $\gamma_3$ & 0.024 & -0.166 & 0.367 & -0.190 & 0.531 & (-0.886, 0.554) & 0.910 \\
&& $\phi$ & 0.500 & 0.381 & - & - & - & - & - \\
\hline
(0.3, 0.9) & 0.15 & $\alpha$ & 1.099 & 1.048 & 0.271 & -0.051 & 0.381 & (0.517, 1.579) & 0.928 \\
&& $\beta_0$ & -0.847 & -0.936 & 0.323 & -0.088 & 0.442 & (-1.568, -0.304) & 0.941 \\
&& $\beta_1$ & 0.213 & 0.222 & 0.145 & 0.045 & 0.217 & (-0.062, 0.505) & 0.885 \\
&& $\gamma_0$ & 1.658 & 1.831 & 0.141 & 0.174 & 0.246 & (1.556, 2.107) & 0.774 \\
&& $\gamma_1$ & 3.765 & 3.936 & 0.526 & 0.171 & 0.724 & (2.905, 4.966) & 0.946 \\
&& $\gamma_2$ & -0.005 & -0.031 & 0.050 & -0.025 & 0.073 & (-0.129, 0.068) & 0.906 \\
&& $\gamma_3$ & 0.024 & -0.259 & 0.326 & -0.283 & 0.502 & (-0.898, 0.381) & 0.871 \\
&& $\phi$ & 0.5 & 0.303 & - & - & - & - & - \\
\hline
(0.2, 0.6) & 0.25 & $\alpha$ & 1.099 & 1.074 & 0.400 & -0.025 & 0.537 & (0.290, 1.857) & 0.946 \\
&& $\beta_0$ & -1.387 & -1.454 & 0.398 & -0.067 & 0.529 & (-2.234, -0.674) & 0.957 \\
&& $\beta_1$ & 0.094 & 0.131 & 0.119 & 0.027 & 0.164 & (-0.103, 0.365) & 0.945 \\
&& $\gamma_0$ & 1.658 & 1.826 & 0.190 & 0.169 & 0.297 & (1.454, 2.199) & 0.882 \\
&& $\gamma_1$ & 3.765 & 3.856 & 0.841 & 0.092 & 1.140 & (2.208, 5.504) & 0.922 \\
&& $\gamma_2$ & -0.005 & -0.027 & 0.077 & -0.022 & 0.105 & (-0.177, 0.123) & 0.933 \\
&& $\gamma_3$ & 0.024 & -0.194 & 0.503 & -0.218 & 0.695 & (-1.180, 0.792) & 0.935 \\
&& $\phi$ & 0.500 & 0.399 & - & - & - & - & - \\
\hline
(0.3, 0.9) & 0.25 & $\alpha$ & 1.099 & 1.068 & 0.361 & -0.031 & 0.492 & (0.361 , 1.775) & 0.936 \\
&& $\beta_0$ & -0.847 & -0.944 & 0.413 & -0.096 & 0.553 & (-1.754, -0.133) & 0.944 \\
&& $\beta_1$ & 0.204 & 0.240 & 0.186 & 0.064 & 0.267 & (-0.124, 0.604) & 0.895 \\
&& $\gamma_0$ & 1.658 & 1.824 & 0.164 & 0.166 & 0.266 & (1.502, 2.146) & 0.856 \\
&& $\gamma_1$ & 3.765 & 3.935 & 0.733 & 0.170 & 0.976 & (2.498, 5.372) & 0.951 \\
&& $\gamma_2$ & -0.005 & -0.029 & 0.065 & -0.024 & 0.092 & (-0.156, 0.097) & 0.912 \\
&& $\gamma_3$ & 0.024 & -0.302 & 0.453 & -0.326 & 0.660 & (-1.191, 0.587) & 0.916 \\
&& $\phi$ & 0.500 & 0.327 & - & - & - & - & - \\
\hline
\end{tabular*}
\label{T:6}
\footnote*{\footnotesize{EST: Parameter Estimate, SE: Standard Error, BIAS: Bias in Estimation, RMSE: Root Mean Squared Error, CI: Confidence Interval, CP: Coverage Probability (Nominal Level of 95\%)} }
\end{table}
\hspace{5mm}As mentioned in Section \ref{sect4}, we estimate the parameters using the EM algorithm, except for $\phi$ which is estimated using the profile likelihood approach. The admissible ranges for $\phi$ are taken to be $\Phi=\{-2.00, -1.90, \ldots, 2.00 \}$ for the DEWP cure model with true $\phi=0.2$, whereas $\Phi=\{0.10, 0.15, \ldots, 2.00\}$ for the DNB cure model when true $\phi=0.5$ and $\Phi=\{3.0, 3.1, \ldots, 7.0\}$ when true $\phi=5.2$. Apart from $\phi$, an initial parameter value is chosen uniformly from the interval ($0.85 \theta_r$, $1.15 \theta_r$) where $\theta_r$ denotes true value of the parameter. In Tables \ref{T:4} - \ref{T:6}, we display the results of our simulation study for some chosen scenarios. The accuracy and robustness of the proposed method of estimation are assessed through average estimated value (EST), standard error (SE), bias (BIAS), root mean squared error (RMSE), 95 $\%$ Confidence Interval (CI) and coverage probability (CP). CPs are obtained by using the asymptotic normality of the ML estimators and a nominal level of 95$\%$ for the confidence interval thus constructed. The results are based on 500 replications of simulated data for each scenario and all calculations are performed in R-3.1.3. \\
\hspace{5mm} From Tables \ref{T:4} - \ref{T:6}, we observe the estimates to be close to the true parameter values, and the bias are small implying high accuracy of the estimation method. The profile likelihood method seems to perform relatively well in terms of accuracy, when data are generated from the DEWP ($\phi=0.2$) cure model. However, when the true model is DNB, bias are found to be high for the estimates of $\phi$. It can be attributed to the fact that the likelihood function is very flat with respect to parameter $\phi$. Under-coverage for $\beta_0$ and $\gamma_0$ are observed for DEWP and DNB cure models, respectively. To explain this under-coverage, we consider one such setting in which data are generated from the DEWP model with $\phi=0.2$ having large sample size ($n=400$), $(p_{\min}, p_{\max})=(0.2, 0.6)$ and low censoring ($\psi=0.05$). We fit DEWP cure models to the data obtained from 100 replications and compare the effect of estimating $\phi$ versus fixed $\phi$ on the coverage probabilities of the other parameters. These results are presented in Table \ref{T:7} from which we observe that the coverage probability of $\beta_0$ reaches the nominal level of 95$\%$ when $\phi$ is not estimated. This immediately points towards the imprecision in estimating $\phi$ (likely due to the flatness of the likelihood surface) leading to the under-coverage of $\beta_0$. The SE and RMSE decrease with an increase in the sample size and decrease in the censoring percentages, as one would naturally expect. For brevity, tables corresponding to other scenarios are not provided here.\\
\begin{table}[htbp]
\caption{EST, SE, BIAS, RMSE, 95$\%$ CI and CP for destructive exponentially weighted Poisson cure model with $\phi=0.2$ with $(p_{\min}, p_{\max})=(0.2, 0.6)$ and $\psi=0.05$ based on $n=400$}
\begin{tabular*}{\textwidth}{c @{\extracolsep{\fill}} c c c c c c c }
\hline
$\theta$ & True Value & EST & SE & BIAS & RMSE & 95$\%$CI & CP \\
\hline
&\multicolumn{7}{c}{$\phi$ is estimated with $\hat \phi=0.597$}\\
\hline
$\alpha$ & 1.099 & 1.064 & 0.187 & -0.035 & 0.252 & (0.698, 1.430) & 0.929 \\
$\beta_0$ & -1.386 & -1.809 & 0.333 & -0.422 & 1.452 & (-2.462, -1.156) & 0.291 \\
$\beta_1$ & 0.099 & 0.778 & 0.570 & 0.675 & 0.923 & (-0.339, 1.894) & 0.899 \\
$\gamma_0$ & 1.658 & 1.816 & 0.120 & 0.158 & 0.215 & (1.581, 2.050) & 0.758 \\
$\gamma_1$ & 3.765 & 3.953 & 0.391 & 0.188 & 0.555 & (3.187, 4.718) & 0.929 \\
$\gamma_2$ & -0.005 & -0.022 & 0.035 & -0.017 & 0.049 & (-0.091, 0.047) & 0.919 \\
$\gamma_3$ & 0.024 & -0.148 & 0.230 & -0.172 & 0.357 & (-0.598, 0.302) & 0.848 \\
\hline
&\multicolumn{7}{c}{$\phi$ is not estimated}\\
\hline
$\alpha$ & 1.099 & 1.086 & 0.204 & -0.013 & 0.264 & (0.685, 1.486) & 0.979 \\
$\beta_0$ & -1.386 & -1.348 & 0.208 & 0.038 & 0.276 & (-1.756, -0.941) & 0.979 \\
$\beta_1$ & 0.099 & 0.099 & 0.053 & -0.004 & 0.069 & (-0.005, 0.202) & 0.989 \\
$\gamma_0$ & 1.658 & 1.815 & 0.120 & 0.157 & 0.214 & (1.581, 2.049) & 0.778 \\
$\gamma_1$ & 3.765 & 3.944 & 0.390 & 0.180 & 0.553 & (3.179, 4.709) & 0.959 \\
$\gamma_2$ & -0.005 & -0.022 & 0.036 & -0.016 & 0.050 & (-0.092, 0.049) & 0.939 \\
$\gamma_3$ & 0.024 & -0.154 & 0.230 & -0.178 & 0.362 & (-0.606, 0.297) & 0.870 \\
\hline
\end{tabular*}
\label{T:7}
\footnote*{\footnotesize{EST: Parameter Estimate, SE: Standard Error, BIAS: Bias in Estimation, RMSE: Root Mean Squared Error, CI: Confidence Interval, CP: Coverage Probability (Nominal Level of 95\%)} }
\end{table}
\section{Model discrimination}\label{sect7}
\hspace{5mm} To assess the impact of model mis-specification on estimates of the cure rate, a model discrimination is performed here based on Akaike Information Criterion (AIC) and Bayesian Information Criterion (BIC). The idea is to observe the frequency with which models other than the true model get selected or rejected by our fitting method of these models. We generate 1000 samples from five true models each, {\it viz.}, DEWP ($\phi=-0.5$), DEWP ($\phi=0.2$), DLBP, DNB ($\phi=0.5$) and DNB ($\phi=0.75$) with $(p_{\min}, p_{\max})=(0.3, 0.9)$, $\eta=3$ for $Z=1$ and $\lambda=0.15$ (i.e., medium censoring). The lifetime parameters are set as $\bm \gamma=(\gamma_0, \gamma_1, \gamma_2, \gamma_3)'=(1.657, 3.764, -0.005, 0.023)'$ (see Section \ref{sect6}). Under these specifications, samples are generated of size $n=400$. \\
\hspace{5mm} We fit three candidate models, i.e., DEWP, DLBP and DNB cure models, to these samples with the proposed method of estimation. The model with the least AIC or BIC value gets selected, where $$ \text{AIC}= -2 \hat l + 2 \tilde k, \hspace{0.4cm} \text{BIC} = -2 \hat l + \tilde k \log(n), $$ with $\hat l$ being the maximized log-likelihood value corresponding to the model and $\tilde k$ being the number of estimated parameters. The selection rates based on AIC, BIC and $\hat l$ are all presented in Table \ref{T:8}. \\
\begin{table}[htbp]
\caption{Selection rates based on AIC, BIC and maximized log-likelihood ($\hat l$) value for $n=400$}
\begin{tabular*}{\textwidth}{c @{\extracolsep{\fill}}ccc}
& \multicolumn{ 3}{c}{Fitted Models} \\
\cline{2-4}
True Models & DEWP & DLB & DNB \\
\hline
\multicolumn{ 1}{c}{DEWP ($\phi=-0.5$)} & $\hat \phi=-0.275$ & & $\hat \phi=0.378$ \\
\cline{1-4}
\multicolumn{ 1}{c}{AIC} & 0.179 & 0.768 & 0.053 \\
\multicolumn{ 1}{c}{BIC} & 0.037 & 0.944 & 0.019 \\
\multicolumn{ 1}{c}{log-lik} & 0.630 & 0.152 & 0.218 \\
\hline
\multicolumn{ 1}{c}{DEWP ($\phi=0.2$)} & $\hat \phi=0.222$ & & $\hat \phi=0.186$ \\
\cline{1-4}
\multicolumn{ 1}{c}{AIC} & 0.125 & 0.843 & 0.032 \\
\multicolumn{ 1}{c}{BIC} & 0.063 & 0.919 & 0.018 \\
\multicolumn{ 1}{c}{log-lik} & 0.597 & 0.360 & 0.043 \\
\hline
\multicolumn{ 1}{c}{DLB} & $\hat \phi=-0.077$ & & $\hat \phi=0.347$ \\
\hline
\multicolumn{ 1}{c}{AIC} & 0.073 & 0.919 & 0.008 \\
\multicolumn{ 1}{c}{BIC} & 0.016 & 0.983 & 0.001 \\
\multicolumn{ 1}{c}{log-lik} & 0.427 & 0.559 & 0.014 \\
\hline
\multicolumn{ 1}{c}{DNB ($\phi=0.5$)} & $\hat \phi=0.311$ & & $\hat \phi=0.336$ \\
\hline
\multicolumn{ 1}{c}{AIC} & 0.163 & 0.762 & 0.075 \\
\multicolumn{ 1}{c}{BIC} & 0.003 & 0.969 & 0.028 \\
\multicolumn{ 1}{c}{log-lik} & 0.556 & 0.262 & 0.182 \\
\hline
\multicolumn{ 1}{c}{DNB ($\phi=0.75$)} & $\hat \phi=0.545$ & & $\hat \phi=0.346$ \\
\hline
\multicolumn{ 1}{c}{AIC} & 0.174 & 0.737 & 0.089 \\
\multicolumn{ 1}{c}{BIC} & 0.040 & 0.927 & 0.033 \\
\multicolumn{ 1}{c}{log-lik} & 0.599 & 0.242 & 0.159 \\
\hline
\end{tabular*}
\label{T:8}
\footnote*{\footnotesize{AIC: Akaike Information Criterion, BIC: Bayesian Information Criterion, log-lik: Maximized log-likelihood value }}
\end{table}
\hspace{5mm} The selection of true models based on both AIC and BIC values are found to be quite low when the data are generated from DEWP and DNB cure models. It is observed that the values of the log-likelihood function for all the fitted cure models are quite similar. For this reason, the models with one extra parameter (i.e. DEWP and DNB), in terms of AIC and BIC values, do get penalized more when compared to the DLB model. Consequently, when the log-likelihood value ($\hat l$) is used as the selection criteria, the results reveal more selections for the true models. Table \ref{T:9} shows that when $\phi$ is not estimated, true models are more likely to get selected. \\
\begin{table}[htbp]
\caption{Comparison of model selection rates based on AIC for $n=400$}
\begin{tabular*}{\textwidth}{l @{\extracolsep{\fill}}cc}
\multicolumn{ 1}{c}{ } & \multicolumn{ 2}{c}{True Model} \\
\cline{2-3}
\multicolumn{ 1}{c}{Fitted Model} & \multicolumn{ 1}{c}{DEWP ($\phi=-0.5$)} & \multicolumn{ 1}{c}{DNB ($\phi=0.5$)} \\
\hline
True Model & 0.540 & 0.330 \\
DEWP & 0.060 & 0.100 \\
DLBP & 0.390 & 0.530 \\
DNB & 0.010 & 0.040 \\
\hline
\end{tabular*}
\label{T:9}
\footnote*{\footnotesize{AIC: Akaike Information Criterion}}
\end{table}
\hspace{5mm} To emphasize the importance of model discrimination, we examine the bias and MSE involved in the estimation of cure rates of patients under model mis-specification. For each model, we compute the total relative bias (TRB) as
$$ \text{TRB} = \sum_{i=1}^n \frac{|\hat \pi_{0,i}-\pi_{0,i}|}{\pi_{0,i}},$$
where $\pi_{0,i}$ and $\hat \pi_{0,i}$ denote true and estimated cure rates for an individual $i$, $i=1, \dots, n$. Similarly, we define total mean squared error (TMSE) for a model as
$$ \text{TMSE}=\frac{1}{n-1}\sum_{i=1}^n (\hat \pi_{0,i}-\pi_{0,i})^2.$$
For two candidate models M1 and M2, total relative efficiency (TRE) of M2 with respect to M1 is defined as $\text{TRE}=\frac{\text{TMSE(M2)}}{\text{TMSE(M1)}}$, where $\text{TMSE(M1)}$ and $\text{TMSE(M2)}$ denote TMSE values based on M1 and M2, respectively. With these measures defined, we compare the three candidate models. Table \ref{T:10} presents TRB (in $\%$), TMSE and TRE for the candidate models for $n=400$ when the data are generated from one of the five true models as described earlier in this section. \\
\begin{table}[h!]
\begin{center}
\caption{TRB $(\%)$ (TMSE, $\hat \phi$, TRE) in estimation of cured proportion for all candidate models for $n=400$}
\resizebox{16.5cm}{!}{
\begin{tabular}{lcccc}
\multicolumn{ 1}{c}{} & \multicolumn{ 4}{c}{Fitted Model} \\
\cline{2-5}
\multicolumn{ 1}{c}{True Model} & True Model & DEWP & DLBP & DNB \\
\hline
DEWP($\phi=-0.5$) & 35.300 (0.003, -, 1.000) & 37.015 (0.004, -0.199, 0.962) & 37.730 (0.004, -, 1.383) & 34.957 (0.003, 0.461, 1.045)\\
DEWP($\phi=0.2$) & 62.365 (0.003, - , 1.000) & 66.532 (0.004, 0.239, 1.004) & 61.101 (0.003, - , 1.087) & 67.786 (0.003, 0.198, 1.094) \\
DLBP & 86.617 (0.003, - , 1.000) &107.147 (0.004, 0.708, 0.964) & 86.617 (0.003, - , 1.000) & 193.413 (0.006, 0.117, 0.455)\\
DNB ($\phi=0.5$) & 41.663 (0.004, - , 1.000) & 42.593 (0.004, -0.079, 1.006) & 42.992 (0.004, - , 1.052) & 40.039 (0.004, 0.396, 1.123) \\
DNB ($\phi=0.75$) & 37.100 (0.003, - , 1.000) & 39.126 (0.004, -0.259, 0.972) & 40.846 (0.004, - , 1.047) &37.247 (0.003, 0.379, 1.030)\\
\hline
\end{tabular}
}
\raggedright \footnote*{\raggedleft {\footnotesize{TRB: Total Relative Bias, TMSE: Total Mean Squared Error, TRE: Total Relative Efficiency}}}
\label{T:10}
\end{center}
\end{table}
\hspace{5mm} The model M1 gets chosen always to be the true model. From Table \ref{T:10}, it can be seen that in cases where data are from the DLBP cure model, model mis-specification may lead to large bias and MSE, and consequently, higher TRB and lower TRE are observed on fitting candidate models when the true model is DLBP. For the other true models, TRB values are relatively close to each other which indicate not much precision is lost under model mis-specification. DNB cure models provide lesser TRB and higher TRE in most of the scenarios considered. Table \ref{T:11} shows TRB and TRE values when using AIC and $\hat l$ as the model selection
criteria. The results suggest that allowing AIC or $\hat l$ to select a working model out of a set of candidate models may lead to lesser relative bias. TRE values are greater than one in most cases, which means that estimating the cured proportion
by fitting the working model as selected by AIC or $\hat l$ results in higher efficiency.
\begin{table}[htbp]
\caption{TRB ($\%$) and TRE when AIC and $\hat l$ are used for model selection for $n=400$}
\begin{tabular*}{\textwidth}{l @{\extracolsep{\fill}}cccc}
& \multicolumn{ 2}{c}{AIC} & \multicolumn{ 2}{c}{$\hat l$} \\
\cline{2-5}
True Model & TRB ($\%$) & TRE & TRB ($\%$) & TRE \\
\hline
DEWP ($\phi=-0.5$) & 36.347 & 1.148 & 36.659 & 1.085 \\
DEWP ($\phi=0.2$) & 62.321 & 1.040 & 63.832 & 1.032 \\
DLB & 88.259 & 0.997 & 94.829 & 0.986 \\
DNB ($\phi=0.5$) & 42.461 & 1.030 & 42.408 & 1.027 \\
DNB ($\phi=0.75$) & 39.347 & 1.023 & 39.104 & 0.998 \\
\hline
\end{tabular*}
\footnote*{{\footnotesize{TRB: Total Relative Bias, TRE: Total Relative Efficiency}}}
\label{T:11}
\end{table}
\section{Concluding Remarks} \label{sect8}
\hspace{5mm} In this work, destructive cure models are studied under competing risks scenario wherein the initial competing causes undergo a destructive mechanism. The models are developed and examined assuming that the hazard functions corresponding to the susceptible individuals follow proportional hazards with Weibull baseline hazard function. The model generalizes the previous works of \cite{ pal2016destructive, pal2016likelihood} on destructive cure model by assuming non i.i.d. lifetimes for the susceptible individuals. This is accomplished by linking covariates to the lifetimes through proportional hazards. The parameter estimates are found to be accurate with low RMSE. A relatively large bias is observed while estimating $\phi$, especially when data are from DNB ($\phi=0.75$) cure model. The estimates are observed to be more precise under scenarios characterized by low censoring, high proportion of undamaged competing causes and large sample size. A model discrimination is also carried out using information-based criteria. A real life example on cutaneous melanoma is considered for the purpose of illustrating the models and the method of fit developed here. Destructive negative binomial cure model with $\hat \phi=5.2$ provided the best fit to these melanoma data. The assumption of i.i.d. lifetimes among the susceptible subjects got rejected at $10\%$ level of significance. It will be of interest to study destructive cure models when covariates are prone to measurement errors. We hope to consider this problem as our future research.
\bibliographystyle{apacite}
| {'timestamp': '2021-09-20T02:21:48', 'yymm': '2109', 'arxiv_id': '2109.08661', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08661'} | arxiv |
\section*{Appendix}
\section{Pseudo-code} \label{appendix:pseudo-code}
The pseudo-code for Dynamics-Aware Quality-Diversity is provided in Algorithm~\ref{algo:mb-qd}.
\input{psuedocode}
\section{Implementation Details}
Our QD implementation builds on pymap\_elites~\cite{vassiliades2016using, mouret2020quality} and extends it for our use case. We conducted all simulation experiments with the Dynamic Animation and Robotics Toolkit (DART) simulator~\cite{lee2018dart}.
\subsection{Addition Condition for Unstructured Containers} \label{appendix:addition}
This section provides additional details regarding the unstructured container~\cite{cully2017quality}, that is explained in section~\ref{sec:background}.
\newcommand{\pi_{new}}{\pi_{new}}
Before attempting to add a policy $\pi_{new}$ to an unstructured repertoire, we evaluate its return $R_{\pi_{new}}$, its skill descriptor $\vec{sd}_{\pi_{new}}$, and novelty score $nov_{\pi_{new}}$ (see equation~\ref{equation:novelty-score}).
We also find the two nearest neighbors of $\pi$ present in the repertoire (the distance between policies corresponds to the euclidian distance between their respective skill descriptors).
In the following, the first and second nearest neighbors of $\pi_{new}$ from the repertoire are respectively denoted $\pi_1$ and $\pi_2$
If the distance of $\vec{sd}_{\pi_{new}}$ to its nearest neighbor from the repertoire $\vec{sd}_{\pi_1}$ is higher than a pre-defined threshold $l$, then $\pi_{new}$ is added to the unstructured repertoire.
Otherwise, $\pi_{new}$ may still replace its nearest neighbor $\pi_1$ in the repertoire if the following conditions are satisfied:
\begin{align}
\label{eq:cond_1}
\|\vec{sd}_{\pi_{new}} - \vec{sd}_{\pi_2}\|_2 &\geqslant l \\
\label{eq:cond_2}
nov_{\pi_{new}} &\geqslant (1-\epsilon) nov_{\pi_1} \\
\label{eq:cond_3}
R_{\pi_{new}} &\geqslant (1 - \epsilon)R_{\pi_1} \\
\label{eq:cond_4}
\left(nov_{\pi_{new}} - nov_{\pi_1}\right)
|R_{\pi_1}| &\geqslant
-\left( R_{\pi_{new}} - R_{\pi_1} \right) |nov_{\pi_1}|
\end{align}
where $\epsilon$ is a parameter in $\left[0, 1\right)$. Condition~\ref{eq:cond_1} ensures that $\pi_{new}$ is novel enough compared to the container policies except $\pi_1$.
Conditions~\ref{eq:cond_2} to~\ref{eq:cond_4} ensure that $\pi_{new}$ outperforms $\pi_1$ with respect to the novelty or the return.
In particular, conditions~\ref{eq:cond_2} and~\ref{eq:cond_3} are there to prevent $\pi_{new}$ from being significantly outperformed by $\pi_1$.
When $\epsilon$ increases, those replacement conditions become more flexible.
See~\cite{cully2017quality} for a detailed explanation and experimentation of this mechanism.
\subsection{Quality-Diversity Exploration}
The hyperparameters used for QD skill discovery of the repertoires are as follows:
\begin{itemize}[noitemsep, leftmargin=8mm]
\item For the repertoire addition condition, the distance threshold $l$ is set to $0.015$, $\epsilon = 0.1$ and $k = 15$ (see sections~\ref{sec:background} and~\ref{appendix:addition}).
\item $\sigma_1 = 0.01$ and $\sigma_2 = 0.2$ for directional variation (see equation~\ref{equation:directional-variation}).
\end{itemize}
We use 32 CPU cores per replication of the skill discovery. As mentioned in the caption of Figure~\ref{fig:hexa_omni_ablation}, we stop the execution of the algorithm as soon as less than one policy is added to the imagined repertoire in one iteration. As the algorithm approaches convergence (i.e. when the skill space gets fully explored), the number of skills that are added to the imagined repertoire significantly decreases.
Since we only evaluate solutions that have been added to the imagined repertoire, the number of evaluated solutions decreases as we approach convergence.
This results in a total number of evaluations that is lower than the other approaches (Fig.~\ref{fig:hexa_omni_ablation}).
\subsection{Dynamics Model}
The dynamics model $\widetilde{p}_{\vec \theta}$ consists of an ensemble of four probabilistic neural networks.
Each of these neural networks takes as input the current state $\vec s_t$ and action $\vec a_t$ and outputs a normal distribution over the next state $\vec s_{t+1}$.
The state $\vec s_t$ consists of the following:
\begin{itemize}[noitemsep, leftmargin=8mm]
\item linear and angular positions and velocities of the torso (center of mass).
\item all joint angles and velocities.
\end{itemize}
In total, the state has $12+36=48$ dimensions.
The action $\vec a_t$ corresponds to the 18 desired joint angles.
Each probabilistic neural network outputs the parameters of a normal distribution for the next state $\vec s_{t+1}$.
More specifically, the dynamics model outputs the mean $\vec\mu = \left( \mu_1, \cdots, \mu_{48} \right)$ and a vector of logarithms of standard deviations $\left(\log \sigma_1, \cdots, \log \sigma_{48}\right)$ (the covariance matrix of the normal distribution is considered diagonal).
Each probabilistic neural network is a Multi-Layer Perceptron with two hidden layers of size 500 with ReLU activation functions.
The dynamics model is trained using the Adam optimizer with a learning rate of $10^{-3}$, $\beta_1=0.9$, $\beta_2=0.999$ and a batch size of $512$.
It is trained every 500 evaluations with the transitions present in the replay buffer.
The size of the replay buffer is $10^6$ transitions.
\subsection{Hexapod Robot Platform}
As mentioned in Section \ref{sec:exps-envs}, we use an 18 DoF hexapod robot that is open-sourced. The robot consists of Dynamixel XM430-W350-R motors. Link to the robot design and setup will be available once the review process is complete.
\section{Additional Experimental Details}
\subsection{Hexapod Omni-directional Skill}
The skill space referred to in Section \ref{sec:exps-sample_eff} has $\vec{sd}$ defined as the following:
\begin{equation*}
\vec{sd} =
\begin{pmatrix}
x_T \\
y_T \\
\end{pmatrix}
\end{equation*}
where $x_T$ and $y_T$ are the relative cartesian displacements of the robot at the end of the episode $T$. The return $R$ is defined as:
\begin{equation*}
R = |\alpha_i-\alpha_d|
\end{equation*}
where $\alpha_i$ is the relative yaw angle of the robot at the end of the episode $T$ and $\alpha_d$ is the desired angle defined by a circular trajectory. Figure~\ref{fig:hexa_omni_ablation}A illustrates this.
Defining the $\vec{sd}$ in this way allows skill policies that result in diversity in the $\left(x,y\right)$ space to be discovered. Figure \ref{fig:omni-rep-viz} shows the repertoire of skills discovered and three sampled example trajectories of executed skills.
\begin{figure}[h]
\centering
\includegraphics[width=\linewidth]{figures/skill_rep_viz_v3.pdf}
\centering
\caption{
\textbf{Omni-directional Skill Repertoire.}
(\textbf{A}) Skill repertoire learned by DA-QD{} showing skills discovered with diverse final positions $\left(x_T,y_T\right)$. Each marker represents the skill descriptor of one policy; the color of each marker represents the return obtained by the policy. (\textbf{B}) DA-QD{} discovers diverse locomotion skills; illustration of the execution of three sampled skills from the repertoire.
}\label{fig:omni-rep-viz}
\end{figure}
\subsection{Hexapod Uni-directional Skill}
The new skill space referred to in section~\ref{sec:exps-continual} has the skill descriptor $\vec{sd}$ defined as follows:
\begin{equation*}
\vec{sd} =
\begin{pmatrix}
\frac{1}{K} \sum_k{U(\Theta_T(k) - 0.005 \pi)} \\
\frac{1}{K} \sum_k{U(-\Theta_T(k) - 0.005 \pi)} \\
\frac{1}{K} \sum_k{U(\Psi_T(k) - 0.005 \pi)} \\
\frac{1}{K} \sum_k{U(-\Psi_T(k) - 0.005 \pi)} \\
\frac{1}{K} \sum_k{U(\Phi_T(k) - 0.005 \pi)} \\
\frac{1}{K} \sum_k{U(-\Phi_T(k) - 0.005 \pi)} \\
\end{pmatrix}
\end{equation*}
where $U(\cdot)$ is the unit step function
$\Theta_T(k)$, $\Psi_T(k)$, and $\Phi_T(k)$ correspond respectively to the roll, pitch, and yaw angles of the robot's torso after an interval of $k=15\text{ms}$. $K$ represents the total number of 15ms intervals during an episode. The return $R$ is defined as:
\begin{equation*}
R = x_T
\end{equation*}
where $x_T$ is the displacement in the forward direction at the end of the episode $T$.
This results in diverse ways of walking forward. This skill repertoire was taken from~\cite{cully2015robots} where it was used to show state-of-the-art damage recovery.
\subsection{Additional results for few-shot learning} \label{app:fewshot_ablation}
This section provides additional results for section \ref{sec:exps-zero_few_shot}. Table \ref{table:continual-ablation-results} shows extended results for the performance of the skills depending on the number of skills selected from the imagined repertoire when performing few-shot learning.
\input{tables/table_ablation_selection_acquisition}
\subsection{Reset-Free Trial and Error}
\label{appendix:rte-reset}
The skill repertoire $\mathcal{A}$ returned by DA-QD{} can be used to accomplish long-horizon tasks in the real world and also be leveraged for adaptation in the event of damage.
To do this, we use the Reset-free Trial and Error (RTE) algorithm \cite{chatzilygeroudis2018reset} based on the returned skill repertoires.
The RTE algorithm predicts the real-world outcomes of the skills from the repertoire, and uses those predicted outcomes as a basis for planning in the real-world environment.
RTE is divided into two phases (see Figure~\ref{fig:two_phase_qd}): the skill discovery phase (in simulation) and the planning phase.
During the skill discovery phase, a skill repertoire is learned via a QD algorithm, such as DA-QD{} or MAP-Elites. The skill repertoire is then used as a prior for the Gaussian Processes.
Gaussian Processes (GPs) are then set to predict the difference between the outcomes in simulation and in the real world.
Similarly to (Chatzilygeroudis et al., 2018) \cite{chatzilygeroudis2018reset}, we use GPs to learn the mapping:
\begin{equation*}
\left(\vec{sd} \in \mathcal{A} \right) \rightarrow \vec o_{real}
\end{equation*}
where $\vec o_{real}$ is a low-dimensional vector containing information about the robot displacement (such as the $(x, y)$ displacement, and the difference of orientation $\theta_{new} - \theta_{old}$).
During the planning phase, RTE uses these GP predictions together with a Monte-Carlo Tree Search (MCTS) planner to decide on the best action to execute.
After each executed action, the observed outcome $\vec o_{real}$ is measured and added to the GP datasets; the GP predictions are then updated accordingly. We then re-plan using these updated GP predictions at the next step.
The RTE algorithm keeps alternating between the MCTS planning and the GP updates until the task is solved. This re-planning along with online GP updates of the skill repertoire allows us to do online adaptation in the form of sim-to-real transfer and damage recovery, while performing a long-horizon task.
\begin{figure}[ht]
\centering
\includegraphics[width=\linewidth]{figures/2_phase_qd.pdf}
\centering
\caption{
\textbf{Skill Discovery Phase}: Skills are discovered using any QD algorithm resulting in a repertoire of skills. \textbf{Planning Phase}: The skill repertoire produced is used by a planning algorithm to accomplish a long-horizon task. GP models which are used for rapid adaptation are also initialized with the skill repertoire.
}\label{fig:two_phase_qd}
\end{figure}
\section{Quality-Diversity and other Skill Discovery Methods} \label{app:other-skill-discovery-methods}
Other methods for skill discovery in RL such as DIAYN~\cite{eysenbach2019diayn} and DADS~\cite{sharma2019dynamics} among others are based on Mutual Information (MI) maximization and different formulations of this MI objective. Quality-Diversity (QD) algorithms and MI maximization based algorithms have similar goals: \textbf{learning a repertoire of diverse policies} $\Pi$, where policies in this repertoire exhibit diverse behaviors.This objective can be summarized as maximizing the entropy of some function of the trajectories in this repertoire of policies.
\begin{align}
\max H(f(\tau_i)) \pi_i \in \Pi
\end{align}
In both cases, the repertoire of policies can serve various purposes such as hierarchical planning~\cite{chatzilygeroudis2018reset, sharma2019dynamics} and adaptation to unforeseen situations~\cite{cully2015robots, chatzilygeroudis2018reset, kumar2020one}. The biggest difference between QD and MI maximization methods and where the methods diverge is the choice on how to represent the set of policies $\Pi$. QD algorithms opt to explicitly keep a population or repertoire (sometimes also referred to as an archive) of policies $\pi_i(a|s)$ while MI maximization methods represent these set of policies as a latent-conditioned policy $\pi(a|s,z)$. The difference in choice of representation arise due to how the methods function and how the policies are optimized.
Therefore, this section describes some of the similarities and differences between these methods.
\subsection{Differences}
\subsubsection{Problem Formulation}
As mentioned above, the difference in choice of the representation for the set of policies $\Pi$ are due to the underlying mechanisms of how these methods function. The representations matter as we want the diverse behaviors we obtain to be \textbf{controllable} by our policy. We have to somehow associate the policies in the repertoire to the diverse behaviors $f(\tau)$ we want as set in the objective.
\paragraph{QD Algorithms}
The QD family of algorithms, which originate from population-based methods~\cite{lehman2011evolving, pugh2016quality, cully2013behavioral, cully2017quality}, represents $\Pi$ explicitly as a repertoire of policies, keeping one policy $\pi_{\theta_i}$ for each skill. Each policy has an associated skill descriptor $\vec{sd}_i$ which is obtained from rolling out the policy to obtain its trajectory $\tau_i$. The skill descriptor is just an encoding of this trajectory $\vec{sd}_i = f(\tau_i)$. As explained in section \ref{sec:background}, new policies are only added to this repertoire $\Pi$ if they are novel (according to $\vec{sd}$) or higher-performing. Maintaining this repertoire of policies is central to computing the novelty of policies and in driving the search towards more novel or higher-performing policies. As described in section \ref{sec:background}, the novelty is computed as the average Euclidean distance to its k-nearest neighbors in this repertoire. This novelty measure is used in the novelty search~\cite{lehman2011evolving} line of work but has recently been referred to also as particle-based entropy.
Controllability in this case is trivial because the parameters $\theta_i$ for each policy is explicitly kept as part of the repertoire $\Pi$ for each skill policy $\pi_{\theta_i}$.
\paragraph{MI maximization algorithms}
MI maximization methods on the other hand represents the set of of policies $\Pi$ as a latent-conditioned policy $\pi(a|s,z)$. z is commonly sampled from an arbitrary uniform distribution before rolling out the policy. In this case, an additional term is added to the original objective to make the policy controllable by selecting a z, resulting in the MI maximization objective and its other formulations due to the symmetry of the MI.
\begin{align}
\max H(f(\tau)) - H(f(\tau)|z)
\end{align}
\begin{align}
\max H(f(\tau)) - H(f(\tau)|z)
= \max I(f(\tau), z)
= \max H(z) - H(z|f(\tau))
\end{align}
As a result, MI maximization methods involve making an approximation for this intractable additional term in the form a variational lower bound. Learning this term is usually referred to as learning a discriminator $q(z|s)$ or skill dynamics $q(s_{t+1}|s_{t},z)$ depending on the MI formulation. The latent-conditioned policy is then optimized using off-the-shelf model-free RL algorithms which use these quantities as an intrinsic reward.
Therefore, despite similar objectives, there is a fundamental difference in how diversity is driven in both methods arising from choice of policies. QD methods rely on maintaining a repertoire and novelty measures while MI maximization methods rely on learning a discriminator to separate the different behaviors along with model-free RL algorithms.
\subsubsection{Nature of Diversity}
The nature of behavioral characterizations between these methods are also different.
The comparison here is akin to policy search based on evolutionary strategies and policy search based on gradient descent.
\paragraph{QD algorithms}
QD algorithms characterize their behaviors via skill descriptors. As introduced above, the skill descriptor is an encoding of the entire trajectory of a policy after being rolled-out $\vec{sd}_i = f(\tau_{\pi_i})$.
QD maximizes the entropy (or spread) of the policies in the skill descriptor space.
In sections~\ref{sec:exps-sample_eff} and~\ref{sec:navigation}, the skill descriptors used for the hexapod correspond to the final $(x,y)$ position of each solution.
And in the zero-shot learning task (section~\ref{sec:exps-continual}), the skill descriptor for the new skill is a 6-dimensional vectors representing the average proportion of time the orientation of the robots torso is beyond an angular threshold value.
The return of the algorithm is a repertoire of different policies exhibiting behaviors that are diverse with respect to their skill descriptors.
\paragraph{MI maximization algorithms}
On the other hand, most MI maximization RL methods operate at the transition level.
It has been shown that maximizing the sum of MI between the states in the trajectory and $z$ lower bounds the MI between the entire trajectory and $z$: $I(\tau, z) \geq \sum_{t=1}^T I(s_t,z)$.
MI maximization RL considers an intrinsic reward designed to maximize the mutual information between the skill $\vec z$ and the states explored by the skill-conditioned policy $\pi \left( \cdot | \cdot, \vec z \right)$.
In the specific case of DADS, the purpose is to maximize the mutual information $I(\vec s_{t+1}, \vec z | \vec s_t)$ (mutual information between the robot's next state $\vec s_{t+1}$ and the skill $\vec z$, given the current state $\vec s_t$).
The return of these algorithms is a single skill-conditioned policy, exhibiting diverse behaviors when sampling different skills $\vec z$.
\subsubsection{Gradient-based VS Gradient-free}
\paragraph{QD algorithms}
Instead of relying on first-order optimization algorithms, QD algorithms generally rely on Evolutionary Algorithms or Evolutionary Strategies to drive the diversity during search.
Such techniques have the advantage of being easily parallelizable, usable with non-differentiable policies and controllers \cite{tang2020neuroevolution} and shown to be viable alternative for Reinforcement Learning \cite{salimans2017evolution}.
However, most of these algorithms suffer from a lack of sample efficiency, which is the motivation for our work in the context of QD algorithms.
Despite being gradient-free, there is nothing in the QD method that restricts using gradients. Recent work has shown impressive results when incorporating gradient-based methods into the QD framework~\cite{nilsson:hal-03135723} when neural network policies are used.
\paragraph{MI maximization algorithms}
MI-based RL algorithms rely on deep RL algorithms to perform optimization of the policy.
Hence, most components in these algorithms need to be differentiable and gradient based.
As MI-based RL algorithms commonly operate at the transition level, they can define a trajectory-agnostic reward.
Maximizing the policy's return when considering this reward aims at maximizing the mutual information objective $I(\vec s_{t+1}, \vec z | \vec s_t)$ in the case of DADS.
Any RL algorithm with any gradient-based optimizer can be used to optimize the skill-conditioned policy.
Such gradient-based optimizers make it easy to train controllers having a large number of parameters such as neural networks.
\subsubsection{Task Reward}
\paragraph{QD algorithms}
QD algorithms inherently accommodate to task-related rewards. They prioritize the diversity of the learned policy repertoire, while locally maximizing the return of each policy.
For example, in the skill repertoire, a new solution is added to the repertoire if it is novel enough with respect to the solutions that are already present in it.
Then, each policy already present in the repertoire may be replaced by a policy having a better return and a similar skill descriptor (Local competition/optimization).
\paragraph{MI maximization algorithms}
DADS and DIAYN are exploration-only algorithms; as such, they rely exclusively on intrinsic task-agnostic rewards.
Recent work in MI-based RL such as SMERL~\cite{kumar2020one} have aimed to bring task-related reward into this line of work by formulating the problem as a Constrained Markov Decision Process (CMDP).
The CMDPs aim to maximize the diversity of a repertoire of policies, while also constraining the learned policies to achieve a minimal return on the task.
Solving those CMDPs leads to a repertoire of policies that are diverse among all the best-performing policies.
\subsection{Similarities}
There is also some similarity between the ways behaviors are characterized among both these methods.
For example, most of the experiments performed in DADS~\cite{sharma2019dynamics} and DIAYN~\cite{eysenbach2019diayn} mention restricting the observation space to the x,y coordinates of the robot. The authors call this a \textit{prior}. Hence, the discriminator $q_{\vec \phi}$ (or skill-dynamics) used mostly rely on this $(x,y)$ \textit{prior}.
In that case, the discriminator $q_{\vec \phi}\left( \left(x,y\right)_{t+1} | \left(x,y\right)_{t}, \vec z \right)$ biases exploration towards diverse behaviors with respect to the $\left(x,y\right)$ space.
Similarly, this is analogous to Quality-Diversity algorithms which require the definition of a skill descriptor $\vec{sd}$.
By defining the skill descriptor, we inject a prior over the dimensions and space where we want to see diversity.
In our locomotion experiments, the skill descriptors are similarly defined as the final $(x,y)$ coordinates of the robot which biases exploration towards diversity in the $(x,y)$ space.
Various types of skills descriptors can be used to characterize a behavior in the case of QD methods and defining it manually is just a way of injecting a prior on the diversity we desire.
However, in the case of where we do not have a prior or would like to learn a prior, there have been recent work to learn these skill descriptors in an unsupervised manner~\cite{cully2019autonomous, paolo2020unsupervised}. As mentioned in the main text, this is outside the scope of our contribution and we leave this for future work.
\section{Quality-Diversity and Goal-Conditioned RL} \label{app:goal-conditioned-RL}
A recent study done by Choi et al.~\cite{choi2021variational} shows that Goal-Conditioned RL (GCRL) leads to a lower bound on the same objective as MI-maximization based methods and can be interpreted as a coarse variational approximation. GCRL can be interpreted as MI-maximization (or variational empowerment) algorihtm that has a fixed variational distribution. Conversely, skill-discovery via MI-maximization can be interpreted as a combination of representation learning and GCRL. They show that GCRL and prior-based variational empowerment (i.e. DIAYN) lie on different ends of the same spectrum.
Hence, many of the points discussed above for QD and other skill discovery methods based on MI-maximization remain for Quality-Diversity and GCRL. The choice of representation for the set of policies remain as the main difference which arise from the different methodologies taken. There are also some documented similarities. Goal spaces in some cases and experimental setups can also be interpreted as the skill or behavior space in QD algorithms. QD algorithms can be seen as a population-based implementation of the well-known Intrinsically Motivated Goal Exploration Processes (IMGEP) framework as explained in Forestier et al.~\cite{forestier2017intrinsically}.
\clearpage
\pagenumbering{arabic}
\section*{Considerations for CoRL 2021 and the Pandemic}
Given social distancing restrictions and remote working orders caused by the pandemic, we had limited access to the lab and hardware to perform real-world experiments. We had hoped to do more real-world experiments to show how DA-QD{} can be used directly in a real-world setting but had to focus on the final application of a resulting repertoire produced by DA-QD{} in simulation due to the constraints on access. However, we still managed to conduct extensive real-world experiments in order to thoroughly evaluate our methodology. For all evaluations, we ensured enough replications were performed to assess the statistical significance. We also utilized open-sourced physics simulators which supplemented our real-world results while working remotely.
\section{Discussion and Conclusion} \label{sec:discussion}
\textbf{Summary.} We introduced a novel algorithm, DA-QD{}, for sample efficient discovery of diverse skills by combining a dynamics model and imagined skill repertoire with Quality-Diversity.
Thanks to this, DA-QD{} is about 20 times more data-efficient than previous methods.
DA-QD{} also demonstrated zero-shot and few-shot skill acquisition which was not possible before this using prior QD methods.
We further show robots using DA-QD{} are capable of long-horizon navigation and damage adaptation.
\textbf{Limitations.}
As we use deep neural networks as dynamics models, we also inherit their common limitations. Of concern to us, the model accuracy of longer horizon rollouts can impact the performance of DA-QD{}. Future research can use latent dynamics models which work better for long-term predictions~\cite{hafner2019dream} and also allow DA-QD to scale to higher-dimensional and more complex domains.
While effective for planning, the skill spaces explored are still low dimensional; this limits scaling to more complex skills. Future work will aim to combine DA-QD with existing approaches to skill descriptor learning~\cite{cully2019autonomous, pere2018unsupervised, paolo2020unsupervised} using unsupervised representation learning methods like autoencoders.
\section{Experiments}
Our experiments address three questions:
(1) Are dynamics models more effective surrogate models than direct models for skill discovery using QD?
(2) Does the DA-QD{} framework with an imagined repertoire allow for zero-shot and few-shot acquisition of new skills?
(3) Given a limited number of evaluations, does DA-QD{} outperform vanilla QD on a long horizon real-world navigation task?
In our experiments (\ref{sec:exps-sample_eff} and \ref{sec:exps-continual}), we perform skill discovery in simulation. The resulting skill repertoires learnt are then used to perform navigation and damage recovery in the real-world (\ref{sec:navigation}).
\subsection{Environment} \label{sec:exps-envs}
\textbf{Hexapod Locomotion.} For our experiments, we use an open-sourced 18-DoF hexapod robot (see Figure \ref{fig:images-hexapod-trajectory-damaged}).
The goal for the robot is to learn primitive locomotion skills that enable it to move in every direction. We call this the omni-directional skill repertoire. To do this, we use a 2-D skill descriptor defined by the final $(x,y)$ position reached by the robot after an episode of three seconds. The reward for this skill repertoire encourages the robot to follow a circular trajectory~\cite{cully2013behavioral, chatzilygeroudis2018reset} defined by $R = |\alpha_i-\alpha_d|$, where $\alpha_i$ is the robot's final orientation and $\alpha_d$ the tangent of the desired circular trajectory. The resulting skill repertoire consists of skills as shown in Figure~\ref{fig:hexa_omni_ablation}A.
We define a primitive policy as a parametric low-level controller, as used in~\cite{cully2015robots, chatzilygeroudis2018reset}. Each joint angle follows a periodic function parameterized by the amplitude, phase and duty cycle of a sinusoid wave. The angular position of the third joint of each leg is opposite to the second leg, leading to 12 independently controlled joints. In total, a movement primitive consists of 36 parameters, $\vec \phi$. We use this policy representation for its simplicity in showing the performance of the overall algorithm. It also injects periodic movement priors which are useful for locomotion. However, more complex policies with a larger number of parameters such as deep neural networks can also be used in the future with our method~\cite{colas2020scaling, nilsson:hal-03135723}.
\subsection{Sample Efficiency} \label{sec:exps-sample_eff}
\begin{figure}[t]
\centering
\includegraphics[width=0.49\textwidth]{figures/figure_comparisons_r2.pdf}
\caption{%
(\textbf{A}) Illustration of the omni-directional skill repertoire for the hexapod;
(\textbf{B} and \textbf{C}) Evolution of repertoire size and QD score for the variants under study.
Each curve presents the evolution of the median performance from 10 replications.
The shaded areas represent the associated interquartile range.
For DA-QD{}, we report the size and QD score of the repertoire $\mathcal{A}$.
}\label{fig:hexa_omni_ablation}
\vspace{-5mm}
\end{figure}
We first show that DA-QD{} improves the sample efficiency of skill discovery in QD algorithms.
\textbf{Baselines and Metrics.}
We compare DA-QD{} against random exploration, Vanilla QD and M-QD~\cite{keller2020model} (QD with direct model) as baselines.
We evaluate the performance of these algorithms using two metrics: (1) the \textit{repertoire size}, which measures the coverage and diversity of the skill repertoire; and (2) the \textit{QD-score}~\cite{pugh2016quality}, which measures the quality of the skills in the repertoire.
The QD-score is computed as the sum of the returns of all the policies in the repertoire.
\textbf{Results.}
Figure \ref{fig:hexa_omni_ablation} shows curves for the progress of the metrics during skill discovery on the hexapod environment. With a median repertoire size and QD-score of $738$ and $694$ after $5\times10^4$ evaluations, DA-QD{} outperforms vanilla QD with $10^6$ evaluations on both metrics. DA-QD{} also performs on par and is equivalent to M-QD with a median repertoire size of $705$ and a QD score of $680$ after $10^6$ evaluations. However, DA-QD{} achieves a significant increase ($\sim$20 times) in sample efficiency.
As DA-QD{} approaches convergence, the number of skills added to the imagined repertoire significantly decreases. We stop the algorithm as soon as less than one policy is added to the imagined repertoire in one iteration.
These results demonstrate that our dynamics model is a better surrogate model than the direct model (as used in M-QD) and leads to high data efficiency. We hypothesize that this is due to the dense training signals from each state transition. We can leverage a much larger dataset to train the dynamics model in comparison to learning a direct model, where one data point corresponds to one evaluation. Additionally, learning a mapping from parameter space to the skill space is potentially more difficult than modeling the transition dynamics. The mapping required to be learnt by the direct model also makes the performance sensitive to the choice of parameter space used.
\subsection{Continual Acquisition of Skills} \label{sec:exps-continual}
One of the benefits of learning a dynamics model is that we can re-use the model for another task.
Given a previously learnt dynamics model $\widetilde{p}_{\vec \theta}$, we can fully perform QD skill discovery in imagination to acquire additional skill repertoires.
As opposed to modeling the next state distribution like in our dynamics model, the direct model from M-QD directly learns a mapping from the parameter space to the skill descriptor and reward space.
This makes the direct model specific to the skill repertoire it was trained on and cannot be re-purposed to learn another skill.
\textbf{Task and Metrics.} Using the same hexapod environment as above and the corresponding learnt dynamics model from \ref{sec:exps-sample_eff}, we now define a different skill descriptor that aims to find many diverse ways to walk forward as fast as possible (details in~\cite{cully2015robots}).
This skill descriptor characterises changes in the angular position of the robot when walking.
This leads to skills with diverse forward locomotion gaits.
To assess the quality of the produced skill repertoires, we report the best return, mean return and size of the skill repertoires.
We show that DA-QD{} is capable of (1) acquiring a new skill repertoire, and (2) learning skills in a zero-shot and few-shot manner for this new task.
\subsubsection{Acquisition of New Skill Repertoires}
\label{sec:exps-acquistion_new_rep}
After performing QD in imagination for 100,000 imagined rollouts (without any evaluations in the environment), we select all the policies present in the fully imagined repertoire $\smash{\widetilde{\mathcal{A}}}$. We evaluate all of them and attempt to add them to the skill repertoire $\mathcal{A}$.
\textbf{Baselines.}
As an equivalent baseline, we consider repertoires generated using vanilla QD with the same number of evaluations: $3{,}000$. This number corresponds to the approximate size of the imagined skill repertoires obtained by DA-QD{} and which are evaluated to form its final repertoires.
As an upper bound, we also compare our results with skill repertoires generated using vanilla QD with $100{,}000$ evaluations, which corresponds to the number of imagined rollouts performed in DA-QD{}.
\textbf{Results.}
Naturally, due to the inaccuracies of the model $\widetilde{p}_{\vec \theta}$, the final skill space coverage (repertoire size) of DA-QD{} is lower than its imagined repertoire size (see Table~\ref{table:continual-results}).
Yet, skills discovered by DA-QD{} in imagination significantly outperform the equivalent vanilla QD variant with the same number of evaluations both in terms of performance and diversity.
While the skill repertoire size is smaller compared to the upper baseline which uses $10^5$ (${\sim}30\times$ more) evaluations, DA-QD{} achieves similar best return and better average return.
\subsubsection{Zero-shot and Few-shot Acquisition of Skills}
\label{sec:exps-zero_few_shot}
Instead of evaluating all the skills of the imagined repertoire, like in the previous section, we can evaluate only a few to obtain new skills in a zero-shot or few-shot manner. The model uncertainty (\ref{sec:methods-dyn_model}) is used to select from the imagined repertoire skills that are most likely to succeed when executed. We select 20 skills with the lowest model disagreement. From this set, the skill with the best expected return is selected to be executed. We use this selection procedure to evaluate zero-shot performance.
When more trials are permitted, the $n$ best skills in the set can be executed and evaluated for $n$-shot performance.
We only report zero-shot and 20-shot results as preliminary experiments show that the best return increases as the number of taken trials increases.
\textbf{Results.} Table~\ref{table:continual-results} shows that using the above selection procedure enables DA-QD{} to obtain skills that successfully solve the new task with minimal or no prior environment interaction.
DA-QD{} (20-shot) performs very similarly to the best policy found by Vanilla QD (Equivalent) while requiring 150 times fewer evaluations.
These few-shot learning capabilities were not possible using prior QD methods.
\subsection{Navigation and Damage Recovery in Real-World}
\label{sec:navigation}
\begin{figure}[t]
\centering
\includegraphics[width=0.49\textwidth]{figures/image-trajectory-hexapod.pdf}
\centering
\caption{%
(\textbf{A}) Picture of the damaged robot;
(\textbf{B}) Example trajectory obtained in the real world for DA-QD{}, where 10 skills are executed to reach the goal.
}
\vspace{-5mm}
\label{fig:images-hexapod-trajectory-damaged}
\end{figure}
Lastly, we show how DA-QD{} can be useful in a real-world long-horizon navigation task, and that the increase in sample-efficiency during skill discovery does not come at the cost of planning and damage recovery capabilities.
\textbf{Task.} We set up a navigation task in which the robot has to navigate through a maze to a goal position using the skill repertoire $\mathcal{A}$ discovered from simulation (via DA-QD{} or any other QD algorithm).
We consider two different scenarios: (1) a \textit{no-damage} scenario where the robot is intact, and (2) a \textit{damaged} scenario in which one of the legs of the robot is removed (Fig.~\ref{fig:images-hexapod-trajectory-damaged}).
The damaged scenario requires the robot to adapt to its damaged condition and solve the task at the same time.
It is important to note that skill discovery in simulation is performed with a fully intact robot, and the robot has no knowledge of its damaged condition when deployed in the real world.
For our experiments, we provide the robot with a 2-D layout of the map it has to navigate as seen in Figure \ref{fig:rte-results}~B.
We use the Reset-free Trial and Error (RTE)~\cite{chatzilygeroudis2018reset} algorithm to solve this navigation task.
\textbf{Skill-space Planning and Adaptation via RTE.} The RTE algorithm relies on a skill repertoire $\mathcal{A}$ to (1) perform planning to solve long-horizon navigation tasks in the real world, and (2) adapt to sim-to-real differences and potential damaged conditions.
To do so, RTE utilises Gaussian Processes (GPs) to predict the difference between the outcome of a skill in simulation and in the real world.
The GP predictions are then used by a Monte-Carlo Tree Search (MCTS) planner to choose the best skill to execute from $\mathcal{A}$.
After each executed skill, the resulting position and orientation of the robot are measured (via a motion-capture system), and the GP predictions are updated accordingly.
More details about RTE are provided in the work of Chatzilygeroudis et al. \cite{chatzilygeroudis2018reset}.
\textbf{Metric.} For each experimental run, we evaluate the total number of repertoire skills that have been executed by the robot to reach the goal.
A low number of executed skills reflects the high quality and diversity of the repertoire.
\input{tables/table_acquisition_skills}
\textbf{Baselines.} To show the effectiveness of using DA-QD{}, we compare skill repertoires generated with DA-QD{} with just 50,000 evaluations to some baselines for these tasks.
As an equivalent baseline, we use vanilla QD to generate skill repertoires with only $50{,}000$ evaluations.
As an upper bound baseline, we do the same but with vanilla QD using $10^6$ evaluations.
For each variant, we generate 10 different repertoires from independent replications and use RTE with each of those repertoires.
This results in 10 replications per variant, both in the real world and in simulation.
\textbf{Results.} Although it uses 20 times fewer evaluations, the results obtained by DA-QD{} are mostly equivalent to the ones from the upper baseline having access to $10^6$ evaluations (Fig.~\ref{fig:rte-results}).
This similarity is noticeable in the no-damage scenario (Fig.~\ref{fig:rte-results}~A), and also in simulation for the damaged scenario.
Thus, DA-QD{} learns a repertoire that is as efficient for long-horizon task solving as the repertoires produced with $20$ times more evaluations.
In the no-damage scenario, DA-QD{} outperforms the equivalent vanilla QD baseline, both in the real world and in simulation (Fig.~\ref{fig:rte-results}~A).
As shown in Figure \ref{fig:rte-results}~B, DA-QD{} requires fewer skills to reach the goal because its displacements tend to be larger. This corresponds to results from \ref{sec:exps-sample_eff} which show that DA-QD{} discovers skill repertoires that have greater coverage and performance over baselines.
In the damaged scenario, some repertoires learnt in simulation heavily rely on the damaged leg to solve the task.
As RTE does not provide any mechanism to handle this issue, those repertoires performed poorly.
The resulting outliers make the comparison challenging between the different variants.
If we compare the performance of those distributions without those outlying performances, DA-QD{} performs slightly better than its equivalent QD algorithm (Fig.~\ref{fig:rte-results}~A).
Given a budget of $5\times 10^4$ evaluations, DA-QD{} learns a repertoire that is more beneficial for long-horizon task solving than those obtained from Vanilla QD algorithms.
\begin{figure}[t]
\centering
\includegraphics[width=0.49\textwidth]{figures/figure_rte.pdf}
\centering
\vspace{-8mm}
\caption{%
(\textbf{A}) Number of actions executed before reaching the goal in the \textit{No Damage} and \textit{Damaged} scenarios.
Results are provided for both the real-world and the simulation settings.
Each box-plot illustrates the distribution obtained from 10 replications.
For each variant in the damaged scenario, the three worst-performing repertoires are represented as outlier points.
(\textbf{B}) Example of real-world trajectories (obtaining median scores in \textbf{A}).
}
\vspace{-5mm}
\label{fig:rte-results}
\end{figure}
\section{INTRODUCTION} \label{sec:introduction}
Despite recent progress, deploying a robot in open-ended real-world settings remains a challenge. This is mostly due to the difficulty for engineers to anticipate all the situations that the robot might have to face. In this context, employing learning algorithms with strong exploration capabilities represents a promising way to enable robots to discover new skills and find new ways to deal with unexpected situations. On the other hand, most exploration methods are sample inefficient and rely on the use of simulators. However, once robots are deployed, sample efficiency is important when acting in the real world.
To be effective and to continually learn when deployed in open-ended real-world environments, robots need sample-efficient exploration algorithms.
In reinforcement learning, Quality-Diversity (QD) algorithms~\cite{cully2017quality,pugh2016quality} have been shown to be powerful exploration algorithms that can solve environments with deceptive rewards and previously unsolved hard exploration tasks on the Atari and robotic domains~\cite{ecoffet2021first}. The importance of QD for exploration in open-ended real-world environments is twofold. Firstly, QD produces collections of high-performing and diverse skills which can be leveraged for versatility and adaptation in real-world environments~\cite{cully2015robots, chatzilygeroudis2018reset, kaushik2020fast}. Secondly, QD is also important during the exploration process. Simultaneously optimizing and preserving a repertoire of policies to diverse skills (or goals) allows for \textit{goal switching}~\cite{nguyen2016understanding, clune2019ai} which enables policies from different skills (or goals) to act as stepping stones to higher performing policies. However, QD algorithms are inherently sample inefficient and heavily leverage the use of simulators.
A common solution to improve sample-efficiency is to use model-based learning methods~\cite{wang2019benchmarking, chua2018deep, kurutach2018model, clavera2018model}. They can incorporate off-policy data and generic priors, making them highly sample efficient. The learnt models can also be re-purposed to solve new tasks~\cite{sekar2020planning}. However, the diversity of training data affects the accuracy of the learned model~\cite{sekar2020planning}. Prior work either learns forward models using random policies~\cite{ha2018world} or update and refine the dynamics model incrementally as the policy is being optimized for the task~\cite{chua2018deep, nagabandi2020deep, janner2019trust, hafner2019learning, hafner2019dream}.
Instead of random or task-specific policies, our work learns a dynamics model using the diverse policies obtained with QD during skill discovery.
In this paper, we introduce Dynamics-Aware Quality Diversity (DA-QD{}), an algorithm that combines deep dynamics models with QD to efficiently perform skill discovery. We use the models to seek out expected novel policies in imagination during skill discovery with QD. Using dynamics models in QD benefits both the QD exploration process and model learning. This lets us learn novel and diverse skills using QD purely from imagined states without any or minimal environment interactions, increasing the sample efficiency of QD by an order of magnitude. At the same time, the QD exploration process inherently provides a rich and diverse dataset of transitions which enables better models to be learnt.
The key contributions of this paper are:
\begin{itemize}[noitemsep, nolistsep, leftmargin=5mm]
\vspace{-2mm}
\setlength\itemsep{0.1em}
\item \textbf{Framework to improve the sample-efficiency of QD using dynamics models.} We show that using dynamics models and the introduction of an imagined skill repertoire enable DA-QD{} to be about 20 times more sample-efficient than previous QD methods for skill discovery.
\item \textbf{Continual acquisition of new skills.} We demonstrate re-use of the dynamics models for QD skill discovery. QD can be performed purely in imagination to learn new skills in a few-shot or zero-shot manner. This was not possible before with prior QD methods.
\item \textbf{Real-world navigation and adaptation capabilities within low evaluation budget.} For long horizon tasks, we pair DA-QD{} with an existing skill planning method. Skill repertoires discovered using DA-QD{} outperform baseline skill repertoires generated with equivalent evaluation budget and are equivalent to methods using a significantly larger budget. We show this by performing extensive real-world experiments on navigation tasks, in both damaged and undamaged conditions.
\end{itemize}
\begin{figure*}[t]
\centering
\includegraphics[width=0.8\textwidth]{figures/DAQD-framework-v5.pdf}
\centering
\caption{
\textbf{Components of DA-QD{}.}
Top (Purple): The agent learns a dynamics model from a dataset of diverse experience generated from skill discovery using QD.
Left (Blue): DA-QD{} uses the dynamics model to perform imagined rollouts to predict the return and skill descriptor and build an imagined repertoire. Depending on the situation, the agent can choose to continue to perform skill discovery using QD with the imagined repertoire or act in the environment.
Right (Green): Agent acts in the environment by selecting skills discovered in its imagined repertoire.
Depending on the outcome, the skills may be added to the repertoire.
DA-QD{} returns a repertoire of diverse and high-performing skills; this repertoire can then be used with planning methods.
}
\vspace{-4mm}
\label{fig:mbme-framework}
\end{figure*}
\section{BACKGROUND: Quality-Diversity} \label{sec:background}
Contrary to conventional single-objective optimization algorithms that search for a single performance-maximizing solution, Quality-Diversity (QD) algorithms generate a collection of diverse and high-performing solutions. QD algorithms achieve this using the notion of novelty which distinguishes between solutions with different behaviours. This novelty is what drives the search and exploration process. To compute novelty, most QD algorithms maintain a repertoire that contains only novel and the highest-performing solutions encountered during the search process. The repertoire is also the final output of the algorithm.
The novelty of a policy is estimated via a skill descriptor, denoted $\vec{sd}$.
The skill descriptor is a numerical vector that characterizes the behaviour of a policy.
QD algorithms learn a repertoire of policies that explore and cover the skill descriptor space as much as possible.
For example, if we want a robot to discover locomotion primitives that allow it to reach any location around it, the final position of the robot can be used as a skill descriptor~\cite{cully2013behavioral, chatzilygeroudis2018reset}.
MAP-Elites~\cite{mouret2015illuminating} is a simple QD algorithm that discretizes the skill space into a grid. Different variations of MAP-Elites manage the repertoire differently~\cite{vassiliades2016using, fontaine2019mapping}. Our approach builds on MAP-Elites but uses an unstructured repertoire~\cite{lehman2011evolving, cully2017quality}, as its flexibility allows the density of the skill space to be adapted easily and enables further extensions such as unsupervised skill descriptors~\cite{cully2019autonomous}.
The skill repertoire $\mathcal{A}$ begins empty and is initialized with a set of randomly generated policies, sampled in the parameter space. QD then follows a loop that; (1) selects and copies $N$ policies $(\policyreal{i})_{i\in\left[1..N\right]}$ from the repertoire $\mathcal{A}$, (2) applies a variation operator on the parameters $\param{i}$ of the selected policies to get new parameters $\parammutated{i}$, (3) evaluates each newly formed policy $\policyrealmutated{i}$ and gathers the agent trajectory to obtain the skill descriptor $\vec{sd}_i$ and the sum of rewards (return) $R_i$, and (4) updates the repertoire based on the novelty score and the return of the policies. The novelty score of a policy $\policy{}$ is computed as the average Euclidean distance to its $K$ nearest skill descriptors $(\vec{sd}_k)_{k\in \left[1..K\right]}$ from the repertoire:
\vspace{-4pt}\begin{equation}
\label{equation:novelty-score}
novelty(\policy{}) = \frac{1}{K}\sum_{k=1}^{K} \|\vec{sd}_{\policy{}} - \vec{sd}_k \|_2
\end{equation}
We use the same repertoire addition condition as in Cully et al., 2017~\cite{cully2017quality}. A policy is added to the repertoire if (i) the distance to its nearest neighbour exceeds a predefined threshold, $l$, meaning it is novel enough. If the distance to its nearest neighbour is lower than $l$, the skill can replace its nearest neighbour in the repertoire if: (ii) the distance to the second nearest neighbour is greater than $l$ and if it improves the repertoire either by having a greater quality score or novelty score over its nearest neighbour. Otherwise, this policy will be discarded. These repertoire addition conditions ensure both quality (exploitation) in the form of local competition within a certain niche of skills, and diversity (exploration) through the preservation of novel behaviours in our skill repertoire.
Traditionally, QD search is driven by an Evolutionary Algorithm (EA) for its effectiveness in diversifying the search to find novel skills. In our work, we use uniform selection operators and EA variation operators, which perturb the parameters of a policy during the optimization process to generate new policies. Specifically, we use the directional variation~\cite{vassiliades2018discovering}:
\vspace{-2pt}
\begin{equation}
\label{equation:directional-variation}
\parammutated{} =
\param{1}
+ \sigma_1 \mathcal{N}(0, \mat{I})
+ \sigma_2 \mathcal{N}(0, 1) (\param{2} - \param{1})
\end{equation}
where $\param{1}$ and $\param{2}$, are the parameters of two randomly selected skill policies from the repertoire. Updated parameters, $\parammutated{}$, are obtained by adding Gaussian noise with a scalar covariance matrix $\sigma_1 N(0, \mat I)$ to $\param{1}$ and displacing the parameter vector along the line from $\param{1}$ to $\param{2}$.
\input{related_work}
\section{Dynamics-Aware Quality-Diversity}
DA-QD{}, illustrated in Figure~\ref{fig:mbme-framework}, is an extension to QD algorithms that incorporates a dynamics model to increase sample efficiency of QD and allows for the continual acquisition of new skills.
DA-QD{} introduces two new components over the standard QD framework: a dynamics model $\widetilde{p}_{\vec \theta}$, and an imagined skill repertoire $\smash{\widetilde{\mathcal{A}}}$.
We learn a dynamics model using experience from skill discovery with QD (\ref{sec:methods-dyn_model}).
Using the dynamics model, we perform QD exploration in imagination and build an imagined skill repertoire (\ref{sec:methods-qd_exploration_imag}). Finally, we select policies from the imagined repertoire; these policies are executed to build the final skill repertoire (\ref{sec:methods-acting_in_env}).
Only evaluating policies novel or high-performing enough to be added to the imagined repertoire enables DA-QD{} to be significantly more data-efficient.
\subsection{Learning Dynamics Models} \label{sec:methods-dyn_model}
DA-QD{} learns a forward dynamics model $\widetilde{p}_{\vec \theta}(\vec s_{t+1} | \vec s_t, \vec a_t)$, and recursively uses the model predictions to imagine trajectories.
We use an ensemble of probabilistic neural networks as the forward dynamics model to capture both the aleatoric and epistemic uncertainties of the model.
Following prior work using neural networks as dynamics models~\cite{chua2018deep, nagabandi2020deep}, we capture the aleatoric uncertainty using output neurons which parameterize a normal distribution: $\widetilde{p}_{\vec \theta}(\cdot |\vec s_t, \vec a_t) = \mathcal{N}(\mu_{\vec \theta}( \vec s_t, \vec a_t), \Sigma_{\vec \theta}(\vec s_t, \vec a_t))$.
We also capture the epistemic uncertainty through the use of ensembles~\cite{chua2018deep} by taking the average disagreement between the models in the ensemble.
The model is trained incrementally by maximizing the log-likelihood based on the transition data stored in the replay buffer.
The transition data is collected from experience of evaluations performed during the skill discovery stage with QD.
Learning dynamics models in this self-supervised manner does not incur any additional cost to obtain data, and allows us to make use of the dense training signals from each state transition.
Our approach differs from M-QD which considers only the skills present in the repertoire as a dataset to update its model.
Conversely, DA-QD{} considers the transitions from every evaluated skill, including those not added to the repertoire.
\subsection{Performing QD Exploration in Imagination} \label{sec:methods-qd_exploration_imag}
DA-QD{} uses the imagined trajectories introduced in the previous section to build an imagined repertoire $\smash{\widetilde{\mathcal{A}}}$.
This imagined skill repertoire works in the same way as a standard skill repertoire but only contains imagined skills (i.e., that have been exclusively evaluated with the dynamics model).
From imagined trajectories, we can obtain imagined skill descriptors $\smash{\widetilde{\vec{sd}}}$ and imagined returns~$\smash{\widetilde{R}}$.
Following the addition condition (section~\ref{sec:background}), if $\smash{\widetilde{\vec{sd}}}$ is novel enough, or if $\smash{\widetilde{R}}$ is high enough, the policies are added to the imagined repertoire $\smash{\widetilde{\mathcal{A}}}$.
We keep performing QD exploration in imagination from the imagined skill repertoire $\smash{\widetilde{\mathcal{A}}}$ until a stopping criterion is met.
The nature of this stopping criterion may be adapted according to our needs.
In the simplest case, we define a fixed number of iterations to perform QD in imagination.
For example, if we want to use this framework as a simple surrogate model, the stopping criterion is set to one iteration of imagined rollouts.
Alternatively, we can set this condition to be dependant on the state of the imagined repertoire (i.e. repertoire size, average return, number of skills added, etc.).
\subsection{Acting in the Environment} \label{sec:methods-acting_in_env}
After performing QD exploration in imagination, skills are selected from the imagined repertoire $\smash{\widetilde{\mathcal{A}}}$ to be evaluated in the environment.
There are several possible ways to perform this selection.
For instance, we can choose to select all policies that have been successfully added to the imagined repertoire, as in~\ref{sec:exps-sample_eff}.
Alternatively, we can take into account the uncertainty in model predictions for the policies in the imagined repertoire: policies with low model uncertainty are likely to work in the environment, as in~\ref{sec:exps-continual}.
Transitions from evaluated policies are stored in the replay buffer.
Once these policies are evaluated, we update the repertoire $\mathcal{A}$ following its addition condition (see section~\ref{sec:background}).
As soon as $\mathcal{A}$ is updated, the two repertoires are synced: the content of the imagined repertoire $\smash{\widetilde{\mathcal{A}}}$ is replaced with the content from $\mathcal{A}$.
Finally, the dynamics model $\widetilde{p}_{\vec \theta}$ is trained with the updated replay buffer after all selected skills have been evaluated.
This way, we ensure our imagined repertoire and the dynamics model are as close to the environment as possible.
\section{RELATED WORK}\label{sec:related-work}
\textbf{Skill Discovery for Adaptation.}
Quality-Diversity (QD) algorithms~\cite{pugh2016quality, cully2017quality, lehman2011evolving} can be used to learn a large repertoire of diverse and high-performing skills~\cite{cully2013behavioral}. Such repertoires have allowed for rapid damage recovery for robots~\cite{cully2015robots, chatzilygeroudis2018reset, colas2020scaling, kaushik2020adaptive} and can also be used by a planning algorithm to perform more meaningful longer-horizon tasks~\cite{chatzilygeroudis2018reset}. Our work builds on QD-based methods for skill discovery to improve the sample-efficiency bottleneck of these methods.
Other methods for skill discovery exist. These are commonly based on maximizing mutual information (MI) between states in a trajectory and a sampled latent code~\cite{gregor2016variational, eysenbach2019diayn, hansen2019fast, sharma2019dynamics}. The latent variable used in these methods is analogous to the skill descriptor used in QD-based methods. Despite some similarities and having the same goal of obtaining a diverse set of policies (skills), these methods differ in their fundamentals. MI maximization methods represent the set of policies as a single latent-conditioned policy while QD methods explicitly keep a large number of individual policies to form an archive.
As a result of this choice of representation, MI-maximization methods optimize the policy using gradient-based RL algorithms driven by the MI objective as an intrinsic reward.
On the other hand, QD methods rely on incrementally building a repertoire to maximize diversity in the skill descriptor space and locally optimize policies.
This mechanism enables QD methods to consider task-based rewards during skill-discovery, which is not trivial in MI-maximization methods~\cite{kumar2020one}.
Due to the core differences between these methods, it would not be fair nor straightforward to compare them with the same evaluation metrics and ablations. Additionally, given that our focus is on the improvement of QD algorithms, we do not compare with MI maximization methods for skill-discovery.
\textbf{Models and Sample Efficiency in QD Search.}
Evolution-based methods typically require a large number of evaluations during the optimization process. The sample efficiency of such evolutionary algorithms can be improved via the use of surrogate models. Such models approximate the reward function and can be used in place of performing expensive evaluations. Inspired by this, SAIL~\cite{gaier2018data} introduced the use of a surrogate model for QD search and showed an increase in sample efficiency when evaluating aerodynamic designs. However, SAIL cannot be used to predict the skill descriptor.
Closest to our work, M-QD~\cite{keller2020model} uses a neural network as a surrogate model to predict both reward and skill descriptor. M-QD directly models the mapping from the parameter space to the skill descriptor space and the return function. We will refer to this as a \textit{direct model}. This model can also be used to adapt to skills in-between the discrete skills found in a repertoire. Like M-QD, we learn a model that can be used as a surrogate model to predict both the return and skill descriptor, but unlike M-QD our model is not task-specific and can be re-used to learn additional skill repertoires.
An alternative method that has been shown to increase the sample efficiency of QD is the addition of more complex optimization techniques.
When combined with policy gradients~\cite{nilsson:hal-03135723} and evolution strategies~\cite{colas2020scaling, fontaine2020covariance, cully2020multi}, the efficiency of QD algorithms can be improved.
Our work is complementary to this line of work and these methods can easily be incorporated into our framework in future work.
\textbf{Model-based Reinforcement Learning.}
Model-based RL (MBRL) methods are effective methods for efficient learning. Recent methods involve learning forward models using deep neural networks which are capable of capturing complex systems dynamics~\cite{nagabandi2020deep}. Methods then fall into two main categories; i) model-based policy search methods that alternate between updating the dynamics model and learning a policy using imagined rollouts from the model's predictions~\cite{hafner2019dream, janner2019trust, rajeswaran2020game}, and ii) model-based planning methods which generally use online planning algorithms with the model to choose optimal actions in a model predictive control (MPC) loop~\cite{chua2018deep, nagabandi2020deep}. Our work is closer to the first setting. We alternate between incrementally learning a deep dynamics model and performing QD search. However, instead of optimizing a single policy using the model, we learn and optimize a repertoire of diverse policies.
Another common choice of transition model in MBRL is Bayesian models such as Gaussian Processes (GPs). GPs have shown to be effective and remarkably sample efficient especially when there are smaller amounts of data and for low-dimensional problems~\cite{deisenroth2011pilco}. However, GP models do not perform well with high-dimensional data and suffer from ill-suited kernels on tasks in which dynamics are complex~\cite{calandra2016manifold}. In our work, we leverage the strengths of GPs by using them on a higher level of abstraction: the GPs operate on the skill descriptor space, which is both low-dimensional and has fewer discontinuities.
\section*{APPENDIX}
\section*{ACKNOWLEDGMENT}
This work was supported by the Engineering and Physical Sciences Research Council (EPSRC) grant EP/V006673/1 project REcoVER.
\bibliographystyle{IEEEtran}
| {'timestamp': '2021-09-20T02:16:41', 'yymm': '2109', 'arxiv_id': '2109.08522', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08522'} | arxiv |
\section{Background and Related Work}
\paragraph{Sparse retrieval}
Before the emergence of dense retrievers, traditional sparse retrievers such as TF-IDF or BM25 were the de facto method in open-domain question-answering systems~\cite{chen2017reading,yang2019end}.
These sparse models measure similarity using weighted term-matching between questions and passages and do not train on a particular data distribution.
It is well-known that sparse models are great at lexical matching, but fail to capture synonyms and paraphrases.
\paragraph{Dense retrieval} On the contrary, dense models~\cite{lee2019latent,karpukhin2020dense,guu2020realm} measure similarity using learned representations from supervised QA datasets, leveraging pre-trained language models like BERT.
In this paper, we use the popular dense passage retriever (DPR) model~\cite{karpukhin2020dense} as our main evaluation,\footnote{The detailed experimental settings are in Appendix~\ref{app:exp-details}.} and we also report the evaluation of REALM~\cite{guu2020realm} in Appendix~\ref{app:full_results}. DPR models the retrieval problem using two encoders, namely the question and the passage encoders, initialized using BERT. DPR uses a contrastive objective during training, with in-batch negatives and hard negatives mined from BM25. During inference, a pre-defined large set of passages (e.g., 21-million passages in English Wikipedia) are encoded and pre-indexed---for any test question, the top passages with the highest similarity scores are returned. Recently, other advances have been made in improving dense retrieval, including incorporating better hard negatives~\cite{xiong2021approximate,qu2021rocketqa}, or fine-grained phrase retrieval~\cite{lee2021learning}. We leave them for future investigation.
\paragraph{Generalization problem}
Despite the impressive in-domain performance of dense retrievers, their capability of generalizing to unseen questions still remains relatively under-explored.
Recently, \newcite{lewis2020question} discover that there is a large overlap between training and testing sets on popular QA benchmarks, concluding that current models tend to memorize training questions and perform significantly worse on non-overlapping questions.
AmbER~\cite{chen2021evaluating} test sets are designed to study the entity disambiguation capacities of passage retrievers and entity linkers. They find models perform much worse on rare entities compared to common entities.
Similar to this work, our results show dense retrieval models generalize poorly, especially on rare entities. We further conduct a series of analyses to dissect the problem and investigate potential approaches for learning robust dense retrieval models.
Finally, another concurrent work~\cite{thakur2021beir} introduces the BEIR benchmark for zero-shot evaluation of retrieval models and shows that dense retrieval models underperform BM25 on most of their datasets.
\section{Conclusion}
In this study, we show that DPR significantly underperforms BM25 on {EntityQuestions}, a dataset of simple questions based on facts mined from Wikidata.
We derive key insights about why DPR performs so poorly on this dataset.
We learn that DPR remembers robust representations for common entities, but struggles to differentiate rarer entities without training on the question pattern.
We suggest future work in incorporating entity memory into dense retrievers to help differentiate rare entities.
Several recent works demonstrate retrievers can easily learn dense representations for a large number of Wikipedia entities~\cite{wu-etal-2020-scalable,li-etal-2020-efficient}, or directly generate entity names in an autoregressive manner~\cite{de2021autoregressive}.
DPR could also leverage entity-aware embedding models like EaE~\cite{fevry-etal-2020-entities} or LUKE~\cite{yamada2020luke} to better recall long-tail entities.
\section*{Ethical Considerations}
Our proposed dataset, {EntityQuestions}, is constructed by sampling (subject, relation, object) triples from Wikidata, which is dedicated to the public domain under the Creative Commons CC0 License.
In general, machine learning has the ability to amplify biases presented implicitly and explicitly in the training data.
Models that we reference in our study are based on BERT, which has been shown to learn and exacerbate stereotypes during training~(e.g., \citealt{kurita-etal-2019-measuring}, \citealt{tan-2019-assessing}, \citealt{nadeem2020stereoset}).
We further train these models on Wikidata triples, which again has the potential to amplify harmful and toxic biases.
In the space of open-domain question answering, deployed systems leveraging biased pre-trained models like BERT will likely be less accurate or biased when asked questions related to stereotyped and marginalized groups. We acknowledge this fact and caution those who build on our work to consider and study this implication before deploying systems in the real world.
\section*{Acknowledgements}
We thank the members of the Princeton NLP group for helpful discussion and valuable feedback.
This research is supported by gift awards from Apple and Amazon.
\section{EntityQuestions}
In this section, we build a new benchmark {EntityQuestions}, a set of simple, entity-centric questions and compare dense and sparse retrievers.
\paragraph{Dataset collection}
We select 24 common relations from Wikidata~\cite{wikidata2014vrandecic} and convert fact (\textit{subject}, \textit{relation}, \textit{object}) triples into natural language questions using manually defined templates (Appendix~\ref{app:full_results}).
To ensure the converted natural language questions are answerable from Wikipedia, we sample triples from the T-REx dataset~\cite{trex2018elsahar}, where triples are aligned with a sentence as evidence in Wikipedia.
We select relations following the criteria:
(1) there are enough triples ($>$2k) in the T-REx;
(2) it is easy enough to formulate clear questions for the relation;
(3) we do not select relations with only a few answer candidates (e.g., \textit{gender}), which may cause too many false negatives when we evaluate the retriever;
(4) we include both person-related relations (e.g., \textit{place-of-birth}) and non-person relations (e.g., \textit{headquarter}).
For each relation, we randomly sample up to 1,000 facts to form the evaluation set.
We report the macro-averaged accuracy over all relations of {EntityQuestions}.
\paragraph{Results}
We evaluate DPR and BM25 on the {EntityQuestions} dataset and report results in Table~\ref{tab:intro} (see full results and examples in Appendix~\ref{app:full_results}).
DPR trained on NQ significantly underperforms BM25 on almost all sets of questions.
For example, on the question ``Where was {\text{[E]}} born?'', BM25 outperforms DPR by $49.8\%$ absolute using top-20 retrieval accuracy.\footnote{For our entire analysis, we consider top-20 retrieval accuracy for brevity. However, trends still hold for top-1, top-5, and top-100 retrieval accuracy.} Although training DPR on multiple datasets can improve the performance (i.e., from $49.7\%$ to $56.7\%$ on average), it still clearly pales in comparison to BM25. We note the gaps are especially large on questions about person entities.
In order to test the generality of our findings, we also evaluate the retrieval performance of REALM~\cite{guu2020realm} on {EntityQuestions}. Compared to DPR, REALM adopts a pre-training task called salient span masking (SSM), along with an inverse cloze task from \newcite{lee2019latent}.
We include the evaluation results in Appendix~\ref{app:full_results}.\footnote{We cannot directly compare the retrieval accuracy of REALM to DPR, as the REALM index uses 288 BPE token blocks while DPR uses 100 word passages.}
We find that REALM still scores much lower than BM25 over all relations ($19.6\%$ on average).
This suggests that incorporating pre-training tasks such as SSM still does not solve the generalization problem on these simple entity-centric questions.
\section{Introduction}
Recent dense passage retrievers outperform traditional sparse retrieval methods like TF-IDF and BM25~\cite{robertson2009probabilistic} by a large margin on popular question answering datasets~(\citealt{lee2019latent}, \citealt{guu2020realm}, \citealt{karpukhin2020dense}, \citealt{xiong2021approximate}).
These dense models are trained using supervised datasets and the dense passage retriever (DPR) model~\cite{karpukhin2020dense} demonstrates that only training 1,000 supervised examples on top of BERT~\cite{devlin2019bert} already outperforms BM25, making it very appealing in practical use. In this work, we argue that dense retrieval models are not yet robust enough to replace sparse methods, and investigate some of the key shortcomings dense retrievers still face.
We first construct {EntityQuestions}, an evaluation benchmark of simple, entity-centric questions like ``Where was Arve Furset born?'', and show dense retrieval methods generalize very poorly.
As shown in Table~\ref{tab:intro}, a DPR model trained on either a single dataset Natural Questions (NQ)~\cite{kwiatkowski2019natural} or a combination of common QA datasets drastically underperforms the sparse BM25 baseline (49.7\% vs 71.2\% on average), with the gap on some question patterns reaching $60\%$ absolute!
\input{tables/intro}
Based on these results, we perform a deep dive into why a single dense model performs so poorly on these simple questions.
We decouple the two distinct aspects of these questions: the entities and the question pattern, and identify what about these questions gives dense models such a hard time.
We discover the dense model is only able to successfully answer questions based on common entities, quickly degrading on rarer entities.
We also observe that dense models can generalize to unseen entities only when the question pattern is explicitly observed during training.
We end with two investigations of practical solutions towards addressing this crucial problem.
First, we consider data augmentation and analyze the trade-off between single- and multi-task fine-tuning.
Second, we consider a fixed passage index and fine-tune specialized question encoders, leading to memory-efficient transfer to new questions.
We find that data augmentation, while able to close gaps on a single domain, is unable to consistently improve performance on unseen domains.
We also find that building a robust passage encoder is crucial in order to successfully adapt to new domains.
We view this study as one important step towards building universal dense retrieval models.
\section{Dissecting the Problem: Entities vs. Question Patterns}
In this section, we investigate why dense retrievers do not perform well on these questions. Specifically, we want to understand whether the poor generalization should be attributed to (a) novel entities, or (b) unseen question patterns. To do this, we study DPR trained on the NQ dataset and evaluate on three representative question templates: \ti{{place-of-birth}}, \ti{{headquarter}}, and \ti{{creator}}.\footnote{The question templates for these relations are: {{place-of-birth}}: ``Where was {\text{[E]}} born?''; {{headquarter}}: ``Where is the headquarters of {\text{[E]}}?''; {{creator}}: ``Who was {\text{[E]}} created by?''.}
\subsection{Dense retrievers exhibit popularity bias}
We first determine how the entity {\text{[E]}} in the question affects DPR's ability to retrieve relevant passages.
To do this, we consider all triples in Wikidata that are associated with a particular relation, and order them based on frequency of the subject entity in Wikipedia. In our analysis, we use the Wikipedia hyperlink count as a proxy for an entity's frequency.
Next, we group the triples into $8$ buckets such that each bucket has approximately the same cumulative frequency.
Using these buckets, we consider two new evaluation sets for each relation. The first (denoted ``rand ent'') randomly samples at most 1,000 triples from each bucket. The second (denoted ``train ent'') selects all triples within each bucket that have subject entities observed in questions within the NQ training set, as identified by ELQ~\cite{li-etal-2020-efficient}.
We evaluate DPR and BM25 on these evaluation sets and plot the top-20 accuracy in Figure~\ref{fig:freq-analysis}.
DPR performs well on the most common entities but quickly degrades on rarer entities, while BM25 is less sensitive to entity frequency.
It is also notable that DPR performs generally better on entities seen during NQ training than on randomly selected entities. This suggests that DPR representations are much better at representing the most common entities as well as entities observed during training.
\input{tables/finetune_analysis}
\subsection{Observing questions helps generalization}
\label{sec:entity_generalization}
We next investigate whether DPR generalizes to unseen entities when trained on the question pattern.
For each relation considered, we build a training set with at most $8,000$ triples.
We ensure no \ti{tokens} from training triples overlap with tokens from triples in the corresponding test set.
In addition to using the question template used during evaluation to generate training questions, we also build a training set based on a syntactically different but semantically equal question template.\footnote{
{{place-of-birth}}: ``What is the birthplace of {\text{[E]}}?''; {{headquarter}}: ``Where is {\text{[E]}} headquartered?''; {{creator}}: ``Who is the creator of {\text{[E]}}?''.
}
We fine-tune DPR models on the training set for each relation and test on the evaluation set of {EntityQuestions} for the particular relation and report results in Table~\ref{tab:p19_finetune_analysis}.
\begin{figure*}[t]
\centering
\hspace{-3em}
\begin{minipage}[b]{.43\textwidth}
\centering
\includegraphics[width=1.1\columnwidth]{figures/visualization/DPR-pt-cvr.pdf}
\vspace{-3em}
\caption*{~~~~~~~(a)}
\end{minipage}\qquad
\begin{minipage}[b]{.43\textwidth}
\centering
\includegraphics[width=1.1\columnwidth]{figures/visualization/DPR-ft-P19-cvr.pdf}
\vspace{-3em}
\caption*{~~~~~~~(b)}
\end{minipage}
\caption{
Visualization of positive passage embeddings returned by DPR before and after fine-tuning on the \ti{place-of-birth} questions.
(a): Positive passage embeddings returned by DPR trained on NQ; (b) Positive passage embeddings returned by DPR after fine-tuning.
}
\label{fig:tsne_plots}
\end{figure*}
Clearly, observing the question pattern during training allows DPR to generalize well on unseen entities.
On all three relations, DPR can match or even outperform BM25 in terms of retrieval accuracy.
Training on the equivalent question pattern achieves comparable performance to the exact pattern, showing dense models do not rely on specific phrasing of the question.
We also attempt fine-tuning the question encoder and passage encoder separately.
As shown in Table~\ref{tab:p19_finetune_analysis}, surprisingly, there is a significant discrepancy between only training the passage encoder (OnlyP) and only training the question encoder (OnlyQ): for example, on {{place-of-birth}}, DPR achieves $72.8\%$ accuracy with the fine-tuned passage encoder, while it achieves $45.4\%$ if only the question encoder is fine-tuned.
This suggests that passage representations might be the culprit for model generalization.
To understand what passage representations have learned from fine-tuning, we visualize the DPR passage space before and after fine-tuning using t-SNE~\cite{van2008visualizing}.
We plot the representations of positive passages sampled from NQ and \ti{{place-of-birth}} in Figure~\ref{fig:tsne_plots}.
Before fine-tuning, positive passages for \ti{{place-of-birth}} questions are clustered together.
Discriminating passages in this clustered space is more difficult using an inner product, which explains why only fine-tuning the question encoder yields minimal gains.
After fine-tuning, the passages are distributed more sparsely, making differentiation much easier.
\section{Towards Robust Dense Retrieval}
\label{sec:robust_dense}
Equipped with a clear understanding of the issues, we explore some simple techniques aimed at fixing the generalization problem.
\paragraph{Data augmentation}
We first explore whether fine-tuning on questions from a \ti{single} {EntityQuestions} relation can help generalize on the full set of {EntityQuestions} as well as other QA datasets such as NQ. We construct a training set of questions for a single relation and consider two training regimes: one where we fine-tune on relation questions alone; and a second where we fine-tune on both relation questions and NQ in a multi-task fashion. We perform this analysis for three relations and report top-20 retrieval accuracy in Table~\ref{tab:data_augmentation_entityqa}.
\input{tables/data_augmentation_entityqa}
We find that fine-tuning only on a single relation improves {EntityQuestions} meaningfully, but degrades performance on NQ and still largely falls behind BM25 on average. When fine-tuning on both relation questions and NQ together, most of the performance on NQ is retained, but the gains on {EntityQuestions} are much more muted.
Clearly, fine-tuning on one type of entity-centric question does not necessarily fix the generalization problem for other relations.
This trade-off between accuracy on the original distribution and improvement on the new questions presents an interesting tension for universal dense encoders to grapple with.
\paragraph{Specialized question encoders}
While it is challenging to have one retrieval model for all unseen question distributions, we consider an alternative approach of having a single passage index and adapting specialized question encoders.
Since the passage index is fixed across different question patterns and cannot be adapted using fine-tuning, having a robust passage encoder is crucial.
We compare two DPR passage encoders: one based on NQ and the other on the PAQ dataset~\cite{lewis2021paq}.\footnote{PAQ dataset sampling scheme is described in Appendix~\ref{app:exp-details}.}
We expect the question encoder trained on PAQ is more robust
because (a) 10M passages are sampled in PAQ, which is arguably more varied than NQ, and (b) all the plausible answer spans are identified using automatic tools.
We fine-tune a question encoder for each relation in {EntityQuestions}, keeping the passage encoder fixed.
As shown in Table~\ref{tab:passage_encoders},\footnote{Per-relation accuracy can be found in Appendix~\ref{app:per-relation}.} fine-tuning the encoder trained on PAQ improves performance over fine-tuning the encoder trained on NQ.
This suggests the DPR-PAQ encoder is more robust,
{ }nearly closing the gap with BM25 using a single passage index.
We believe constructing a robust passage index is an encouraging avenue for future work towards a more general retriever.
\input{tables/passage_encoders}
\section{Full Results on {EntityQuestions}}
\label{app:full_results}
\paragraph{DPR vs. BM25} The evaluation results are shown in Table~\ref{tab:full_results}.
BM25 significantly outperforms DPR models trained on either a single dataset NQ or a combination of common QA datasets.
\paragraph{REALM vs. BM25} We also evaluate he retrieval performance of REALM~\cite{guu2020realm} on {EntityQuestions}. Specifically, we use REALM to retrieve 20 passages and check if the gold answer is a sub-string of the retrieved passages. We also evaluate BM25 on the same 288-token blocks that are used in REALM model. As shown in Table~\ref{tab:realm_results}, the results show that REALM still significantly underperforms BM25 on {EntityQuestions}, even with the extra pre-training tasks.
\paragraph{Examples of DPR retrived passages} Table~\ref{tab:dpr-examples} shows examples of DPR retrieved results on three representative questions.
DPR makes clear mistakes like confusing entities with similar names or missing the presence of an entity, causing it to retrieve irrelevant passages on these simple, entity-centric questions.
\section{Experimental Details}
\label{app:exp-details}
\paragraph{Experimental settings of DPR}
In our experiments, we use either pre-trained DPR models released by the authors, or the DPR models re-trained by ourself (Table~\ref{tab:passage_encoders}).
All our experiments are carried out on $4 \times$ 11Gb Nvidia RTX 2080Ti GPUs.
For all our fine-tuning experiments, we fine-tune for 10 epochs, with a learning rate $2 \times 10^{-5}$ and a batch size of 24.
When we retrain DPR from scratch, we train for 20 epochs with a batch size of 24 (the original DPR models were trained on 8$\times$ 32Gb GPUs with a batch size of 128 and we have to reduce the batch size due to the limited computational resources) and a learning rate of $2 \times 10^{-5}$.
\paragraph{Experimental settings of BM25}
In our experiments, we use the Pyserini~\cite{lin2021pyserini} implementation of unigram BM25 with default parameters. We build an index using the same Wikipedia passage splits provided in the official DPR release.
\paragraph{PAQ dataset sampling}
\citet{lewis2021paq} introduce Probably Asked Questions (PAQ), a large question repository constructed using a question generation model on Wikipedia passages.
We group all of the questions asked about a particular passage and filter out any passages that have less than 3 generated questions. We then sample 100K such passages and sample one question asked about each. We split this dataset into 70K/15K/15K for train/dev/test splits, although we do not evaluate on this dataset. Following \citet{karpukhin2020dense}, we use BM25 to mine hard negative examples.
\section{Per-relation Accuracy with Different Passage Encoders}
\label{app:per-relation}
We fine-tune DPR with the passage encoder fixed on either NQ or PAQ.
Table~\ref{tab:full__passage_encoders} compares the per-relation accuracy of DPR with fixed passage encoder fine-tuned on NQ and PAQ. As is shown, the passage encoder trained on PAQ is much more robust than the passage encoder trained on NQ.
For many non-person relations, using a PAQ-based passage encoder can outperform BM25.
\input{tables/full__passage_encoders}
| {'timestamp': '2021-09-28T02:26:40', 'yymm': '2109', 'arxiv_id': '2109.08535', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08535'} | arxiv |
\section{Introduction}
\label{sec:introduction}
\IEEEPARstart{A}{s} the growth rate of single-machine computation speeds started to stagnate in recent years, parallelism seemed like an effective technique to aggregate the computation speeds of multiple machines.
Since then, parallelism has become a main ingredient in compute cluster architectures~\cite{Dean:2008:MSD,2014:CVH} as it incurs less processing and storage cost on any one individual server \cite{griffith2009above}.
Beyond the aggregation of capacity, a major difficulty in the operation of parallel servers is optimizing for low latency and loss.
The key to this optimization is the mapping of the input, that we denote as \emph{jobs}, to the different and possibly heterogeneous serving machines, denoted \emph{servers}, of time-varying capacity and finite memory (buffers). This mapping of input to servers is carried out by a \emph{scheduler}.
Classical results
prove the optimality of the Join-the-Shortest-Queue (JSQ) algorithm in terms of the expected job delay\cite{hordijk1990optimality,winston1977optimality} when the servers are homogeneous, have infinite buffer space and the job service times are independent, identically (iid) and exponentially distributed. For the case when the service times are exponentially distributed but with different service rates, Shortest-expected-delay (SED) has been shown to minimize the mean response time of jobs, especially in the case of heavy traffic limits \cite{banawan1989load,selen2016steady}.
\begin{figure}[!t]
\centering
\includegraphics[width=3in]{model/Figure1.pdf}
\caption{A sketch of a parallelized point cloud processing system. Frames are
dispatched to non-exclusive parallel servers for segmentation, object classification and tracking. The scheduler is logically part of the system management but it may reside on the data path as it maps scenes to servers while taking feedback acknowledgements into account.}
\label{fig:gen-model}
\end{figure}
Note, however, that such types of algorithms assume that the scheduler has accurate, timely and synchronized information of all servers and their queues.
\emph{In practice this assumption does not hold}, e.g., in data center clusters it cannot be assumed that a job scheduler has timely and synchronized information of all available servers but rather observes some event or time-triggered server feedback.
Fig.~\ref{fig:gen-model} shows a sketch of a modern application of such a system, i.e., cluster processing of a data stream where scenes are mapped to server clones for analysis.
The goal of this work is to model and optimize the scheduling decision-making over parallel and heterogeneous servers having finite buffers and each following first-in-first-out (FIFO) order, where these servers provide randomly delayed acknowledgements back to the scheduler.
This model captures that the scheduler is only able to partially observe the server states at the decision time points.
The scheduler does not directly observe the server queues but rather receives acknowledgements for completed jobs that are randomly delayed on the way back to the scheduler.
Our contributions are:
\begin{itemize}
\item We present a model for controlled scheduling in parallel systems with randomly delayed acknowledgements.
\item We find a control law by optimizing a predefined objective function subject to the stochastic dynamics induced by the model.
\item We present \emph{POS} - a Partial Observability Scheduler that estimates the unknown parameters of the parallel system at runtime and despite partial observations achieves a job drop rate and response time comparable with full information schedulers. The performance evaluation is carried out in a simulation environment. Note that this POS can be used for any number of servers and for any kind of inter-arrival and service time distributions. In this work we have tested a few of them.
\end{itemize}
The rest of this paper is organized as follows: In \cref{sec:related_work} we first discuss the related work. Then, in \cref{sec:system-model} we outline the system model and give some background on the key topics of this work. In \cref{sec:queueing_system_pomdp}, we give our contributions starting from the modelling of the partially observable queueing system to our Monte Carlo approach for finding a near-optimal scheduling policy.
In \cref{sec:sim_results}, we give our simulation results and discuss the inference of unobserved system parameters in \cref{sec:inference} along with an experiment with real world data.
\input{sections/02_related_work.tex}
\input{sections/03_system_description.tex}
\input{sections/04_model.tex}
\input{sections/04a_simulations_model.tex}
\input{sections/05_inference.tex}
\input{sections/07_conclusion.tex}
\bibliographystyle{IEEEtran}
\balance
\subsection{Inferring arrival flow and system parameters}
\label{sec:inference}
In system deployments where the distribution of the inter-arrival times and the service times is unknown, the following method can be used to infer them.
For POS to be deployed in an unknown environment, we require an estimate of the inter-arrival density as well as of the service rates.
We resort here to a Bayesian estimation approach to infer the densities $f_U(u)$ and $f_{V_i}(v_i)$.
We select a likelihood model $f(\mathcal{D} \mid \theta)$ for the data generation process and a prior $f(\theta)$, with model parameters $\Theta$. We assume we have access to data
$\mathcal{D}=\{d^{(1)},d^{(2)}, \dots, d^{(n)} \}$,
where $d^{(j)}$ is inter-arrival times between the $j$-th and $j+1$-st job arrival event that is observed by the scheduler or the service times for each server. For inference-based scheduling in POS we use the inferred distribution of the inter-arrival times as in the posterior predictive $f(d^\ast \mid \mathcal{D})=\int f(\theta \mid \mathcal{D}) f(d^\ast \mid \theta) d \theta$,
of a new data point~$d^\ast$, which is used in the simulator, see Eq.~\eqref{eq:sampling}.
Same is done with the data for the service times.
Next, we describe models of different complexities for the data generation. Since, most models do not admit a closed form solution, we resort to a Monte Carlo sampling approach to sample from the posterior predictive.
\subsubsection{Inference for exponential inter-arrival times}
\label{sec:exponential}
Here, we briefly show the calculation for the posterior distribution and posterior predictive distribution for renewal job arrivals with exponentially distributed inter-arrival times. For the likelihood model we assume
\begin{equation*}
D^{(j)} \mid m \sim \ExpDis(m),\quad j=1, \dots, n
\end{equation*}
where $m$ is the rate parameter of the exponential distribution. We use a conjugate Gamma prior $M \sim \GamDis(\alpha_0, \beta_0)$.
Hence, the posterior distribution is
\vspace{-5pt}
\begin{equation*}
M \mid \mathcal{D} \sim \GamDis(\alpha_0 +n, \beta_0+ \sum_{j=1}^n d^{(j)})
\end{equation*}
And the posterior predictive distribution is found as
\vspace{-5pt}
\begin{equation*}
D^\ast \mid \mathcal{D} \sim \TPDis(\alpha_0 +n, \beta_0+ \sum_{j=1}^n d^{(j)}),
\vspace{-5pt}
\end{equation*}
where $\TPDis(\alpha, \beta)$ denotes the translated Pareto distribution.
\subsubsection{Inference for Gamma distributed inter-arrival times}
\label{sec:gamma_likelihood}
In case of a gamma likelihood of the form
\begin{equation*}
D^{(j)} \mid a, b \sim \GamDis(a, b),\quad j=1, \dots, n
\vspace{-5pt}
\end{equation*}
we use independent Gamma priors for the shape and the rate, with $A \sim \GamDis( a_0, b_0)$ and $B \sim\GamDis( a_1, b_1)$.
Finally, we sample from the posterior predictive using Hamiltonian Monte Carlo (HMC)~\cite{hoffman2014no}, which can be
implemented using a probabilistic programming language, e.g. using PyMC3 \cite{salvatier2016probabilistic}.
\begin{figure}
\center
\includegraphics[scale=.54]{fig13/ppr_gamma_plot_0.pdf}
\caption{ The density estimate of the job inter-arrival times indicates that it is exponentially distributed.}
\label{fig:arr}
\end{figure}
\begin{figure}
\center
\includegraphics[scale=.6]{fig14/joined_results.pdf}
\caption{ The density estimate of the job service times using a Gamma Mixture Likelihood model indicates that the servers are heterogeneous with high service times.}
\label{fig:srv}
\end{figure}
\subsubsection{Service times distributed as an infinite Gamma mixture}
\label{sec:mixture}
Here, we present a framework to non-parametrically infer the posterior distribution.
We use an approximate Dirichlet process mixture model which
can be regarded as an infinite mixture model~\cite{ghosal2017fundamentals}.
We use a gamma distribution for the observation model
\begin{equation} \phi(d \mid \theta_i) \propto d^{a_i-1} e^{-b_i d},
\end{equation}
with mixture parameters $a_i$ and $b_i$. For the base measure $G_0$, i.e., the prior distribution of the mixture parameters, we use $G_0=F_{A_i} \times F_{B_i}$, with $A_i \sim \GamDis( 1,1)$ and $B_i \sim \GamDis(1,1)$.
The truncated stick-breaking approximation is then given by
\begin{equation*}
\begin{split}
&M \sim \GamDis(1,1), \quad B_i \mid m \sim \BetaDis(1, m), \quad i=1,\dots, c-1\\
&W_i = \beta_i \prod_{j=i-1}^i (1-B_j), \quad i=1,\dots, c-1\\
& W_c =1 -\sum_{j=1}^{c-1} W_j, \quad \Theta_i \sim G_0\\
&D^{(j)} \mid w_1,\dots, w_c, \theta_1, \dots, \theta_c \sim \sum_{i=1}^c w_i \phi(d \mid \theta_i), \; j=1, \dots, n,\\
\end{split}
\vspace{-10pt}
\end{equation*}
which corresponds to a mixture of Gamma pdfs.
Here too, samples from the posterior predictive can be efficiently generated using HMC.
For the truncation point, the number of components $c$ in the formula above can be assessed using
\begin{equation}
c= \lceil2-\E[M] \log(\epsilon)\rceil=\lceil2-\log(\epsilon)\rceil,
\end{equation}
where $\epsilon$ is an upper bound on the total variation distance between the exact and truncated approximation. For example, we can choose $\epsilon=10^{-12}$, which corresponds to $c=30$ components.
\begin{figure}
\center
\includegraphics[scale=.95]{fig15/scatter.pdf}
\caption{Tradeoff between response time and packet drop: In terms of packet drops, POS has comparable performance to DJSQ-FI, while it outperforms the other FI and all LI strategies. The additionally allocated packets increase the overall average response time.}
\label{fig:scatter}
\end{figure}
\subsection{Experiments with trace data}
\label{sec:real_data}
For the results of this section, we make use of \textit{Labeled Network Traffic Flow} data, provided by Kaggle in 2019 \cite{kaggle, kaggle2}.
We used the above frameworks to infer the underlying distributions of the inter-arrival and service times provided in this data set.
The inferred distribution based on data of the inter-arrival times of the chosen source is given in Fig. \ref{fig:arr}, it can be seen to follow an exponential distribution with high arrival rate.
We then selected $20$ heterogeneous servers from the available data such that they all followed the Gamma Mixture distribution.
Gamma Mixture was selected to show the performance of POS with yet another type of service time distributions.
The empirical distribution as a histogram as well as the posterior mean estimate for some of these selected servers is given in Fig. \ref{fig:srv}.
The hyperparameters used are: $c=3$, $a_i,b_i=1$, $m=1$.
POS makes use of the samples generated using the posterior predictions.
We assume that the servers have a finite buffer of size $B=10$ and a delay in acknowledgements of $p=0.6$.
Fig. \ref{fig:scatter} shows that even with limited information, POS has the lowest average packets drops. However, due to the limited information available to POS and the reward function it is using, its average response time is as high as the full information strategy DJSQ-FI.
POS is able to allocate more packets (due to fewer drops), which comes at a cost of higher response time for some jobs.
Note that the reward function we used, \eqref{eq:linear_reward_function} with $\kappa_1=0$, focuses on avoiding packet drops and not on minimizing the response time.
\section{Discussion \& Conclusion }
\label{sec:conclusion}
In this work, we analyzed online algorithms for mapping incoming jobs to parallel and heterogeneous processing systems under partial observability constraints. This partial observability is rooted in the assumption that the entity controlling this mapping, denoted scheduler, takes decisions only based on \emph{randomly delayed feedback} of the parallel systems. Unlike classical models that assume full knowledge of the parallel systems, e.g., knowing the queue lengths (Join-the-Shortest Queue - JSQ) or additionally the job service times (Shortest Expected Delay - SED) this model is particularly suited for large distributed processing systems that only provide an acknowledgement-based feedback.
In addition to presenting a partially observable (semi-) Markov decision process model that captures the scheduling decisions in this parallel queuing system under delayed acknowledgements, we provide an online scheduler - denoted {Partial Observable Scheduler (POS)} - to find near-optimal solutions in real-time.
A particular strength of POS is that it allows to \emph{define the objectives of the system and lets it find the appropriate scheduling policy instead of manually defining a fixed one}.
It can also be used for any kinds of inter-arrival and service time distributions and is scalable to a large number of queues.
We numerically show that the resulting scheduler is especially powerful under server heterogeneity.
We also show that the POS scheduling policies obtained under partial observability are comparable to fixed scheduling policies such as JSQ, JSQ(d) and SED having full information.
This is the case although POS receives less, and in addition randomly delayed, informative feedback.
In a possible extension to this work, one may explore finite horizon objectives for time dependent transition dynamics.
Another direction for extending this work is to include the memory effect of the last served job in the model simulator, e.g., through state space extension.
This work can also be extended to more than one scheduler, working in parallel in a multiagent manner.
\section{System Model}
\label{sec:system-model}
We consider a queuing system with $N$ parallel servers each having its own finite FIFO queue.
The queue filling is denoted $b_i \in \mathcal{B}_i, i=1,\dots,N$,
where $\mathcal{B}_i=\{0,\dots,\bar{b}_i\}$ and
$\bar{b}_i$ is the buffer space for the $i$-th queue. We define the vector of queue sizes as $\mathbf b =[b_1,\dots,b_N]^\top$. In the following, we will use boldface letters to denote column vectors.
We consider the general case of heterogeneous servers
where the service times $V_i^{(1)},V_i^{(2)}\dots,$ of consecutive jobs at the $i$-th server\footnote{We denote random variables by uppercase letters and their realizations as lowercase letters.} are independent and identically distributed (iid) according to a probability density $f_{V_i}$.
Jobs arrive to the scheduler, as depicted in \cref{fig:queuein_dynamics},
according to some renewal process described by the sequence $(T^{(n)})_{n\in \mathbb{N}}$, where the job inter-arrival times $ U^{(j)}:=T^{(j+1)} - T^{(j)}$ are drawn iid from a distribution
$F$
leading to an average arrival rate $\lambda$.
Each arriving job is mapped by the scheduler to exactly one server where we denote the average service rate of the $i$-th server as~$\mu_i$.
If a job is mapped to a full buffer the job is lost.
When a job leaves the system the server sends an acknowledgement back to the scheduler.
The scheduler uses this feedback to estimate the buffer fillings, $b_i$, of each queue.
A major challenge for deciding on the job routing arises when the acknowledgments are delayed.
Here, we incorporate three main delay components, i.e., $(i)$ the job waiting time in the queue it was assigned to, $(ii)$ the job processing time, and $(iii)$ the propagation delay of the acknowledgement back to the scheduler.
The third component \textit{makes the decision problem particularly hard} as a decision does not only impact the current state of the system but also future states due to its delayed acknowledgement feedback.
Note that the scheduler makes the routing decision based only on these observed acknowledgments, thus making the system state partially observable, PO.
In Fig.~\ref{fig:queuein_dynamics} we denote the number of acknowledgements, that are observed by the scheduler at the $i$-th server in one inter-arrival time as $y_i$.
Since the scheduler is PO, it does not directly observe the queue states $b_i$, the job service times, or the delayed feedback $x_i$, i.e., the number of acknowledgments that are on the way back to the scheduler but have not reached it yet.
Depending on the distribution type of the inter-arrival times, $U$, and service times, $V$, we model the decision-making process in this PO queuing system as a \emph{partially observable Markov decision process}, \ac{pomdp}\xspace, or a \emph{partially observable semi Markov decision process}, POSMDP.
A \ac{pomdp}\xspace has an underlying \ac{mdp}\xspace, where the actual state of the system is not known to the agent, i.e., the scheduler in our case. This modelling can be used when both $U$ and $V$ are exponentially distributed, keeping the system Markovian.
For non-exponential $U$ and/or $V$, \ac{posmdp}\xspace formulation can be used, where the underlying process is now semi-Markov and the actual state of the system is still not known to the scheduler.
\begin{figure}
\center
\includegraphics[scale=.2]{model/queuing_model_small.pdf}
\caption{A parallel queuing system with a scheduler that maps jobs to servers.
The scheduler observes the inter-arrival times $u$ and the feedback, i.e., the number of acknowledgements, from each server $y_i$. The scheduler \emph{does not observe} the queue states $b_i$, the job service times, or the delayed feedback $x_i$, i.e., the number of acknowledgements on the way back.}
\label{fig:queuein_dynamics}
\vspace{-15pt}
\end{figure}
\subsection*{Markov Decision Process with Partial Observability}
\label{subsec:primer_pomdp}
An \ac{mdp}\xspace ~\cite{Sutton1998} is defined as a tuple $\langle\mathcal{S},\mathcal{A}, \mathcal{T}, \mathcal R \rangle$, where~$\mathcal{S}$ is the countable state space,
$\mathcal{A}$ is the countable action space,
$\mathcal{T}: \mathcal{S} \times \mathcal{S} \times \mathcal{A} \rightarrow [0,1]$ is the transition function,
$\mathcal R: \mathcal{S} \times \mathcal{S} \times \mathcal{A} \rightarrow \mathbb R$ is the reward function.
Throughout this work we assume time homogeneity for the transition function~$\mathcal T$, observation function~$\mathcal O$ and reward function~$\mathcal R$.
An MDP with partial observations is also' a controlled Markov process, where the exact state of the process is latent.
It is in addition defined using; $\mathcal{Z}$, the countable observation space, and $\mathcal{O}: \mathcal{Z} \times \mathcal{S} \times \mathcal{A} \rightarrow [0,1]$, the observation function.
Consider the case of discrete epochs at time points $t\in \mathbb{N}_0$.
Note that the clock given by $t$ is an event clock and not a wall-clock time.
If the decision epochs $t$ are exponentially distributed then this PO process can be modelled as a \ac{pomdp}\xspace \cite{kaelbling1998planning}, otherwise under the condition that the decision-making is done only at the epochs $t$, it can be modelled as a \ac{posmdp}\xspace \cite{yu2006approximate}.
We consider a latent process $S^{(t)} \in \mathcal{S}$ that can be controlled by actions $A^{(t)} \in \mathcal{A}$.
Since, the state is latent only observations $Z^{(t)} \in \mathcal{Z}$ are available.
The transition function $\mathcal{T}(s^\prime, s, a) := \mathbb P (S^{(t+1)}=s^\prime \mid S^{(t)}= s, A^{(t)}= a)$ is the conditional probability of moving from state $ s$ under action $a$ to a new state ${s}^\prime$.
The observation function $\mathcal{O}(z, s, a):=\mathbb P (Z^{(t+1)}=z \mid S^{(t+1)} = s', A^{(t)}=a)$ denotes the conditional probability of observing ${z}$ under the latent state $ s'$ and action $a$. An agent receives a reward $R^{(t)} = \mathcal{R}(S^{(t+1)},S^{(t)},A^{(t)})$, which it tries to maximize over time.
Since the current state is not directly accessible by the agent, it has to rely on the action-observation history sequence, $\mathcal H^{(t)} = \{ A^{(0)}, Z^{(0)}, A^{(1)}, Z^{(1)}, \dots, A^{(t)}, Z^{(t)}\}$, up to the current time point $t$. A policy $\pi_t(a,h):=\mathbb P (A^{(t)}=a \mid \mathcal H^{(t)}=h )$ is the conditional probability of choosing action $a$ under action-observation history $h$.
The solution then corresponds to a policy which maximizes an objective over a prediction horizon.
The policy is defined as a function of the observation-action history of the agent, which makes it very challenging, since a naive planning algorithm requires to evaluate an exponentially increasing number of histories in the length of the considered time horizon. For this reason, different solution techniques are required.
Since keeping a record of the entire history, $h$, is not feasible, one way is to represent this history in terms of the belief state, $\bm{\rho}^{(t)} \in \Delta^{ \mathcal |S|}$, where $\Delta^{ \mathcal |S|}$ is an $\mathcal S$ dimensional probability simplex, $\boldsymbol \rho^{(t)}=[\rho_1^{(t)},\dots,\rho_{\mathcal |S|}^{(t)}]^\top$ and the components $\rho_s^{(t)}$ are the filtering distribution $\rho_s^{(t)}=\mathbb{P}(S^{(t)}=s \mid \mathcal{H}^{t}=h)$.
If the state space is huge, this will be a very high dimensional vector.
So, in order to break the curses of \textit{history} and \textit{dimensionality}, a certain number of particles can be used to represent the belief state $\bm{\rho}^{(t)}$ of the system at time $t$.
These particles represent the belief state $\bm{\rho}^{(t)}$ of the system and are updated using Monte Carlo simulations based on the action taken and observations received.
This is the approach that we build upon in this paper.
We consider an infinite horizon objective, where the optimal policy
$\pi^*$ is found by maximizing the expected total discounted future reward
$\pi^* = \argmax_{\pi}\sum^{\infty}_{t=0} \E_{\pi}[\gamma^t R^{(t)}]$ with $\gamma<1$.
Note that our work can easily be reformulated into finite horizon objectives.
\begin{comment}
\subsection{Partially Observable Semi-Markov Decision Processes}
\label{subsec:posmdp}
On the other hand if you have non-exponentially distributed inter arrival times then the underlying process is no longer Markov, instead it is now a semi-Markov decision process and can be represented using a partially observable semi-Markov decision process (POSMDP) \cite{yu2006approximate}.
In a POSMDP the time interval between two transitions, known as sojourn time, is random.
With this formulation we can make use of any non exponential inter arrival time and/or service time distribution, with the condition that the decision making is done only at the non exponentially occurring decision epochs (which are job arrivals in our case).
For our experiments we have evaluated our POS scheduler also on gamma distributed inter arrival times and heavy-tailed pareto distributed service time distributions.
\subsection{Partially Observable Markov Decision Processes}
\label{subsec:primer_pomdp}
A partially observable Markov decision process (POMDP)~\cite{kaelbling1998planning} is defined as a tuple $\langle\mathcal{S},\mathcal{A}, \mathcal{Z}, \mathcal{T},\mathcal{O}, \mathcal R \rangle$, where~$\mathcal{S}$ is the countable state space,
$\mathcal{A}$ is the countable action space,
$\mathcal{Z}$ is the countable observation space,
$\mathcal{T}: \mathcal{S} \times \mathcal{S} \times \mathcal{A} \rightarrow [0,1]$ is the transition function,
$\mathcal{O}: \mathcal{Z} \times \mathcal{S} \times \mathcal{A} \rightarrow [0,1]$ is the observation function and
$\mathcal R: \mathcal{S} \times \mathcal{S} \times \mathcal{A} \rightarrow \mathbb R$ is the reward function.
Throughout this work we assume time homogeneity for the transition function~$\mathcal T$, observation function~$\mathcal O$ and reward function~$\mathcal R$.
A POMDP is a controlled Markov process, where the exact state of the Markov process is latent.
Consider the case of discrete epochs at time points $t\in \mathbb{N}_0$.
Note that the clock given by $t$ is an event clock and not a wall-clock time. We consider a latent process $S^{(t)} \in \mathcal{S}$ that can be controlled by actions $A^{(t)} \in \mathcal{A}$.
Since, the state is latent only observations $Z^{(t)} \in \mathcal{Z}$ are available.
The transition function $\mathcal{T}(s^\prime, s, a) := \mathbb P (S^{(t+1)}=s^\prime \mid S^{(t)}= s, A^{(t)}= a)$ is the conditional probability of moving from state $ s$ under action $a$ to a new state ${s}^\prime$.
The observation function $\mathcal{O}(z, s, a):=\mathbb P (Z^{(t+1)}=z \mid S^{(t+1)} = s', A^{(t)}=a)$ denotes the conditional probability of observing ${z}$ under the latent state $ s'$ and action $a$. An agent receives a reward $R^{(t)} = \mathcal{R}(S^{(t+1)},S^{(t)},A^{(t)})$, which it tries to maximize over time.
Since the current state is not directly accessible by the agent, it has to rely on the action-observation history sequence, $\mathcal H^{(t)} = \{ A^{(0)}, Z^{(0)}, A^{(1)}, Z^{(1)}, \dots, A^{(t)}, Z^{(t)}\}$, up to the current time point $t$. A policy $\pi_t(a,h):=\mathbb P (A^{(t)}=a \mid \mathcal H^{(t)}=h )$ is the conditional probability of choosing action $a$ under action-observation history $h$.
The solution of a POMDP corresponds to a policy which maximizes an objective over a prediction horizon.
The policy is defined as a function of the observation-action history of the agent which makes the problem of solving a POMDP challenging, since a naive planning algorithm requires to evaluate an exponentially increasing number of histories in the length of the considered time horizon. For this reason different solution techniques are required.
Since keeping a record of the entire history, $h$, is not feasible, one way is to represent this history in terms of the belief state, $\bm{\rho}^{(t)} \in \Delta^{ \mathcal |S|}$, where $\Delta^{ \mathcal |S|}$ is an $\mathcal S$ dimensional probability simplex, $\boldsymbol \rho^{(t)}=[\rho_1^{(t)},\dots,\rho_{\mathcal |S|}^{(t)}]^\top$ and the components $\rho_s^{(t)}$ are the filtering distribution $\rho_s^{(t)}=\mathbb{P}(S^{(t)}=s \mid \mathcal{H}^{t}=h)$.
If the state space is huge this will be a very high dimensional vector.
So, in order to break the curses of \textit{history} and \textit{dimensionality}, a certain number of particles can be used to represent the belief state $\bm{\rho}^{(t)}$ of the system at time $t$.
These particles represent the belief state $\bm{\rho}^{(t)}$ of the system and are updated using Monte Carlo simulations based on the action taken and observations received.
This is the approach that we build upon in this paper.
We consider an infinite horizon objective, where the optimal policy
$\pi^*$ is found by maximizing the expected total discounted future reward
$\pi^* = \argmax_{\pi}\sum^{\infty}_{t=0} \E_{\pi}[\gamma^t R^{(t)}]$ with $\gamma<1$.
Note that our work can easily be reformulated into finite horizon objectives.
\subsection{Partially Observable Semi-Markov Decision Processes}
\label{subsec:posmdp}
On the other hand if you have non-exponentially distributed inter arrival times then the underlying process is no longer Markov, instead it is now a semi-Markov decision process and can be represented using a partially observable semi-Markov decision process (POSMDP) \cite{yu2006approximate}.
In a POSMDP the time interval between two transitions, known as sojourn time, is random.
With this formulation we can make use of any non exponential inter arrival time and/or service time distribution, with the condition that the decision making is done only at the non exponentially occurring decision epochs (which are job arrivals in our case).
For our experiments we have evaluated our POS scheduler also on gamma distributed inter arrival times and heavy-tailed pareto distributed service time distributions.
\end{comment}
\section{Simulation results}
\label{sec:sim_results}
In the following, we show numerical evaluation results for the proposed Partial Observability Scheduler (POS) under randomly delayed acknowledgements.
Recall that if the acknowledgement is not observed in the current inter-arrival time, it is not incorporated into the scheduling decision for the next incoming job.
In order to evaluate the impact of this delay, we consider in our simulations a probability of $p_i=0.6$ $\forall i$ in Eq. \eqref{eq:binomial}, if not stated otherwise.
This means that an acknowledgement is delayed until the next epochs with probability: $1-p_i=0.4$.
We set the buffer size, $b_i$, for all queues to $10$ jobs.
Further, if not explicitly given, we use the \textit{combined linear reward function} given in Eq. \eqref{eq:linear_reward_function} with $\kappa_1=0$, since we want to focus more on avoiding job drops in the system.
We consider the system depicted in Fig.~\ref{fig:queuein_dynamics} for both cases of heterogeneous and homogeneous servers.
In particular, we show numerical results comparing POS to different variants of scheduling strategies (with and without full system information) with respect to:
\begin{itemize}
\item the empirical job response time distribution (measured from the time a job enters the system until it completes service and leaves),
\item the empirical distribution of the job drop rate (measured as the fraction of jobs that could not be accommodated into the system and were hence dropped),
\item and the cumulative reward.
\end{itemize}
The evaluation box plots are based on $100$ independent runs of $5 \cdot10^3$ jobs with whiskers at [0.5, 0.95] percentiles.
The chosen inter-arrival and service time distributions are mentioned with the figures.
The offered load ratio $(\eta:=\lambda /\sum_i\mu_i )$ is used to describe the ratio between arrival rate and the combined service rate.
The higher the value of $\eta$, the higher is the job load on the system.
In order to be able to occupy all the queues, most of the experiments are done at the heavy traffic regime, i.e. nearly fully loaded systems, where $\eta \approx 1$.
\subsection{Compared Schedulers}
We compare POS to the following scheduling strategies:
\subsubsection{Full information (FI) strategies} These strategies have access to the exact buffer length of queues at the time of each job arrival, and also know the service rates of the servers.
\begin{itemize}
\item JSQ-FI: Join-the-Shortest-Queue assigns the incoming job to the server with the smallest buffer filling.
\item DJSQ-FI: Join the shortest out of $d$ randomly selected queues. If not stated otherwise, $d=2$ has been used for our experiments.
\item SED-FI: Shortest-Expected-Delay assigns the incoming job to the server with the minimum fraction of the current buffer filling divided by the average service rate.
\end{itemize}
\subsubsection{Limited information (LI) strategies} These strategies only have access to the randomly delayed acknowledgements.
\begin{itemize}
\item JMO: Join-the-Most-Observations maps an incoming job to the server that has generated the most observations, i.e., received acknowledgements, in the last inter-arrival epoch. This might lead to servers becoming and remaining idle (stale).
\item JMO-E (with Exploration): explores stale servers, with a probability that we set to $p_e = 0.2$, by mapping a job to one of those servers uniformly at random.
\end{itemize}
For all strategies, ties are broken randomly.
\begin{figure}
\center
\includegraphics[scale=.5]{fig5/joined_results.pdf}
\caption{$N=50$ heterogeneous servers with job inter-arrival times and service times described by an exponential distribution, with the offered load $(\eta \approx 1)$. POS outperforms the other algorithms with limited information, JMO and JMO-E, in terms of (a) response time and (b) job drops. And has comparable performance to the full information strategies, SED-FI, DJSQ-FI and JSQ-FI.}
\label{fig:het50-exp-arr-exp-srv}
\end{figure}
\subsection{Numerical Results}
We first consider a system with $N=2$ heterogeneous servers with exponentially distributed service times with rates $\mu_1=4$ and $\mu_2=2$.
The inter-arrival times are also exponentially distributed with rate $\lambda =5$.
Fig.~\ref{fig:het2-exp-arr-exp-srv} shows the numerical comparison of POS with other schedulers.
Observe that, even though POS does not have access to the exact state of parallel systems and also the acknowledgements from the different systems are randomly delayed, it still achieves comparable results to \textit{full information strategies}, while it outperforms the other \textit{limited information strategies}. The heatmap in, Fig. \ref{fig:het2-exp-arr-exp-srv}(d), represents the policy of POS at each buffer filling state.
It can be seen that higher priority is given to the faster server, $\mu_1$, having buffer filling $b_1$.
The light (dark) regions in the heatmap corresponds to the state where jobs are allocated to server $1$($2$).
Note, however, that this policy is not present as such at POS, as it does \emph{not} observe the buffer fillings $b_i$.
Fig. \ref{fig:het50-exp-arr-exp-srv} shows the performance of POS for $N=50$ heterogeneous servers.
The service rates of this setup are the same in Figure \ref{fig:het2-exp-arr-exp-srv} extended to $50$ queues with the offered load, $(\eta \approx 1)$.
This experiment shows that our scheduler is scalable to perform well for large number of queues.
Note that the time taken by the experiments for $N=2$ and $N=50$ servers is the same.
\begin{figure}
\center
\includegraphics[scale=.5]{fig6/joined_results.pdf}
\caption{$N=50$ heterogeneous servers with gamma arrivals and Pareto service times, with offered load $(\eta \approx 1)$.
The effect of the heavy tailed Pareto distribution can be seen in the response plot (a).
In terms of packet drops, POS is even able to outperform limited information (LI) strategies, while having equally good performance as the full information (FI) strategies.}
\label{fig:het50-gamma-arr-par-srv}
\end{figure}
\begin{figure}
\center
\includegraphics[scale=.95]{fig7/delay_org_ccdf.pdf}
\caption{$N=100$ homogenous servers with gamma arrivals with shape = rate = $k\alpha$, and Pareto service times shape=$\alpha$, while the rate is adjusted in order to achieve the offered load $\eta=0.95$. The plot shows the response time performance of POS for $k=\{1,2,4,8,16,32 \}$. As the $k$ increases, while keeping the same load, the response time reduces. }
\label{fig:vary_k}
\end{figure}
Next, we remain with the case of $N=50$ heterogeneous servers, however with inter-arrival times that are gamma distributed while the service times follow a heavy tailed Pareto distribution, with the offered load $(\eta \approx 1)$.
Fig. ~\ref{fig:het50-gamma-arr-par-srv} shows that here too POS is able to outperform the LI strategies, while having a comparable job drop rate performance as two FI strategies.
POS also outperforms the FI strategy, DJSQ-FI, in terms of job drops, which was the main focus of the reward function used in these experiments.
In Fig. \ref{fig:vary_k} we have the setup with $N=100$ homogenous servers with offered load $\eta=0.95$. We consider gamma distributed inter-arrival times, with parameters: shape = rate = $k\alpha$, so that the mean is $1$ and variance is $\frac{1}{k \alpha}$, with $k=\{1,2,4,8,16,32,64\}$. The service times are Pareto distributed with parameters: shape=$\alpha$, while the rate is adjusted in order to achieve the desired offered load $\eta$. Fig. \ref{fig:vary_k} plots the performance of POS in terms of response time for varying values of $k$. As the $k$ keeps increasing while keeping the offered load same, the response time becomes less and less. Since the offered load is the same for all $k$, the job drops were the same for all and hence have been omitted.
\begin{figure}
\center
\hspace{-20pt}\includegraphics[scale=0.58]{fig8/sample_run.pdf}
\caption{$N=10$ homogenous servers from which $5$ were chosen at random to see their sample run for $50$ time steps. The delay $p_i$ for the acknowledgements from each of the server was also allocated randomly, ranging from $0.1$ to $1.0$. In each subplot is given the queue/server number and its delay, $p$. The solid line trajectory is the sample path for each queue (\emph{not known to POS}), while the shaded region around it is the belief probability that POS has for each state at each time step.
Exponentially distributed inter-arrival and service times were used, with the offered load $\eta \approx 1$.
POS is able to track the real state of the system, as long as the delay is not too high.}
\label{fig:sample run}
\end{figure}
\subsection{Sensitivity Analysis}
Next, we discuss the impact of the limited observations on POS under different acknowledgements delays, $p_i$.
Recall, that POS is not able to observe the buffer fillings, but rather receives the randomly delayed acknowledgements of the served jobs.
These delayed acknowledgements enable inferring the queue states and, hence, calculating an optimal mapping of incoming jobs to servers.
Fig. \ref{fig:sample run} depicts sample runs showing the evolution of the job queue states (red solid line) and the belief state that POS has on each queue state at each time step, under different acknowledgement delays.
Observe that increasing delays (i.e., lower $p_i$) increases the uncertainty in belief of each state.
Note that this increase in uncertainty is not a sampling issue, rather it is the inherent uncertainty (partial observability) of the scheduler about the state of the system,
which increases with the increase in delay.
Also observe how POS is still able to track the system state for different delay distribution parameters for each server.
Having different delays in acknowledgements from each server reflects a distributed system, where network conditions may be different for each server and may lead to different delays in acknowledgements from different servers.
In Fig. \ref{fig:vary arr rate} we analyse the performance of the POS scheduler under varying offered loads ranging from $\eta=0.2$ to $\eta=1.2$.
It can be seen that POS has almost no job losses up to a load of $\eta = 1$.
Note the qualitative change of the response time distribution as the offered load reaches $\eta = 1$ and beyond.
For lower offered load, the response time distribution resembles an exponentially tailed distribution which changes with $\eta = 1$ and beyond.
In Fig. \ref{fig:high-load} we show the performance comparison of different LI and FI strategies for the high offered load case of $\eta=1.2$.
This is done to show that even though POS has high job drops and response, it outperforms the LI strategies and the FI strategy DJSQ-FI, while having comparable performance to the other FI strategies.
\begin{figure}
\center
\hspace{-20pt}\includegraphics[scale=0.45]{fig9/joined_results.pdf}
\caption{Varying offered load for a setup as in Fig.~\ref{fig:het50-exp-arr-exp-srv}. As long as the offered load is $\eta \le 1$, POS has almost no packet losses. For loads $\eta < 1$ we observe a load dependent exponential tail of the response time distribution.}
\label{fig:vary arr rate}
\end{figure}
\begin{figure}
\center
\hspace{-20pt}\includegraphics[scale=0.45]{fig10/joined_results.pdf}
\caption{For the setup from Fig. \ref{fig:vary arr rate} with an offered load $\eta =1.2$: POS shows a comparable performance to full information (FI) strategies, while outperforming limited information (LI) ones. }
\label{fig:high-load}
\end{figure}
Another sensitivity analysis we performed is given in Fig. \ref{fig:increasing-servers}, where the number of homogeneous servers $N$ was increased from $N=10$ to $N=90$ with increments of $20$, while keeping the offered load the same, $\eta=0.99$.
The inter-arrival times and service times were exponentially distributed.
It can be seen that as the number of servers increase, the response time decreases for the same number of jobs, which is the expected trend.
The packet drop performance was the same for all from $N=30$ onwards, since the offered load was the same.
While, $N=10$ is very less and the system can get overloaded, due to high offered load, resulting in some packet being dropped.
\begin{figure}
\center
\includegraphics[scale=0.5]{fig11/joined_results.pdf}
\caption{Homogeneous servers with exponentially distributed inter arrival and service times. The number of servers are increased in intervals of $10$ up to $100$ servers, while keeping the offered load always $(\eta = 0.99)$. The performance in terms of packet drops is same for $N=30$ onwards, since the offered load is kept constant, while the effect of increasing the servers can be seen more clearly by the reduction in the response time.}
\label{fig:increasing-servers}
\end{figure}
For the sake of completeness, Fig. \ref{fig:reward comp} compares the performance of POS using different reward functions from subsection \ref{subsec:reward_functions}, while keeping all the other parameters the same.
The job drop rates were the same for all and hence have been omitted.
Hence, based on the information available and the system requirements, any reward function can be designed and used.
In the next section, we discuss the scenario when some system parameters are not known and need to be inferred from the available data.
\begin{figure}
\center
\hspace{-20pt}\includegraphics[scale=0.75]{fig12/delay_org_ccdf.pdf}
\caption{Comparison of different reward functions for $50$ homogeneous servers, with gamma arrivals and Pareto service times and offered load $\eta \approx 1$. }
\label{fig:reward comp}
\end{figure}
\section{Introduction}
As the growth rate of single-machine computation speeds started to stagnate in recent years, parallelism seemed like an effective technique to aggregate the computation speeds of multiple machines.
Since then, parallelism has become a main ingredient in compute cluster architectures~\cite{Dean:2008:MSD,2014:CVH} as it incurs less processing and storage cost on any one individual server \cite{griffith2009above}.
Beyond the aggregation of capacity, a major difficulty in the operation of parallel servers is optimizing for low latency and loss.
The key to this optimization is the mapping of the input, that we denote as \emph{jobs}, to the different and possibly heterogeneous serving machines, denoted \emph{servers}, of time-varying capacity and finite memory (buffers). This mapping of input to servers is carried out by a \emph{scheduler}.
Classical results
prove the optimality of the Join-the-Shortest-Queue (JSQ) algorithm in terms of the expected job delay\cite{hordijk1990optimality,winston1977optimality} when the servers are homogeneous, have infinite buffer space and the job service times are independent, identically (iid) and exponentially distributed. For the case when the service times are exponentially distributed but with different service rates, Shortest-expected-delay (SED) has been shown to minimize the mean response time of jobs, especially in the case of heavy traffic limits \cite{banawan1989load,selen2016steady}.
\begin{figure}
\center
\includegraphics[scale=.7]{Figure 1.pdf}
\caption{A sketch of a parallelized point cloud processing system. Frames are
dispatched to non-exclusive parallel servers for segmentation, object classification and tracking. The scheduler is logically part of the system management but it may reside on the data path as it maps scenes to servers while taking feedback acknowledgements into account.}
\label{fig:gen-model}
\end{figure}
Note, however, that such types of algorithms assume that the scheduler has accurate, timely and synchronized information of all servers and their queues.
\emph{In practice this assumption does not hold}, e.g.,
in data center clusters it cannot be assumed that a job scheduler has timely and synchronized information of all available servers but rather observes some event or time-triggered server feedback.
Fig.~\ref{fig:gen-model} shows a sketch of a modern application of such a system, i.e., cluster processing of a point cloud data stream where scenes are mapped to server clones for analysis.
Later, we will use this prototype application to demonstrate the strength of our approach.
The goal of this work is to model and optimize the scheduling decision-making over parallel and heterogeneous servers having finite buffers and each following first-in-first-out (FIFO) order, where these servers provide randomly delayed acknowledgements back to the scheduler.
This model captures that the scheduler is only able to partially observe the server states at the decision time points.
The scheduler does not directly observe the server queues, but rather receives acknowledgements for completed jobs that are randomly delayed on the way back to the scheduler.
Our contributions are:
\begin{itemize}
\item We present a model for controlled scheduling in parallel systems with randomly delayed acknowledgements.
\item We find a control law by optimizing a predefined objective function subject to the stochastic dynamics induced by the model.
\item We present \emph{POS} - a Partial Observability Scheduler that estimates the unknown parameters of the parallel system at runtime and despite partial observations achieves a job drop rate and response time comparable with full information schedulers. The performance evaluation is carried out in a simulation environment as well as a real-world point cloud stream processing application.
\end{itemize}
The rest of this paper is organized as follows: In \cref{sec:related_work} we first discuss the related work. Then, in \cref{sec:system-model} we outline the system model before casting the decision making at the scheduler as a partially observable Markov decision process in \cref{sec:queueing_system_pomdp}. We present a Monte Carlo approach for this model to find a near-optimal scheduling policy in real-time in \cref{sec:model_simulations} together with simulation results in \cref{sec:sim_results} and discuss the inference of unobserved system parameters in \cref{sec:inference}. Finally, we evaluate our approach in a point cloud streaming prototype in \cref{sec:point_cloud} and conclude the paper in \cref{sec:conclusion}.
\section{Scheduling in Parallel Queuing Systems with Delayed Acknowledgments}
\label{sec:queueing_system_pomdp}
In this section we explain how we model our partially observable (PO) queueing system and then give our proposed solution.
\subsection{Modelling Scheduling in the Partially Observable Queuing System }
\label{subsection:queue_as_pomdp}
In order to model the scheduling decision in a queuing system, with~$N$ parallel finite buffer servers (cf. Fig.~\ref{fig:queuein_dynamics}), as a PO process, we define a state $\mathbf s\in \mathcal S$, using $\mathbf s=[\mathbf s_1,\dots, \mathbf s_N]^\top$. Here, $\mathbf s_i$ is the augmented state of the $i$-th queue that is defined as $\mathbf s_i= [b_i, x_i,y_i]^\top$. The components of $\mathbf s_i$ are given as follows: \emph{(i)} $b_i \in \mathcal{B}_i$ denotes the current buffer filling at server $i$, \emph{(ii)} $x_i \in \mathcal{B}_i$ denotes the number of delayed acknowledgements for executed jobs at server $i$, hence, not observed by the scheduler in the current epoch\footnote{An epoch corresponds here to one inter-arrival time.}, and finally \emph{(iii)} $y_i \in \mathcal{B}_i$ denoting the number of acknowledgements \textit{observed} by the scheduler in the current epoch. Hence, the state space is $\mathcal S \subseteq {\mathbb{N}_0}^{3 N}$ and
an action $a \in \mathcal A$, with $\vert \mathcal A \vert=N$ corresponds to sending a job to the $a$-th server.
An observation $\mathbf z \in \mathcal Z$ is the vector of observed acknowledgements at the scheduler, with the observation space being $\mathcal Z \subseteq {\mathbb N_0}^N$.
\subsection{The Dynamical Model}
Next, we describe the dynamics of the underlying processes of the PO model. The corresponding probabilistic graphical model is depicted in \cref{fig:pgm}.
In case of the \ac{pomdp}\xspace model, the time, $t$ in \cref{fig:pgm} is exponentially distributed while for \ac{posmdp}\xspace it can be random (non-exponential).
As we are using Monte Carlo simulations to solve the PO system, the transition probabilities do not have to be defined explicitly. Therefore, we define the transition function indirectly as a generative process.
\begin{figure}
\center
\includegraphics[scale=.8]{model/pgm.pdf}
\caption{Probabilistic graphical model of the partially observable queuing system with delayed acknowledgements. Shown are three time slices, where grey nodes depict observed quantities and diamond shaped nodes denote deterministic functions.}
\vspace{-10pt}
\label{fig:pgm}
\end{figure}
We consider a scheduler that makes a mapping decision at each job arrival, where the inter-arrival times $U^{(j)}$ are iid.
In order to characterize the stochastic dynamics, we determine the random behavior of the number of jobs $\tilde{k}_i$ that leave the $i$-th queue during an inter-arrival time. Note that the number of jobs leaving the queue is constrained by the current filling of the queue, hence we use $\tilde{k}_i=\min (k_i,b_i)$, where $k_i$ is the number of jobs that \emph{can be served}, which is determined by the inter-arrival time and the service times of the $i$-th server.
An important system constraint is that the buffer spaces are finite. Therefore, we define the generative model for the queuing dynamics as:
\begin{equation}
\mathbf{b}^\prime= \min ( \max (\mathbf{b}-\mathbf{k},\mathbf 0) +\mathbf{e}_{a}, \bar{\mathbf{b}}),
\end{equation}
where $\mathbf{b}$ denotes the queue size vector of the queuing system at some arrival time point and $\mathbf{b}^\prime$ is the queue size vector of the queuing system at the next arrival time point.
By $\mathbf{k}$ we denote the untruncated vector of number of jobs that can be served and $\mathbf{e}_a$ is a vector of all zeros, but the $a$-th position is set to one to indicate a mapping of the incoming job to the $a$-th server.
We use $\bar{\mathbf{b}}$ as the vector of maximum buffer sizes, and $ \min (\cdot, \cdot)$ and $ \max (\cdot, \cdot)$ denote the element wise minimum and maximum operation.
As the scheduler only observes the job acknowledgements, we update the augmented state space, $\mathbf{s}$ (as defined in Section \ref{subsection:queue_as_pomdp}), using the following stochastic update equation:
\begin{equation}
\begin{bmatrix}
\mathbf b^\prime\\
\mathbf x^\prime\\
\mathbf y^\prime
\end{bmatrix}
=
\begin{bmatrix}
\min ( \max (\mathbf{b}-\mathbf{k},\mathbf 0) +\mathbf{e}_{a}, \bar{\mathbf{b}})\\
\min( \mathbf b, \mathbf k) + \mathbf x - \mathbf l\\
\mathbf l
\end{bmatrix},
\label{eq:augmented_state}
\end{equation}
where $\mathbf{l}$ is the vector containing the number of jobs which are observed by the scheduler for each queue at the current epoch.
The number of unacknowledged jobs from the previous epoch is denoted $\mathbf{x}$.
The delay model according to which $\mathbf{l}$ is calculated is given in the next section.
\subsection{Delay Model}
We assume that the number of jobs that can be served in one inter-arrival time is distributed as $K_i \sim f_{K_i}(k_i)$ and we choose a delay model, where
\begin{equation}
L_i \mid b_i, k_i, x_i \sim \BinDis(\min( b_i, k_i) + x_i, p_i ).
\label{eq:binomial}
\end{equation}
Here, $\min( b_i, k_i)$ is the number of jobs leaving the $i$-th queue at the current epoch,
$x_i$ is the number of jobs from the $i$-th queue for which no acknowledgements have been previously observed by the scheduler,
$p_i$ is the probability that an acknowledgement is received by the scheduler in the current epoch and
$L_i$ is the distribution from which $l_i$ is sampled for Eq.\eqref{eq:augmented_state}.
We have chosen the binomial distribution because it captures the fact that only a subset of the $\min( b_i, k_i) + x_i$ jobs are observed in form of acknowledgements at the scheduler in the current epoch.
We believe that this can reflect any kind of delay distribution in which some acknowledgements are delayed till future epochs.
For example, $p=0.6$ would mean that out of all the acknowledgements sent only $60$\% are expected to be received by the scheduler in that epoch while $40$\% are expected to be delayed.
Similarly, $p_i=1$ would then represent the case of no delay.
\textit{Note that any other distribution describing your delay model can be used.}
The number of acknowledgements that are not observed in this epoch are accounted for in the next epoch as $x_i'$.
The introduced observations are essentially the received acknowledgements, i.e., $\mathbf{z} =\mathbf{y}'$.
Since only the vector $\mathbf{y}'$ of the state $\mathbf s'$ is observed, a partial observability is established due to the delayed acknowledgements.
\subsection{Job Acknowledgement Distribution}
Next, we discuss how to quantify the distribution of the number of jobs $k_i$ that can be served at the $i$-th queue in one inter-arrival time. The marginal probability
\begin{equation}
f_{K_i}(k_i)=\int_{0}^\infty f_{K_i \mid U}(k_i \mid u) f_U(u) d u,
\label{eq:integral}
\end{equation}
can be computed by noting \cite{ross2014introduction}
\begin{equation}
f_{K_i \mid U}(k_i \mid u)=\mathbb{P}\left(\bar{V}^{(k_i)}_i \leq u\right) - \mathbb{P}\left(\bar{V}^{(k_i+1)}_i \leq u \right),
\end{equation}
with $\bar{V}^{(k_i)}_i=\sum_{m=1}^{k_i} V^{(m)}_i$.
Assuming exponentially distributed inter-arrival times $U \sim \ExpDis(\lambda)$,
with rate parameter $\lambda$,
and additionally assuming exponential service times for all servers
$V_i \sim \ExpDis(\mu_i)$,
with rate parameter $\mu_i$, the distribution $f_{K_i}(k_i)$ can be calculated in closed form. Since the service process corresponds to a Poisson process, we find the conditional distribution $f_{K_i \mid U}(k_i \mid u)$ as $K_i \mid u \sim \PoisDis( \mu_i u)$.
Carrying out the integral, in Eq. \eqref{eq:integral}, we find the number of jobs that can be served in one inter-arrival time follow a Geometric distribution $K_i \sim \GeomDis( \frac{\lambda }{\mu_i + \lambda} ),$
with $\frac{\lambda }{\mu_i + \lambda}$ denoting success probability.
For general inter-arrival and service time distributions closed form expressions for the marginal probability above are often not available, since, this would require closed form expressions for a $k$-fold convolution of the probability density function (pdf) of the service times.
Note that some corresponding general expressions exist as Laplace transforms where the difficulty is passed down to calculating the inverse transform.
Therefore, in such cases we resort to a sampling based scheme for the marginal distribution $f_{K_i}(k_i)$, i.e.,
\begin{equation}
\begin{split}
&U \sim f_U(u) \\
&V^{(m)}_i \sim f_{V_i}(v_i), \quad m=1, 2, \dots\\
&\mathcal K_i = \left\lbrace j \in \mathbb N_0: \sum_{m=1}^{j} V^{(m)}_i \leq U \right\rbrace \\
&K_i=\max(\mathcal K_i).
\end{split}
\label{eq:sampling}
\end{equation}
In this numerical solution, we draw a random inter-arrival time $U$ and count the number $K_i$ of service times that fit in the inter-arrival interval.
Note that the number of jobs $K_i^{(t)}$ at time $t$ is not necessarily independent for the number of jobs $K_i^{(t+1)}$ in the next interval. The impact of this effect can be well demonstrated when the service time distribution is, e.g., heavy tailed.
Note that the exact modelling of this behaviour would, in general, require an extended state space incorporating this memory effect.
Therefore, the sampling scheme can be seen as an approximation to the exact system behaviour.
This approximation enables the derivation of a fast simulator, which is needed for a runtime solution.
\subsection{Reward Function Design}
\label{subsec:reward_functions}
A main difference of our approach to \emph{explicitly} defining a scheduling algorithm is that we provide the algorithm designer with the flexibility to set different optimization objectives for the scheduler and correspondingly obtain the optimal policy by solving the \ac{pomdp}\xspace or the \ac{posmdp}\xspace. This is carried out through the design of the reward function $\mathcal R$ as defined in Sect.~\ref{subsec:primer_pomdp}. The optimal policy $\pi^*$ maximizes the expected discounted reward as $\pi^* = \argmax_{\pi} \sum^{\infty}_{t=0} \E_{\pi}[\gamma^t R^{(t)}]$ where $R^{(t)} = \mathcal{R}(S^{(t+1)},S^{(t)},A^{(t)})$, with $\gamma<1$.
In the following, we discuss several reward functions $\mathcal R$ in the context of scheduling incoming jobs over parallel finite queuing systems, as illustrated in Fig.~\ref{fig:queuein_dynamics}.
\noindent\textbf{Minimize queue lengths:} A first reward function aims to minimize the overall number of jobs waiting in the system. This is an intuitive objective that can be formalized as
\begin{equation}
\mathcal R(\mathbf{s}' , \mathbf{s}, a)=-\sum_{i=1}^N b_i'
\label{eq:linear}
\end{equation}
as it takes the sum of all queue fillings. Similarly, one a polynomial or exponential reward functions, such as
\begin{equation}
\mathcal R(\mathbf{s}' , \mathbf{s}, a)=-\sum_{i=1}^N \chi^{b_i'}
\label{eq:expon}
\end{equation}
with $\chi>1$, penalizes job mappings that lead to queue length imbalance. Intuitively, this objective tends to balance queue lengths.
Using the variance amongst the current queue fillings also balances the load on queues. The reward function is then given as:
\begin{equation}
\mathcal R(\mathbf{s}' , \mathbf{s}, a)=\mathrm{Var}(b_i,\dots,b_n)
\label{eq:variance}
\vspace{-5pt}
\end{equation}
Note, however, that balancing queue lengths does not necessarily lead to lower delays if the servers are heterogeneous.
Hence, proportional allocation
provides more reward when jobs are mapped to the faster server as
\begin{equation}
\mathcal R(\mathbf{s}' , \mathbf{s}, a)=-\sum_{i=1}^N \frac{b_i'}{\mu_i}
\label{eq:prop}
\end{equation}
\noindent\textbf{Minimize loss events:}
To prevent job losses, we also formulate a reward function that penalizes actions that lead to fully filled queues, i.e.,
\begin{equation}
\mathcal R(\mathbf{s}' , \mathbf{s}, a)=-\sum_{i=1}^N\mathbbm{1}(b_i'=\bar{b}_i)
\label{eq:pkt_drop}
\vspace{-5pt}
\end{equation}
The indicator function evaluates to one only when the corresponding queue is full.
\noindent\textbf{Minimize idle events:} A scheduler designer might also require that the parallel system remains work-conserving, i.e., no servers idling, as this essentially wastes capacity. Hence, in the simplest case we can formulate a reward function of the form
\begin{equation}
\mathcal R(\mathbf{s}' , \mathbf{s}, a)=- \sum_i \mathbbm{1}(b_i'=0)
\label{eq:idle}
\vspace{-5pt}
\end{equation}
Note that some of the reward functions above can be combined, e.g., in a weighted form.
In the following, if not stated otherwise we utilize the following\textit{ combined linear reward function} for our scheduler
\begin{IEEEeqnarray}{rCl}
\mathcal R(\mathbf{s}' , \mathbf{s}, a)=- \left[\sum_{i=1}^N b_i' + \sum_{i=1}^N\kappa_1 \mathbbm{1}(b_i'=0) + \kappa_2 \mathbbm{1}(b_i'=\bar{b}_i) \right],\nonumber\\
\label{eq:linear_reward_function}
\end{IEEEeqnarray}
\begin{comment}
\begin{IEEEeqnarray}{rCl}
\mathcal R(\mathbf{s}' , \mathbf{s}, a)=- \left[\sum_{i=1}^N \frac{b_i'}{\mu_i} + \sum_{i=1}^N\kappa_1 \mathbbm{1}(b_i'=0) + \kappa_2 \mathbbm{1}(b_i'=\bar{b}_i) \right],\nonumber\\
\label{eq:prop_alloc_reward_function}
\end{IEEEeqnarray}
\end{comment}
where, $b_i'$ is the new buffer state after taking action $a$ and constants $\kappa_1,\kappa_2>0$ that enable tuning the scheduler.
\subsection{Partial Observability Scheduler: A Monte Carlo Approach for Delayed Acknowledgements}
\label{subsec:model_simulations}
\begin{figure*}
\center
\includegraphics[scale=.5]{fig4/joined_results.pdf}
\caption{$N=2$ heterogeneous servers with service rates $\mu_1=4$, $\mu_2=2$. Job inter arrival times are exponentially distributed with parameter $\lambda=5$. POS outperforms the algorithms with limited information, JMO and JMO-E, in terms of (a) cumulative reward (higher is better) , (b) response time (lower is better), and (c) job drops (lower is better).
Although POS \emph{only observes} the randomly delayed job acknowledgements, while SED-FI, DJSQ-FI and JSQ-FI know the \textbf{exact buffer fillings and service times / rates}, POS still has comparable performance. The heatmap (d)
shows the fraction of jobs POS allocates to the servers, i.e., the label $1.0$ ($2.0$) denotes the allocation to server $1(2)$, respectively.
\label{fig:het2-exp-arr-exp-srv}
\end{figure*}
In this section, we outline our approach to solve the partially observable system for the job routing problem in parallel queuing systems with delayed acknowledgements.
Our solution is an alternate technique to Dynamic Programming and is based on a combination of the Monte Carlo Tree Search (MCTS) algorithm, \cite{silver2010monte}, and Sequential Importance Resampling (SIR).
One main contribution lies in the design of a simulator which incorporates the properties of the queuing model given in Section~\ref{sec:system-model} into the algorithm.
The reason for choosing a MCTS algorithm is that queuing problems, like the one presented in this work, can span to very large state spaces. In these scenarios solution methods based on dynamic programming \cite{bellman1966dynamic} often break due to the \emph{curse of dimensionality}.
MCTS solves this problem by using a sampling based heuristic approach to construct a search tree to represent different states of the system, the possible actions in those states and the expected value of taking each action.
In recent years, these techniques have been shown to yield exceptional results in solving very large decision making problems \cite{silver2016mastering}\cite{silver2018general}.
Our algorithm makes use of the simulator
$\mathcal G$, which is a generative model of the POMDP and POSMDP, to build the search tree.
We designed this simulator based on the queuing model, depicted in Fig. \ref{fig:queuein_dynamics}, to incorporate the randomly delayed acknowledgements.
The simulator $\mathcal G$, provides the next state $\mathbf s^{(t+1)}$, the observation $\mathbf {z^{(t+1)}}$ and the reward $R^{(t+1)}$, when given the current state $\mathbf s$ of the system and the taken action $a$ as input,
\begin{equation}
\mathbf {s^{(t+1)}}, \mathbf {z^{(t+1)}}, R^{(t+1)} \mid \mathbf{s^t}, a^t \sim \mathcal G(\mathbf{s}, a ).
\label{eq:simulator}
\end{equation}
This simulator $\mathcal G$, is used in the MCTS algorithm to rollout simulations of different possible trajectories in the search tree.
Each trajectory is a path in the search tree starting from the current belief state of the system and expanding (using our simulator) to a certain depth.
While traversing through the search tree, the trajectories (actions) are chosen using the Upper Confidence bounds for Trees algorithm (UCT), which is an improvement over the greedy-action selection \cite{kocsis2006bandit}.
In UCT the upper confidence bounds guide the selection of the next action by trading off between exploiting the actions with the highest expected reward up till now and exploring the actions with unknown rewards.
The search tree is then used to find the best action, $a$, given a certain belief state of the system, $\bm{\rho}^{(t)}$, see Section \ref{subsec:primer_pomdp}.
The action $a$ is chosen which has the highest expected reward and the trajectories for all other actions are then pruned from the search tree since they are no longer possible.
This is done to avoid the tree from growing infinitely large.
Once an action $a$ is taken and the job is allocated to a certain queue, the scheduler receives real observations,~$\textbf{z}$, from the system.
These are the randomly delayed acknowledgements from the system.
It then uses these observations as an input to the SIR particle filter, in order to update its belief of the state the system is in.
The weights given to each particle (state), $w(s_i) = p(z_i|s_i)$, while \textit{resampling} in this SIR particle filter were designed to incorporate our queuing system and its delay model, which is given in Eq. \eqref{eq:binomial}.
After applying the filter we have the new belief state of the system, $\bm{\rho}^{(t)}$, which is represented in terms of a certain number of particles.
These particles are then used to sample the states for simulating the search tree and finding the optimal action at the next time step \footnote{Note that in POS receiving observations, action selection and belief update all happen at each decision epoch, which is why it is possible to model the system as a POSMDP \cite{yu2006approximate} as well.}.
\section{Related Work}
\label{sec:related_work}
Dynamic scheduling for the performance optimization of parallel queuing systems has fueled numerous seminal algorithms such as Join-the-shortest-queue (JSQ),
and Shortest-expected-delay (SED), and more generally Power-of-d policies \cite{banawan1992comparative, van2018scalable, whitt1986deciding}.
JSQ provides optimal decisions, for minimizing the mean response time of a job, when the servers are homogeneous and the service times are independent and identically exponentially distributed \cite{hordijk1990optimality,winston1977optimality}.
A similar approach for heterogeneous servers is the SED algorithm, which
implicitly considers the server rates and maps an incoming job to the server which provides the smallest expected response time for the job at hand.
SED is known to perform well for heterogeneous servers, especially in the case of heavy traffic \cite{banawan1989load, selen2016steady}.
When the number of parallel systems $N$ becomes large, the assumption of knowing the state of each system before every scheduling decision becomes too strong. For example, the state may be the queue length or the required cumulative service times for the waiting jobs at each system.
Depending on the type of system this information, e.g., the service times for servers of random varying capacity, is not known in advance.
Power-of-d policies provide a remedy to the problem of the scheduler not being able to know all system states at decision time. Here, a number of servers, specifically $d<N$, is repeatedly polled at random at every decision instant and hence, JSQ(d) or SED(d) is performed on this changing subset~\cite{963420}.
This policy is enhanced by a short term memory that keeps knowledge of the least filled servers from the last decision instant~\cite{shah2002use, psounis2002efficient}.
Hence, instead of choosing $d$ servers at random for every job the decision is based on a combination of new randomly chosen $d$ servers and the least filled servers known from the last decision.
For our evaluation purposes we have chosen to compare our algorithm with SED, JSQ and JSQ(d) since the comparison is with respect to the classes of full and limited information at the scheduler.
\emph{The strong assumption behind the different variants of JSQ, SED and the Power-of-d policies is that at every decision instant the scheduler is aware of the current system state of all or some of the servers}. This includes for example the states of the queues, the service times of the jobs waiting at the servers or other required parameters.
The main difference in this work is that we hypothesize that this assumption of instant (and full) knowledge is often not realistic, as due to the distributed nature of the system the scheduler may only observe the impact of a decision that maps a job to a server after some non-deterministic feedback time.
This feedback time may arise, e.g., due to the propagation delay or simply that the scheduler receives feedback only after the job has been processed.
The impact of this non-deterministic and heterogeneous feedback time on the scheduling decision is significant, as the consequence of a scheduling decision on performance metrics such as job response times or job drop rates is only partially observed at the decision instant.
Markov decision processes, MDP, have been used to achieve optimal control in queuing systems under static and dynamic environments \cite{stidham1993survey}. In an MDP the current state, delayed or not, is known to the agent \cite{Sutton1998}.
The authors of \cite{winston1977optimality} used an MDP formulation together with a stochastic ordering argument to show that JSQ maximizes the discounted number of jobs to complete their service for a homogeneous server setting.
The authors of \cite{krishnan1987joining} study the problem of allocating customers to parallel queues.
They model this problem as an MDP with the goal of minimizing the sojourn time for each customer and produce a 'separable rule', which is a generalization of JSQ, for queues with heterogeneous servers (in rates and numbers).
Note, however, that it is assumed that the queue filling is known and available without delay to the scheduler.
In \cite{altman1992closed} the authors assume that the scheduler receives the exact queue length information but with a delay of $k$ steps.
They formulate their system as a Markov control model with \textit{perfect state information} by augmenting to the state space the last known state (exact queue length) and all the actions taken until the next known state.
In their work, they solve the flow control problem by \textit{controlling the arrival} to a single server queue and show for $k=1$ that the optimal policy is of threshold type and depends on the last action.
In \cite{kuri1995optimal}, along with the single server flow control problem with similar results as \cite{altman1992closed}, they also showed that when $k=1$, the optimal policy for minimizing the discounted number of jobs in a system of two parallel queues is join-the-shortest-expected-length.
In \cite{artiges1993optimal}, the scheduler at time \textit{n} \emph{knows the number of jobs} that were present in each (infinite) queue at time \textit{n-1}, such that it takes decisions at a deterministic delay of one time slot.
The state space at any time \textit{n} is augmented and contains the actual queue filling at time \textit{n-1}, the action taken at time \textit{n} and if there was an arrival at time \textit{n}.
In our work, we assume that not only is the information received by the scheduler randomly delayed, but it is also not the state of the buffers, rather it is in the form of acknowledgements of the number of jobs processed.
This makes the system \textit{partially observable} and complex to solve, i.e., in the sense of a \ac{pomdp}\xspace model.
Several online and offline algorithms have been introduced to solve \ac{pomdp}\xspace \cite{murphy2000survey,monahan1982state}, but there is little work on optimizing queuing systems as a \ac{pomdp}\xspace.
Standard solutions, for \ac{pomdp}\xspace, that do full-width planning \cite{ross2008online}, like Value iteration and Policy iteration, perform poorly when the state space grows too large. This can easily be the case in queuing systems, due to the curse of dimensionality and the curse of history \cite{kaelbling1998planning}, \cite{pineau2011anytime}. For such large state problems, the POMCP algorithm \cite{silver2010monte}, which uses \ac{mcts}\xspace, is a fast and scalable algorithm for solving a \ac{pomdp}\xspace.
Our algorithm also makes use of the \ac{mcts}\xspace algorithm specifically designed to simulate a parallel queueing system with finite buffers. In addition, we also designed a Sequential Importance Resampling, SIR, particle filter to deal with the delayed feedback acknowledgements in the queueing system.
We also use this MCTS approach for solving a \ac{posmdp}\xspace \cite{yu2006approximate}, which is needed when the time between decision epochs is no more exponential.
| {'timestamp': '2021-09-20T02:18:04', 'yymm': '2109', 'arxiv_id': '2109.08548', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08548'} | arxiv |
\section{INTRODUCTION}\label{introduction}}
Coronavirus Disease 2019 (COVID-19) caused a worldwide public health crisis that has reshaped many aspects of society.
The scientific community has, in turn, devoted significant attention and resources towards COVID-19 and the associated virus, SARS-CoV-2, resulting in the release of data and publications at a rate and scale never previously seen for a single topic.
Over 20,000 articles about COVID-19 were released in the first four months of the pandemic \citep{7ub6VM4Z}, causing an ``infodemic'' \citep{7ub6VM4Z, nnfOazAC}.
The COVID-19 Open Research Dataset (CORD-19) \citep{CiOwklc6}, which was developed in part with the goal of training machine learning algorithms on COVID-19-related text, illustrates the growth of related scholarly literature (Figure \ref{fig:cord19-growth}).
This resource was developed by querying several sources for terms related to SARS-CoV-2 and COVID-19, as well as the coronaviruses SARS-CoV-1 and MERS-CoV and their associated diseases \citep{CiOwklc6}.
CORD-19 contained 768,929 manuscripts as of September 6, 2021.
Additional curation by CoronaCentral \citep{Ybg667S0} has produced, at present, a set of over 180,000 publications particularly relevant to COVID-19 and closely related viruses.
Despite many advances in understanding the virus and the disease, there are also downsides to the availability of so much information.
"Excessive publication" has been recognized as a concern for over forty years \citep{DfSr1Ohc} and has been discussed with respect to the COVID-19 literature \citep{dUvvJvv6}.
Any effort to synthesize, summarize, and contextualize COVID-19 research will face a vast corpus of potentially relevant material.
\begin{figure}[htbp]
\hypertarget{fig:cord19-growth}{%
\centering
\includegraphics[width=0.5\textwidth]{images/cord19-growth.pdf}
\caption{\textbf{Growth of the CORD-19 dataset.}
The number of articles has proliferated, with both traditional and preprint manuscripts in the corpus.
The first release (March 16, 2020) contained 28,000 documents \citep{CiOwklc6}.
As of September 6, 2021, this had increased to 768,929 articles.
Of these, 30,726 are preprints from \emph{arXiv}, \emph{medRxiv}, and \emph{bioRxiv}.
}\label{fig:cord19-growth}
}
\end{figure}
Information was released rapidly by both traditional publishers and preprint servers, and many papers faced subsequent scrutiny.
The number of COVID-19 papers retracted may be higher, and potentially much higher, than is typical, although a thorough investigation of this question requires more time to elapse \citep{ZUk10707, caxpZEmy}.
Many preprints and papers are also associated with corrections or expressions of concern\footnote{\url{https://asapbio.org/preprints-and-covid-19} as well as \url{https://retractionwatch.com/retracted-coronavirus-covid-19-papers}} \citep{caxpZEmy}.
Preprints are released prior to peer review, but some traditional publishing venues have fast-tracked COVID-19 papers through peer review, leading to questions about whether they are held to typical standards \citep{1Dez1ZOc5}.
Therefore, evaluating the COVID-19 literature requires not only digesting available information but also monitoring subsequent changes.
Because of the fast-moving nature of the topic, many efforts to summarize and synthesize the COVID-19 literature have been undertaken.
These efforts include newsletters\footnote{\url{https://depts.washington.edu/pandemicalliance/covid-19-literature-report/latest-reports}} \citep{JdWiPJCL}, web portals\footnote{\url{https://outbreaksci.prereview.org}} \citep{1CBWvhTdy} or the now-defunct http://covidpreprints.com\footnote{\url{https://asapbio.org/preprints-and-covid-19}}, comments on preprint servers\footnote{\url{https://disqus.com/by/sinaiimmunologyreviewproject}} \citep{YZ4cHNuH}, and even a journal\footnote{\url{https://rapidreviewscovid19.mitpress.mit.edu}}.
However, the explosive rate of publication presents challenges for such efforts, many of which are no longer active.
Similarly, many literature reviews have been written on the available COVID-19 literature \citep{I2EsJmfs, evtsR3C5, 18eCxyLhx, SAE5ME3N, xOs5ctsW}, but static reviews quickly become outdated as new research is released or existing research is retracted or superseded.
One example is a review of topics in COVID-19 research including vaccine development \citep{xOs5ctsW}.
This review was published on July 10, 2020, four days before Moderna released the surprisingly promising results of their phase 1 trial \citep{wiGjCZC8} that changed expectations surrounding vaccines.
Therefore, the COVID-19 publishing climate presented a challenge where curation of the literature by a diverse group of experts in a format that could respond quickly to high-volume, high-velocity information was desirable.
We therefore sought to develop a platform for scientific discussion and collaboration around COVID-19 by adapting open publishing infrastructure to accommodate the scale of COVID-19 publishing.
Recent advances in open publishing have created an infrastructure that facilitates distributed, version-controlled collaboration on manuscripts \citep{YuJbg3zO}.
Manubot \citep{YuJbg3zO} is a collaborative framework developed to adapt open-source software development techniques and version control for manuscript writing.
With Manubot, manuscripts are managed and maintained using GitHub, a popular, online version control interface.
We selected Manubot because it offers several advantages over comparable collaborative writing platforms such as Authorea, Overleaf, Google Docs, Word Online, or wikis \citep{YuJbg3zO}.
Citation-by-identifier ensures consistent reference metadata standards that would be difficult to maintain manually in a manuscript with dozens of authors and over 1,500 citations.
Manubot's pull request-based contribution model balances the goals of making the project open to everyone and maintaining scientific accuracy.
All contributions are reviewed, discussed, and formally approved on GitHub before text updates appear in the public-facing manuscript\footnote{\url{https://greenelab.github.io/covid19-review}}.
Continuous integration (CI) seamlessly combines author-produced text and figures with automatically generated and updated statistics and figures derived from external data sources and the manuscript's own content.
In addition, the authors who initially launched this project included Manubot developers who had prior successes using Manubot for massively open and traditional manuscript, such as a large-scale collaborative efforts such as a review of developments in deep learning \citep{PZMP42Ak} and a re-evaluation of the role of authorship in modern collaborations \citep{6acsZuy7}.
Collaboration via massively open online papers has been identified as a strategy for promoting inclusion and interdisciplinary thought \citep{PoDz2q0A}.
However, the Manubot workflow can be intimidating to contributors who are not well-versed in git \citep{PoDz2q0A}.
The synthesis and discussion of the emerging literature by biomedical scientists and clinicians is imperative to a robust interpretation of COVID-19 research.
Such efforts in biology often rely on What You See Is What You Get tools such as Google Docs, despite the significant limitations of these platforms in the face of excessive publication.
We recognized that the problem of synthesizing the COVID-19 literature lent itself well to the Manubot platform, but that the potential technical expertise required to work with Manubot presented a barrier to domain experts.
Here, we describe the adaptation of Manubot to facilitate collaboration in the extreme case of the COVID-19 infodemic, with the objective of developing a centralized platform for summarizing and synthesizing a massive amount of preprints, news stories, journal publications, and data.
Unlike prior collaborations built on Manubot, most contributors to the COVID-19 collaborative literature review came from biology or medicine.
The members of the COVID-19 Review Consortium consolidated information about the virus in the context of related viruses and to synthesize rapidly emerging literature.
Manubot provided the infrastructure to manage contributions from the community and create a living, scholarly document integrating data from multiple sources.
Its back-end allowed biomedical scientists to sort and distill informative content out of the overwhelming flood of information \citep{1HZeeO4Cs} in order to provide a resource that would be useful to the broader scientific community.
This case study demonstrates the value of open collaborative writing tools such as Manubot to emerging challenges.
Because it is open source software, we were able to adapt and customize Manubot to flexibly meet the needs of COVID-19 review.
Recording the evolution of information over time and assembling a resource that auto-updated in response to the evolving crisis revealed the particular value that Manubot holds for managing rapid changes in scientific thought.
\hypertarget{methods}{%
\section{METHODS}\label{methods}}
\hypertarget{contributor-recruitment-and-roles}{%
\subsection{Contributor Recruitment and Roles}\label{contributor-recruitment-and-roles}}
First, it was necessary to establish Manubot as a platform accessible to researchers with limited experience working with version control, given that this is not typically emphasized in biology and medicine \citep{1HmO21gZN, OO1DuZd, 4ny1onB0}.
Contributors were recruited primarily by word of mouth and on Twitter, and we also collaborated with existing efforts to train early-career researchers.
We invited potential collaborators to contribute a short introduction on a GitHub issue in order to collect information about participants and provide an introduction to working with GitHub issues.
Interested participants were encouraged to contribute in several ways.
One option was to catalog articles of interest as issues.
We developed a standardized set of questions for contributors to consider when evaluating an article following a framework often used for assessing medical literature.
This approach emphasizes examining the methods used, assignment (whether the study was observational or randomized), assessment, results, interpretation, and how well the study extrapolates \citep{17OQtAY4l}.
Contributors were also invited to contribute or edit text using GitHub's pull request system.
These contributions were not strictly defined and could range from minor corrections to punctuation and grammar to large-scale additions of text.
Finally, a small number of contributors (the authors of this paper) contributed technical expertise, either through the development of standardized approaches to the evaluation of papers based on the MAARIE Framework \citep{k1GJLUxP}, the writing of code to generate manuscript figures, or the addition of features to Manubot.
All of these additions were also submitted as pull requests, either to the COVID-19 review repository or to an external repository, as appropriate.
Each pull request was reviewed and approved by at least one other contributor before being merged into the main branch.
We tagged potential reviewers based on the introductions they had contributed in order to encourage participation.
Authorship was determined based on the Contributor Roles Taxonomy\footnote{\url{https://casrai.org/credit}}.
Due to the permeability of ideas among different sections, contributors to a specific manuscript were recognized with masthead authorship, while all contributors to the project were recognized with consortium authorship on all papers.
Emphasizing the use of issues and pull requests was designed to encourage authors with and without git experience to discuss papers and provide feedback (both formal and informal) on proposed text additions or changes.
We also used the Gitter chat platform\footnote{\url{https://www.gitter.im}} to promote informal questions and sharing of information among collaborators.
\hypertarget{utilization-and-expansion-of-manubot}{%
\subsection{Utilization and Expansion of Manubot}\label{utilization-and-expansion-of-manubot}}
Applying Manubot's existing capabilities allowed us to confront several challenges common in large-scale collaborations, such as maintaining a record of contributions that allowed us to allocate credit appropriately or to contact the original author if questions arose.
Additionally, an up-to-date version of the content was available at all times online in HTML\footnote{\url{https://greenelab.github.io/covid19-review}} or PDF format\footnote{\url{https://greenelab.github.io/covid19-review/manuscript.pdf}}.
This approach also allowed us to minimize the demand on authors to curate and sync bibliographic resources.
Manubot provides the functionality to create a bibliography using digital object identifiers (DOIs), website URLs, or other identifiers such as PubMed identifiers and arXiv IDs.
The author can insert a citation in-line using a format such as \texttt{{[}@doi:10.1371/journal.pcbi.1007128{]}}.
Manubot then obtains reference metadata, exports the citations as Citation Style Language JSON Data Items, and renders the bibliographic information needed to generate the references section \citep{YuJbg3zO}.
This approach allows multiple authors to work on a piece of text without needing to make manual adjustments to the reference lists.
Due to the needs of this project, several new features were implemented in Manubot.
Because of the ever-evolving nature of the COVID-19 crisis, figures and statistics in the text quickly became outdated.
To address this concern, Manubot and GitHub's CI features were used to create figures that integrated online data sources and to dynamically update information, such as the current number of active COVID-19 clinical trials \citep{cifK9B8t}, within the text of the manuscripts (Figure \ref{fig:manubot-workflow}).
GitHub Actions runs a nightly workflow to update these external data and regenerate the statistics and figures for the manuscript.
The workflow uses the GitHub API to detect and save the latest commit of the external data sources that are GitHub repositories\footnote{Vaccines: \url{https://github.com/owid/covid-19-data}; Clinical Trials: \url{https://github.com/ebmdatalab/covid\_trials\_tracker-covid}; Cases and Deaths: \url{https://github.com/CSSEGISandData/COVID-19}}.
It then downloads versioned data from that snapshot of the external repositories and runs bash and Python scripts to calculate the desired statistics and produce the summary figures using Matplotlib \citep{1026Gxdsi}.
The statistics are stored in JSON files that are accessed by Manubot to populate the values of placeholder template variables dynamically every time the manuscript is built.
For instance, the template variable \texttt{\{\{ebm\_trials\_results\}\}} in the manuscript is replaced by the actual number of clinical trials with results, 98.
The template variables also include versioned URLs to the dynamically updated figures.
The JSON files and figures are stored in the \texttt{external-resources} branch of the GitHub repository, providing versioned storage.
The GitHub Actions workflow automatically adds and commits the new JSON files and figures to the \texttt{external-resources} branch every time it runs, and Manubot uses the latest version of these resources when it builds the manuscript.
The GitHub Actions workflow file is available online\footnote{\url{https://github.com/greenelab/covid19-review/blob/master/.github/workflows/update-external-resources.yaml}}, as are the scripts\footnote{\url{https://github.com/greenelab/covid19-review/tree/external-resources}}.
The Python package versions are also available\footnote{\url{https://github.com/greenelab/covid19-review/blob/external-resources/environment.yml}}.
\begin{figure*}[htbp]
\hypertarget{fig:manubot-workflow}{%
\centering
\includegraphics[width=\textwidth]{images/covid-19-review-workflow-horizontal-cropped.pdf}
\caption{\textbf{COVID-19 review GitHub repository organization and workflows.}
Manubot uses CI to combine author-contributed content with automatically updated information from outside sources.
A nightly workflow updates figures and statistics derived from external resources.
Authors write text and add figures to the \texttt{master} branch (starred) via GitHub pull requests.
Manubot generates updated manuscript outputs for each new git commit, integrating the static text and figures with the dynamic statistics and figures and automatically-extracted citation information.
GitHub Pages hosts the latest HTML and PDF versions of the manuscript along with permanent links to prior versions.}\label{fig:manubot-workflow}
}
\end{figure*}
Another issue identified was the need for standardized citation to clinical trials.
Other researchers identified the same need\footnote{\url{https://forums.zotero.org/discussion/74933/import-from-clinical-trials-registry} and \url{https://forums.zotero.org/discussion/77721/add-reference-from-clinical-trials-org}}.
Trials that are registered with clinicaltrials.gov receive a unique clinical trial identifier, or ``NCT ID.''
Because clinical trials are registered long before results are published, referencing clinical trial identifiers was a priority.
Manubot uses the Zotero translation server\footnote{\url{https://www.zotero.org} and \url{https://github.com/zotero/translation-server}} to extract citation metadata for some types of citations.
However, Zotero did not support clinical trial identifiers and could not extract relevant metadata from their URLs.
In order to pull clinical trial metadata associated into Manubot, we added Zotero support for these identifiers.
To achieve this, we query clinicaltrials.gov to retrieve XML metadata associated with each identifier using JavaScript\footnote{\url{https://github.com/zotero/translators/pull/2153}}.
This extension enables citing a trial as \texttt{@clinicaltrials:NCT04280705} instead of the URL.
Then, when Manubot requests clinical trial metadata from the Zotero translation server, the response includes the trial sponsors, responsible investigators, title, and summary.
Manubot now supports directly citing hundreds of registered Compact Uniform Resource Identifiers\footnote{\url{https://identifiers.org}}, beyond just the \texttt{clinicaltrials} identifier.
Because of the large number of citations used in this manuscript and the fast-moving nature of COVID-19 research, keeping track of retractions, corrections, and notices of concern also became a challenge.
We implemented a new Manubot plugin to support ``smart citations'' in the HTML build of manuscripts.
The plugin uses the scite \citep{14UJbLWf4} service to display a badge below any citation with a DOI.
The badge contains a set of icons and numbers that indicate how many times that source has been mentioned, supported, or disputed and whether there have been any important editorial notices.
We were thus able to identify references that needed to be reevaluated by an expert.
This addition was invaluable given the nature of the project, where we were disseminating rapidly evolving information of great consequence from over 1,500 different sources.
The badges also allow readers to ascertain a rough approximation of the reliability of cited sources at a glance.
Because most collaborators were writing and editing text through the GitHub website rather than in a local text editor, we also needed to add spell-checking functionalities to Manubot.
We integrated an existing Pandoc\footnote{\url{https://pandoc.org}} spell-check extension with AppVeyor CI to automatically post spelling errors as comments in a GitHub pull request.
The comment reported both unique misspelled tokens and all locations where the token was detected.
Project maintainers managed a custom dictionary to allow over 1,500 scientific and technical terms that were not common English words.
Spell-checking also helped standardize the writing style across dozens of authors by detecting features such as British versus American English spellings.
The actual spell-checking was implemented using GNU Aspell\footnote{\url{http://aspell.net}} and the Pandoc spellcheck filter\footnote{\url{https://github.com/pandoc/lua-filters/tree/master/spellcheck}}.
The filter enables checking only the manuscript text, ignoring URLs and formatting.
Manubot can render a manuscript in several formats that serve different purposes.
Prior to this project, Manubot could use Pandoc to convert the markdown-formatted manuscript to HTML, PDF, and DOCX formats.
We expanded this functionality to export individual sections of the manuscript as separate DOCX files while still rendering the complete manuscript in HTML and PDF formats.
This development was necessary because the manuscript grew so large that it needed to be split into seven separate papers for journal submission while still maintaining shared GitHub discussion across topics.
When exporting an individual section, Manubot customizes the manuscript title, authors, and author contributions to pertain to that specific section.
In addition, we expanded the export formats to include partial LaTeX support via Pandoc.
Pandoc converts the markdown content for an individual section to TeX and the Citation Style Language JSON, which contains reference metadata generated by Manubot, to BibTeX.
We customized a LaTeX template and reformatted the Manubot metadata, such as authors and their affiliations, for the LaTeX template.
The exported TeX file requires manual refinement but contains all manuscript content and most of the formatting.
Because LaTeX is required for manuscript submission in many fields, automating most of the process of converting markdown to a submission-friendly format expands Manubot's potential user base.
Manubot users can write in the simple markdown format, render the manuscript in continuously-updated PDF or interactive HTML formats, and export the manuscript in DOCX or TeX and BibTeX for submission to traditional publishers, taking full advantage of Pandoc's powerful document conversion capabilities and Manubot's automation.
\hypertarget{results}{%
\section{RESULTS}\label{results}}
\hypertarget{recruitment-and-manuscript-development}{%
\subsection{Recruitment and Manuscript Development}\label{recruitment-and-manuscript-development}}
\begin{figure}[htbp]
\hypertarget{fig:projectstats}{%
\centering
\includegraphics[width=0.5\textwidth]{images/manuscript_stats.pdf}
\caption{\textbf{Project growth over time.}
The number of authors, word count, and number of references have all grown dramatically from when the project began on March 20, 2020.
As of September 10, 2021, there were 52 authors (including consortia), 1,676 references, and 138,213 words.
The spike in word count during summer 2020 was caused by erroneous duplication and subsequent removal of a large appendix.}\label{fig:projectstats}
}
\end{figure}
Coverage by \emph{Nature Toolbox} \citep{AE0QcVgJ} and an associated tweet\footnote{\url{https://twitter.com/j\_perkel/status/1245454628235309057}} about the project on April 1, 2020 attracted the interest of the scientific community (Figure \ref{fig:projectstats}).
Because GitHub issues are similar to other common web commenting systems, authors learned these tools quickly.
The Gitter chat also presented a low barrier to entry.
The manuscript continued to grow throughout the first year and a half of the project in both word count and the number of references (Figure \ref{fig:projectstats}).
Though only a fraction of potential contributors contributed to the text included in the manuscripts (Figure \ref{fig:projectstats}), many contributors remained engaged over the long term (Figure \ref{fig:projectdots}).
Additionally, new contributors continued to join even into the second year of the project.
\begin{figure}[htbp]
\hypertarget{fig:projectdots}{%
\centering
\includegraphics[width=0.5\textwidth]{images/covid19-review-contribution-dot.pdf}
\caption{\textbf{User contributions to the manuscript text over time.}
The dot size indicates the number of words added or edited each month since March 2020.
The figure does not depict other types of author contributions such as literature summaries, pull request review, visualization, or software.}\label{fig:projectdots}
}
\end{figure}
In order to make the project more accessible, we developed resources explaining how to use GitHub's web interface to develop and edit text for Manubot assuming no prior experience with version control.
These tutorials explained how to open an issue, open a pull request, and review a pull request\footnote{CONTRIBUTING.md and INSTRUCTIONS.md within the repository}.
Additionally, the framework for evaluating literature was converted into issue templates to simplify the review of new articles.
Articles were classified as \emph{diagnostic}, \emph{therapeutic}, or \emph{other}, with an associated template developed to guide the review of papers and preprints in each category.
A total of 285 new paper issues had been opened as of September 13, 2021.
The manuscripts produced by the consortium (excluding this one) will be submitted to \emph{mSystems} as part of a special issue that provides support for continuous updates as more information becomes available.
One has been published and two are available as preprints.
This approach allows for a version of record to be maintained alongside the most recent version, which is always available through GitHub.
These manuscripts cover a wide range of topics including the fundamental biology of SARS-CoV-2 (pathogenesis \citep{r366f5T3} and evolution), biomedical advances in responding to the virus and COVID-19 (pharmaceuticals \citep{cifK9B8t}, nutraceuticals \citep{wgAGKcBj}, vaccines, and diagnostic technologies), and biological and social factors influencing disease transmission and outcomes.
To date, 50 authors are associated with the consortium (Figure \ref{fig:projectstats}).
More formal recruitment efforts to integrate with existing projects providing support for undergraduate students during COVID-19 were also successful.
We incorporated summaries written by the students, post-docs, and faculty of the Immunology Institute at the Mount Sinai School of Medicine\footnote{\url{https://github.com/ismms-himc/covid-19\_sinai\_reviews}} \citep{YZ4cHNuH}.
Additionally, two of the consortium authors were undergraduate students recruited through the American Physician Scientist Association's Virtual Summer Research Program.
Thus, the consortium was successful in providing a venue for researchers across all career stages to continue investigating and publishing at a time when many biomedical researchers were unable to access their laboratory facilities.
\hypertarget{integrating-data}{%
\subsection{Integrating Data}\label{integrating-data}}
We integrated data into the manuscripts from several sources (Figure \ref{fig:manubot-workflow}).
Worldwide cases and deaths were tracked by the COVID-19 Data Repository by the Center for Systems Science and Engineering at Johns Hopkins University\footnote{\url{https://github.com/CSSEGISandData/COVID-19/tree/master/csse\_covid\_19\_data/csse\_covid\_19\_time\_series}}.
The clinical trials statistics and figure were generated based on data from the University of Oxford Evidence-Based Medicine Data Lab's COVID-19 TrialsTracker \citep{SSbnPnzT}.
Information about vaccine distribution was extracted from Our World In Data\footnote{\url{https://github.com/owid/covid-19-data}} \citep{ZHvhFakW}.
Figure \ref{fig:cord19-growth} integrates data from the CORD-19 dataset \citep{CiOwklc6}.
Manubot's bibliographic management capabilities were critical because the amount of relevant literature published far outstripped what we had anticipated at the beginning of the project.
As of September 10, 2021, there were 1,676 references (Figure \ref{fig:projectstats}).
The scite plugin provided a way to visually inspect the reference list to identify possible references of concern.
This and the other new features required for the COVID-19 project are now included in Manubot's rootstock, which is the template GitHub repository for creating a new manuscript.
Using CI, Manubot now checks that the manuscript was built correctly, runs spell-checking, and cross-references the manuscripts cited in this review.
In addition, Manubot now supports citing clinical trial identifiers such as \texttt{clinicaltrials:NCT04292899} \citep{yTCAmOyt}.
\hypertarget{discussion}{%
\section{DISCUSSION}\label{discussion}}
The current project was based in the GitHub repository \texttt{greenelab/covid19-review} using Manubot \citep{YuJbg3zO} to continuously generate the manuscript.
The Manubot framework facilitated a massive collaborative review on an urgent topic.
We demonstrated the utility of Manubot to a project where many contributors lacked expertise or even experience working with version control.
This effort has produced not only seven literature reviews on topics relevant to the COVID-19 pandemic, but has also generated cyberinfrastructure for training novice users in GitHub.
We also extended the functionalities of Manubot to provide more of the benefits of What You See Is What You Get platforms such as Google Docs (Table \ref{tbl:manubot-addons}).
Open publishing thus allowed us to harness the domain expertise of a large group of non-technical users to respond to the flood of COVID-19 publications.
Several existing and new features in Manubot aid in responding to the challenges posed by the infodemic.
Manuscripts are written in markdown and can be rendered in several formats providing different advantages to users.
For example, beyond building just a PDF, Manubot also renders the manuscript in HTML, DOCX, and now, LaTeX (in a more limited capacity).
The interactive HTML manuscript format offers several advantages over a static PDF to harmonize available resources and address specific problems related to COVID-19.
The integration of scite into the HTML build makes references more manageable by visually indicating whether their results are contested or whether they have been corrected or retracted.
Cross-referencing different pieces of the manuscript, such as cited preprints with reviews stored in an appendix, is another interactive option presented by HTML.
The DOCX format was preferred by most non-technical users for reviewing the final version of the manuscript and was useful for creating submissions to a biological journal.
Additionally, because of the heavy emphasis on Word processing in biology, Manubot's ability to generate DOCX outputs was expanded to allow users to generate DOCX files containing only a section of the manuscript.
In our case, where the full project is nearly 150,000 words, this allows individual pieces to be shared more easily.
Finally, the preliminary addition of LaTeX output is useful for researchers from computational fields who submit papers in TeX format and removes the step of reformatting markdown prior to submission.
\begin{table}[ht]
\caption{\textbf{Manubot extensions for the COVID-19 review.}}
\begin{tabular}{p{0.06\textwidth} p{0.38\textwidth}}
\toprule
\textbf{Type} & \textbf{Description} \\
\midrule
CI & Regularly download external data sources, generate new figures and statistics, and read them when Manubot builds the latest manuscript \\
CI & Post spell-checking reports as pull request comments \\
Citations & Zotero extension to report more relevant clinical trial metadata from \url{https://clinicaltrials.gov} \\
Citations & Cite any Compact Uniform Resource Identifier, such as \texttt{clinicaltrials} or \texttt{ncbigene} \\
Citations & scite badges to track retractions, corrections, and notices of concern \\
Outputs & Improved support for Pandoc's LaTeX output \\
Outputs & Build complete manuscript alongside individual sections as standalone documents \\
\bottomrule
\end{tabular}
\label{tbl:manubot-addons}
\end{table}
The COVID-19 Review Consortium provided a platform for researchers to engage in scientific investigation early in the pandemic when many biological scientists were unable to access their research spaces.
In turn, by seeking to adapt Manubot to allow for broader participation, we made a number of improvements that are expected to increase its appeal to researchers from all backgrounds.
Manubot provided a way for contributors from a variety of backgrounds, including early-career researchers, to join a massive collaborative project while demonstrating their individual contributions to the larger work and gaining experience with version control.
The licensing and infrastructure also provide the basis for individuals to adapt from this project to create their own snapshots of the COVID-19 literature that derive from, but are not wholly identical to, the primary versions of these reviews.
This project suggests that massive online open publishing efforts can indeed advance scholarship through inclusion \citep{PoDz2q0A}, including during the extreme challenges presented by the COVID-19 pandemic.
Some challenges did arise in efforts to include an academically diverse set of authors.
The barriers to entry posed by git and GitHub likely still reduced participation from individuals who might have otherwise been interested.
Using pull requests as a tool for writing text is also unfamiliar to many or most scientists, and the review process can be slow, which might cause interested contributors to lose interest.
Additionally, the pull request model may limit people from providing general feedback on the manuscript or a section of the manuscript.
As a result, some feedback came through email or comments on the DOCX outputs that were then translated into issues or pull requests by the project managers.
Given that our approach hinged on these version control tools, it is likely that our group of contributors was biased towards those who were interested in or experienced with computational tools.
The trajectory of the pandemic itself also likely influenced participation: engagement waned over the course of the pandemic as labs opened back up and researchers were able to return to their work, and we recruited very few senior clinicians to the project, which is unsurprising given the load on medical professionals during this time.
Engagement that waxes and wanes is, however, typical when writing massively open online papers \citep{PoDz2q0A}.
Adding features such as spell-check did improve usability, and additional features such as automatically checking the formatting of citations could further improve the usability of this tool.
In the future, a formal study of participation could allow for quantification of these biases and improved efforts to foster inclusion.
Additional limitations are challenges associated with massively open online papers in general.
With such a large amount of text, it is not possible to keep all sections of the manuscript up to date at all times.
Readers are not able to distinguish when each section was updated.
Even GitHub's blame functionality does not distinguish minor changes from substantive updates to the text.
While much of the data and statistics update automatically, the text itself required updating by human experts.
This asynchronicity could potentially introduce incompatibility between the figures and the surrounding text.
Similarly, in line with the collaboration-related challenges of the project, some authors returned to update their text, while others did not.
As a result, the lead authors of each paper often spent several weeks prior to journal submission updating the text to reflect new developments in each area.
In the future, it may be possible to streamline this process through integration with a tool such as CoronaCentral \citep{Ybg667S0} to automatically identify relevant, high-impact papers that need to be included, although expertise would still be required to incorporate them.
Another challenge involves tracking preprints as they are reviewed or critiqued, revised, and potentially published.
While updating the content of the manuscript would likely fall to human contributors, automatic detection of published versions of preprints \citep{pESBLU4c} could be integrated in the future.
These challenges are exacerbated by the scale of the infodemic, but developing solutions would benefit future projects tracking more typical trends in publication.
Similarly, outputting machine readable summaries of key information in the COVID-19 review manuscripts could reduce their contribution to the infodemic.
As it stands, the integration of Compact Uniform Resource Identifier does make a step in this direction.
Formal identifiers could be used to extract relationships among clinical trials, genes, publications, and other entities.
Thus, the experience of using Manubot for a massive project has laid the foundation for future additions to enhance user experience and inclusivity.
\hypertarget{conclusion}{%
\section{CONCLUSION}\label{conclusion}}
With the worldwide scientific community uniting during 2020 and 2021 to investigate COVID-19 from a wide range of perspectives, findings from many disciplines are relevant on a rapid timescale to a broad scientific audience.
As many other efforts have described, the publishing rate of formal manuscripts and preprints about COVID-19 has been unprecedented \citep{7ub6VM4Z}, and efforts to review the body of COVID-19 literature are faced with an ever-expanding corpus to evaluate.
In the case of the seven manuscripts produced by the COVID-19 Review Consortium, Manubot allows for continuous updating of the manuscripts as the pandemic enters its second year and the landscape shifts with the emergence of promising therapeutics and vaccines \citep{cifK9B8t}.
These manuscripts pull data from external sources and update information and visualizations daily using CI.
By off-loading some updates to computational pipelines, domain experts can focus on the broader implications of new information as it emerges.
Centralizing, summarizing, and critiquing data and literature broadly relevant to COVID-19 can expedite the interdisciplinary scientific process that is currently happening at an advanced pace.
As of September 13, 2021, 2,886 commits have been made to the manuscript across 575 merged pull requests.
The efforts of the COVID-19 Review Consortium illustrate the value of including open source tools, including those focused on open publishing, in these efforts.
By facilitating the versioning of text, such platforms also allow for documentation of the evolution of thought in an evolving area and formal analysis of a collaborative project.
This application of version control holds the potential to improve scientific publishing in a range of disciplines, including those outside of traditional computational fields.
While Manubot is a technologically complex tool, this project demonstrates that it can be applied to a variety of projects.
Future work can address remaining limitations and continue to advance Manubot as an inclusive tool for open publishing projects.
\hypertarget{acknowledgements}{%
\section*{Acknowledgements}\label{acknowledgements}}
\addcontentsline{toc}{section}{Acknowledgements}
We thank Josh Nicholson and Milo Mordaunt for scite support, David Nicholson for spell-check assistance, Milton Pividori and consortium members\footnote{COVID-19 Review Consortium: Vikas Bansal, John P. Barton, Simina M. Boca, Joel D Boerckel, Christian Brueffer, James Brian Byrd, Stephen Capone, Shikta Das, Anna Ada Dattoli, John J. Dziak, Jeffrey M. Field, Soumita Ghosh, Anthony Gitter, Rishi Raj Goel, Casey S. Greene, Marouen Ben Guebila, Daniel S. Himmelstein, Fengling Hu, Nafisa M. Jadavji, Jeremy P. Kamil, Sergey Knyazev, Likhitha Kolla, Alexandra J. Lee, Ronan Lordan, Tiago Lubiana, Temitayo Lukan, Adam L. MacLean, David Mai, Serghei Mangul, David Manheim, Lucy D'Agostino McGowan, Amruta Naik, YoSon Park, Dimitri Perrin, Yanjun Qi, Diane N. Rafizadeh, Bharath Ramsundar, Halie M. Rando, Sandipan Ray, Michael P. Robson, Vincent Rubinetti, Elizabeth Sell, Lamonica Shinholster, Ashwin N. Skelly, Yuchen Sun, Yusha Sun, Gregory L Szeto, Ryan Velazquez, Jinhui Wang, Nils Wellhausen} Alex Lee and Christian Brueffer for feedback, and Nick DeVito for assistance with the Evidence-Based Medicine Data Lab COVID-19 TrialsTracker data.
Research was supported by the Gordon and Betty Moore Foundation award GBMF 4552 (HMR, DSH, CSG), the National Institutes of Health award R01HG010067 (HMR, CSG), and the John W. and Jeanne M. Rowe Center for Research in Virology (AG)\footnote{Conflicts of interest. SMB: Now employed by AstraZeneca (Gaithersburg, MD). May own stock or stock options. Work conducted at previous position. LDM: Received consulting fees from Acelity and Sanofi. AG: Patent application filed with the Wisconsin Alumni Research Foundation related to classifying activated T cells.}.
| {'timestamp': '2021-09-20T02:20:46', 'yymm': '2109', 'arxiv_id': '2109.08633', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08633'} | arxiv |
\section{Introduction}
This work studies the relation between the existence of a fair allocation of indivisible items among agents -- for various notions of fairness -- in two different models that at first blush do not seem tightly related.
The first model has indivisible goods with multiple {\em copies} of each good. The second model has indivisible {\em chores} (or ``bads''), which are items with negative values.
\noindent {\bf Goods with copies.} While the seminal work of Budish~\shortcite{budish2011combinatorial} on allocation of indivisible items includes copies as a key ingredient (motivated by important applications like the allocation of university courses to students),
most subsequent works focus on a single copy of each item \cite[see, e.g.,][]{caragiannis2019unreasonable}. We consider a model where each agent may receive at most one copy of each good; we term such allocations ``exclusive''.%
\footnote{Such allocations are termed ``valid'' in \cite{PTAS_MMS}, or ``at most one'' allocations in \cite{AMO}.}
This captures applications like course allocation, where a student cannot be allocated multiple seats in the same course. Another example is digital goods with a license quota (e.g., a university with X software licenses that allocates at most one license per student).
Interestingly, even if a ``fair'' allocation (for an appropriate definition of fairness) is guaranteed to hold when each good has a single copy, this may significantly change when multiple copies are available. Considering fair allocation of goods with copies thus raises many open questions.
\noindent{\bf Chores.}
Fair allocation of chores is a topic of much recent research \cite[e.g.,][]{huang2019choresApproximation}.
The literature usually treats chores separately from goods~\cite[e.g.,][]{IdenticalOrdinalPref,chaudhury2020efx,garg2020improvedMMSgoods}, and our current understanding of chores is lacking.
For example, while it is known that an EFX allocatio
\footnote{In an EFX (resp.~EF1) allocation, the envy among any two agents can be eliminated by removing any (resp.~some) good from the envied bundle -- see Section~\ref{sec-pre} for formal fairness definitions.}
always exists for any number of goods (without copies) and three agents \cite{chaudhury2020efx}, almost nothing is known regarding EFX allocations of chores, and this is a major open problem. While this difference is a knowledge gap, other gaps provably hold. E.g., for goods, every allocation with \emph{MNW (maximum Nash welfare)} satisfies the ``envy bounded by a single item'' (EF1) fairness notion as well as Pareto efficiency \cite{caragiannis2019unreasonable}. In contrast, for chores, there is no single valued welfare function whose maximization implies both fairness and efficiency \cite{MixedManna}.%
\footnote{This phenomenon persists in the \emph{divisible} case, where there is a polytime algorithm to find a competitive division for goods, but the same problem is PPAD-hard for chores \cite{DBLP:journals/corr/abs-2008-00285}.}
\noindent {\bf Relating the models.} Given the above, one may conclude that studying existence of solution concepts for fair allocation of goods with copies and of chores is to be achieved by two disparate lines of research.
However, a main contribution of this paper is to formalize a tight relation among the models, via a duality theorem that we develop for a large class of fairness notions. The connection between goods and chores has been informally alluded to in the past by \citet{MixedManna}, who give a nice intuitive description: ``Say that we must allocate 5 hours of a painful job [...] Working 2 hours [on the job] is the same as being exempt [from the job] for 3 hours''. Very recently, \citet{PTAS_MMS} employed this connection in their proofs.
\emph{Our goal in this paper is to develop a formal treatment of this duality in the context of fair allocation existence, in order to enable a comprehensive exploration of the fundamental connection between fair allocations of goods, chores, and their copies.}
\subsection{Our Results}
We now describe our duality results via a main motivating application. \unless\ifdefined\full{} Throughout, missing proofs appear in the supplementary material.
\fi
\noindent
\textbf{Main application.}
Consider the well-studied fairness notion of EFX, in which each agent~$i$ prefers her own bundle over the bundle of any other agent~$j$, if one arbitrary good is removed from $j$'s bundle (in the related EF1 notion, the most valued good is removed from $j$'s bundle). As standard in the literature, we assume additive values/costs, and study exclusive allocations.
In light of the recent progress on existence of EFX for goods, culminating with the result of \cite{chaudhury2020efx} for three agents, a natural question is whether EFX existence persists in our first model of interest -- goods \emph{with copies}.
We show (in Section~\ref{sec-warmup-efx}) that an EFX allocation does not always exist for goods with multiple copies. This negative result holds even in a simple setting with any number $n\geq 3$ of agents and identical values (see Example~\ref{ex:GeneralCopiesNoEFX}), demonstrating how adding copies can completely change the fairness landscape.
To circumvent the underlying reason for inexistence with copies, we introduce a new fairness notion that we term ``EFX without commons'', or ``$\text{EFX}_{\text{WC}}$'' for short.
$\text{EFX}_{\text{WC}}$ requires each agent~$i$ to prefer her own bundle over the bundle of any other agent~$j$, if an arbitrary good \emph{which is not also in $i$'s bundle} is removed from $j$'s bundle. Intuitively, an agent compares herself to her peers while putting aside the intersection of their bundles, i.e., goods common to both.
Where does $\text{EFX}_{\text{WC}}$ fit in with other solution concepts?
In the special case of a single copy per good, $\text{EFX}_{\text{WC}}$ coincides with EFX. With multiple copies, $\text{EFX}_{\text{WC}}$ is a strictly weaker fairness requirement than EFX (i.e., $\text{EFX}_{\text{WC}}$ is implied by EFX but not vice versa).
On the other hand, $\text{EFX}_{\text{WC}}$ is a strictly stronger fairness requirement than EF1.
This immediately raises the question of whether an $\text{EFX}_{\text{WC}}$ allocation (unlike EFX) is guaranteed to exist for goods with copies.
At this point, the second model we study -- fair allocation of chores -- becomes relevant. We show that in any fair allocation setting where $n$ is the number of agents,
an $\text{EFX}_{\text{WC}}$ allocation for goods with $n-1$ copies per good exists if and only if an EFX allocation for chores
exists when the valuations are treated as costs (see Corollary~\ref{cor-efx-for-chores-iff-efxwc}). Thus, we have established a new characterization for the important open problem of existence of EFX for chores.
This characterization ``justifies'' our new $\text{EFX}_{\text{WC}}$ notion, since its existence
determines that of
the well-studied EFX notion for chores.
\noindent
\textbf{Duality theorems.}
The characterization result for EFX with chores
is obtained as a corollary of our duality ``meta-theorem'' (Theorem~\ref{thm:wc-duality} in Section~\ref{sec-dual}), connecting goods with copies on the one hand, and chores with copies on the other. This meta-theorem shows, for example, that any allocation of goods with copies is $\text{EFX}_{\text{WC}}$ if and only if its \emph{dual} allocation for chores with copies is $\text{EFX}_{\text{WC}}$.
Since the dual allocation for goods with $n-1$ copies is an allocation with one copy per chore, the characterization result follows.
The meta-theorem is
formulated in a general way that fits other envy-based solution concepts as well, and a similar duality meta-theorem (Theorem~\ref{thm-meta-share}) applies to \emph{share-based} solution concepts.%
\footnote{In share-based fairness, an agent compares her allocation to her ``fair share'' of the whole rather than to her peers'; see Section~\ref{sec-pre}.}
The duality meta-theorems are in fact flexible enough to apply to settings with a mixture of goods and chores (see Remark \ref{rem:mixture}).
\noindent
\textbf{Fairness notions ``without commons''.}
In Section~\ref{sec:notions_hierarchy} we further explore ``without commons'' fairness, since its connection to EFX for chores seems to indicate it is the ``right'' notion to study for copies, and since disregarding common items is a natural way to limit envy among agents. We define similar notions to $\text{EFX}_{\text{WC}}$ for other solution concepts beyond EFX, in particular $\text{EF1}_{\text{WC}}$ and $\text{EFL}_{\text{WC}}$.%
\footnote{EFL (the basis for $\text{EFL}_{\text{WC}}$) is due to \cite{barman2018groupwise}.}
We study how these new concepts expand the hierarchy of envy-based fairness notions. Expansion of the hierarchy is important for two reasons: First, intermediate ``without commons'' fairness notions can serve as a technical stepping stone for making progress on the elusive existence of more standard notions. Second, as we show, ``without commons'' envy-freeness has good share-based fairness guarantees
\footnote{As measured by their approximation of MMS, the maximin share of every agent \cite{budish2011combinatorial}.}
especially in comparison to standard envy-freeness concepts like EF1.
We thus believe such concepts to be of independent interest.
Our results in this section are summarized in Figure~\ref{fig:notions_hierarchy}.
\begin{figure}
\begin{tikzpicture}
\matrix (m) [matrix of math nodes, row sep=2em, column sep=2em]
{ & & \text{EFL} & & \\
\text{EFX} & \text{EFX}_{\text{WC}} & \text{EFL}_{\text{WC}} & \text{EF1}_{\text{WC}} & \text{EF1} \\
& \frac{4}{11}\text{-MMS} &\frac{1}{3}\text{-MMS} & \frac{1}{n}\text{-MMS} & \\};
{ [start chain] \chainin (m-2-1);
\chainin (m-2-2);
{ [start branch=A] \chainin (m-3-2)
[join={node[right,labeled] {\text{Thm.~\ref{thm:efx-wc_separation}}}}];}
\chainin (m-2-3) [join={node[above,labeled] {\text{Prop.~\ref{prop:inclusive_efxwc_eflwc}}}}];
{ [start branch=B] \chainin (m-3-3)
[join={node[right,labeled] {\text{Thm.~\ref{thm:efl-wc_separation}}}}];}
\chainin (m-2-4) [join={node[above,labeled] {\text{Prop.~\ref{prop:inclusive_efxwc_eflwc}}}}];
{ [start branch=C] \chainin (m-3-4)
[join={node[right,labeled] {\text{(Amanatidis et al.~2018)}}}];}
\chainin (m-2-5);
}
{ [start chain]
\chainin (m-2-1);
\chainin (m-1-3) [join={node[above,labeled] {\hspace{-40pt}\text{\cite{barman2018groupwise}}}}];
\chainin (m-2-5) [join={node[above,labeled] {\hspace{40pt}\text{\cite{barman2018groupwise}}}}];
}
\end{tikzpicture}
\caption{The hierarchy among fairness notions for goods with copies, as established in Section~\ref{sec:notions_hierarchy}. A horizontal arrow $A\rightarrow B$ means that an allocation satisfying $A$ also satisfies $B$, but not vice versa. A vertical arrow $A\rightarrow \alpha$-MMS means that an allocation satisfying $A$ guarantees $\alpha$-MMS (in the case of $\text{EF1}_{\text{WC}}$ the guarantee is \emph{at most} $\frac{1}{n}$-MMS).}
\label{fig:notions_hierarchy}
\end{figure}
Returning to our main application, while the general question of $\text{EFX}_{\text{WC}}$ existence for goods with copies is as hard as EFX for chores and thus beyond our current scope, Section~\ref{sec:leveled} provides an affirmative answer for the special case of \emph{leveled} preferences \cite{Babaioff2017CompetitiveEW,ManjunathW21}, where larger bundles are always preferred to smaller ones. This immediately implies the existence of EFX for chores with leveled preferences, thus demonstrating the usefulness of our duality results.
\subsection{Additional Related Literature}
\textbf{Solution concepts.}
An EF1 allocation is guaranteed to exist for goods without copies \cite{lipton2004approximately,caragiannis2019unreasonable}, for goods with copies~\cite{cardinalityConstraints2018}, and for chores \cite{mixGoodsChores,EnvyCycleCancellationExample}. Envy-freeness up to any item (EFX)
existence is still a wide open problem for $n\geq4$ agents and additive valuations.
An MMS allocation does not always exist, as was observed by Kurokawa \emph{et al}.~\shortcite{alphaMMS}, but fractional approximations of it may be guaranteed, prompting the notion of $\alpha$-MMS. Their work guarantees existence of $\frac{2}{3}$-MMS, and further works guarantee $\frac{3}{4}$-MMS or more for goods, depending on the number of agents \cite{ghodsi2018BestMMSgoods,garg2020improvedMMSgoods}. For chores, Aziz \emph{et al}.~\shortcite{aziz2017MMSChores} and Huang and Lu~\shortcite{huang2019choresApproximation} establish $\frac{11}{9}$-MMS. The envy-free concept of ``EFL'', which we find useful as an intermediary to argue about EFX, was introduced by Barman \emph{et al}.~\shortcite{barman2018groupwise}, who show its existence for additive goods. For goods, envy-freeness notions can be sorted into a hierarchy (namely, $\text{EFX} \implies \text{EFL} \implies \text{EF1}$), with the notions separated by their $\alpha$-MMS guarantees, as shown by Amanatidis \emph{et al}.~\shortcite{comparingNotions2018}. We are able to establish a similar hierarchy for our more general goods with copies model.
\noindent
\textbf{Restricted allocations.}
Kroer and Peysakhovich \shortcite{AMO} consider optimization of MNW by exclusive (``at most one'') allocations, showing these achieve an approximate CEEI in large enough instances.
Biswas and Barman~\shortcite{cardinalityConstraints2018} consider a model
where each agent has cardinality constraints over the amount of a same-typed good she can be allocated. Our model is a special case and thus their general results hold, namely existence of EF1 allocations and of $\frac{1}{3}$-MMS allocations. EFX and EFL allocations may not exist for certain instances in their model as well as in ours. We refine these notions by the introduction of ``without commons'' which enables our duality results, the hierarchy of concepts we describe, and our existence results. Other models with matroid constraints over allocations are presented in \cite{matroidConstraints2019,HeterogenousMatroidConstraints2020}.
\noindent
\textbf{Relation between goods and chores.}
Mixed instances of goods and chores are considered by Aziz \emph{et al}.~\shortcite{mixGoodsChores}. As we show, a mixed model of goods and chores is a special case of our goods with copies model.
Kulkarni \emph{et al.} \shortcite{PTAS_MMS} note that a chore can be reinterpreted as $n-1$ goods, and use this as a technical tool in their PTAS for computing the MMS guarantee in mixed manna settings.
They do not explore further implications of this duality.
\section{Preliminaries}\label{sec-pre}
In this section we present our model, provide definitions for leading measures of fair allocation of goods, and explain how they generalize to chores.
\noindent
\textbf{Our model.}
Let $\agents$ be a set of $n$ agents and let $\items$ be the set of items to allocate to the agents.
Let $\mathcal{T}$ be a set of item {\em types} to allocate to the agents
(we slightly abuse notation and use~$\mathcal{T}$ to also denote an item set with a single copy per item).
The item set $\items$ is a multiset of the type set $\mathcal{T}$, and includes $k_t \le n$ copies of each item type $t\in\mathcal{T}$.
Every agent $i\in\agents$ has a \emph{valuation} function $v_i :2^{\items}\rightarrow \mathbb{R}$ mapping bundles of values to their values.
An item $t \in \items$ is termed a \emph{good} if $\vai{t}\ge 0$ for each agent~$i$ and $>0$ for at least one agent, and a \emph{chore} if $\vai{t}\le 0$ for each agent~$i$.
We assume that each item is either a good or a chore, i.e., we do not allow an item to be a good for one agent and a chore for another. We use $t$ when referring to a general item, $g$ when referring to a good, and $c$ when referring to a chore.
Throughout we assume \emph{additive} valuations, i.e., for every bundle of items $S \subseteq \items, v(S) = \sum_{t \in S} v(t)$. Note that additive valuations are \emph{monotone}, i.e., for every two bundles $S_1 \subseteq S_2 \subseteq \items$, we have $v(S_1) \leq v(S_2)$ for goods and
$v(S_1) \geq v(S_2)$ for chores.
An \emph{allocation} $\allocs=\alloclist$ is a partition of all items among the agents (no item can be left unallocated). We focus on allocations that satisfy the following constraint:
\begin{definition}
An allocation $\allocs$ is {\bf exclusive} if no two copies of the same item are allocated to the same agent
\end{definition}
(That is, by ``allocation'' we always refer to an exclusive allocation.) We denote the set of all (exclusive) allocations of items $\items$ by $\ea{\items}$.
\begin{definition}
Consider exclusive allocations $\allocs,\allocs'\in\ea{\items}$. Then $\allocs'$ \emph{\bf Pareto dominates} $\allocs$ if for every agent $i$, $\vai{\alloci'}\ge\vai{\alloci}$ and $\vai[j]{\alloci[j]'}>\vai[j]{\alloci[j]}$ for at least one agent $j$.
Allocation $\allocs$ is {\bf Pareto optimal} if there is no $\allocs'$ that Pareto dominates it.
\end{definition}
\paragraph{Fairness notions for goods and chores.}
The next definition summarizes many prominent fairness notions studied in previous literature, as defined for goods.
\begin{definition}\label{def-fair-normal}
An allocation $\allocs\in \ea{\items}$ of \emph{goods} is:
\begin{itemize}
\item \emph{\bf EFX} if $\forall i,j\in\agents, \forall g\in\alloci[j] : \vai{\alloci}\ge\vai{\alloci[j]\setminus \{g\}}$;
\item \emph{\bf EF1} if $\forall\ i,j\in\agents, \exists g\in\alloci[j] : \vai{\alloci}\ge\vai{\alloci[j]\setminus \{g\}}$
\footnote{In case $\alloci[j]$ is empty, the good exists ``in an empty sense'' and the condition is satisfied.}
\item \emph{\bf EFL} if $\forall\ i,j\in\agents$, either (1) $|A_j| \leq 1,$ or
(2) $\exists g\in\alloci[j] : \vai{\alloci}\ge\max\{\vai{\alloci[j]\setminus \{g\}},\vai{g}\}$. In words, \emph{EFL} strengthens the \emph{EF1} requirement by not allowing to remove from $A_j$ a highly valuable good, unless $A_j$ is a singleton;
\item \emph{\bf PROP} (proportional) if $\forall\ i \in \agents$ : $\vai{\alloci}\ge\frac{1}{n}\vai{\items}$;
\item \emph{\bf $\alpha$-MMS} (maximin share) for some $0 < \alpha \leq 1$ if
$\forall i \in \agents$:
$$\vai{\alloci}\ge \alpha \max_{\allocs\in\ea{\items}}\min_{j\in\agents}\vai{\alloci[j]}.$$
\emph{1-\text{MMS}} is termed \emph{\text{MMS}}.
\end{itemize}
\end{definition}
We can distinguish between two classes of fairness notions appearing in Definition~\ref{def:share-fair}: \emph{share-based} and \emph{envy-based}. Interestingly, this classification determines how the fairness notions are generalized to chores.
First, PROP and MMS are share-based, meaning that an agent's allocation is measured against what is deemed her fair share:
\begin{definition}
\label{def:share-fair}
Given a valuation $v$, the number of agents $n$ and
an item set $\items$, a {\bf share} function $s$ outputs a real value, i.e., $s(v,\items, n)\in \mathbb{R}$. An exclusive allocation $\allocs$ is called {\bf $s$-share fair} if we have $\vai{\alloci}\ge s(\vau[i],\items, n), \forall i\in\agents$.
\end{definition}
\noindent
For example, for PROP, $s(\vau[i],\items, n)=\frac{1}{n}v_i(\items)$. The definitions of PROP and MMS above hold for chores too, and in fact for any mixture of goods and chores.
The notions of EFX, EF1 and EFL are envy-based, meaning that an agent's allocation is measured against those of her peers. The definition of envy-based notions for chores is different than their definition for goods in that, when an agent $i$ compares her bundle to the bundle of another agent~$j$, she removes a single chore from her \emph{own} bundle (while a good is removed from the other agent's bundle). For example, an exclusive allocation $\allocs$ for chores is EFX if for every agent pair $i,j\in\agents$ and chore $c\in \alloci$:
\begin{equation}
\vai{\alloci\setminus \{c\}}\ge\vai{\alloci[j]}.\label{eq:EFX-chores}
\end{equation}
To more generally phrase the connection between envy-based fairness for goods and for chores we need the following definition.
\begin{definition}[Comparison criterion for goods and chores]
\label{def:comp-criterion}
~~
\begin{itemize}
\item Given a valuation function $\vau[]$ and two bundles $\bundlei[I]$ and $\bundlei[U]$, a {\bf comparison criterion} $f$ outputs $F$ for ``fair'' and $\neg F$ for ``unfair'', i.e., $f(\vau[],\bundlei[I],\bundlei[U]) \in \{F,\neg F\}$.
\item Given a comparison criterion $f$, the {\bf complementary} comparison criterion $f^c$ satisfies $f^c(\vau[],\bundlei[I],\bundlei[U])=f(-\vau[],\bundlei[U],\bundlei[I])$.
\end{itemize}
\end{definition}
For example, let $f$ be the comparison criterion corresponding to EFX for goods (see Definition~\ref{def-fair-normal}), then $f^c$ coincides with the comparison criterion of EFX for chores in Eq.~\eqref{eq:EFX-chores}.
One can similarly define EF1 and EFL for chores. More generally:
\begin{definition}[Envy-based fairness for goods and chores]
\label{def-envy-based}
~~
\begin{itemize}
\item Given a comparison criterion $f$, we say an allocation $\allocs$ is $f$-{\bf fair} iff $\forall i,j\in\agents: f(\vau,\alloci[i],\alloci[j])=F$.
\item A solution concept \emph{E} is {\bf envy-based} if there exists a comparison criterion $f$ such that an allocation $\allocs$ for goods satisfies \emph{E} iff $\allocs$ is $f$-fair, and an allocation $\allocs$ for chores satisfies \emph{E} iff $\allocs$ is $f^c$-fair.
\end{itemize}
\end{definition}
\begin{remark}
\label{rem:mixture}
We define envy-based fair allocation solution concepts for the case where all items are goods and for the case where all items are chores. Our definition -- and in fact all results in this paper -- can be extended to a setting of additive valuations where some items are goods while others are chores, using the envy-based fair allocation solution concepts of \citet{mixGoodsChores}.
\end{remark}
\section{EFX for Goods with Copies}
\label{sec-warmup-efx}
We begin by showing that EFX may not exist with copies.
\begin{example}
\label{ex:GeneralCopiesNoEFX}
Consider $n\geq 3$ agents, $n+1$ goods, and $\frac{n}{2}<k<n$ copies of each good. All agents share the same additive valuation function~$v$, and for every item type $g_w\in \items$:
$$
v(g_w) = \begin{cases}
w & w < n+1; \\
n^2 & w = n+1.
\end{cases}
$$
\end{example}
\begin{prop}
\label{pro:GeneralCopiesNoEFX}
For goods with copies, an \emph{$\text{EFX}$} allocation may not exist even for 3 agents. The same holds for~\emph{$\text{EFL}$}.
\end{prop}
\begin{comment}
\begin{proof}
Consider Example~\ref{ex:GeneralCopiesNoEFX}. Fix an agent $l$ who does not receive a copy of $g_{n+1}$.
Since there are $k$ copies of $g_1$ and $k$ copies of $g_{n+1}$ where $2k>n$, there exists an agent $h$ which receives both $g_1$ and $g_{n+1}$. Agent $l$ EFX envies agent $h$ since
$$
\vai[l]{\alloci[l]} \le \sum_{w\le n}\vai[l]{g_{w}} < \vai[l]{g_{n+1}} \le \vai[l]{\alloci[h]\setminus\{g_1\}}.
$$
\end{proof}
\end{comment}
\begin{proof}
Consider Example~\ref{ex:GeneralCopiesNoEFX}. We show non-existence of EFL allocations. Since every EFX allocation is also EFL \cite{barman2018groupwise}, this shows no EFX allocations exist for these settings. Fix an agent $l$ who does not receive a copy of $g_{n+1}$.
Since there are $k$ copies of $g_1$ and $k$ copies of $g_{n+1}$ where $2k>n$, there exists an agent $h$ which receives both $g_1$ and $g_{n+1}$. Agent $l$ EFL-envies agent $h$ since the first condition of EFL is not satisfied ($|\alloci[h]| \geq 2$), and for any $g \in \alloci[h]$ with $\vai[l]{g} \leq \vai[l]{\alloci[l]}$,
$$
\vai[l]{\alloci[l]} \le \sum_{w\le n}\vai[l]{g_{w}} < \vai[l]{g_{n+1}} \le \vai[l]{\alloci[h]\setminus\{g\}},
$$
violating the second condition of EFL.
\end{proof}
To handle the non-existence problem we introduce the new fairness notion of $\text{EFX}_{\text{WC}}$ -- a generalization of EFX to a model with copies. When comparing two bundles, $\text{EFX}_{\text{WC}}$ puts aside all items common to both bundles, and then compares the remaining items in an EFX way:
\begin{definition}[$\text{EFX}_{\text{WC}}$ for goods]
\label{def-efxwc}
An exclusive allocation $\allocs$ of goods is \emph{$\text{EFX}_{\text{WC}}$} if for every two agents $i,j\in\agents$ and item $g\in \alloci[j]\setminus\alloci$ it holds that
$
\vai{\alloci\setminus\alloci[j]}\ge\vai{(\alloci[j]\setminus\alloci)\setminus \{g\}}.
$
\end{definition}
\noindent
\begin{remark}
We remark that:
~~
\begin{itemize}
\item \emph{$\text{EFX}_{\text{WC}}$} is an envy-based notion and therefore its definition extends to chores using Definition~\ref{def-envy-based}.
\item A model with no copies is a special case of our model, and when there is one copy of each good in our model then \emph{$\text{EFX}_{\text{WC}}$} is equivalent to \emph{EFX.}
\item \emph{EFX} implies \emph{$\text{EFX}_{\text{WC}}$}: By additivity of the values, the inequality in Def.~\ref{def-efxwc} is equivalent to the EFX inequality $\vai{\alloci}\ge\vai{\alloci[j]\setminus \{g\}}$, but \emph{EFX} allows $g$ to be any item while \emph{$\text{EFX}_{\text{WC}}$} restricts its choice.
\end{itemize}
\end{remark}
A main technical justification of $\text{EFX}_{\text{WC}}$ is its ability to give a ``dual'' view of goods and chores, which also yields a new characterization of existence of standard EFX allocations for chores. This is summarized by the following result (it is a corollary of Theorem~\ref{thm:wc-duality} stated in the next section).
\begin{corollary}[Characterization of EFX existence for chores]
\label{cor-efx-for-chores-iff-efxwc}
An \emph{EFX} allocation for chores exists in the standard setting without copies iff an \emph{$\text{EFX}_{\text{WC}}$} allocation for goods exists in our setting with $k=n-1$ copies of each good.
\end{corollary}
The following example illustrates the above.
\begin{example}
[Special case of Example~\ref{ex:GeneralCopiesNoEFX}]
\label{ex-dual}
There are $n=3$ agents and 4 goods with $n-1=2$ copies each. All agents have valuation $v$ as defined in Example \ref{ex:GeneralCopiesNoEFX} (the values of items $t_1,t_2,t_3,t_4$ are $1,2,3,9$ respectively).
\end{example}
In Example~\ref{ex-dual}, the allocation $\alloci[1]=\{t_1,t_2,t_4\}$, $\alloci[2]=\{t_3,t_4\}$ and $\alloci[3]=\{t_1,t_2,t_3\}$ is $\text{EFX}_{\text{WC}}$. Indeed, agent~3 EFX-envies the others (and moreover EFL-envies them),
but after putting aside common items, only item $t_4$ is left for the other agents, implying $\text{EFX}_{\text{WC}}$.
We now show that the ``dual'' allocation is $\text{EFX}$ for chores. The dual allocation is given by $\dual{\alloci}=\mathcal{T}\setminus\alloci$ for every $i$ (see formal definition in Section~\ref{sec-dual}). I.e., $\dual{\alloci[1]}=\{t_3\}$, $\dual{\alloci[2]}=\{t_1,t_2\}$ and $\dual{\alloci[3]}=\{t_4\}$. When the goods are treated as chores by simply taking the negation $(-v)$ of the valuation (such that the values of $t_1,t_2,t_3,t_4$ are $-1,-2,-3,-9$ respectively),
it is not hard to check that the dual allocation is EFX for these chores. Indeed, agent~3 envies the others, but removing any chore from agent~3's single-chore bundle alleviates the envy.
\section{Fairness Duality for Copies and Chores}\label{sec-dual}
In this section we show that allocations of goods and of chores are ``dual'' in a formal sense, and more importantly that fairness notions translate between dual allocations.
\begin{definition}[Duality]
The {\bf dual} of a tuple $(\allocs,v,\items)$ is:
\begin{itemize}
\item The dual allocation $\dual{\allocs}$ is $\dual{\alloci}=\mathcal{T}\setminus\alloci$.
\item The dual valuation
is $\dual{v}=-v$. Thus goods become chores and vice versa.
\item The dual item set $\dual{\items}$
contains $n-k_t$ copies of every $t \in \mathcal{T}$, where $k_t$ is the number of copies of $t$ in $\items$.
\end{itemize}
\end{definition}
\begin{prop}[Properties of dual transformations]
\label{prop:duality}
~~
\begin{enumerate}
\item If $\allocs$ is an exclusive allocation of item set $\items$ then $\dual{\allocs}$ is an exclusive allocation of item set $\dual{\items}$.
\item The dual of the dual is the original: $\dual{\dual{\allocs}}=\allocs$, $\dual{\dual{v}}=v$ and $\dual{\dual{\items}}=\items$.
\item The dual operation is a one-to-one mapping.
\end{enumerate}
\end{prop}
\begin{proof}
\begin{enumerate}
\item $\dual{\allocs}$ is an allocation since each item $t$ is allocated $k_t$ times in $\allocs$, so it does not appear in the bundles of $n-k_t$ agents. Every such agent is allocated a copy of $t$ in $\dual{\allocs}$, and other agents are not. $\dual{\allocs}$ is exclusive since by construction each bundle $\dual{\alloci}$ is contained in $\mathcal{T}$ and has at most one copy of each item.
\item $\dual{\dual{\alloci[i]}} = \mathcal{T} \setminus \dual{\alloci[i]} = \mathcal{T} \setminus (\mathcal{T} \setminus \alloci[i]) = \alloci[i],\
\dual{\dual{v}} = -\dual{v} = v$,
and $\dual{\dual{\items}}$ contains $n-(n-k_t) = k_t$ items $\forall t \in \mathcal{T}$.
\item Assume that $\allocs_1, \allocs_2, v_1, v_2, \items_1, \items_2$ satisfy $\dual{\allocs_1} = \dual{\allocs_2}$, $\dual{v_1} = \dual{v_2}$, $\dual{\items_1} = \dual{\items_2}$, then we have $\allocs_1 = \dual{\dual{\allocs_1}} = \dual{\dual{\allocs_2}} = \allocs_2$. The rest follows similarly.
\end{enumerate}
\vspace{-4mm}
\end{proof}
\begin{theorem}
An exclusive allocation $\allocs$ is Pareto optimal iff the dual allocation $\dual{\allocs}$ is Pareto optimal.
\end{theorem}
\begin{proof}
First we prove a property of the dual: If $\vai{\bundlei}>\vai{\alloci}$ then $\dual{\vau[i]}(\dual{\bundlei})>\dual{\vau[i]}(\dual{\alloci})$. From $\vai{\bundlei}>\vai{\alloci}$, we have $\vai{\mathcal{T}\setminus\bundlei}<\vai{\mathcal{T}\setminus\alloci}$, i.e. $\vai{\dual{\bundlei}}<\vai{\dual{\alloci}}$. Because $\dual{\vau[i]}=-\vau[i]$, we have $\dual{\vau[i]}(\dual{\bundlei})>\dual{\vau[i]}(\dual{\alloci})$.
Suppose that allocation $\bundles$ Pareto dominates allocation $\allocs$. We prove that allocation $\dual{\bundles}$ Pareto dominates allocation $\dual{\allocs}$.
By the property we just proved, we have $\dual{\vau[i]}(\bundlei)\ge\dual{\vau[i]}(\alloci)$ for all $i\in\agents$ and there is a $j$ such that $\dual{\vau[j]}(\dual{\bundlei[j]})>\dual{\vau[j]}(\dual{\alloci[j]})$
This directly implies the statement, as there is a Pareto dominating allocation over $\allocs$ iff there is such an allocation for the dual.
\end{proof}
\begin{comment}
\begin{theorem}
\label{thm:GeneralEFXNoCommonEquivalence}
An exclusive allocation for $n$ agents indivisible additive chores with $k_1,...,k_t$ copies, is $\text{EFX}_{\text{WC}}$ iff its dual allocation is $\text{EFX}_{\text{WC}}$.
\end{theorem}
\begin{proof}
We show ($\Longrightarrow$). The other direction is very similar.
Let $\allocs$ be an $\text{EFX}_{\text{WC}}$ chores allocation, and $v$ the agents' valuation function.
Then $\dual{\allocs}$ is a full allocation of $\dual{\items}$ by Proposition~\ref{prop:duality}.
It is left to show that no agent $\text{EFX}_{\text{WC}}$-envies another agent. Assume by contradiction, that in $\dual{\allocs}$, agent $i$ $\text{EFX}_{\text{WC}}$-envies agent $j$. Then there must be some good $s\in \dual{\alloci[j]}$, that has no copy in $\dual{\alloci[i]}$, and has
\begin{equation}
\label{general-efx-no-common-condition}
\dual{v}_i(\dual{\alloci[i]}) < \dual{v}_i(\dual{\alloci[j]} \setminus \{s\}).
\end{equation} Since $s$ has no copy in $\dual{\alloci[i]}$, it must be a copy of a chore in $\alloci[i]$, and since it has a copy in $\dual{\alloci[j]}$, it is not a copy of a chore in $\alloci[j]$. Then Eq~\ref{general-efx-no-common-condition} is by additivity
\[
\begin{split}
\dual{v}_i(\mathcal{T} \setminus \alloci[i]) &< \dual{v}_i((\mathcal{T} \setminus \alloci[j]) \setminus \{s\}) \\
& \equiv \\
\dual{v}_i(\mathcal{T}) - \dual{v}_i(\alloci[i]) &< \dual{v}_i(\mathcal{T}) - \dual{v}_i(\alloci[j]) - \dual{v}_i(s) \\
& \equiv \\
v_i(\alloci[i]) &< v_i(\alloci[j]) + v_i(s) \\
& \equiv \\
v_i(\alloci[i] \setminus \{s\}) & = v_i(\alloci[i]) - v_i(s) < v_i(\alloci[j]),
\end{split}
\]
which violates the $\text{EFX}_{\text{WC}}$ condition for agent $i$ in the chores settings.
\end{proof}
\end{comment}
\subsection{A Meta-theorem for Envy-based Notions}
\label{sub:meta-envy}
The idea of $\text{EFX}_{\text{WC}}$ generalizes to other envy-based notions:
\begin{definition}[Comparison without commons]
\label{def-wc}
Given a comparison criterion $f$, the comparison criterion \emph{$f_{\text{WC}}$} satisfies $f_{\text{\emph{WC}}}(\vau[],\bundlei[I],\bundlei[U])=f(\vau[],\bundlei[I]\setminus\bundlei[U],\bundlei[U]\setminus\bundlei[I])$, for all $\vau[],\bundlei[I],\bundlei[U]$.
\end{definition}
\noindent
As additional examples to $\text{EFX}_{\text{WC}}$, consider $\text{EF1}_{\text{WC}}$ and $\text{EFL}_{\text{WC}}$.
Note that by Definition~\ref{def:comp-criterion}, for any comparison criterion~$f$ we have $(f_{\text{WC}})^c = (f^c)_{\text{WC}} \equiv f^c_{\text{WC}}$.
We now show our first main theorem -- that envy-based fairness holds under a duality transformation from goods to chores
\begin{theorem}
\label{thm:wc-duality}
Given a comparison criterion $f$, an exclusive allocation $\allocs$ is $f_{\text{\emph{WC}}}$-fair with respect to $v$ iff its dual $\dual{\allocs}$ is $f_{\text{\emph{WC}}}^c$-fair with respect to $\dual{v}$.
\end{theorem}
\begin{proof}
We prove $f_{\text{WC}}(\vau,\alloci,\alloci[j])=f^c_{\text{WC}}(\dual{\vau},\dual{\alloci},\dual{\alloci[j]})$ for all $i,j\in\agents$. Let $O_i=\alloci\setminus\alloci[j]$ and $O_j=\alloci[j]\setminus\alloci$. Note that $O_i=\dual{\alloci[j]}\setminus\dual{\alloci}$ and $O_j=\dual{\alloci}\setminus\dual{\alloci[j]}$. Thus,
\[
\begin{split}
f_{\text{WC}}&(\vau,\alloci,\alloci[j])=f(\vau,O_i,O_j)
=f^c(-\vau,O_j,O_i)\\
&=f^c_{\text{WC}}(\dual{\vau},\dual{\alloci},\dual{\alloci[j]}).
\end{split}
\]
\end{proof}
It follows from Theorem~\ref{thm:wc-duality} that an exclusive allocation is $\text{EFX}_{\text{WC}}$ for goods if and only if its dual allocation is $\text{EFX}_{\text{WC}}$ for chores. An important application is
Corollary~\ref{cor-efx-for-chores-iff-efxwc} in Section~\ref{sec-warmup-efx}, since the dual of a setting of chores with no copies is a setting of goods with $n-1$ copies of each good, and in a setting of chores with no copies $\text{EFX}_{\text{WC}}$ is identical to EFX.
\subsection{A Meta-theorem for Share-based Notions}
\label{sub:meta-share}
Does a similar duality result hold for share-based fairness? We give an affirmative answer for a class of share-based notions that satisfy a property we term \emph{linear shares}.
As we show below, MMS and PROP are both notions in this class.
The idea of a linear shares is as follows.
Focus on one agent and consider all values from her perspective.
For any allocation, our dual transformation shifts the value of every bundle in her eyes by a constant $d$ (in particular, $d=v(\mathcal{T})$).
It is natural to require that her fair share for this allocation also shifts by the same constant $d$. A linear share-based notion is one for which this property holds. The following definition formalizes this intuition, while generalizing the dual transformation to appropriate one-to-one mappings.
\begin{definition}[Linear shares]
\label{def:linear-share}
Two item sets $\items$ and $\items'$ are {\bf linearly related} w.r.t.~valuations $\vau[]$, $\vau[]'$ and a real constant~$d$ if there is a one-to-one mapping from exclusive allocations $\allocs\in\ea{\items}$ to exclusive allocations $\allocs'\in\ea{\items'}$ such that $\vai[]{\alloci}=v'(\alloci')+d$ for all $i\in\agents$.
A share $s$ is {\bf linear} if for any item sets $\items$ and $\items'$ that are linearly related w.r.t.~$\vau[]$, $\vau[]'$ and $d$ we have $s(v,\items, n)=s(v',\items', n)+d$.
\end{definition}
An example of linearly related item sets and valuations is $\items,\items',v,v'$ where $\items'$ is equal to $\items$ with an additional $n$ copies of a new item $t$, and $v'$ is equal to $v$ with an additional value for $t$. Thus if $s$ is a linear share
then $s(v,\items, n)=s(v',\items', n)-v'(t)$.
\begin{comment}
\begin{definition}
\label{def:linear-share}
For any item $t\in\items$, we define the process of dual the item $t$ as following:
\begin{itemize}
\item The item $t$ becomes $\dual{t}$.
\item The valuation $\vai{\dual{t}}=-\vai{t}$.
\item The allocation $\alloci[i][\dual{t}]=\alloci\setminus t$ if $t\in\alloci$; otherwise $ \alloci[i][\dual{t}]=\alloci\cup\{\dual{t}\}$
\item The allocation $\allocs[\dual{t}]=(\alloci[1][\dual{t}],\dots,\alloci[n][\dual{t}])$
\item The set $\items$ becomes $\items[\dual{t}]=\bigcup_{i\in\agents}\alloci[i][\dual{t}]$.
\end{itemize}
\end{definition}
Notice that if we dual all items, then
\begin{theorem}
For any linear share $s$ and an item $t\in\items$, an exclusive allocation $\allocs$ is $s$-share fair of $\items, v$ if and only if $\allocs[\dual{t}]$ is $s$-share fair of $\items[\dual{t}], \dual{v}$.
\end{theorem}
\end{comment}
\begin{theorem}\label{thm-meta-share}
For any linear share $s$, an exclusive allocation $\allocs$ is $s$-share fair for $\items, v$ iff $\dual{\allocs}$ is $s$-share fair for $\dual{\items}, \dual{v}$.
\end{theorem}
\begin{proof}
We prove that for every agent $i\in\agents$, item sets $\items$ and $\dual{\items}$ are linearly related w.r.t.~valuations $\vau$, $\dual{\vau}$ and $d=\vai{\mathcal{T}}$. Given an allocation $\allocs\in\ea{\items}$, let us consider the dual transformation, which is a one-to-one mapping that satisfies the condition in Definition~\ref{def:linear-share}:
\begin{equation*}
\begin{split}
\vai{\alloci[j]}- & \dual{\vau}(\dual{\alloci[j]}) =\vai{\alloci[j]} -(-\vai{\dual{\alloci[j]}}) \\
& = \vai{\alloci[j]}+\vai{\mathcal{T}\setminus\alloci[j]} = \vai{\mathcal{T}}.
\end{split}
\end{equation*}
Suppose that $\allocs$ is $s$-share fair for $\items, v_i$. By definition, we have $\vai{\alloci}\ge s(\vau,\items, n)$ for all $i\in\agents$. Since the share $s$ is linear, $s(\vau,\items, n)=s(\dual{\vau},\dual{\items}, n)+\vai{\mathcal{T}}$. Therefore, $\dual{\vau}(\dual{\alloci})\ge s(\dual{\vau},\dual{\items}, n)\ \forall i\in\agents$, and $\dual{\allocs}$ is $s$-share fair for $\dual{\items}, \dual{v_i}$.
The converse is proved similarly.
\end{proof}
\ifdefined\aps{}
The linear share is a sufficient condition for the duality. We notice that a new notion called AnyPrice share \cite{fairshare_arbitraryentitlements} can have a similar duality without linearity. We discuss this in an appendix in the full version.
\fi
\noindent{\bf Examples and non-examples of linear shares.} Linearity is an arguably natural property and indeed holds for the most prominent share-based notions.
\begin{prop}
\label{pro:who-is-linear}
\emph{MMS} and \emph{PROP} are linear.
\end{prop}
\ifdefined\full
\begin{proof}
Suppose that item sets $\items$ and $\items'$ are linearly related with $v$, $v'$ and $d$.
We have a one to one mapping from exclusive allocations $\allocs\in\ea{\items}$ to exclusive allocations $\allocs'\in\ea{\items'}$ such that $\vai[]{\alloci}=v'(\alloci')+d$ for all $i\in\agents$ and all allocations.
For MMS, we have
\begin{equation*}
\begin{split}
\max_{\allocs\in\ea{\items}}\min_{j\in\agents}\vai{\alloci[j]} &=\max_{\allocs\in\ea{\items'}}\min_{j\in\agents}\vau'(\alloci[j])+d\\
&=d+\max_{\allocs\in\ea{\items'}}\min_{j\in\agents}\vau'(\alloci[j])
\end{split}
\end{equation*}
For PROP, it holds that $\vai{\items} = \sum_{j\in\agents} \vai{\alloci[j]} = \sum_{j\in\agents} (\vau'(\alloci[j]') + d) = \vau'(\items')+n\cdot d$.
So the value of PROP increases by $d$.
\end{proof}
\fi
Interestingly, more nuanced share-based notions do not always satisfy linearity, thus portraying the possible limits of the duality between fair allocations of copies and chores.
For example, $\alpha$-MMS is not linear, since a shift $d$ in the valuation translates to a shift $\alpha d$ in the share.
\unless\ifdefined\full{}
As we show in the full version, this is also the case for the new notion of \emph{truncated proportional share} (TPS), an extension of PROP
\fi
\ifdefined\full{}
We show this is also the case for the new notion of
\fi
\emph{truncated proportional share} (TPS), which is defined for goods in \cite{fairshare_arbitraryentitlements}.\footnote{\citet{fairshare_arbitraryentitlements} propose another interesting notion called \emph{AnyPrice share}, but extending it to the setting of copies seems challenging so we do not address it here.}
\ifdefined\full{}
The notion is an extension of PROP and it has been shown that $\text{PROP}\ge \text{TPS}\ge \text{MMS}$.
\begin{definition}
(Truncated Proportional Share for goods) Given an instance and an agent $i$, the truncated proportional share is
TPS($v_i,\items,n$)=$\max_z \{ z | \frac{1}{n} \sum_{g\in \items} \min\{\vai{g},z\} = z\}.$
\end{definition}
The following example shows that TPS is not a linear share:
\begin{example}
Suppose that there are 3 agents and 3 goods. Let us focus on one agent's valuation: 2, 3, 5. The TPS would be 2 at this point. If we add 3 copies of a good with valuation 3, then PROP would be $\frac{19}{3}>5$. After adding these good copies, the TPS becomes $\frac{19}{3}$, which increases more than 3.
\end{example}
\ifdefined\extraTPS{}
We wish to further show that this does not just violate the linearity but also the duality. For this, we first have to define TPS for chores.
\begin{definition}
(Truncated Proportional Share for chores) Given an instance and an agent $i$, the truncated proportional share is
TPS($v_i, \items, n$)=$\min \{ \frac{1}{n}\cdot v(\items), \min_{i\in \items} \{ v(i)\} \}$
\end{definition}
To the best of our knowledge, TPS was not defined for chores previously, so this definition requires some justification. First, it preserves the intuition of TPS for goods, where since large items prevent an equal distribution of goods, they are truncated for a more realistic estimation of the possible fair share. In the chores case, large items must be assigned, and so a fair share must consider receiving them as a singleton bundle. The definition also preserves the important property that $TPS \leq PROP$. Yet, it does not satisfy duality, as we see in the following example:
\begin{example}
\label{ex:TPS}
Consider $n=4$ agents, 6 goods with 1 copy each, and valuations $1,3,4,6,7,19$ respectively. It has $PROP = 10, TPS = 7$ as $\frac{1}{4} \sum_{g\in \items} \min\{v(g),7\} = \frac{1}{4} (1 + 3 + 4 + 6 + 7 + 7) = 7$, but for any $z > 7$, $\frac{1}{4} \sum_{g\in \items} \min\{v(g),z\} = \frac{1}{4} (1 + 3 + 4 + 6 + 7 + z) = 7 + \frac{z - 7}{4} \neq 7 + z - 7 = z$. The TPS value is implemented by allocation $\allocs = \{\{1,6\}, \{3,4\}, \{7\}, \{19\}\}$.
The dual chores instance has $6$ chores with three copies each and valuations $-1, -3, -4, -6, -7, -19$ respectively. For this instance, $PROP = TPS = -30$ by direct calculation. But the dual allocation $\dual{\allocs}$
has a bundle with value $-33$, which is less than the TPS value.
\end{example}
\fi
\fi
\section{Expanding the Envy-Based Hierarchy}
\label{sec:notions_hierarchy}
Given the duality between goods with copies and chores with copies, we now focus on the former. We first analyze the connections between the new envy-based fairness notions and the more standard ones, as summarized in Figure~\ref{fig:notions_hierarchy}.
In Section~\ref{sub:MMS} we show that this hierarchical structure implies strictly different approximation guarantees to MMS.
\begin{prop}
\label{prop:inclusive_efxwc_eflwc}
$\text{EFX}_{\text{WC}} \implies \text{EFL}_{\text{WC}} \implies \text{EF1}_{\text{WC}}$.
\end{prop}
\ifdefined\full
\begin{proof}
($\text{EFX}_{\text{WC}} \implies \text{EFL}_{\text{WC}}$)
Fix an $\text{EFX}_{\text{WC}}$ allocation $\allocs$ and $i,j \in \agents$. We wish to show $j$ does not $\text{EFL}_{\text{WC}}$-envy $i$. If $|\alloci[i] \setminus \alloci[j]|\leq 1$, the first $\text{EFL}_{\text{WC}}$ condition holds. Thus assume that $|\alloci[i] \setminus \alloci[j]|\geq 2$. Suppose that there is a good $g \in \alloci[i] \setminus \alloci[j]$ s.t.~$v_i(g) > v_i(\alloci[j] \setminus \alloci[i])$. Since there are at least 2 goods, there must be another good $g^* \in (\alloci \setminus \alloci[j]) \setminus g$. For $g^*$, we have
$$v_i((\alloci \setminus \alloci[j]) \setminus g^*) \stackrel{monotone}{\geq} v_i(g) > v_i(\alloci[j] \setminus \alloci[i]),$$ violating the $\text{EFX}_{\text{WC}}$ condition.
We conclude that all goods $g \in \alloci \setminus \alloci[j]$ satisfy $v_i(g) \leq v_i(\alloci[j] \setminus \alloci[i])$. Again by the $\text{EFX}_{\text{WC}}$ condition, $v_i((\alloci[i] \setminus \alloci[j]) \setminus \{g\})) \leq v_i(\alloci[j] \setminus \alloci[i])$. We can therefore choose an arbitrary good and the second $\text{EFL}_{\text{WC}}$ condition holds.
($\text{EFL}_{\text{WC}} \implies \text{EF1}_{\text{WC}}$) The only difference occurs when the second $\text{EFL}_{\text{WC}}$ condition is invoked. Then, there is an extra constraint over the choice of good $g$ for $\text{EFL}_{\text{WC}}$ condition that does not appear in the $\text{EF1}_{\text{WC}}$ definition. Therefore, the $\text{EFL}_{\text{WC}}$ definition is stricter than the $\text{EF1}_{\text{WC}}$, and the implication follows.
\end{proof}
\fi
\begin{example}($\text{EFL}_{\text{WC}} \centernot \implies \text{EFX}_{\text{WC}}$) Consider two agents and five goods with a single copy each, and identical valuations $a = b = 1, c = d = 1+\epsilon, e = \epsilon = 0.01$. The allocation $\{\{c,d,e\},\{a,b\}\}$ is $\text{EFL}_{\text{WC}}$ but not $\text{EFX}_{\text{WC}}$.
\end{example}
\begin{prop}
$\text{EFX}_{\text{WC}} \centernot\implies \text{EFL}, \text{EFL}\centernot\implies \text{EF1}_{\text{WC}}$.
\end{prop}
The first negation is due to Example~\ref{ex-dual}. The second negation is due to Example~\ref{ex-EFL-does-not-imply-efowc}:
\begin{table}[]
\centering
\begin{tabular}{c|c|c|c|c|c}
Goods & H & a & b & c & d\\
\hline
Copies & 1 & 2 & 1 & 1 & 1 \\
\hline
$v$ & 1000 & 100 & 1 & 2 & 2 \\
\end{tabular}
\caption{Instance with an EFL allocation that is not $\text{EF1}_{\text{WC}}$.}
\label{tab:efl-not-efowc}
\end{table}
\begin{example} ($\text{EFL} \centernot\implies \text{EF1}_{\text{WC}}$)
\label{ex-EFL-does-not-imply-efowc}
Consider three agents, and goods as given in Table~\ref{tab:efl-not-efowc}, where $v$ is the identical valuation of all agents. Then
$\allocs = \{ \{a,b\}, \{a,c,d\}, \{H\}\}$
is EFL, but not $\text{EF1}_{\text{WC}}$, as agent 1 $\text{EF1}_{\text{WC}}$-envies agent 2.
\end{example}
\begin{example} ($\text{EF1} \centernot\implies \text{EF1}_{\text{WC}}$)
Consider three agents, five goods $a,b,c,d,e$ with two copies each, and identical values $v(a) = 1$, $v(b) = v(c) = \frac{1}{2}, v(d) = v(e) = \epsilon = \frac{1}{100}$. Consider the allocation
$\allocs = \{ \{a, d, e\}, \{a, b, c\}, \{b, c, d, e\}$. It is EF1, and players' values are $(1.02,2,1.02)$. But agent 1 $\text{EF1}_{\text{WC}}$ envies agent 2 (the special good for the EF1 condition is $a$). For comparison, $\allocs' = \{ \{a, b, e\}, \{a, c, d\}, \{b, c, d, e\}$
is both EF1 and $\text{EF1}_{\text{WC}}$.
\end{example}
\subsection{MMS Approximations}
\label{sub:MMS}
We show upper bounds on the MMS approximation guarantees of the three ``without commons'' notions introduced above.%
\footnote{Since our duality theorems do not hold for $\alpha$-MMS, the results in this section cannot be directly transformed to chores.}
We also establish a lower bound for the approximation guarantee of $\text{EFL}_{\text{WC}}$, thus separating $\text{EFX}_{\text{WC}}$ and $\text{EFL}_{\text{WC}}$ from $\text{EF1}_{\text{WC}}$ by a
factor that grows to infinity with $n$.
It is interesting to note that the bounds we show for goods with copies are strictly lower than known bounds for goods without copies: for $\text{EFX}_{\text{WC}}$ we give an upper bound of $0.4$ while without copies a lower bound of $\frac{4}{7}$ is known \cite{comparingNotions2018}; for $\text{EFL}_{\text{WC}}$ we give an upper bound of $\frac{1}{3}$ while without copies a lower bound of $\frac{1}{2}$ is known \cite{barman2018groupwise}.
\paragraph{$\text{EF1}_{\text{WC}}$.} \citet{comparingNotions2018} show that EF1
allocations do not guarantee an approximation strictly larger than $\frac{1}{n}$ to MMS for goods without copies. Upper bounds on $\alpha$ for goods without copies immediately apply to goods with copies, since the former is a special case of the latter.
\unless\ifdefined\full{}
In the full version, for completeness,
\fi
\ifdefined\full{}
For completeness,
\fi
we include an example showing that
$\text{EF1}_{\text{WC}}$ cannot guarantee strictly more than $\frac{1}{n}$-MMS for goods with copies.
\ifdefined\full{}
\begin{example}[$\text{EF1}_{\text{WC}}$ cannot guarantee strictly more than $\frac{1}{n}$-MMS for goods with copies.]
\label{ex:EF1-low-MMS}
Consider an example with $n$ agents, all goods have one copy each, and identical valuations. Let $L_1,..., L_n$ be goods, all with value 1, and let $H_1,...,H_{n-1}$ be additional goods, all with value $n$. Then
$$\allocs = \{\underbrace{\{H_{\theta},L_{\theta}\}}_{1\leq \theta \leq n-1}, \{L_n\}\}.$$
is an $\text{EF1}_{\text{WC}}$ allocation with $v(\alloci[n]) = v(L_n) = 1$, while
an MMS of $n$ is guaranteed for agent $n$ by
$$\allocs ' = \{\underbrace{\{H_{\theta}\}}_{1\leq \theta \leq n-1}, \{L_1,...,L_n\}\}. $$
\end{example}
\fi
\paragraph{\bf $\text{EFX}_{\text{WC}}$.} We give an upper bound of $0.4$ and a lower bound of $\frac{4}{11} \approx 0.36$.
\begin{example}[There is an $\text{EFX}_{\text{WC}}$ allocation which is at most $0.4$-MMS for goods with copies]
Consider 13 agents and 9 goods as given in Table~\ref{tab:efx-0.4-mms}, where $v$ is the valuation of agent 13, and all other agents value all goods as $1$.
\begin{table}[]
\centering
\begin{tabular}{c|c|c|c|c|c|c|c|c|c}
Goods & H & x & x' & x'' & y & y' & $y_a$ & $y_b$ & $y_c$\\
\hline
Copies & 6 & 7 & 3 & 3 & 3 & 3 & 1 & 1 & 1 \\
\hline
$v$ & 2.5 & 1 & 1 & 1 & $\frac{1}{2}$ & $\frac{1}{2}$ & $\frac{1}{2}$ & $\frac{1}{2}$ & $\frac{1}{2}$
\end{tabular}
\caption{$\text{EFX}_{\text{WC}}$ 0.4-MMS upper bound.}
\label{tab:efx-0.4-mms}
\end{table}
%
The following allocation is $\text{EFX}_{\text{WC}}$:
$$\allocs = \{\underbrace{\{H,x\}}_{\times 6}, \underbrace{\{x',x''\}}_{\times 3}, \underbrace{\{y, y', y_{\theta}\}}_{\theta \in (a,b,c)}, \{x\}\}.$$
%
%
In the following allocation all agents have a value of exactly 2.5 in terms of $v$:
$$\allocs ' = \{\underbrace{\{H\}}_{\times 6}, \underbrace{\{x,x',y\}}_{\times 3}, \underbrace{\{x, x'', y'\}}_{\times 3}, \{x, y_a, y_b, y_c\}\}.$$
\end{example}
We establish the following $\frac{4}{11}$-MMS lower bound by appropriately generalizing a proof of \cite{comparingNotions2018} to the case of goods with copies. We intentionally keep similar notations to allow easy comparison.
\begin{theorem}
\label{thm:efx-wc_separation}
An $\text{EFX}_{\text{WC}}$ allocation is at least $\frac{4}{11}$-MMS for goods with copies.
\end{theorem}
\ifdefined\full{}
\begin{proof}
Suppose that allocation $\allocs$ is an $\text{EFX}_{\text{WC}}$ allocation. Let us take the perspective of agent $\alpha$. We divide the agents into three disjoint sets: $L_1=\{i\in\agents\mid |\alloci\setminus\alloci[\alpha]|\le 1 \}$, $L_2=\{i\in\agents\mid|\alloci\setminus\alloci[\alpha]|=2 \}$, $L_3=\{i\in\agents\mid |\alloci\setminus\alloci[\alpha]|\ge3 \}$. Define the set of goods $\forall \theta \in \{1,2,3\}, S_{\theta} = \cup_{i\in L_{\theta}} (\alloci \setminus \alloci[\alpha]).$
\begin{claim}\label{claim-efxwc}
$\text{EFX}_{\text{WC}}$ implies:
\begin{enumerate}
\item For any good $g\in S_2$, $\vai[\alpha]{g}\le \vai[\alpha]{\alloci[\alpha]}.$
\item For any agent $i\in L_3$, $\vai[\alpha]{\alloci\setminus\alloci[\alpha]}\le \frac{3}{2}\cdot \vai[\alpha]{\alloci[\alpha]}.$
\end{enumerate}
\end{claim}
\ifdefined\full
\begin{proof}
For the first inequality, let $i$ be an agent in the set $L_2$. By the condition of $\text{EFX}_{\text{WC}}$, $$\forall g\in \alloci\setminus\alloci[\alpha],\vai[\alpha]{ (\alloci\setminus\alloci[\alpha])\setminus g}\le\vai[\alpha]{\alloci[\alpha]\setminus\alloci}\le\vai[\alpha]{\alloci[\alpha]}.$$ As $ |\alloci\setminus\alloci[\alpha]|=2$, $\vai[\alpha]{g} = \vai[\alpha]{ (\alloci\setminus\alloci[\alpha])\setminus g'} \le \vai[\alpha]{\alloci[\alpha]}$, where $g'$ is another good in the set $\alloci\setminus\alloci[\alpha]$.
For the second inequality, $\min_{g\in \alloci\setminus\alloci[\alpha]}\vai[\alpha]{g}\le\frac{1}{2}\vai[\alpha]{\alloci[\alpha]},$ since otherwise we have for any good $g' \in A_i \setminus A_{\alpha},$
\[
\begin{split}
v_{\alpha} & ((A_i \setminus A_{\alpha}) \setminus \{g'\}) = \sum_{g \in (A_i \setminus A_{\alpha}) \setminus \{g'\}} v_{\alpha}(g) \\
& \geq \sum_{g \in (A_i \setminus A_{\alpha}) \setminus \{g'\}} \min_{g'' \in \alloci\setminus\alloci[\alpha]} \vai[\alpha]{g''} \\ & \geq 2 \min_{g'' \in \alloci\setminus\alloci[\alpha]} \vai[\alpha]{g''} > 2\cdot \frac{1}{2}v_{\alpha}(A_{\alpha}) = v_{\alpha}(A_{\alpha}),
\end{split}
\]
\noindent
contradicting $\text{EFX}_{\text{WC}}$. For $g = \arg\min_{g'\in \alloci\setminus\alloci[\alpha]}\vai[\alpha]{g'}$:
\[
\begin{split}
& \vai[\alpha]{\alloci\setminus\alloci[\alpha]} = \vai[\alpha]{(\alloci\setminus\alloci[\alpha]) \setminus \{g\}} + \vai[\alpha]{g} \le \\
& \vai[\alpha]{\alloci[\alpha]}+\min_{g\in \alloci\setminus\alloci[\alpha]}\vai[\alpha]{g}\le \frac{3}{2}\cdot \vai[\alpha]{\alloci[\alpha]}.
\end{split}
\]
\end{proof}
\fi
Suppose that allocation $\allocs^*$ is a maximin share allocation for agent $\alpha$. Let the allocation $\allocs'=\{\alloci\in\allocs^*\mid |\alloci\cap S_1|=0 \text{ and } |\alloci\cap S_2|\le 1 \}$. We remove any bundle contains at least one good in $S_1$ or at least two goods in $S_2$ from the allocation $\allocs^*$. Notice that allocation $\allocs'$ cannot be empty. As $\alpha\in L_1$, the number of bundles is at least $1+|S_1|+\frac{|S_2|}{2}$. And we remove at most $|S_1|+\frac{|S_2|}{2}$ bundles. Let $n'=|\allocs'|$.
Next we prove that there is a bundle $\alloci[j]'$ in the allocation $\allocs'$ such that $\vai[\alpha]{\alloci[j]'}\le\frac{11}{4}\cdot \vai[\alpha]{\alloci[\alpha]}.$ Let $n'$ be the size of $|\allocs'|$, $y$ be the size of $|L_3|$ and $x$ be the number of goods in set $S_2$ appearing in the allocation $\allocs'$.
\begin{claim}\label{claim-quan}
We have the following quantity relationships: (1) $n' \ge x$, (2) $n' \ge \frac{x}{2}+y$.
\end{claim}
\ifdefined\full
\begin{proof}
The first inequality holds as each bundle in $\allocs'$ has at most one good from $S_2$. For the second inequality, we have $$n=|L_1|+|L_2|+|L_3|\ge |S_1|+\frac{|S_2|}{2}+y.$$ The number of removed bundles is at most $|S_1|+\frac{|S_2|-x}{2}$. Therefore, $n'\ge n-|S_1|-\frac{|S_2|-x}{2}\ge \frac{x}{2}+y$.
\end{proof}
\fi
By Claim \ref{claim-efxwc}, the total sum of goods from sets $S_2$ and $S_3$ in allocation $\allocs'$ for agent $\alpha$ is upper bounded by
\[
\begin{split}
&x\cdot \max_{g\in S_2}\vai[\alpha]{g}+y\cdot \max_{i\in L_3}\vai[\alpha]{\alloci\setminus\alloci[\alpha]}\\
\le&x\cdot \vai[\alpha]{\alloci[\alpha]}+y\cdot \frac{3}{2}\vai[\alpha]{\alloci[\alpha]}.
\end{split}
\]
By Claim \ref{claim-quan}, the average valuation is bounded by
\begin{equation*}
\begin{split}
\frac{x+\frac{3}{2} y}{n'}\cdot \vai[\alpha]{\alloci[\alpha]} & \le \frac{x+\frac{3}{2}\cdot (n'-\frac{x}{2})}{n'}\cdot \vai[\alpha]{\alloci[\alpha]} \\
& = (\frac{1}{4}\cdot\frac{x}{n'}+\frac{3}{2})\cdot \vai[\alpha]{\alloci[\alpha]}
\le\frac{7}{4}\cdot \vai[\alpha]{\alloci[\alpha]}.
\end{split}
\end{equation*}
Therefore, there is an agent $j$ such that $\vai[\alpha]{\alloci[j]'\setminus\alloci[\alpha]}\le \frac{7}{4}\cdot \vai[\alpha]{\alloci[\alpha]}.$ We have \begin{equation*}
\begin{split}
\vai[\alpha]{\alloci[j]'}&=\vai[\alpha]{\alloci[j]'\setminus\alloci[\alpha]}+\vai[\alpha]{\alloci[j]'\cap\alloci[\alpha]}\\
&\le\frac{7}{4}\cdot \vai[\alpha]{\alloci[\alpha]}+\vai[\alpha]{\alloci[\alpha]}
=\frac{11}{4}\cdot \vai[\alpha]{\alloci[\alpha]}.
\end{split}
\end{equation*}
\noindent
MMS is $\min_{i\in\agents}\vai[\alpha]{\alloci^*}\le\vai[\alpha]{\alloci[j]'}\le\frac{11}{4}\cdot \vai[\alpha]{\alloci[\alpha]}$.
\end{proof}
\fi
\paragraph{\bf $\text{EFL}_{\text{WC}}$.} We give an upper and a lower bound of one-third.
\begin{example}[There is an $\text{EFL}_{\text{WC}}$ allocation with at most $\frac{1}{3}$-MMS for goods with copies]
\label{ex:third-MMS}
\unless\ifdefined\full{}
See full version for details.
\fi
\ifdefined\full{}
Consider $2\ell+1$ agents and goods as given in Table~\ref{tab:efl-1/3-mms}, where $v$ is the valuation of agent $2\ell+1$ and all other agents value all goods as $1$.
\begin{table}[]
\centering
\begin{tabular}{c|c|c|c|c|c}
Goods & H & x & x' & $\forall_{1\leq i \leq \ell}, \mathbf{y_i}$ & $\forall_{1\leq i \leq \ell},\mathbf{z_i}$ \\
\hline
Copies & $\ell$ & $\ell+1$ & $\ell$ & 1 & 1 \\
\hline
$v$ & 3 & 1 & 1 & $1 - \frac{2}{\ell}$ & $\frac{2}{\ell}$
\end{tabular}
\caption{$\text{EFL}_{\text{WC}}$ $\frac{1}{3}$-MMS upper bound}
\label{tab:efl-1/3-mms}
\end{table}
Then,
$$\allocs = \{ \underbrace{\{H,x\}}_{\times \ell}, \underbrace{\{x',y_{\theta}, z_{\theta}\}}_{1\leq \theta \leq \ell}, \{x\} \} $$ is $\text{EFL}_{\text{WC}}$, but $v(\alloci[2\ell+1]) = 1$, while a MMS of at least $3 - \frac{2}{\ell}$ is guaranteed by $$\allocs ' = \{ \underbrace{\{H\}}_{\times \ell}, \underbrace{\{x, x',y_{\theta}\}}_{1\leq \theta \leq \ell}, \{x, z_1,...,z_{\ell}\} \}.$$
\fi
\end{example}
\begin{theorem}
\label{thm:efl-wc_separation} An $\text{EFL}_{\text{WC}}$ allocation is at least $\frac{1}{3}$-MMS for goods with copies.
\end{theorem}
\ifdefined\full
\begin{proof}
Suppose that $\allocs$ is an $\text{EFL}_{\text{WC}}$ allocation, and consider the perspective of an agent $i^*$.
Among the remaining $n-1$ agents, let $L_1$ be the set of agents satisfying the first $\text{EFL}_{\text{WC}}$ condition, and let $L_2$ be the remaining agents (that must thus satisfy the second condition). Denote $\ell = |L_1|, n-\ell - 1 = |L_2|$. Define $\forall \theta \in \{1,2\}, S_{\theta} = \cup_{j\in L_{\theta}} (A_j \setminus A_{i^*})$ (we allow multiple copies in the same set). Notice that for any $j\in L_2$ we have by the second $\text{EFL}_{\text{WC}}$ condition
that there is such good $g \in \alloci[j]$ with
\begin{equation} \label{eq:eflwc_condition_L2} \max \{v_{i^*}(\alloci[j] \setminus (\alloci[i^*] \cup \{g\})), v_{i^*}(g)\} \le v_i(\alloci[i^*] \setminus \alloci[j]),\end{equation}
and so \[
\begin{split}
v_{i^*}(\alloci[j] \setminus \alloci[i^*])
& \leq v_{i^*}(\alloci[j] \setminus (\alloci[i^*] \cup \{g\})) + v_{i^*}(g) \\
&\stackrel{\text{Eq.~\ref{eq:eflwc_condition_L2}}}{\leq}
2v_{i^*}(\alloci[i^*] \setminus \alloci[j]) \\
& \leq 2v_{i^*}(\alloci[i^*]),
\end{split}
\]
which implies
$$v_{i^*}(S_2) \leq \sum_{j \in L_2} v_{i^*}(\alloci[j] \setminus \alloci[i^*]) \leq 2(n-\ell - 1) v_{i^*}(\alloci[i^*]).$$
All goods that are not in $S_1, S_2$ must have a copy in $\alloci[i^*]$. Denote all the remaining goods' copies $R$, then we overall have $\items = S_1 \cup S_2 \cup R$.
In any allocation $\allocs ' $, there are at most $\ell$ agents with goods from $S_1$. That is since the first $\text{EFL}_{\text{WC}}$ condition for an agent $j$ requires $|\alloci[j] \setminus \alloci[i^*]| = 1$, and so we have $|S_1| = \sum_{j\in L_1}|\alloci[j] \setminus \alloci[i^*]| = \ell$. Let $L'$ then be the set of at least $n-\ell$ agents with no good from $S_1$, and let $\{S_2^j\}_{j\in L'}, \{R^j\}_{j\in L'}$ be the allocations of $S_2, R$ goods to these agents under $\allocs '$. Since
$$ \sum_{j \in L'} v_{i^*}(S_2^j) \leq v_{i^*}(S_2), $$
there exists some $j\in L'$ with
\[
\begin{split}
v_{i^*}(S_2^j) &\leq \frac{2(n-\ell - 1)}{|L'|}v_{i^*}(\alloci[i^*]) \\
&\leq \frac{2(n-\ell - 1)}{n-\ell}v_{i^*}(\alloci[i^*]) < 2v_{i^*}(\alloci[i^*]).
\end{split}
\]
Since $\allocs '$ is an exclusive allocation, and since $R$ includes only goods with a copy in $\alloci[i^*]$, agent $j$ satisfies $v_{i^*}(R^j) \leq v_{i^*}(\alloci[i^*])$, and overall $v_{i^*}(\alloci[j]) = v_{i^*}(S_1^j) + v_{i^*}(S_2^j) + v_{i^*}(R^j) \leq 3v_{i^*}(\alloci[i^*])$. Since such an agent exists for any exclusive allocation, it exists for the MMS allocation, and so the minimal bundle in terms of $v_{i^*}$ in that allocation is bounded by $3v_{i^*}(\alloci[i^*])$. This shows the $\frac{1}{3}$-MMS guarantee.
\end{proof}
\fi
\section{Existence of $\text{EFX}_{\text{WC}}$}
\label{sec:leveled}
In this section we show an existence result for leveled preferences \cite{Babaioff2017CompetitiveEW,ManjunathW21}, and identify where new ideas will be necessary to go beyond such preferences.
\begin{definition}
A valuation $v$ is a \emph{\bf leveled preference} for goods if for any two bundles, $|B_1| > |B_2| \implies v(B_1) > v(B_2)$.
\end{definition}
We prove our existence result for goods with copies. By our duality framework (Theorem~\ref{thm:wc-duality}),
this existence result
holds for chores and in fact for mixed goods and chores.
\ifdefined\resolvedIssues
\subsection{$\text{EF1}_{\text{WC}}$}
Since we fall within the settings of \cite{cardinalityConstraints2018}, their EF1 existence result translates to our settings. Still, as explained in the previous sections, the correct notion for our settings is $\text{EF1}_{\text{WC}}$, which is a stronger notion than EF1. That is, $\text{EF1}_{\text{WC}} \implies \text{EF1}$, but not vice versa. Intuitively, that is because the special good that must satisfy the EF1 condition for some two agents $i,j$ has to belong to the set $\alloci[j] \setminus \alloci[i]$, and can not just be in the larger $\alloci[j]$. It is thus possible for an allocation to be EF1 and not $\text{EF1}_{\text{WC}}$:
Also note that proving $\text{EF1}_{\text{WC}}$ existence for additive goods with copies gives EF1 existence for chores as a corollary, while EF1 existence for goods with copies does not.
\ifdefined\full
We now present the envy-cycle cancellation algorithm for the existence, and prove its correctness. The \emph{envy graph} of an allocation $\allocs$, denoted by $E_{\allocs}$, is the directed graph where the nodes are the set of agents, and there is an outgoing edge $i\rightarrow j$ if $\vai{\alloci} < \vai{\alloci[j]}$.
\begin{algorithm}[H]
\SetAlgoLined
\DontPrintSemicolon
\KwIn{$\agents$, $\items$ and valuations}
\KwOut{An $\text{EF1}_{\text{WC}}$ allocation $\allocs$}
Initialize an empty allocation $\allocs$\;
\For{j=1 to $\tau$}{
Perform a topological sort over $E_{\allocs}$, and save the first $k_j$ agents into $K$\;
Add a copy of the good $j$ for each of the agents in $K$\;
Cancel cycles in $E_{\allocs}$\;
}
\caption{$\text{EF1}_{\text{WC}}$ allocation for a general additive goods with copies instance}
\label{alg:EF1-WC}
\end{algorithm}
\begin{theorem}
Algorithm~\ref{alg:EF1-WC} always runs to completion and produces an $\text{EF1}_{\text{WC}}$ allocation.
\end{theorem}
\begin{proof}
We prove two properties of $\allocs$ that are always maintained at the beginning (end) of the loop round:
\emph{$E_{\allocs}$ is acyclic} - for the empty allocation $\allocs$, $E_{\allocs}$ is an empty graph. Step 5 guarantees that $E_{\allocs}$ remains acyclic with each round of the loop, by using the primitive
\emph{$\allocs$ has no $\text{EF1}_{\text{WC}}$-envious agents} - This holds for the empty allocation. Each round of the loop maintains that if a copy of a good was added to a bundle an agent envies, then it was also added to its own bundle (by the topological sorting). If a copy of a good was added to a bundle the agent does not envy, then removing it removes envy, which suffices for the $\text{EF1}_{\text{WC}}$ condition. The cycle cancellation preserves envy-freeness notions, as mentioned.
\end{proof}
\fi
\unless\ifdefined\full
\begin{theorem}
There is a polynomial time algorithm that finds an $\text{EF1}_{\text{WC}}$ allocation for any additive goods with copies instance.
\end{theorem}
\fi
\subsection{$\text{EFX}_{\text{WC}}$ for (Almost) Identical Ordinal Preferences}
An instance is identical ordinal if all agents have the same ordering for all goods. \cite{IdenticalOrdinalPref} designs two efficient algorithms for goods and chores separately to find an EFX allocation in standard setting for identical ordinal preferences. In this section, we extend their result to the notion $\text{EFX}_{\text{WC}}$ and a more general valuation class. Due to the duality, one algorithm for goods is sufficient for our model.
{\bf Almost IO instance:} There is an special agent $\omega$ and an ordering $\succ_{id}$ of goods $\mathcal{T}$ such that $g\succ_{id}g'$, we have $\vai{g}\ge\vai{g'}$ for all agents $i\neq\omega$.
We make use of the primitive of the envy graph cycle cancellation introduced by \cite{lipton2004approximately}.
The \emph{envy graph} of an allocation $\allocs$, denoted by $E_{\allocs}$, is the directed graph where the nodes are the set of agents, and there is an outgoing edge $i\rightarrow j$ if $\vai{\alloci} < \vai{\alloci[j]}$.
\begin{algorithm}[H]
\SetAlgoLined
\DontPrintSemicolon
\KwIn{
An almost IO instance
}
\KwOut{$\allocs$, an $\text{EFX}_{\text{WC}}$ allocation}
Order the goods $g_1,\cdots,g_{\tau}$ by decreasing valuation according to the ordering $\succ_{id}$\;
Initialize an empty allocation $\allocs$\;
\For{j=1 to \tau}{
Let $G=E_{\allocs}$ ($G$ does not change when $\allocs$ changes)\;
Perform a topological sort over $G$ with priority to the agents who have a directed path going to agent $\omega$\;
Let $K$ be the first $k_j$ agents according to order of topological sort\;
Add a copy of the good $g_j$ for each of the agents in $K$\;\label{inalg-add}
\If{ the best bundle for agent $\omega$ is $h\in K$} {
Let $s_0 = h,...,s_r = \omega$ be a path in $G$ from $h$ to $\omega$ such that if $s_i$ has a successor in $K$, then $s_{i+1}\in K$\;
Perform the cyclic reassignment $\allocs_{s_i} = \allocs_{s_{(i+1) mod (r + 1)}} $\;
}
Cancel cycles in $E_{\allocs}$\;
}
\caption{$\text{EFX}_{\text{WC}}$ allocation for almost identical ordinal preference}
\label{alg:EFX-WC_ordinal}
\end{algorithm}
\begin{theorem}
Algorithm~\ref{alg:EFX-WC_ordinal} always outputs an $\text{EFX}_{\text{WC}}$ allocation in $O(\tau n^2)$ time.
\end{theorem}
\ifdefined\full
\begin{proof}
We prove that the algorithm always maintains the allocation $\allocs$ an $\text{EFX}_{\text{WC}}$ allocation.
We first prove until line
\begin{comment}
We prove three properties of $\allocs$ that are always maintained at the beginning (end) of a main loop round:
\emph{$unq$ has no outgoing edges in $E_{\allocs}$} - this holds for the empty allocation $\allocs$. If it was in $K$ during the round, then it was given some copy of a good. All other bundles were given a copy of that same good or were unchanged, so relative to any other bundle its valuation didn't decrease, and so it still has no outgoing edges in $E_{\allocs}$. If it was not in $K$, then it is possible that it prefers the bundle of some agent $h\in K$ bundle, with the added $g_j$ good, over its original bundle. The if condition guarantees that in these circumstances it gets its best valued bundle of all bundles.
\emph{$E_{\allocs}$ is acyclic} - for the empty allocation $\allocs$, $E_{\allocs}$ is an empty graph. The cycle cancellation step guarantees that $E_{\allocs}$ remains acyclic with each round of the loop.
\emph{$\allocs$ has no $\text{EFX}_{\text{WC}}$-envious agents} - This holds for the empty allocation. $unq$ is not $\text{EFX}_{\text{WC}}$-envious since it always has the best bundle by its valuation. Each round of the loop maintains that if a copy of a good was added to a bundle an agent envies, then it was also added to its own bundle (by the topological sort). If a copy of a good was added to a bundle the agent does not envy, since it is the smallest good by its ordinal preference (they are iterated over in decreasing order), it does not cause $\text{EFX}_{\text{WC}}$-envy, as removing the smallestgood removes envy. If we enter the if condition, we can divide the agents in the path from $s_0 = h_{\max}, ..., s_r = unq$ into 4 sets, based on whether they are in $K$, and whether the bundle they point to in the path is in $K$.
\begin{itemize}
\item If $s_i, s_{(i+1) mod (r+1)} \in K$, then $i$ receives the bundle of an agent they envy they envy with the extra good $g_j$. As we noted, for such agent $s_i$, even its original bundle with the extra good $g_j$ maintains that it is not $\text{EFX}_{\text{WC}}$-envious, so receiving a better bundle also maintains it.
\item If $s_i \in K, s_{(i+1) mod (r+1)} \not \in K$, then agent $i$ does not envy any of the other agents in $K$ (by our description of our choice of the path), and receives $\allocs_{unq}$ which she envies. Since $g_j$ is the smallest good allocated by its ordinal preference, and disregarding it guarantees the agent has no envy to the agents allocated it, it is not $\text{EFX}_{\text{WC}}$-envious.
\item If $s_i, s_{(i+1) mod (r+1)} \not \in K$, again $g_j$ is the smallest good allocated by its ordinal preference, and disregarding it guarantees the agent has no envy to the agents allocated it.
\item If $s_i \not \in K, s_{(i+1) mod (r+1)} \in K$, the agent is $unq$, which we discussed before.
\end{itemize}
\end{comment}
\end{proof}
\fi
\fi
\begin{theorem}
There is an algorithm that always finds an $\text{EFX}_{\text{WC}}$ exclusive allocation for goods with copies in the case of leveled preferences. Its runtime is $O(n|\mathcal{T}|^2)$.
\end{theorem}
\unless\ifdefined\full{}
\begin{proof}
We describe here the algorithm and defer the details to the full version. We choose an initial allocation $\allocs$ such that $|\alloci|-|\alloci[j]|\le 1$ for every pair of agents $i,j\in\agents$, e.g., by setting some arbitrary order $1,...,n$ over the agents, an arbitrary order $1,...,t$ over the good types, and allocating the $k_i$ copies of the next good to the next $k_i$ agents in a cyclic fashion.
If all bundle sizes in $\allocs$ are the same, then $\allocs$ is $\text{EFX}_{\text{WC}}$ (and moreover, EFX), we are done.
Otherwise, $\allocs$ has two bundle sizes (two levels). Let the number of goods in the upper level of $\allocs$ be $H$, and thus the number of goods in the lower level is $H-1$. If $\allocs$ is not $\text{EFX}_{\text{WC}}$ we perform the following operation. Suppose that agent $i$ $\text{EFX}_{\text{WC}}$-envies agent $j$.
Agent $i$ must be at a lower level than agent $j$, otherwise after removing a good from $j$, agent $i$ is at a higher level and by the leveled preferences prefers its own bundle.
Let $g_{\max} = \arg\max_{g \in \alloci[j] \setminus \alloci[i]} v_i(g), g_{\min} = \arg\min_{g \in \alloci[i] \setminus \alloci[j]} v_i(g)$.
Let agent $i$ get the bundle $(\alloci[i]\setminus \{g_{\min}\}) \cup \{g_{\max}\}$, and let agent~$j$ get the bundle $(\alloci[j]\setminus \{g_{\max}\}) \cup \{g_{\min}\}$. After this operation, the allocation remains exclusive. Agent $i$ gets a strictly improved bundle by her valuation (as we can prove), and both agents get a bundle with the same cardinality as before, thus maintaining the sets of lower-level and upper-level bundle agents unchanged. We repeat the process.
\end{proof}
\fi
\ifdefined\full{}
\begin{comment}
\begin{proof}
We can choose an initial allocation $\allocs$ such that $|\alloci|-|\alloci[j]|\le 1$ for any $i,j\in\agents$, e.g., by setting some arbitrary order $1,...,n$ over the agents, an arbitrary order $1,...,t$ over the good types, and allocating the $k_i$ copies of the next good to the next $k_i$ agents in a cyclic fashion. If there is exactly one level, then $\allocs$ is $\text{EFX}_{\text{WC}}$ (and moreover, EFX), and we are done.
If the allocation $\allocs$ is not an $\text{EFX}_{\text{WC}}$ allocation, we perform the following operation. Suppose that agent $i$ $\text{EFX}_{\text{WC}}$-envies agent $j$ (that is, EFX-envies it after removing the goods they have in common). Agent $i$ must be at a lower level than agent $j$, otherwise after removing a good from $j$, agent $i$ is at a higher level and by the leveled preferences prefers its own bundle.
Thus, there is a good $g$, such that $g\in \alloci[j], g\notin\alloci$ and $\vai{\alloci}<\vai{\alloci[j]\setminus g}$. Now let agent $i$ get the bundle $\alloci[j]\setminus g$, and let agent $j$ get the bundle $\alloci\cup g$. After this operation, agent $i$ gets a strictly improved bundle by its valuation, and both agents get a bundle with the same cardinality as before, thus maintaining the sets of lower-level and upper-level bundle agents unchanged. If we repeat this operation, the lower-level agents sum of values (that is, $\sum_{i\in L} \vai{\alloci}$) only increases at each step. Since this process must stop, we see that at some step there are no more such $i,j$ where agent $i$ $\text{EFX}_{\text{WC}}$-envies $j$, and we have an $\text{EFX}_{\text{WC}}$ allocation.
\end{proof}
\end{comment}
\begin{proof}
We can choose an initial allocation $\allocs$ such that $|\alloci|-|\alloci[j]|\le 1$ for any $i,j\in\agents$, e.g., by setting some arbitrary order $1,...,n$ over the agents, an arbitrary order $1,...,t$ over the good types, and allocating the $k_i$ copies of the next good to the next $k_i$ agents in a cyclic fashion. If all bundle sizes in $\allocs$ are the same, then $\allocs$ is $\text{EFX}_{\text{WC}}$ (and moreover, EFX), we are done.
Otherwise, $\allocs$ has two bundle sizes (two levels). Let the number of goods in the upper level of $\allocs$ be $H$, and thus the number of goods in the lower level is $H-1$. If the allocation $\allocs$ is not an $\text{EFX}_{\text{WC}}$ allocation, we perform the following operation. Suppose that agent $i$ $\text{EFX}_{\text{WC}}$-envies agent $j$ (that is, EFX-envies it after removing the goods they have in common). Agent $i$ must be at a lower level than agent $j$, otherwise after removing a good from $j$, agent $i$ is at a higher level and by the leveled preferences prefers its own bundle.
It must hold that $\max_{g \in \alloci[j] \setminus \alloci[i]} v_i(g) > \min_{g \in \alloci[i] \setminus \alloci[j]} v_i(g)$, otherwise we have for any good $g' \in \alloci[j] \setminus \alloci[i]$:
\[
\begin{split}
& v_i((\alloci[j] \setminus \alloci[i]) \setminus \{g'\}) \leq |(\alloci[j] \setminus \alloci[i]) \setminus \{g'\}|\max_{g \in \alloci[j] \setminus \alloci[i]} v_i(g) \leq \\
& |\alloci[i] \setminus \alloci[j]|\min_{g \in \alloci[i] \setminus \alloci[j]} v_i(g) \leq v_i(\alloci[i] \setminus \alloci[j]),
\end{split}
\]
in contradiction to our assumption of $\text{EFX}_{\text{WC}}$-envy.
Let $$g_{\max} = \arg\max_{g \in \alloci[j] \setminus \alloci} v_i(g), g_{\min} = \arg\min_{g \in \alloci[i] \setminus \alloci[j]} v_i(g).$$ Let agent $i$ get the bundle $(\alloci[i]\setminus \{g_{\min}\}) \cup \{g_{\max}\}$, and let agent $j$ get the bundle $(\alloci[j]\setminus \{g_{\max}\}) \cup \{g_{\min}\}$. After this operation, the allocation remains exclusive. Agent $i$ gets a strictly improved bundle by its valuation, and both agents get a bundle with the same cardinality as before, thus maintaining the sets of lower-level and upper-level bundle agents unchanged. We repeat the process.
We construct the potential function to show the number of steps is bounded and polynomial. For any good $g\in T$, let $\omega_i(g)$ be its ordinal position according to agent $i$'s preference over the goods, e.g., for the minimal good $g\in T$ by $i$ valuation we have $\omega_i(g) = 1$, and for the maximal good $g'$ we have $\omega_i(g') = |\mathcal{T}|$. We consider the potential function $$\psi(\allocs) = \sum_{\substack{i\in \mathcal{N} \\ |\alloci[i]| = H-1}} \sum_{g\in \alloci[i]} \omega_i(g).$$
Notice that at each step this potential function strictly increases as we replace some good with a strictly preferred good for some lower level agent. Also note that $0 \leq \min_{\allocs \in \ea{\items}} \psi(\allocs) \leq \max_{\allocs \in \ea{\items}} \psi(\allocs) \leq n |\mathcal{T}|^2$, and the function always returns an integer value. Thus the maximal number of substitution steps is in $O(n|\mathcal{T}|^2)$.
\end{proof}
\fi
\noindent{\bf Challenges.}
Many existence results of envy-based fairness notions for goods without copies rely on the primitive of envy-cycle canceling, first shown by \cite{lipton2004approximately}. We thus note an important technical difference in proving existence for $f_{wc}$ notions. For goods with copies, it is sometimes impossible to cancel an envy-cycle without breaking the fairness notion.
This was first pointed out in \cite{EnvyCycleCancellationExample}. We give below another such example that has two additional properties: First, the allocation is $\text{EFX}_{\text{WC}}$ before cancelling the envy-cycle, but not even $\text{EF1}_{\text{WC}}$ after the cancellation. Second, in our example the choice of which envy-cycle to cancel is immaterial to the difficulty arising, as there is only one envy cycle.
\begin{comment}
\begin{table}[]
\centering
\begin{tabular}{c|c|c|c|c|c|c|c|c}
Goods & H_1 & H_2 & a & b & c & d & e & f\\
\hline
Copies & 1 & 2 & 1 & 2 & 2 & 1 & 2 & 1 \\
\hline
$\vau[1]$ & 2.1 & 2 & 1 & 1 & 1 & 0.1 & 0.1 & 0.1 \\
\hline
$\vau[2]$ & 4 & 2 & 1 & 0.5 & 0.5 & 0.1 & 0.1 & 0.1\\
\hline
$\vau[3]$ & 2.1 & 2 & 1 & 0.5 & 0.5 & 0.1 & 0.1 & 0.1\\
\hline
$\vau[4]$ & 4 & 1.1 & 1 & 1 & 1 & 1 & 1 & 1
\end{tabular}
\caption{Envy-cycle cancelation failure for goods with copies}
\label{tab:cycle-cancle}
\end{table}
\begin{example}
There are 4 agents and 8 good types. The valuation and the number of copies are listed in Table \ref{tab:cycle-cancle}. Note that these valuations have identical ordinal preferences. Consider the allocation $\alloci[1]=\{b,c,d,e,f\}$, $\alloci[2]=\{H_2,a\}$, $\alloci[3]=\{H_2,b,c,e\}$, $\alloci[4]=\{H_1\}$. It is an $\text{EFX}_{\text{WC}}$ allocation. We have agent $1$ envies agent 2, agent 2 envies agent 4 and agent 4 envies agent 1. Let us reallocate the bundles to resolve this envy cycle. Even though everyone gets a better bundle, it is not $\text{EF1}_{\text{WC}}$, as agent 1 then gets the bundle $\{H_2,a\}$ but $\text{EF1}_{\text{WC}}$-envies the bundle $\{H_2,b,c,e\}$.
\end{example}
\end{comment}
\begin{table}[]
\centering
\begin{tabular}{c|c|c|c|c|c|c|c}
Goods & H & a & b & c & d & e & f\\
\hline
Copies & 2 & 1 & 1 & 2 & 2 & 2 & 1 \\
\hline
$\vau[1]$ & 2.5 & 1 & 1 & 1 & 1 & 0.1 & 0.1 \\
\hline
$\vau[2]$ & 2 & 1.5 & 1 & 0.7 & 0.7 & 0.7 & 0.7\\
\hline
$\vau[3]$ & 2 & 1 & 0.5 & 0.5 & 0.1 & 0.1 & 0.1\\
\end{tabular}
\caption{Envy-cycle cancellation failure for goods with copies.}
\label{tab:cycle-cancle-small}
\end{table}
\begin{example}
There are 3 agents and 7 good types. The valuation and the number of copies are listed in Table \ref{tab:cycle-cancle-small}. Note that these valuations have identical ordinal preferences. Consider the allocation $\alloci[1]=\{b,c,d,e,f\}$, $\alloci[2]=\{H,a\}$, $\alloci[3]=\{H,c,d,e\}$. It is an $\text{EFX}_{\text{WC}}$ allocation. We have that agent~$1$ envies agent 2 and vice versa. Let us reallocate the bundles to resolve this envy-cycle. Even though everyone gets a better bundle, it is not $\text{EF1}_{\text{WC}}$, as agent 1 then gets the bundle $\{H,a\}$ but $\text{EF1}_{\text{WC}}$-envies the bundle $\{H,c,d,e\}$.
\end{example}
Another intriguing property of goods with copies is that the MNW allocation is not even necessarily $\text{EF1}_{\text{WC}}$ (unlike the case of goods), as the following example shows.
\begin{definition}
The \emph{\bf Nash welfare} of an allocation is the product $NW(\allocs) = \prod_{i\in \agents} v_i(\alloci)$.
The \emph{\bf maximum Nash welfare} allocation is MNW $= \arg \max_{\allocs} NW(\allocs)$.
\end{definition}
\begin{table}[]
\centering
\begin{tabular}{c|c|c|c|c}
Goods & a & b & c & d \\
\hline
Copies & 2 & 1 & 1 & 1 \\
\hline
$\vau[1]$ & 1 & 1 & 1 & $\epsilon$ \\
\hline
$\vau[2]$ & 1 & $\epsilon$ & $\epsilon$ & $\epsilon$ \\
\hline
$\vau[3]$ & $\epsilon$ & $\epsilon$ & $\epsilon$ & 1 \\
\end{tabular}
\caption{An MNW allocation that is not $\text{EF1}_{\text{WC}}$.}
\label{tab:mnw-not-ef1wc}
\end{table}
\begin{example}
Consider Table~\ref{tab:mnw-not-ef1wc} with $\epsilon = 10^{-6}$. The MNW allocation is the exclusive allocation $\{\{a,b,c\}, \{a\}, \{d\} \}$. In this allocation agent 2 $\text{EF1}_{\text{WC}}$-envies agent 1.
\end{example}
\section{Discussion}
\label{sec:discussion}
To the best of our knowledge, we provide the first formal duality relationship between goods with copies and chores that establishes the equivalence of both settings for a broad class of fairness notions. Some of our results can be extended beyond additive valuations. In particular, Theorem~\ref{thm:wc-duality} holds for general valuations, and Proposition~\ref{prop:inclusive_efxwc_eflwc} holds for all monotone valuations, as indicated in the proof. Other results do not generalize. For example, Theorem~\ref{thm:efl-wc_separation} can not be extended, even to monotone and submodular valuations:
\begin{definition}
A valuation $v$ of goods is \emph{\bf submodular} if $\forall S_1,S_2 \subseteq \items, v(S_1) + v(S_2) \geq v(S_1 \cup S_2) + v(S_1 \cap S_2)$.
\end{definition}
\begin{example}[For monotone and submodular valuations, there is an $\text{EFL}_{\text{WC}}$ allocation with at most $\frac{1}{n}$-MMS for goods with copies]
\label{ex:third-MMS-submodular}
\unless\ifdefined\full{}
See full version for details.
\fi
\ifdefined\full{}
Consider $n$ agents and goods $\{y^{i}_{j}\}^{1\leq i\leq n}_{1\leq j \leq n}$, each with one copy, where $v$ is the valuation function of all agents:
$$v(S) = |\{i\ |\ \exists j, y^i_j \in S\}|.$$
In words, there are $n^2$ goods, partitioned into $n$ groups, where goods in the same group are substitutes, and the valuation of a bundle of goods equals to the number of good groups present in the bundle. Then,
$$\allocs = \{ \underbrace{\{y^{\theta}_{1}, \ldots, y^{\theta}_n\}}_{1\leq \theta \leq n} \} $$ is $\text{EFL}_{\text{WC}}$ (in fact it is envy-free), but $v(\alloci[i]) = 1$ for each agent $i$, while a MMS of $n$ is guaranteed by $$\allocs ' = \{ \underbrace{\{y^{\theta}_1, \ldots, y^{(\theta + i) \mod n}_i, \ldots, y^{(\theta + n-1) \mod n}_n\}}_{1\leq \theta \leq n} \}. $$
\fi
\end{example}
For future work, we believe it is of interest to further investigate the duality phenomenon studied in this paper in the context of other fair division settings, e.g., divisible items.
The main open challenge for the new fairness notions that we propose (such as $\text{EFX}_{\text{WC}}, \text{EF1}_{\text{WC}}$) is to settle their general existence for goods with copies. As a special case, the existence of EFX, EFL for chores is open.
%
It is also worth investigating a more flexible model where the number of copies of each good is only loosely set, e.g., constrained between a minimal and maximal value.
\section*{Acknowledgments}
Yotam Gafni and Ron Lavi were partially supported by the ISF-NSFC joint research program (grant No.~2560/17). Xin Huang was partially supported by the Aly-Kaufman Fellowship. This research was supported by the Israel Science Foundation (grant No.~336/18).
An early version of this work was presented at the 8th International Workshop on Computational Social Choice (COMSOC), 2021
\footnote{The COMSOC version is accessible at \url{https://drive.google.com/open?id=17b5r_kXT8lC1fzvKkU7-0Vh_WRTAIosk}.}
| {'timestamp': '2021-09-29T02:13:21', 'yymm': '2109', 'arxiv_id': '2109.08671', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08671'} | arxiv |
\section{Introduction}\label{sect:intro}
As the standardization of fifth-generation (5G) New Radio (NR) technology operating in microwave and millimeter wave (mmWave) bands is over, the focus of the research community is shifting towards performance optimization of these systems for future cellular deployments \cite{volk20215g,antoniou2021quality,hutajulu2020two}. At the same time, seeking for even more capacity at the air interface, the researchers already start to entertain the challenge of utilizing terahertz (THz) frequency band for cellular communications having tens of even hundreds of GHz of consecutive bandwidth available \cite{petrov2020ieee,giordani2020toward,polese2020toward,akyildiz2014terahertz}.
The utilization of mmWave and THz frequency bands promises to not only bring the extreme capacity to the air interface enabling novel rate-greedy applications such as virtual reality (VR), augmented reality (AR), and holographic telepresence but to enable truly multi-service access networks delivering guarantees to applications sensitive to various parameters such as delay and throughput \cite{parkvall2017nr,antoniou2021quality}. However, the inherent properties of these bands including the need for extremely high radiation patterns at both sides of communications link to compensate for extreme path losses \cite{andrews2014will,sadhu2018128,akyildiz2016realizing}, blockage of propagation paths by large objects such as buildings \cite{ruiz2020analysis,mohebi2021sectors,tafintsev2020handling} or small dynamic obstacles such as human bodies and vehicles \cite{dynamicBlockage,maccartney2016millimeter,petrov2019exploiting}, as well as macro- and micromobility of user equipment (UE) \cite{orsino2016direct,petrov2020capacity,petrov2018effect,moorthy2020beam} may drastically affect the performance of these technologies frequently leading to either drastic rate degradation or even outage situations. In fact, the performance of these radio access networks (RAT), tailored specifically towards service provisioning in crowded environments with extreme traffic demands, will suffer most in these conditions. To overcome these problems, novel mechanisms maintaining the advertised performance are needed. To evaluate the performance of these mechanisms system-level performance evaluation methodologies are required.
The system-level performance evaluation of cellular communications systems is conventionally performed utilizing either a purely mathematical approach or via computer simulations. As discussed in \cite{gkonis2020comprehensive,begishev2018connectivity,gapeyenko2017temporal} the multi-path propagation and as well as dynamic blockage phenomena drastically affect the efficiency of simulation techniques. At the physical layer, the extreme mmWave and THz propagation sensitivity to different surfaces naturally call for ray tracing techniques for precise modeling \cite{yaman2021ray,solomitckii2019evaluation} inducing accuracy-complexity trade-off \cite{lecci2020accuracy,lecci2020simplified}. Further, accounting for blockage requires capturing not only static scenario geometry and tracking UEs having active sessions but accounting for all of the dynamic objects in the channel, e.g., humans, vehicles. In these conditions, the utilization of mathematical frameworks may provide a viable way for the first-order assessment of the novel mechanisms improving the performance of mmWave and THz systems. In doing this, the frameworks proposed in the past for LTE systems \cite{elsawy2016modeling,elsawy2013stochastic} have to be properly extended to account for specifics of mmWave and THz communications including highly directional antenna radiation patterns, static and dynamic blockage, atmospheric attenuation, etc. Notably, those frameworks have been developed assuming adaptive (full buffer) traffic patterns inherently adaptive to network state and thus mainly utilized the elements of stochastic geometry \cite{haenggi2012stochastic,haenggi2009stochastic,blaszczyszyn2018stochastic}.
Contrarily, mmWave and THz RATs, having extreme capacity at their disposal, are expected to primarily target applications generating non-elastic/adaptive traffic and requiring high and guaranteed bitrates at the air interface and having no or limited application layer adaptation capabilities \cite{vannithamby2017towards,bariah2020prospective,ghosh2020nr}. Thus, the performance evaluation frameworks tailored towards mmWave and THz RATs have to take into account not only the specifics of the radio part and stochastic factors related to the randomness of UE locations, but the traffic service dynamics at BSs by joining the tools of stochastic geometry and queuing theory.
The goal of this manuscript is to provide a comprehensive tutorial on mathematical performance analysis of prospective mmWave and THz RAT deployments supporting non-elastic/adaptive traffic and implementing advanced capabilities for improving service reliability at the air interface. To this aim, we first provide an exhaustive survey of analytically tractable models of various components utilized for building the modeling scenarios including deployment, propagation, antenna, blockage, micromobility, beamsearching, traffic, and service models for a different system and environmental conditions. We discuss the abstraction levels and parameterization techniques as well as comment on the potential pitfalls and applicability of these models to considered RATs. We also define and evaluate both user-centric and system-centric key performance indicators (KPI). For non-elastic/adaptive traffic the former are mainly related to the service reliability and include the new session drop probability and the ongoing session drop probability while the latter is defined in terms of the ratio of utilized to available resources at BSs and characterizes the efficiency of resource utilization. More detailed discussion on these KPIs is provided in Sections \ref{sect:metrics} and \ref{sect:approaches}.
Then, we introduce the structure of the generic performance evaluation framework capable of simultaneously capturing radio part details of mmWave/THz systems as well as traffic service dynamics at BSs. For flexibility reasons, the contributed framework is divided into two parts: (i) service and (ii) radio abstraction. Specifically, the latter characterizes the type of deployment and abstracts the stochastic effects of radio channel via a separate parameterization part, i.e., UE locations, blockage, and micromobility, and represents them via a predefined set of parameters in the form suitable for the queuing part. The queuing part accepts the probability mass function (pmf) of the amount of requested resources by arriving sessions and the temporal intensity of the UE stage changes induced by blockage and micromobility processes and utilizes them to produce performance metrics.
The modular structure of the framework allows for the reuse of its core models for studying various mmWave and THz deployments characterized by different scenario geometry, blocker types and their mobility, antenna arrays, micromobility patterns of applications, network associations, reliability and rate improvement mechanisms, etc. In addition to the baseline model having a single traffic type, no priorities, and no reliability improvement mechanisms, we consider in detail more sophisticated traffic service processes at BSs in incremental order of complexity, including systems with resource reservation, multiconnectivity, and models with multiple UE types and priorities. Note that additional models can be built on top of these, e.g., by uniting multiconnectivity and priorities and defining additional rules to utilize the former, one could produce a model of a network segment with multiconnectivity capabilities servicing more than a single traffic type. In overall, in this tutorial we provide our readers with building blocks that can be selected and then combined to form a comprehensive performance evaluation framework suitable for a given deployment type and use-case of mmWave/THz cellular systems.
Our main contributions are:
\begin{itemize}
\item{a comprehensive review of analytically tractable models utilized in system-level mathematical performance evaluation frameworks targeting mmWave and THz communications systems including deployment, propagation, antenna, blockage, micromobility, beamsearching, traffic and service models;
\item{compound performance evaluation methodology tailored at evaluating user- and system-centric KPIs of mmWave and THz communications systems capturing their critical specifics and consisting of two independent parts interfaced with each via a predefined set of parameters;}
\item{detailed treatment of several cases of specific service processes at BS side (baseline, multiconnectivity, resource reservation, explicit priorities) as well as examples of parameterization of the framework.}
\end{itemize}
The rest of the manuscript is organized as follows. First, in Section \ref{sect:specifics} we provide an outlook of state-of-the-art in 5G/6G cellular systems utilizing mmWave and THz band as well as overview the applications, use-cases, and traffic specifics. Further, in Section \ref{sect:approaches} we review the conventional stochastic geometry approach to performance evaluation of cellular systems, discuss its limitations for traffic pattens that are expected to be inherent for mmWave/THz5G/6G systems and formulate the basics of joint approach accounting for radio and service parts simultaneously. In Section \ref{sect:system} we introduce the mathematically tractable models of individual components of mmWave and THz communications systems. These models are further combined together in Section \ref{sect:param} providing abstraction of the mmWave/THz radio channel specifics. Queuing-theoretic service models for such systems are introduced in Section \ref{sect:perf}. Finally, conclusions and future challenges are drawn in the last section.
\section{Millimeter Wave and Terahertz Systems}\label{sect:specifics}
In this section, we start by briefly reminding the state-of-the-art and specifics of mmWave and THz systems that differentiate them from 4G LTE systems operating in microwave band. Then, we discuss two challenges requiring development of new mechanisms: (i) reliable communications over mmWave/THz systems and (ii) support of multiple traffic types in these RATs. Finally, we provide overview of applicarions, use-cases and traffic specifics for mmWave/THz cellular systems.
\subsection{5G NR mmWave Systems}
Directional wireless communications in mmWave bands is one of the most significant novelties introduced in the fifth-generation (5G) wireless networks. To this aim, 3GPP and ITU-R presumes the use of the two frequency ranges, up to 6 GHz (FR1) and higher than 6 GHz (FR2), where the latter mainly utilizes frequencies in the mmWave band. MmWave communications at frequencies between 24.25 GHz and 52.6 GHz allow for data exchange at the rates of several gigabits per second (Gbps) \cite{ericsson5G}. To overcome the limitation of LTE networks, the 3GPP has recently defined NR (New Radio) technology. NR exploits the mmWave band and supports new techniques such as massive Multiple Input Multiple Output (MIMO), flexibility in terms of the frame structure, target different use cases, and multiple deployment options for the Radio Access Network (RAN) \cite{polese20183gpp}. Another NR novelty with respect to LTE is the support for ultra-low latency communications at the air interface to target the sub-1 ms latency requirement.
The initial phase of the standardization process for mmWave NR was finished in 2018 and resulted in the first NR release, Release 15, standardized by 3GPP, where the support of mmWave band was limited to non-stand-alone (NSA) operation. Since that, the evolution of 5G New Radio (NR) has progressed swiftly. Release 16 was completed in early July 2020. The most notable enhancements to the existing features in Release 16 lie in the areas of MIMO design and beamforming enhancements, dynamic spectrum sharing (DSS), dual connectivity (DC), carrier aggregation (CA), and user equipment (UE) power saving functions \cite{ericssonReport1718}. Also, in July 2020, 3GPP 5G Release 15 and 16 were formally endorsed as ITU IMT-2020 5G standard \cite{ieee5GmmWave}. In addition to the utilization of sub-6GHz spectrum, Release 16 also enables stand-alone (SA) mmWave band operation.
Release 17 will introduce new features for the three main use-case families: (i) enhanced mobile broadband (eMBB), (ii) ultra-reliable low latency communications (URLLC), and (iii) massive machine-type communications (mMTC). The purpose is to support the expected growth in mobile-data traffic and customize NR for automotive, logistics, public safety, media, and manufacturing use cases. Some of the new functionalities added in Release 17 are, for instance, extended NR frequency range to allow exploitation of more spectrum, utilization of the 60 GHz unlicensed band via CA functionality, the definition of new OFDM numerology and channel access mechanism, anything reality (XR) evaluations to support various forms of AR/VR, support of reduced-capability NR UEs for mMTC.
Nowadays, 3GPP has also started to plan Release 18 and beyond. To enable large-scale mmWave network deployment, the research community still faces significant challenges, such as massive MIMO beamforming for outdoor and indoor coverage, cost-effective deployment solutions, seamless mobility with effective beam management, network and device energy efficiency, mobile device complexity, enabling bands higher than 52.6 GHz, etc. In addition to the existing challenges, there are numerous new emerging use cases for 5G mmWave NR, such as uplink-centric traffic, real-time immersive communications, positioning for IIOT, sensing. Some other notable challenges to solve are outlined in the pre-Release 18 presentation \cite{3gpp5gplans}. They include NR sidelink enhancements related to the use of unlicensed bands, power saving, relay enchantments and co-existence with LTE V2X and NR V2X technologies. Non-Terrestrial Networks evolution, including both NR and IoT aspects, together with the evolution for broadcast and multicast services, including both LTE based 5G broadcast and NR MBS (Multicast Broadcast Services), are also targeted.
For both microwave and millimeter wave bands NR provides flexible resource allocations by utilizing different sets of the so-called numerologies defining the flexible time and bandwidth allocation unit for efficient operation over large bandwidth \cite{nrmcs}. On top of this, NR received significant enhancements as compared to LTE with respect to the initial access phase, synchronization mechanism, channel modulation and coding, etc. For an in-depth description of NR radio interface, we refer to specialized two recent monographs \cite{dahlman20205g, bhattacharyya2013handbook}. For physical channel models, NR design considerations, antenna constructions, and link-budget calculation we also refer our readers to an excellent survey paper in \cite{hemadeh2017millimeter}.
\begin{figure*}[!t]
\hspace{-0mm}
\subfigure[{Different BS antenna arrays, 28 GHz}]{
\includegraphics[width=0.3\textwidth]{snrAnt.pdf}
\label{fig:effectsChannel_antenna}
}
\subfigure[{Different absorption compounds}]{
\includegraphics[width=0.3\textwidth]{abs.pdf}
\label{fig:effectsChannel_absorption}
}
\subfigure[{Different whether conditions, 28 GHz}]{
\includegraphics[width=0.3\textwidth]{snrWeather.pdf}
\label{fig:effectsChannel_whether}
}
\caption{Effect of environmental and system parameters in mmWave/THz channel performance.}
\label{fig:effectsChannel}
\vspace{-0mm}
\end{figure*}
\subsection{6G THz Systems}
Terahertz (THz) communications systems utilizing the range of frequencies from 100 GHz up until 3 THz are seen as a key technology for 6G wireless systems to meet the demands for extremely high data rates and ultra-low end-to-end latency in the next decade \cite{han2019terahertz}. However, there are still significant limitations in the ability to efficiently and flexibly handle the enormous amount of QoS/QoE-compliant data. This data will be exchanged in a future Big-data-driven society, along with the requirements of ultra-high data rates and near-zero latency. Thus, terabit-per-second wireless communication and the support of backhaul network infrastructure are expected to be the leading technological trends over the next ten years and beyond \cite{terranova}.
The standardization process of THz cellular air interface is still in its infancy. Nevertheless, the standardization process of future wireless communication systems in THz bands had already been initiated by the Interest Group on THz communication under the IEEE 802.15 umbrella in early 2008. By 2013, the IEEE 802.15 WPAN Task Group3-D 100 Gbit/s Wireless (TG 3d 100 G) was established to create a 100 Gbit/s wireless communications standard in the 275-325 GHz band. As a result of this group's work, the IEEE 802.15.3d-2017 wireless standard \cite{ieee802153d}, operating in the 300 GHz band, was formally approved and published in fall 2017 \cite{petrov2020ieee}.
The standard includes a new physical layer based on IEEE 802.15.3-2016, MAC based on IEEE 802.15.3e-2017, 8 different channels with bandwidth multiples of 2.16 GHz to 69.12 GHz. It also allows for multiple modulation and coding schemes. The standard covers applications of THz communication systems such as kiosk loading, wireless backhauling and fronthauling, in-device communications, and wireless channels in data centers. The Application Requirements document within IEEE 802.15.3d also defines use-cases and system performance and functionality requirements for the application-based approach. The standard also supports single carrier mode and OOK mode at the physical layer. In addition, the Channel Modeling Document summarizes channel propagation characteristics for target scenarios and proposes application-based channel models highlighting that propagation losses are much heavily affected by atmospheric absorption as compared to mmWave band \cite{tekbiyik2019terahertz}. Future steps for the standard should investigate interference in the bands defined by the ITU-R for use by applications such as radio astronomy, Earth exploration satellites, and space research services.
THz bands allow high-speed data transmission of up to 100 Gbps for short-range communications. However, system designers still face numerous challenges such as channel modeling, transceiver design, antenna design, signal processing, upper layer protocols, macro- and micro-mobility implications, and security. These challenges are expected to be explored within 3GPP over the next decade to specify a new air interface technology for 6G cellular systems.
\subsection{mmWave/THz Design Challenges}
\subsubsection{mmWave/THz Propagation Challenges}
In addition to the advantages, the use of mmWave/THz brings a number of problems stemming from the frequency band in use. The reason lies in the specific characteristics of radio wave propagation including high propagation losses, atmospheric and rain absorption, low diffraction, higher scattering due to the roughness of materials, high penetration losses through objects. However, many of these disadvantages can be effectively solved, which will allow the use of a new frequency spectrum for 5G communication networks.
First, according to the standard Friis propagation model, an increase in carrier frequency leads to a significant increase in propagation losses \cite{rappaport1996wireless, steinberg1976principles}. Increasing the carrier frequency by an order of magnitude increases propagation losses by 20 dB, which can be effectively offset by the means of beamforming. This effect is illustrated in Fig. \ref{fig:effectsChannel_antenna} as a function of distance for a given set of antenna array elements. Note that the use of antenna arrays also makes it possible to significantly increase the potential coverage area of one BS.
The additional component in signal attenuation is caused by absorption in the atmosphere \cite{smith1982centimeter, liebe1987millimeter}. The main components responsible for absorption in the considered frequency range are oxygen and water vapor. The absorption data for mmWave and THz bands are shown in Fig. \ref{fig:effectsChannel_absorption}. The absorption by oxygen is exceptionally high reaching 15 dB/km at 60 GHz frequency \cite{reber1968oxygen}. However, in general, absorption is insignificant both for indoor communications and for urban cellular deployments, where the distance between BSs is limited to a few hundred of meters. Furthermore, to some extent, this kind of absorption is beneficial since it allows you to reduce the interference from BSs utilizing the same frequency channel.
\begin{table}[b!]
\vspace{-2mm}
\renewcommand{\arraystretch}{1.0}
\centering
\caption{Impact of environment on mmWave propagation \cite{ometov2019packet}}
\begin{tabular}{lll}
\hline
Type&Value&Measurements\\
\hline\hline
Rain &$50$ mm/hr&$<$10 GHz: 1-6 dB/km, $>$10 GHz: 10 dB/km\\
\hline
Fog&0.5g/m$^3$&50 GHz: 0.16 dB/km, 81 GHz: 0.35 dB/km\\
\hline
Snow&$700$g/m&35-135 GHz: 0.2-1 dB/km\\
\hline
Foliage&0.5$m^2$/m$^3$& 28.8, 57 GHz: 1.3-2.0 dB/m, 73 GHz: 0.4 dB/m\\
\hline
\end{tabular}
\label{tab:effects}
\end{table}
Additionally, effects of weather conditions on the propagation of millimeter waves are fairly well investigated so far \cite{brooker2007seeing}, see Table \ref{tab:effects}. The most significant influence is exerted by foliage, in the presence of which in the channel, the magnitude of the signal drop reaches 2 dB/m. Losses caused by heavy snow, fog and clouds are quite insignificant (less than 1 dB/km). Rain usually has an additional attenuation of about 10 dB/km, which can seriously affect the wireless channel performance, which is illustrated in Fig. \ref{fig:effectsChannel_whether}. High directionality partially addresses this problem.
Finally, mmWave/THz bands are characterized by much smaller diffraction as compared to microwave frequencies, leading to the frequent blockage situations induced by large static objects in the channel such as buildings \cite{umi}, and mobile entities such as vehicles and humans \cite{gapeyenko2019spatially,gapeyenko2016analysis,gapeyenko2019spatially}.
Particularly, dynamic blockage introduces additional losses of about 15-40 dB \cite{slezak2018empirical, maccartney2017rapid}. The received signal power degradation caused by a human body blockage of the line-of-sight (LoS) path is demonstrated further in Fig. \ref{fig:pathGain}, in Section \ref{sect:system}, where we discuss blockage modeling principles. Notably, the signal power drop is quite sharp, taking about 20-100 milliseconds. Blockage duration depends on the density of dynamic blockers and their speed and can take longer than 100 ms \cite{gapeyenko2017temporal}. It should be noted that when there is no LoS path, the use of reflected signal paths may not provide sufficient signal power. For example, reflection from rough surfaces, such as concrete or bricks, may attenuate mmWave/THz signal by 40-80 dB \cite{etsitr138}.
The extreme propagation losses in mmWave/THz bands increasing as a power function of the frequency naturally call for massive antenna arrays featuring tens and even hundreds of elements \cite{akyildiz2016realizing,bjornson2019massive}. These arrays will operate in a beamforming regime \cite{ali2017beamforming} and be capable of creating very directional radiation patterns with the half-power beamwidth (HPBW) values reaching few degrees for mmWave systems down to a fraction of degree for THz links \cite{singh2020design,han2021hybrid}. The later feature is vital for mmWave/THz communications systems not only allowing to overcome severe path losses but ensuring an almost interference free environment even for extreme deployment density of base stations (BS) \cite{petrov2017interference}. However, as a side effect, these high directivities bring additional challenges. First of all, they lead to large beamforming codebooks, especially for THz systems, drastically increasing the beamsearching time. Secondly, in THz communications systems, in addition to macromobility, micromobility manifesting itself in fast UE displacements and rotations have to be considered \cite{hur_dynamic_mmWave,petrov2018effect,kokkoniemi2020impact}. This phenomenon happens during the communications process may cause frequent misalignments of the highly-directional THz beams, resulting in fluctuations of the channel capacity and outages \cite{peng_dynamic_thz}.
\subsubsection{Reliable Communications and Session Continuity}
As opposed to previous generations of cellular systems, mmWave and THz RAT in 5G/6G systems will mostly target bandwidth-greedy new applications such as VR/AR, uncompressed video, holographic telepresence, and multimedia-rich extended reality (XR) services \cite{hu2021vision,vannithamby2017towards,agiwal2016next}. For such systems, not only uninterrupted network connectivity, but other quality of service (QoS) parameters such as guaranteed bitrate and latency become critical. Thus, we now proceed to discuss approaches recently proposed for improving session continuity in mmWave/THz systems.
The blockage events in mmWave/THz systems may lead to two principally different effects. When the signal-to-noise plus interference ratio (SINR) falls below a predefined threshold, the UE suffers from outage conditions. The outage probability depends on many system parameters including propagation conditions, receiver sensitivity, utilized power, as well as antenna arrays at both BS and UE. The effect of micromobility is similar in nature and is heavily affected by the type of application utilizing the wireless channel \cite{petrov2018effect}. To ensure uninterrupted service in mmWave/THz deployments, one may utilize multiconnectivity operation standardized by 3GPP \cite{3gpp_MC}. According to it, UE is capable of maintaining multiple connections with the nearest BSs within the same RAT. These connections can be utilized for data transmission simultaneously. Even when only one of these connections may be utilized at a time, the packet flow can be rerouted to the backup connection should the current link experience outage conditions. However, the efficient use of this technique inherently requires dense deployments that may not be available at early phases of mmWave/THz systems rollouts.
Vendors and standardization bodies also consider the support of multiple RATs at the UE via multi-band multiconnectivity option \cite{holma20205g}. This approach addresses the outage problem by timely rerouting traffic to the backup connection when the currently active link becomes unusable. However, the inherent rate mismatch between RATs utilized in future 5G/6G deployments, especially, between mmWave/THz and LTE interfaces, may render this capability useless in practical use cases. Moreover, recall that the outage events caused by micromobility and blockage by small dynamic objects such as human or vehicle bodies are characterized by a rather short duration and high frequency \cite{raghavan2018spatio,petrov2020capacity,gapeyenko2017temporal}. Thus, the resulting traffic that needs to be supported at lower rate interfaces is expected to be bursty in nature. These occasional traffic spikes caused by high bitrate sessions temporarily offloaded onto lower rate interface may negatively affect the service performance of other sessions and also lead to inefficient resource utilization of the corresponding BSs. As a result, traffic protection strategies might be required.
The blockage may not lead to an outage when the SINR still remains higher than the one associated with the lowest possible MCS. In this case, even though the connection is not lost the amount of resources required to maintain the required bitrate increases drastically. To address this case, the authors in \cite{moltchanov2018improving} suggested the use of the resource reservation technique. According to it, a fraction of BS resources is reserved for sessions that are accepted for service ensuring that there is a surplus of resources for them when their state changes from non-blocked to blocked. This approach is fully localized at the BS and thus can be utilized at the early rollouts of mmWave/THz RATs when the network density is insufficient to efficiently utilize multiconnectivity operation. Furthermore, it does not require maintaining active connections to more than a single BS reducing the complexity of the UE implementation. However, by joining this technique with multiconnectivity one may attain additional gain in terms of session service performance \cite{begishev2021joint}.
\subsubsection{Traffic Coexistence}
Modern cellular systems are being developed having multiple types of traffic in mind with drastically different service requirements. As an example, the NR radio interface is expected to support at least two traffic types \cite{dahlman20205g,holma20205g}. At one extreme, there is eMBB service which is an extension of the broadband access provided in 4G LTE technology having similar service requirements. In industrial automation scenarios, 5G NR is also expected to enable specific services, such as positioning, clock synchronization, joint tasks execution. All these applications are characterized by extreme latency and reliability requirements and need to be supported via URLLC service. This implies that future BSs need to support a mixture of traffic with drastically different service requirements at the air interface. Mechanisms for supporting eMBB or URLLC in isolation are current the focus of ongoing studies, see, e.g., \cite{samuylov2020characterizing,moltchanov2018improving,begishev2019quantifying} for eMBB and \cite{mahmood2018reliability,rao2018packet,mahmood2019resource} for URLLC. Their joint support, however, requires advanced techniques at the BS side.
There have been two principally different approaches for enabling the coexistence of eMBB and URLLC at the air interface. The first one implies the use of smart scheduling techniques. This approach has been taken in \cite{anand2020joint} to formalize the optimization problem of joint scheduling of these services. While discussing their results, the authors concluded that the major impact is produced by the minimum scheduling interval utilized by the technology in question. To alleviate this limitation, several studies suggested the use of the non-orthogonal multiple access (NOMA) technique, e.g., \cite{kassab2018coexistence,dougan2019noma,kotaba2020urllc}. According to NOMA, properly encoded URLLC transmissions can be superimposed on top of already scheduled eMBB traffic and the message content can be restored at the receiving end. While this approach may indeed drastically reduce the latency, the reliability of communications still remains a challenging problem. On top of this, the intended UEs need to be always awake to receive the intended transmissions.
An alternative approach is based on explicit resource allocation and prioritization techniques. When the minimum scheduling interval allows for satisfying latency constraints, one may utilize, e.g., network slicing techniques at the air interface to explicitly allocate a part of resources to URLLC traffic \cite{sallent2017radio,popovski20185g,koucheryavy2021quantifying}. However, as a load of URLLC traffic may not be known in advance this approach may result in inefficient use of resources. A viable alternative is to utilize priorities between traffic flows as illustrated in \cite{markova2020prioritized,markoval2020priority}. Compared to the resource reservation technique, this approach does not suffer from resource utilization problem but may lead to reduced service performance of eMBB flows.
\begin{comment}
\subsection{Multicasting}
High directionality of the antenna radiation patterns is considered to be one of the crucial advantages of future NR systems, allowing for planar directivity of under $1^{\circ}$ with linear arrays of $128\times{}4$ or more antenna elements \cite{jeong2018recent,sadhu2018128}. The net effect is the significant extension of coverage from a single NR access point (AP) \cite{rappaport2013millimeter} as well as the possibility to operate closer to the noise-limited mode \cite{andrews2014will}. While being essential for unicast sessions, the use of extreme antenna directivities may however result in inefficient resource utilization when serving multicast traffic. Particularly, the smaller the half-power beamwidth (HPBW) of the antenna array is, the fewer the number of multicast user equipment (UE) nodes is, which can be served simultaneously by a single antenna configuration in a single transmission. Hence, a number of multicast transmissions disseminating the same content needs to be supported at the NR APs resulting in the inefficient use of radio resources.
The problem of multicasting in mmWave systems has been addressed in several recent studies. The authors in \cite{kim2012rate} addressed the matter of rate adaptation in 60GHz IEEE 802.11ad systems by optimizing delay performance of user sessions. Their solution is based on a max-min problem formulation and leads to a convex programming problem. In \cite{park2013incremental}, the issue of grouping the UEs based on their proximity has been tackled. The corresponding heuristic algorithm is based on a consecutive testing of different HPBWs that maximize the sum-rate of the system. Among other conclusions, the authors demonstrated that the use of fixed HPBW might lead to non-optimal resource usage. A similar approach was proposed in \cite{feng2017multicast}. The optimization framework developed in \cite{sundaresan2009optimal} not only operates with HPBW but also accounts for unequal power-sharing among beams.
A complex multicast multiplexing scheme based on non-orthogonal multiples access (NOMA) was proposed and analyzed in \cite{zhang2017non}. However, the utilization of NOMA-based access in NR deployments is still under discussion by 3GPP. Finally, the problem of multicast transmissions in systems with directional antennas was recently addressed by \cite{biason2017multicast}. In that study, the authors proposed and analyzed several transmission schemes that target delay minimization of packet delivery. This literature review indicates that the research community recognizes the challenge of multicasting using directional antennas. However, to the best of our knowledge, none of the works completed so far has addressed simultaneous support of both multicast and unicast traffic types in mmWave-based NR layouts. Accordingly, the matter of optimized NR system configuration for serving a mixture of multicast and unicast sessions requires a more detailed investigation.
\end{comment}
\subsection{5G/6G Services, Use-Cases and Traffic Specifics}
\subsubsection{5G/6G Services}
The advent of 5G/6G cellular systems could radically improve the customer experience, but it poses new challenges for network operators, device manufacturers, and telecommunications infrastructure: (i) UEs will require redesign or upgrades to ensure that they properly meet the higher data rates and power requirements, (ii) UEs may become more sophisticated to meet consumer expectations for small and miniaturized devices, thus, reliability and miniaturization of component technology will become a necessity, (iii) higher data transfer rates will mean higher device temperatures, which will cause performance and safety issues and will require more efficient power utilization and longer battery lifetime.
5G addresses the challenges of latency, power consumption, hardware complexity, bandwidth, and reliability. For example, the challenges of requiring eMBB and URLLC are being addressed with 5G networking technologies. In contrast, future 6G technology will be developed in a holistic manner to jointly meet extremely demanding network requirements (e.g., ultra-high reliability, capacity, efficiency, and low latency) given the projected economic, social, technological, and environmental context by 2030. To this aim, below, we present the characteristics and anticipated requirements of use cases that, because of their generality and complementarity, are believed to represent future 6G services. For similar outlook of 5G requirements we refer to ITU-R M.2410 \cite{series2017minimum} and also for the assessment of the current evolution of 5G systems provided in recent studies, e.g., \cite{henry20205g,fuentes20205g}.
\begin{figure}[!t]
\vspace{-0mm}
\centering
\includegraphics[width=1.0\columnwidth]{applications_5G_6G.pdf}
\caption{Illustration of typical applications in 6G.}
\label{fig:typicalApps}
\vspace{-2mm}
\end{figure}
KPIs for analyzing and evaluating 6G wireless networks include high growth in peak data rates, data rates, traffic throughput, connection density, latency and mobility, as well as the use of additional spectrum and energy efficiency, and presents the following requirements \cite{key_technolog6G}:
\begin{itemize}
\item{the user peak data rate is not less than 1 $Tbit/s$, which is 100 times higher than that of 5G; for some scenarios, such as backhaul and direct transmission in THz band (x-haul), the peak data rate is expected to reach 10 $Tbit/s$;}
\item{the user data rate is 1 $Gbps$, which is 10 times faster than 5G; it is also expected to provide data rates of up to 10 $Gbps$ for some scenarios such as indoor access;}
\item{delay at the air interface is expected to be 10-100 $\mu{}s$ at high mobility speeds reaching 1000 $km/h$ -- this will provide acceptable QoE for scenarios such as hyper-high-speed railway (HSR) and aviation systems;}
\item{the number of connections is ten times higher than that of 5G -- this will allow achieving up to $10^2$ devices/$km^2$ and zone throughput up to 1 $Gb/s/m^2$ for scenarios such in highly crowded conditions;}
\item{energy efficiency is expected to be 10-100 times and spectral efficiency -- 5-10 times higher than 5G.}
\end{itemize}
Mobile Internet and Internet of Everything (IoE) are considered to constitute a powerful platform for the development of 6G to support holographic and high-precision communication, tactile applications to provide a full sensory experience (such as sight, hearing, smell, taste and touch). Achieving these factors requires processing very large amounts of data in near real-time with extremely high throughput (approximately Tb/s) and low latency. In addition, 6G wireless networks will provide \cite{key_technolog6G}: (i) support of ultra high definition (SHD) and ultra high definition (EHD) video with ultra high bandwidth, (ii) guaranteed connection with extremely low latency (approximately 10 $\mu{}s$) for the industrial Internet, (iii) support for the IoT of nano-things through intelligent wearable devices provided by implantable nano-devices and ultra-low-power nanosensors (on the order of picowatts, nanowatts and microwatts), (iv) support for space and underwater communications to expand the boundaries of human activity to make space travel and explore hard-to-reach sea depths, (v) setting up uniform service in new scenarios and applications such as ultra high speed rail (HSR), (vi) significantly improved vertical 5G applications such as the massive Internet of Things (IoT) and fully autonomous vehicles.
\begin{table}[t!]
\vspace{-6mm}
\renewcommand{\arraystretch}{1.0}
\centering
\caption{The network features of 5G and the future 6G} \cite{key_technolog6G}
\addtolength{\tabcolsep}{-4.5pt}
\begin{tabular}{l|ll}
\hline
\multicolumn{1}{c}{\textbf{Type}} &
\multicolumn{1}{c}{\textbf{5G}} & \multicolumn{1}{c}{\textbf{6G}} \\
\hline\hline
\begin{tabular}[c]
{@{}l@{}}\textit{Usage}\\
\textit{Scenarios}
\end{tabular} &
\begin{tabular}[c]
{@{}l@{}}• eMBB \\• URLLC \\• mMTC~~
\end{tabular} &
\begin{tabular}[c]
{@{}l@{}}• FeMBB \\• URLLC \\• umMTC\\• LDHMC \\• ELPC~~
\end{tabular} \\
\hline
\textit{Applications} &
\begin{tabular}[c]
{@{}l@{}}• VR/AR/360° Videos\\• UHD Videos\\• V2X\\• IoT\\• Smart City/Factory/Home\\• Telemedicine\\• Wearable Devices
\end{tabular} &
\begin{tabular}[c]
{@{}l@{}}• Holographic Society\\• Tactile/Haptic Internet\\• Sensory Sensing/Reality\\• Fully Automated Driving\\• Industrial Internet\\• Space Travel\\• Deep-Sea Sightseeing\\• Internet of Nano-Things
\end{tabular} \\
\hline
\begin{tabular}[c]
{@{}l@{}}\textit{Network}\\
\textit{Characteristics}
\end{tabular} &
\begin{tabular}[c]
{@{}l@{}}• Cloudization\\• Softwarization\\• Virtualization\\• Slicing
\end{tabular} &
\begin{tabular}[c]{@{}l@{}}• Intelligentization\\• Cloudization\\• Softwarization\\• Virtualization\\• Slicing
\end{tabular} \\
\hline
\begin{tabular}[c]
{@{}l@{}}\textit{Peak }\\
\textit{Data Rate}
\end{tabular} & 20 Gb/s~~ & ≥1 Tb/s \\
\hline
\begin{tabular}[c]
{@{}l@{}}\textit{Experienced}\\
\textit{Data Rate}
\end{tabular} & 0.1 Gb/s & 1 Gb/s \\
\hline
\begin{tabular}[c]
{@{}l@{}}\textit{Spectrum}\\
\textit{Efficiency}\end{tabular} & 3× that of 4G~~ & 5–10× that of 5G~~ \\
\hline
\begin{tabular}[c]
{@{}l@{}}\textit{Network}\\
\textit{Energy}\\
\textit{Efficiency}\end{tabular} & 10–100× that of 4G~~ & 10–100× that of 5G~~ \\
\hline
\begin{tabular}[c]
{@{}l@{}}\textit{Area Traffic}\\
\textit{Capacity}
\end{tabular} & 10 Mb/s/$m^2$~~ & 1 Gb/s/$m^2$~~ \\
\hline
\begin{tabular}[c]
{@{}l@{}}\textit{Connectivity}\\
\textit{Density}
\end{tabular} & $10^6$ Devices/$km^2$~~ & $10^7$ Devices/$km^2$~~ \\
\hline
\textit{Latency} &
\begin{tabular}[c]{@{}l@{}}1 ms \\~
\end{tabular} & 10–100 µs\\
\hline
\textit{Mobility}& 500 km/h~~ & ≥1,000 km/h~~ \\
\hline
\textit{Technologies} &
\begin{tabular}[c]
{@{}l@{}}• mmWave Communications\\• Massive MIMO\\• LDPC and Polar Codes\\• Flexible Frame Structure\\• Ultradense Networks\\• NOMA\\• Fog/Edge Computing\\• SDN/NFV/Network Slicing~~
\end{tabular} &
\begin{tabular}[c]
{@{}l@{}}• THz Communications\\• SM-MIMO\\• LIS and HBF\\• OAM Multiplexing\\• Laser and VLC\\• Blockchain Sharing\\• Quantum Comm. \\• AI/Machine Learning~~
\end{tabular} \\
\hline
\end{tabular}
\label{tab:key_application}
\end{table}
Therefore, the typical scenarios are shown in Fig. \ref{fig:typicalApps} and in Table \ref{tab:key_application} (ELPC -- extremely low-power communications, FeMBB -- further-enhanced mobile broadband, LDHMC -- long-distance and high-mobility communications, NFV -- network function virtualization, SDN -- software-defined networking, UHD -- ultra-high definition, umMTC -- ultra-massive machine-type communications, V2X -- vehicle to everything; LDPC -- low-density parity check codes) should be supported in 6G networks. 6G technology extends eMBB, URLLC, and mMTC services further to their extremes simultaneously introducing new edges to the baseline 5G service triangle with long distance, extremely high-speed, and ultra low power communications.
\subsubsection{(F)eMBB Use-Cases and Applications}
In this work, we will mainly focus on eMBB services for 5G networks and FeMBB services for 6G systems. These services will have to provide both higher bandwidth as compared to 4G systems in densely populated areas and expanded coverage for those on the move. Next, we will define the main use-cases of (F)eMBB services for current 5G and future 6G networks. Three typical use-cases for 5G eMBB service are:
\begin{enumerate}
\item{\textit{Enhancing the Fan Experience.} This is an example of public places such as stadiums and arenas, where thousands of fans simultaneously connect to the Internet and share their experiences using apps on their mobile devices. In this case, the demand for connection and more bandwidth grows exponentially. With situations like this, eMBB can handle and provide users with improved broadband access in densely populated areas. Enhanced video capabilities combined with improved network bandwidth can provide fans with real-time mobile access. It will also allow fans to upload videos of their stadium experiences to social media in real time and share them outside of the stadium.}
\item{\textit{Smart/Safe Cities.} eMMBs can improve security by placing AR/VR-enabled video devices in strategic locations that were previously not possible with legacy 4G technology. Traffic flow monitoring and instant AI analysis views can save the seconds needed to send paramedics to the scene of a car accident. Police services, tow trucks, and other service vehicles, also unmanned aerial vehicles, may be dispatched earlier at the same time. This will allow to quickly eliminate the violation and restore normal traffic flow. Traffic signals can be linked to the flow of cars to eliminate traffic jams on the street.}
\item{\textit{An Untethered Virtual Experience.} The eMBB will support the key functions of our day-to-day work -- and it will do so wirelessly. From people who use cloud applications while commuting to work, employees who communicate with the office, to an entire smart office where all devices are connected wirelessly, 5G will connect and make our work easier.}
\end{enumerate}
We will now proceed by presenting the overview of the eMMB service application for 6G networks. For such services, we highlight the following main applications (see Fig. \ref{fig:typicalApps} and Table \ref{tab:key_application}): Holographic Verticals and Society, Tactile/Haptic Internet, Full-Sensory Digital Sensing and Reality:
\begin{enumerate}
\item{\textit{Holographic Verticals and Society.} Holographic communication is the next evolution in multimedia, delivering 3D images from one or more sources to one or more destinations, providing an immersive 3D experience for the end user. The possibility of interactive holography on the web will require a combination of very high data rates and ultra-low latency. The first arises from the fact that the hologram is composed of several three-dimensional images, and the second is based on the fact that parallax is added so that the user can interact with the image, which also changes depending on the position of the viewer. This is essential for providing an immersive 3D user experience \cite{6g_dohler}.\\
Note that there are significant problems in the implementation of holographic communications, especially, in connection with their widespread use. These problems arise at all stages of holographic video systems and extend from signal generation to display. As far as we know, there are no standards for how to transfer data to a display. Recording digital holograms is another problem, as specialized optical installations may be required. Computer-generated holograms require significant computational resources compared to classical image rendering due to the many-to-many relationship between the source and hologram pixels. The high bit rates required do not take advantage of established compression methods such as the Joint Photographic Experts Group (JPEG)/Moving Image Experts Group (MPEG) since the statistical properties of holographic signals are very different from video images.}
\item{\textit{Tactile/Haptic Internet.} After using holographic communication to transmit a virtual vision of people close to real species, events, the environment, it will be very convenient to remotely exchange physical interaction via the tactile Internet in real time. Many applications fall into this category. Consider the following examples \cite{6g_dohler}:}
\begin{itemize}
\item{\textit{Robotization and Industrial Automation:} We are on the cusp of a revolution in manufacturing, driving networks that facilitate communication between people and between people and machines in Cyber Physical Systems (CPS). This so-called Industry 4.0 vision enables the development of new applications. This approach requires communication between large connected systems without the need for human intervention. Remote production control is based on the management and control of industrial systems in real time. Robotics will need guaranteed real-time control to avoid oscillatory motion. Advanced robotics scenarios in manufacturing require a maximum target latency of 100 $\mu{} s$ and a round trip time of 1 ms. Human operators can control remote machines using virtual reality or holographic communication, and are assisted by tactile sensors, which can also include triggering and control through kinesthetic feedback;}
\item{\textit{Autonomous driving:} Through communication and coordination between vehicles (V2V) or between vehicles and infrastructure (V2I), autonomous driving can lead to a significant reduction in road accidents and congestion. However, collision avoidance and remote driving will likely require a delay of the order of a few milliseconds.}
\end{itemize}
\end{enumerate}
\subsubsection{5G/6G Traffic Specifics}
Performance assessment of 4G and older cellular systems is conventionally assessed by utilizing the stochastic geometry \cite{haenggi2012stochastic,haenggi2009stochastic,blaszczyszyn2018stochastic}. The rationale is that those systems mainly target adaptive applications with appropriate transport layer (via TCP rate feedback) or application layer (via application layer rate control) adaptivity to constantly changing the wireless channel and available resources conditions. Contrarily, current 5G and future 6G systems primarily target non-elastic/adaptive traffic rate-greedy with limited adaptation capabilities such as VR/AR, tactile Internet, holographic telepresence, etc, \cite{hu2021vision,vannithamby2017towards,agiwal2016next}.
In our paper we mainly concentrate on non-elastic/adaptive applications that may not tolerate outage and rate degradation. The principal difference compared to elastic/adaptive traffic is that these sessions require time-varying amount of resources in spontaneously changing channel conditions, especially, under blockage and micromobility impairments. As a result, new approaches that are capable of accounting for channel conditions and resource allocations need to be developed.
\section{Modeling Principles of THz/mmWave Systems}\label{sect:approaches}
In this section, we briefly overview the basic principles of stochastic geometry analysis of cellular systems that is still utilized as one of the tools for radio part characterization in joint new frameworks suitable for mmWave/THz systems. Then, we proceed by assessing the current state-of-the-art in queuing models providing the abstraction of dynamic resource allocation at mmWave/THz BSs. Finally, we briefly sketch the basic principles of the new frameworks required for performance assessment of non-elastic/adaptive applications.
\subsection{Stochastic Geometry Approach}
\subsubsection{Random Variable Transformation Technique}
Stochastic geometry operates with random events in two- or three-dimensional space representing locations of BSs and UEs. To this aim, it utilizes spatial point processes (Poisson, Matern, etc.), as well as random graphs and spatial tessellations (for example, Dirichlet tessellations leading to Voronoi cells) to simulate BS service areas. The main probability theory tool the stochastic geometry is based upon is the functional transformation of random variables (RV). Recall, that given the joint probability density function (pdf) $w_n(x_1,\dots,x_n)$ of RVs $\{\psi_1,\dots,\psi_n\}$ and Jacobian of functional transformation from $\{\psi_1,\dots,\psi_n\}$ to $\{\nu_1,\dots,\nu_n\}$,
\begin{align}
J=\frac{\partial{}(x_1,\dots,x_n)}{\partial{}(y_1,\dots,y_n)}=
\left|\begin{matrix}
\frac{\partial{}x_1}{\partial{}y_1}&\dots&\frac{\partial{}x_1}{\partial{}y_n}\\
\vdots&\dots&\vdots\\
\frac{\partial{}x_n}{\partial{}y_1}&\dots&\frac{\partial{}x_n}{\partial{}y_n}.\\
\end{matrix}\right|,
\end{align}
then the sought joint pdf is given by \cite{ross,samuylov2015random}
\begin{align}\label{eqn:meth_RVtrans}
W_n(y_1,\dots,y_n)=\sum_{k}w_n(x_{1k},\dots,x_{nk})|J|,
\end{align}
where $x_{ik}=(y_1,\dots,y_n)$, $i=1,2,\dots,n$, is $k$-th branch of inverse function.
When in the original set of RVs we have $m<n$, i.e., $\{\nu_1,\dots,\nu_m \} $, then the system (\ref{eqn:meth_RVtrans}) must be supplemented with $m-n$ RVs $\nu_j=\psi_j$, $j=m+1,\dots,n$. Then, the joint pdf is obtained by integrating over the variables $y_{m + 1},\dots,y_n$ as
\begin{align}
W_n(y_1,\dots,y_m)&=\int\dots\int\sum_{k}w_n(x_{1k},\dots,x_{nk})\times{}\nonumber\\
&\times{}|J|d_{y_{m+1}}\dots{}d_{y_n}.
\end{align}
For example, the distance from a random point to the $i$-th neighbor in the Poisson field of BSs obeys the Gamma distribution with a pdf \cite{moltchanov2012distance}
\begin{align}\label{eqn:distancePoissonProcess}
f_{i}(x)=\frac{2(\pi\lambda)^{i}}{(i-1)!}x^{2i-1}e^{-\pi\lambda{}x^{2}},\,x>0,\,i=1,2,\dots.
\end{align}
Now, one can determine the received power from the nearest UE by utilizing the model of the $i$-th BS at the receiver by applying the propagation model in the form $P(x)=Ax^{-\zeta}$, where $x$ is the distance between the receiver and the transmitter, $\zeta$ is the attenuation constant, $A$ -- a constant that depends on the properties of the transmitter, receiver and carrier frequency. Specifically, the inverse function and the modulus of its derivative are
\begin{align}
G(y)=P^{-1}(x)=\left(\frac{y}{A}\right)^{-1/\zeta },\,G'(y)=\frac{\left(\frac{y}{A}\right)^{-\frac{1}{\zeta }-1}}{A \zeta }.
\end{align}
Thus, by applying (\ref{eqn:meth_RVtrans}) the received power from the $i$-th BS can be written as
\begin{align}
f_{i}(y)&=\frac{2(\pi\lambda)^{i}}{(i-1)!}\left(\frac{y}{A}\right)^{-(2i-1)/\zeta }e^{-\pi\lambda{}\left(\frac{y}{A}\right)^{-2/\zeta }}\times{}\nonumber\\
&\times{}\frac{\left(\frac{y}{A}\right)^{-\frac{1}{\zeta }-1}}{A \zeta },\,y>0,\,i=1,2,\dots.
\end{align}
For fairly simple scenarios, for example, the triangle scenario with one receiver-transmitter pair and one source of interference, considered in, e.g., \cite{samuylov2015random}, or for a part of cellular network with six sources of interference, considered in \cite{etezov2016distribution}, or in indoor premises, also with a limited number of interference sources, see \cite{samuylov2017analytical}, the use of this method allows you to obtain pdfs of basic characteristics of communication channels, such as signal-to-interference ratio (SIR), SINR, spectral efficiency, and data rate. However, such simple stochastic geometry models become more complicated in the case of UEs movement as shown e.g., \cite{orlov2017time,fedorov2017sir} or when the number of interference sources is RV itself, \cite{petrov2017interference,kovalchukov2018evaluating,kovalchukov2018analyzing}.
\subsubsection{Random Field of Interferers}
In those cases, where the number of interference sources is a RV, the use of the transformation of RVs does not allow obtaining closed-form expressions for the metric of interest. Consider the example where BSs operating at the same frequency are distributed according to the Poisson process over the plane with some intensity $\lambda$. The UEs associated with the BSs are located at a fixed distance from the receivers, $r_0$. Consider some randomly selected receiver and some metric, e.g., SIR, that can be written as $S(x)=\frac{C_0}{C_1+I}$, where $C_0$ is a constant that determines the level of the received power from BS located at a fixed distance $r_0$ from the receiver, $C_1$ is a constant that takes into account transmission and reception losses, $I$ is the total interference from the field of interference sources,
\begin{align}\label{eqn:metrics02}
I=C_2\sum_{i=1}^{\infty}R_{i}^{-\zeta},
\end{align}
where $C_2$ is a constant that takes into account the transmit and receive gains, $\zeta$ is a path loss exponent, $R_i$ is the distance from the interfering BS to UE.
In the considered scenario, $R_i$ are RVs whose distributions obey the generalized Gamma distribution in (\ref{eqn:distancePoissonProcess}). Using the RV transformation technique one may determine pdf of the interference from any $i$-th BS. However, the aggregate interference is a random sum of RVs, where each component has its own distributions. In this case, one may utilize the Campbell's theorem \cite{chiu2013stochastic}, to obtain the moments of interference as
\begin{align}\label{eqn:meth_campbell}
E[I^{n}]=\int_{r_{B}}^{D}(C_2r^{-\zeta})^{n}2\lambda\pi{}rdr,
\end{align}
where $r_B$ is the minimum distance from the UE, where interfering BS might be located, $D$ is the maximum distance, where interference is non-negligible, $2\lambda\pi{}r$ is the probability that there is interfering BS at the $dr$ increment of circumference.
The result in (\ref{eqn:meth_campbell}) can be extended to accommodate LoS blockages, antenna directivity, 3D deployments, random BS and UE heights, and non-Poisson distribution of BSs, etc. as shown in \cite{petrov2017interference,kovalchukov2018evaluating,kovalchukov2018analyzing}.
Further, to obtain estimates of the moments of the SIR, SINR, spectral efficiency, and data rate, one may again utilize RV transformation technique. Consider as an example SIR function. In the absence of pdf of aggregate interference, one can use the expansion of the sought functions in a Taylor series around the mean of $I$, as shown in, e.g., \cite{petrov2017interference}. Particularly, for the mean value of the RV $Y=g(X)$, where $ X $ is a RV with mean value and variance $\mu_{X}$ and $\sigma^{2}_X$, we have
\begin{align}\label{eqn:saddle_04}
&E[Y]=g(\mu_{X})+\frac{g''(\mu_{X})}{2}\sigma^{2}_X,\nonumber\\
&\sigma^{2}[Y]=[g'(\mu_{X})]^{2}\sigma^{2}_X-\frac{1}{4}[f''(\mu_{X})\sigma^{2}_X]^2.
\end{align}
Note that the obtained moments can be further utilized to construct probabilistic bounds on the considered metrics of interest by applying, e.g., Markov, Chebyshev, and Hoeffding inequalities \cite{wasserman2004inequalities}. As an alternative, one may also utilize Laplace-Stieltjes transform technique to get transforms of SIR, SINR, and rate metrics. However, these transforms can rarely be converted back to the RV domain.
\subsubsection{Rate Approximations}
Stochastic geometry can also be used to estimate the rate provided to UEs in the presence of competing users. However, for such an assessment, one needs to make additional assumptions about the resource allocation between UEs. Assume, for example, that in the BS service area of radius $R$ there the number of active UEs are distributed according to Poisson's distribution with the parameter $\lambda\pi{}R^2$, where $\lambda$ is the density of users per squared meter. Let us also assume that the location of each user is uniformly distributed in the BS coverage area, and the available frequency band, $B$, is evenly distributed among UEs. This scenario corresponds to the deployment of BSs in the Poisson field of active UEs with the intensity $\lambda$. In this deployment, the bandwidth available to a UE additionally ``thrown'' into the service area of BS is provided by $B/i$ with Poisson probability
\begin{align}\label{eqn:meth_poissonPr}
p_{i}=\frac{(\lambda\pi{}R^2)^{i}}{i!}e^{-\lambda\pi{}R^2},\,i=1,2,\dots,
\end{align}
while the achieved rate in the presence of $i$ competing users can be determined by transforming a RV describing the distance from the user to the BS, $f_X(x)=2x/R^2$, $x>0$, according to the Shannon rate, i.e.,
\begin{align}
C_i=\frac{B}{i}\log_{2}[1+S(x)],\,i=1,2,\dots,
\end{align}
where $S(x)$ is the SNR at a distance $x$ from the BS. The final result can be obtained by summing up the rates corresponding to $i$ users in the service area, weighted by the coefficients (\ref{eqn:meth_poissonPr}).
\subsubsection{Limitations of Stochastic Geometry}
Note that the considered scenario can be extended to the case of resource allocations between competing UEs. For example, max-min resource sharing, which equalizes user speeds, or proportional sharing, which gives priority to users who are in more favorable conditions, can be obtained by introducing additional weighting factors, see, e.g., \cite{moltchanov2014optimal,gerasimenko2015cooperative}. It is also possible to extend it further to the $\alpha$-weighted priority, where the operator has the ability to control the sharing of speeds between users, as shown in \cite{gerasimenko2016adaptive}. Although in our work we mainly concentrate on non-elastic/adaptive traffic, we sketch the analysis for such adaptive type of traffic with mmWave/THz specifics in Section \ref{sect:adaptive}, while systems with elastic traffic are briefly outlined in Section \ref{sec:servcoefs}.
The stochastic geometry approach is still inherently limited to the case of elastic full-buffer traffic, where UE always have an infinite amount of data to transmit and may adapt its transmission rate to the current wireless channel and system conditions (i.e., number of active UEs). In the context of mmWave/THz systems, this approach is also not suitable for capturing the performance of applications sensitive to outage conditions that can be caused by either blockage or micromobility.
\subsection{Queuing-Theoretic Approach}
The session service process in systems with stochastic arrival processes, service times, and a limited amount of resources is traditionally modeled by the methods of queuing theory. To capture the resource allocation in the context of mmWave/THz systems, in addition to these specifics, the queuing-theoretical models need to be supplemented with the randomness of the amount of requested resources caused by the location of the UEs in the coverage area of BSs. While the stochastic geometry alone cannot capture resource allocation dynamics, it may complement queuing-theoretic models by abstracting the radio part characteristics to the form suitable for queuing theory. However, the methods of the queuing theory itself need to be expanded to include models capturing randomness of the amount of requested resources. Below, we briefly review the current state-of-the-art and recent developments in this direction, concentrating on the so-called resource queuing systems.
\subsubsection{Conventional Service Models}
The roots of the resource queuing systems go back to the celebrated Erlang-B and Erlang-C formulas describing the call drop probability in $M/M/C/C$ queuing system and waiting for probability in $M/M/C$ queuing system, respectively. Since then, Erlang's results have been widely used for performance analysis of communications systems. Moreover, they have been extended and generalized following technological advances.
It started with trunking -- a way to provide network access to multiple users by making them share a group of circuits. In terms of queuing theory, the process can be described by a loss service system depicted in Fig. \ref{fig:rels_1}. The system consists of $C$ servers, each of which is available to an arriving customer whenever it is not busy. Customers arrive according to a Poisson process of rate $\lambda $, i.e., interarrival times are independent and have exponential distribution with a mean $1/\lambda $. Service times are independent and have exponential distribution with a mean $1/\mu $. An arriving customer is blocked and lost if it finds all servers busy. By studying this system in 1917, Erlang derived the famous relation now known as the Erlang loss formula, or Erlang-B, which provides the probability that a call is lost
\begin{align}\label{eqn:rels_1}
E_{C} (\rho )=B=\frac{\rho ^{!} }{C!} \left(\sum _{k=0}^{!}\frac{\rho ^{k} }{k!} \right)^{-1} ,
\end{align}
where $\rho =\lambda /\mu $ is the mean number of arrivals during the mean service time, referred to as traffic intensity. This expression has seen several extensions, for example, the multi-class arrivals. As a result, generalized loss systems are suitable for modeling multi-rate circuit-switched communications and have proved useful, among other applications, for performance analysis of Time Division Multiplexing (TDM) systems, where multiple time slots can be allocated to reduce delay.
\begin{figure}[!t]
\centering
\includegraphics[width=0.4\columnwidth]{rels_1.pdf}
\caption{Erlang's loss model -- $M/M/C/C$ queuing system: exponential arrival and service processes with intensities $\lambda$ and $\mu$, finite number of servers $C$ representing currently served sessions.}
\label{fig:rels_1}
\vspace{-4mm}
\end{figure}
The Erlang formula received further development in application to multiservice broadband networks, which has resulted in a class of models named loss networks, or multiservice loss networks [Kelly, 1991; Ross, 1995]. A classical loss network is a general model of a circuit-switched network carrying multi-rate traffic. The model is well-suited for bidirectional traffic flows, because the reverse traffic for a given pair of nodes may have different bandwidth requirements. This evolved model further enabled the analysis of the first wireless general purpose telecommunication systems like GSM, which has played a pivotal role in the telecommunications revolution \cite{rappaport1996wireless}. It is a traditional circuit-switched telephony system, and that is exactly why the focus is on the call blocking probabilities as one of the key performance metrics of GSM systems.
Further technology development brings us the core technology of the fourth generation (4G) cellular networks -- LTE, with its predecessor of the third generation (3G), UMTS technology. It is substantially different from the radio access technologies of previous generations as LTE is completely packet switched with the smallest unit of resource assignment being a single physical resource block (PRB), providing highly efficient resource management for multiple users. Here, PRBs are allocated to user sessions by schedulers based upon the signal characteristics between the transmitter and receiver. Therefore, the amounts of resources (the number of PRBs) allocated to sessions vary and can be considered as random variables (more precisely, as discrete random variables). In subsequent radio access technologies, such as 5G New Radio (NR) systems operating in a millimeter-wave (mmWave) band, the resource requirement of a session can be represented by a continuous random variable. This is why performance analysis of such systems required another major modification of loss models, giving rise to loss systems with random resource requirements (ReLS). Loss systems with random resource requirements constitute the new evolution of the Erlang formula.
\subsubsection{Baseline Resource Queuing System Formalization}\label{sect:RQSformal}
The main difference between resource queuing systems and classic ones is that in the former a session upon arrival, in addition to a server, demands a random amount of limited resources, that are occupied for the duration of its service time. The resulting models can thus reflect the fact that user session requirements for the radio resources of a base station vary due to random user positioning, and, consequently, to random spectral efficiency of the transmission channel. A multi-resource ReLS, depicted in Fig. \ref{fig:rels_2}, relies on the following assumptions. Let a $C$-server loss system have $M$ types of resources of capacities given by a vector $R=(R_{_{1} } ,...,R_{M} )$. Class $k$ sessions arrive according to a Poisson process of rate $\lambda _{k} $ and have a mean service time of $1/\mu _{k} $, $\rho _{k} =\lambda _{k} /\mu _{k} $, $k=1,\ldots ,K$.
\begin{figure}[!t]
\centering
\includegraphics[width=1.0\columnwidth]{rels_2_new.pdf}
\caption{Multi-resource loss system with random resource requirements: multiple flows of sessions with arrival and service intensities $\lambda_i$, $\mu_i$, finite number of servers $C$ representing currently served sessions, and multiple resource pools modeling quantities associated with active sessions, e.g., amount of requested resources \cite{naumov2021}.}
\label{fig:rels_2}
\vspace{-4mm}
\end{figure}
The $i$-th customer of class $k$ requires an amount $r_{km} (i)$ of resources of type $m,$which is a real-valued random variable. Resource requirements ${\it r}_{k} (i)=(r_{k_{1} } (i),...,r_{k_{M} } (i))$, $i=1,2,...$, of class $k$ customers are nonnegative random vectors with a cumulative distribution function (CDF) $F_{k} (x).$An arriving customer receives service if it finds at least one server free and the required resource amounts available. Then, the required resource amounts are allocated, and the customer holds them, along with a server, for the duration of its service time. Upon departure, the allocated resources are released.
The analysis of these complicated systems can be substantially simplified by using what can be called ``pseudo-lists''. In this approach, we deal with an otherwise same service system, but the resource amounts released upon a departure are assumed random and may differ from the amounts allocated to the departing customer upon its arrival. We assume that given the totals of allocated resources -- i.e., for each resource type, the resource amount held by all customers combined -- and the number of customers in service, the resource amounts released upon a departure are independent of the system's behavior prior to the departure instant and have an easily calculable CDF. Stochastic processes representing the behavior of such simplified systems are easier to study since there is no need to remember the resource amounts held by each customer: the totals of allocated resources suffice. This fact will be crucial for more complex systems. The reason is that for more complex systems, usually, one fails to derive an analytical expression for the stationary probabilities and the equilibrium equations have to be solved numerically. The proposed short-cut approach hence permits obtaining the performance measures of the system numerically in a reasonable time.
Note, that for more complex systems, it still has not been proved that the aggregated states' probabilities of the original process equal the stationary probabilities of the corresponding simplified process. Nevertheless, we can reasonably believe that such a simplification provides a good approximation, with an acceptable error. When applied in practice, however, this assumption is to be verified, for instance through simulation.
\section{Models of Individual Radio Components}\label{sect:system}
In this section, we survey analytically tractable models of various components that can be utilized as building blocks for specifying the prospective mmWave and THz deployment scenarios. These include BS and UE locations, propagation, antenna, blockage, micromobility, beamsearching models. For each model, we discuss the level of abstraction, parameterization and comment on its applicability to considered RATs.
We would like to note that from the system-level performance modeling and characterization point of view there are no principal differences between mmWave and THz specifics as both technologies will be subject to blockage and micromobility impairments (albeit with quantitatively different impact) as well as utilize highly directional antenna arrays at both BSs and UEs sides. This implies that the same models can be utilized for both considered bands. Furthermore, these specifics are unique to mmWave/THz, making them very unreliable for prospective services as compared to legacy microwave systems such as LTE, and also constitute the main challenge for developing new service models of sessions and their mathematical models for these systems. The main difference is in quantitative values and also in propagation models that we will highlight explicitly in the discussion below.
\subsection{Deployment Models}
The choice of the deployment model, i.e., indoor/outdoor as well as BS and UE locations, for mmWave and THz systems is a more critical question as compared to microwave ones. The rationale is that now scenario geometry that involves not only deployment premises but the type of the surrounding objects that may cause blockage starts to play an important role in systems performance. Particularly, in addition to the effects of indoor and outdoor propagation the relative positioning of these objects affects the tractability of considered deployments.
Furthermore, the directionality of antenna radiation patterns coupled with inherent multi-path propagation of mmWave/THz bands forces researchers to switch from conventional two-dimensional (2D) models to more comprehensive three-dimensional (3D) ones. Finally, in addition to UE and BS locations, one should also need to specify blocker types, locations, and/or their mobility.
\begin{figure}[!t]
\centering
\subfigure[{Outdoor random deployment}]
{
\includegraphics[width=0.75\columnwidth]{deployment_fig1b.pdf}
\label{fig:randomDep}
}\\
\subfigure[{Outdoor semi-regular deployment}]
{
\includegraphics[width=0.75\columnwidth]{deployment_fig1c.pdf}
\label{fig:regularDep}
}\\
\subfigure[{Indoor regular deployment}]
{
\includegraphics[width=0.75\columnwidth]{deployment_fig1d.pdf}
\label{fig:regularDep}
}
\caption{Illustration of different deployment types.}
\label{fig:deployments}
\vspace{-4mm}
\end{figure}
\subsubsection{Outdoor Purely Random Deployments}
Following the studies of microwave LTE systems \cite{elsawy2013stochastic,elsawy2016modeling}, the early works on mmWave and THz systems performance, e.g., \cite{maksymyuk2015stochastic,di2015stochastic,petrov2017interference}, assumed purely stochastic 2D deployments, where BSs, UEs, and blockers are assumed to follow certain stochastic processes in $\Re^2$, see Fig. \ref{fig:randomDep}. Here, active UEs are often characterized as a separate process or included (as a fraction of) in the specification of blockers representing humans. Often, a homogeneous Poisson point process (PPP) is utilized for tractability reasons. Indeed, the geometric distances between points in PPP are readily available \cite{moltchanov2012distance}, the coverage area of a BS can be roughly approximated by Voronoi diagrams \cite{haenggi2009stochastic}, while the distance between BS and UE can be found assuming circle approximation of Voronoi cells.
The rationale behind the use of purely stochastic deployments is that the locations of BSs may not follow the regularity assumption (i.e., cellular deployments) and possess a certain degree of randomness as discussed in \cite{li2015statistical}. Furthermore, UE may indeed be naturally randomly distributed within the cell coverage area. Finally, the use of 2D planar deployments is warranted when antenna radiation patterns are not extremely directional in the vertical dimension. Such purely random 2D deployments may still be relevant for mmWave systems in outdoor open space conditions, where the coverage of a single BS is relatively large reaching few hundreds of meters, such as squares, parks, suburbs, etc.
Recently, extensions of these deployment models to 3D open space environments have been provided \cite{kovalchukov2018analyzing,kovalchukov2019evaluating,yi2019unified,yi2020clustered} in context of unmanned aerial vehicle (UAV) communications. Here, in addition to the planar deployment assumption, one has to characterize vertical dimension by supplying BS, UE and blocker height distributions. Assuming analytically convenient distributions such as exponential or uniform mathematically tractable models can be provided.
\subsubsection{Outdoor Semi-Regular Deployments}
As mmWave and THz BSs are characterized by much smaller coverage areas compared to sub-6 GHz BS, the impact of scenario geometry and type of the objects in the channel is expected to be profound. This concerns both outdoor and indoor environments. First, in urban street deployments, locations of BSs are no longer stochastic and likely follow regular deployment along the street, e.g., BSs are mounted on lampposts or building walls \cite{he2019channel,kumari2020optimization,begishev2018connectivity}, UE are also naturally located along the sidewalks and crossroads. In addition to humans blocking the propagation paths, vehicles moving along straight trajectories may contribute to the blockage process in mmWave and THz systems \cite{boban2019multi,park2017millimeter,petrov2020measurements,eckhardt2021channel}, see Fig. \ref{fig:regularDep}. In city squares, BSs may also be installed along the perimeter \cite{begishev2021joint,kovalchukov2018improved}. Finally, the dimensions of blockers, e.g., vehicles, can be comparable to the communications distances and thus one may need to take into account detailed blockers geometry. The latter is also critical for indoor THz system deployments \cite{chen2021channel,xing2021millimeter}.
The abovementioned specifics naturally lead to semi-regular environments with stochastic factors interrelated with deterministic ones. Particularly, the conventional Poisson process may not be applicable for modeling vehicle and pedestrian locations due to potential overlapping between adjacent objects requiring the utilization of hardcore processes. The potential specific locations of BS, i.e., building corners, walls, lampposts, crossroad centers lead to different performance results \cite{petrov2019analysis}. The analysis is further complicated by 3D specifics including heights of blockers, BS and UEs. As a result, the use of stochastic geometry for addressing radio part performance, although feasible, is usually more complicated and tedious as compared to purely stochastic deployments as discussed in \cite{petrov2019analysis,wang2017blockage,wang2018mmwave}.
\subsection{Indoor Regular Deployments}
Indoor deployments present the most complex environment for modeling purposes. The main rationale is very complex propagation environment that differs from building to building making impossible to infer general laws of BS locations, see Fig. X. For this reason, studies assessing performance of mmWave/THz BS indoor deployments are forced to deal with regular fixed locations almost prohibiting mathematical system-level performance assessment and forcing investigators to reduce the scenario to single-room environment \cite{moldovan2017coverage} or utilize computer simulations or both \cite{bai2014coverage,petrov2018last}. Thus, to still obtain qualitative insights on performance measures of interest, similarly to outdoor deployment either semi-regular deployment or even fully stochastic one are often assumed with appropriate propagation models, see, e.g., \cite{bai2014coverage2,wu2020interference,wu2019interference,wang2020interference}.
\subsection{Propagation Models}
Generally, there are two types of propagation models for mmWave and THz communications system: (i) ray-tracing models and (ii) models based on fitting of measurements data. Although the former may precisely account for details of the propagation environment leading to very accurate models, they, by design, cannot be utilized in the mathematical modeling of communications systems. However, these models as well as empirical experiments allow to formulate empirical models. These models are based on the fitting experimental data to mathematical expressions and can further be classified into two large groups: (i) ``averaged'' models and (ii) 3D multi-path cluster-based models.
\subsubsection{Averaged Models}
The SINR at the UE is written as
\begin{align}\label{eqn:genericProp}
S(y)=\frac{P_AG_AG_UL(y)}{N_0 + I},
\end{align}
where $y$ is the 3D distance between BS and UE, $P_{A}$ is the transmit power at BS, $G_A$ and $G_{U}$ are the antenna gains at the BS and the UE, respectively, $N_0$ is the thermal noise at the UE, $L(y)$ is the path loss, and $I$ is the interference.
Note that propagation $L(y)$ and interference $I$ components in (\ref{eqn:genericProp}) are often RVs. In (\ref{eqn:genericProp}), one may also account for fast fading and shadow fading phenomena via additional RVs with exponential and Normal distributions, respectively, \cite{umi}. To simplify the model, the shadow fading effect is often accounted for by margins, $M_{S,1}$ and $M_{S,2}$ for the LoS non-blocked. These margins are specified in \cite{umi}.
To define the path loss, $L(y)$, for mmWave systems one may utilize the models defined in \cite{umi}. Particularly, the urban-micro (UMi) path loss is dB scale is readily given by
\begin{align}\label{eqn:plDb}
\hspace{-2mm}L_{dB}(y)=
\begin{cases}
32.4 + 21\log_{10}y + 20\log_{10}{f_c},\,\text{non-bl.},\\
32.4 + 31.9\log_{10}y + 20\log_{10}{f_c},\,\text{blocked},\\
\end{cases}\hspace{-1mm}
\end{align}
where $f_c$ is the carrier measured in GHz. The UMi path loss model for the $140$ GHz band has been introduced in \cite{xing2021propagation} while \cite{xing2021millimeter} reports an indoor-hall (InH) model for the same frequency.
The path loss defined in (\ref{eqn:plDb}) can also be converted to the linear scale by utilizing the generic representation $A_iy^{-\zeta_i}$, where $A_i$, $\zeta_i$, $i=1,2$, are the propagation coefficients corresponding to LoS non-blocked ($i=1$) and blocked ($i=2$) conditions, i.e,
\begin{align}\label{eqn:prop_coeff}
A=A_1=A_2=10^{2\log_{10}{f_c}+3.24},\,\zeta_1=2.1,\,\zeta_2=3.19.
\end{align}
Now, the SINR at the UE can then be rewritten as
\begin{align}\label{eqn:prop}
S(y)=\frac{P_{A}G_{A}G_{U}}{A(N_0+I)}[{y}^{-\zeta_1}[1-p_B(y)]+{y}^{-\zeta_2}p_B(y)],
\end{align}
where $p_B(y)$ is the blockage probability \cite{gapeyenko2016analysis}
\begin{align}\label{eqn:blockage}
p_{B}(y)=1-\exp^{-2\lambda_Br_B\left[\sqrt{y^2-(h_A-h_U)^2}\frac{h_{B}-h_{U}}{h_{A}-h_{U}}+r_B\right]},
\end{align}
where $\lambda_B$ is the blockers density, $h_B$ and $r_B$ are the blockers' height and radius, $h_U$ is the UE height, $h_U\geq{}h_B$, $h_A$ is the BS height, $y$ is the 3D distance between UE and BS.
Finally, introducing the coefficient
\begin{align}\label{eqn:Ci}
C=P_AG_AG_U/A,
\end{align}
the SINR at UE can be compactly written as
\begin{align}\label{eqn:finalPropModel}
S(y)=\frac{C}{N_0+I} [{y}^{-\zeta_1}[1-p_{B}(y)]+ {y}^{-\zeta_2}p_{B}(y)].
\end{align}
\subsubsection{Absorption Losses in mmWave and THz Bands}
The unique property of the mmWave and THz channels is the atmospheric (molecular) absorption \cite{jornet2011channel,jornet2014femtosecond}. In the mmWave band, absorption is mostly due to the oxygen molecules while in the THz band it is mainly caused by the atmospheric water vapor \cite{hitran}. These losses may induce frequency selectivity in the channel characteristics. With absorption losses accounted for, the SINR at the UE takes the following form
\begin{equation}\label{eq:s_rx1}
S(y)=\frac{P_AG_AG_UL(y)L_A(y)}{N_0 + I},
\end{equation}
where the additional factor $L_A(y)$ represents absorption losses. Following \cite{jornet2011channel}, the absorption loss is defined as
\begin{equation}\label{eq:l_a}
L_{A}(y) = 1/\tau(y),
\end{equation}
where $\tau(y)$ is the medium transmittance described by the Beer-Lambert-Bouguer law. The latter is related to the frequency dependent absorption coefficient $K(f)$ as $\tau(y) \approx e^{-K(f)y}$. The values of $K(f)$ can be obtained from \cite{hitran} as described in detail in \cite{jornet2011channel,jornet2014femtosecond}.
Note that in mmWave band absorption losses are only non-negligible in the 60 GHz band that is utilized for WLAN systems. In the THz band, there are so-called transparency windows \cite{boronin2014capacity}, where the impact of these losses is negligible as well. Finally, the absorption phenomena may also lead to the molecular noise theoretically predicted in \cite{jornet2011channel}. The theoretical model for molecular noise has been proposed in \cite{boronin2015molecular}. However, recent measurements \cite{kokkoniemi2016discussion} did not reveal any noticeable impact of the molecular noise phenomenon.
\begin{figure}[!t]
\centering
\includegraphics[width=1.0\columnwidth]{cluster.pdf}
\caption{Illustration of the 3D cluster-based propagation model: a nuber of paths between BS and UE are available each characterized with its own delay and power profiles \cite{umi}.}
\label{fig:cluster}
\vspace{-2mm}
\end{figure}
\subsubsection{Cluster-based Models}
MmWave and THz channels are inherently characterized by multi-path nature. To this aim, 3GPP standardized 3D channel model for $6-100$ GHz band in~\cite{umi}. The structure of the model, see Fig. \ref{fig:cluster}, is essentially similar to the LTE 3D model specified in \cite{standard_15_lte}, with enhancements inherent to mmWave propagation such as a blockage. According to it, the received power consists of energy coming from LoS and reflected paths. Here, the term cluster is interpreted as a surface potentially leading to the reflection of propagating rays. Taking the number of clusters in the range of $5-20$ as an input, this model relates the specifics of the propagation environment to a set of parameters that include: (i) zenith of departure and arrival (ZoD/ZoA), (ii) azimuth of departure and arrival (AoD/AoD), (iii) number of rays (paths) in a cluster, (iv) cluster delay, (v) power fraction of a cluster, and (vi) other parameters such as Ricean K-factor.
The 3GPP 3D cluster model has an explicit algorithmic structure providing no closed-form expressions for the abovementioned parameters. However, the authors in \cite{gapeyenko2018analytical} provided analytical approximations for selected parameters required for the use of this model in the mathematical analysis of mmWave systems. Particularly, they have shown that the power of a cluster follows Log-Normal distribution while AoA and ZoA can be approximated by Laplace distribution, i.e.,
\begin{align}\label{eqn:theta_Ai}
&f_{\theta_i}(y;x)=\frac{1}{2a_{i,2}(x)}e^{-\frac{|y-a_{i,1}(x)|}{a_{i,2}(x)}},\,i=1,2,\dots,W,\nonumber\\
&f_{P_{S,i}}(y;x)=\frac{1}{ya_{i,4}\sqrt{2\pi}} e^{-\frac{(\ln y - a_{i,3})^2}{2a_{i,4}^{2}}},\, i=1,2,\dots,
\end{align}
where $a_{i,1}(x)$, $a_{i,2}(x)$, $a_{i,3}(x)$, and $a_{i,4}(x)$, $i=1,2,\dots,W$, are the parameters estimated from statistical data, see \cite{gapeyenko2018analytical} for details. It has also been shown in \cite{gapeyenko2018analytical} that $a_{i,1}(x)$ are independent of the cluster number $i$ and only depend on the separation distance $x$. Further, the mean of ZoA for all clusters coincides with the constant ZoA of the LoS cluster. In its turn, $a_{i,2}(x)$, $a_{i,3}(x)$, and $a_{i,4}(x)$ are independent of the distance and only depend on the cluster number, see \cite{gapeyenko2018analytical}. The use of the model is demonstrated in \cite{petrov2019exploiting,gapeyenko2018analytical,begishev2021joint}.
As of now, 3D cluster model parameters are only available for mmWave bands for outdoor deployment conditions \cite{umi}. For other environments, such as vehicle-to-vehicle (V2V) and vehicle-to-infrastructure (V2I) communications exhaustive data for parameterization have been recently reported \cite{boban2019multi,he2019propagation}. Despite similar structure is expected to be retained by THz models as well, only a few comprehensive measurements studies are available to date that can be used to infer channel parameters, see e.g. \cite{eckhardt2021channel} for V2V,
\cite{guan2019measurement} for the train to infrastructure links, as well \cite{he2017stochastic} for a static kiosk application.
\subsubsection{Other Types of Impairments}
In addition to the path loss as well as blockage considered in the subsequent sections, meteorological conditions such as rain \cite{sun2017novel,ghosh2014millimeter,khan2011mmwave}, fog \cite{frey1999effects,liebe1989millimeter}, snow \cite{foessel1999short} and foliage \cite{nashashibi2004millimeter,schwering1988millimeter} may provide additional impairments on mmWave and THz propagation summarized in Table \ref{tab:effects}. As one may observe, foliage produces the most significant impact resulting in up to $2$ dB/m of additional degradation. On the other hand, the impact of snow, fog, and cloud is insignificant, i.e., less than $1$ dB/km. Finally, up to 10 dB/km of signal degradation is induced by rain. The impact of these environmental conditions is expected to be higher for the THz band. These values can be utilized as an additional constant in path loss models defined above.
\subsection{Static and Dynamic Blockage Models}
\begin{figure}[!t]
\vspace{-0mm}
\centering
\includegraphics[width=1.0\columnwidth]{blockageProfile_new.pdf}
\caption{Typical blockage profile at 60 GHz: mean attenuation characterizes the signal drop while fade, blockage, and rise intervals describe time-dependent metrics \cite{slezak2018empirical}.}
\label{fig:pathGain}
\vspace{-2mm}
\end{figure}
Blockage caused by dynamic objects in the channel is an inherent property of mmWave and THz systems. Depending on the induced attenuation on top of the path loss, the blockage may or may not lead to outage conditions. In the latter case, the communications may still be possible at much reduced modulation and coding scheme (MCS). In the former case, depending on outage duration, application layer connectivity may or may not be interrupted. Thus, to comprehensively characterize it for performance evaluation studies one needs to provide: (i) attenuation values induced by different objects in the channel and (ii) blockage intervals under different types of UE and blockers and their mobilities.
The dynamic human body blockage introduces additional uncertainty in the channel resulting in drastic fluctuations in the received signal. An illustration of the typical measured path loss experienced as a result of human body blockage by UE in the 60 GHz band is shown in Fig.~\ref{fig:pathGain}. The absolute values of blockage induced attenuation heavily depend on the type of blockers. For human body blockage in mmWave band values of losses in the range of 15--25 dB have been reported \cite{weiler2016environment,maccartney2016millimeter,maccartney2017rapid}. For THz band these losses are expected to reach $40$ dB \cite{bilgin2019human}. Blockage by vehicles at 300 GHz heavily depends on the vehicle type and geometry and reported to be from 20 dB at the front-shield glass level up to 50 dB at the engine level. They are considerably higher than those for mmWave band. Particularly, at $60$ GHz, 5 dB--30 dB blockage losses have been reported. Note that the values of blockage losses also depend on the vehicle size and the number of them between communicating entities \cite{yamamoto2008path}. For 28 GHz, the authors in \cite{boban2019multi,park2017millimeter,park2018vehicle} also report the following height-dependent vehicle blockage losses: 11 dB--12.2 dB for 1.7 m, 13.3 dB for 1.5 m, and 30 dB--40 dB for 0.6 m.
The fading and recovery phases highlighted in Fig.~\ref{fig:pathGain} are reported to be on the scale from tens to a couple of hundreds of milliseconds \cite{slezak2018empirical,maccartney2016millimeter,maccartney2017rapid}. Similar observations have been made recently for THz links \cite{bilgin2019human}. In mathematical modeling, these phases are often omitted assuming that fading and recovery phases are negligibly small compared to the blockage duration. The blockage models utilized in performance evaluation frameworks attempt to predict the probability of blockage and blockage duration that can be caused by multiple blockers occluding the propagation paths between UE and BS.
\begin{figure}[!t]
\vspace{-0mm}
\centering
\includegraphics[width=0.8\columnwidth]{meth_staticBlockage_new.pdf}
\caption{Illustration of the LoS blockage zone: the length is defined by the distance between UE and BS while the width is specified by the blocker's ``radius'' \cite{gapeyenko2016analysis}.}
\label{fig:meth_staticBlockage}
\vspace{-2mm}
\end{figure}
\subsubsection{Static Human Body Blockage Models}
Most of the static blockage models proposed in the literature, e.g., \cite{bai2014analysis,gapeyenko2016analysis}, assume the following model. Consider the static case of stationary UE in $\Re^2$ located in stationary homogeneous PPP of blockers with intensity $\lambda_B$ considered in \cite{gapeyenko2016analysis}. Assume that UE is located at a 2D distance $r_0$ from the BS. UE and BS are located at heights $h_T$ and $h_R$, respectively. Human bodies are represented by cylinders with constant height $h_B$ and base diameter $d_B=2r_B$. In the considered scenario, one may introduce the so-called ``LoS blockage zone'' of rectangular shape with sides $2r_B$ and $r$ as shown in Fig. \ref{fig:meth_staticBlockage}. Observe that the LoS is blocked when a center of at least one blocker is located inside this zone. Utilizing the void probability of the Poisson process the LoS blockage probability immediately follows
\begin{align}\label{eqn:meth_probNbl}
p_{B}(x)=1-e^{-2\lambda_Br_B\left[r_0\frac{h_{B}-h_{R}}{h_{T}-h_{R}}+r_B\right]}.
\end{align}
Analyzing (\ref{eqn:meth_probNbl}) one may deduce that the blockage probability increases exponentially as a function of blockers density. The heights of UE and BS also affect the final values. Note that this model can be utilized in those cases when UE and blockers are stationary or to predict the time-averaged behavior of mobile blockers in the mobile field of blockers. However, in performance evaluation frameworks addressing session continuity parameters, one needs to characterize blocked and non-blocked times explicitly as discussed below.
\subsubsection{Mobile UE and Static Blockers}
Consider the case when UE moves according to the uniform rectilinear pattern in a static homogeneous PPP of blockers considered in \cite{samuylov2016characterizing}. In this case, in addition to the fraction of time UE spends in blockage, one is also interested in conditional blockage probabilities of UE at $M$ given a certain state at $O$, see Fig. \ref{fig:meth_MobileUE}. To capture dependence between links states one may utilized conditional probabilities defined as $p_{ij}$ P\{at M LoS blocked/non-blocked given that LoS at O is blocked/non-blocked\}. These probabilities can be formed in a matrix as
\begin{align}\label{eqn:1}
P=
\begin{pmatrix}
p_{00} & p_{01} \\
p_{10} & p_{11} \\
\end{pmatrix}
\end{align}
where states $0$ and $1$ reflect the non-blocked and blocked states. In general, these probabilities are a function of (i) distance from $O$ to $P$, $r_0$, (ii) distance from $O$ to $M$, $d$, (iii) angle $\angle$POM, see Fig. \ref{fig:meth_MobileUE}, (iv) blockers density $\lambda_A$, (v) heights of UE and BS at $P$, $O$, and $M$, $h_C$. Observing that
\begin{align}\label{eqn:1m}
p_{00}=1-p_{01},\quad p_{10}=1-p_{11},
\end{align}
one needs $p_{00}$ and $p_{11}$ to fully parameterize (\ref{eqn:1}).
The illustration of the model is shown in Fig. \ref{fig:meth_MobileUE}, where rectangles represent the areas affecting the blockage of $PO$ and $PM$ links. Their width and length are determined by the blockers diameter $d_B=2r_B$ and the link lengths $PO$ and $PM$. The intersection area of these rectangles visually represents the correlation between link states. Particularly, this zone can be further divided into sub-zones that affect it differently. More specifically, zone $4$ is further split into two smaller zones, $4a$ and $4b$, representing the area on the right and left sides, respectively, along with the $PU$ line of intersection of two planes. Observe that zone $1$ can be excluded as it is fairly small for any potential geometry. Zones $2$ and $3$ affect LoS state at $O$ and $M$, respectively. Furthermore, LoS state at both $O$ and $P$ is simultaneously affected by zones $4$a and $4$b. By using these observations, the probability $p_{00}$ is obtained as
\begin{align}\label{eqn:p00_0}
p_{00} = P\left[\text{nB at M}|\text{nB at O}\right] = \frac{P\left[\text{nB at M}\cap\text{nB at O}\right]}{P\left[\text{nB at O} \right]},
\end{align}
where $nB$ and $B$ denote LoS non-blocked and blocked states. Once $p_{ij}$ are determined, conditional and unconditional cumulative distribution function (CDF) and pdf of time spent in blocked and non-blocked states can be determined as shown in \cite{gapeyenko2019spatially}.
\begin{figure}[t!]
\vspace{-0mm}
\centering
\includegraphics[width=0.8\columnwidth]{meth_MobileUE.pdf}
\caption{Illustration of the LoS blockage zones for the case with moving UE: UE moves from point $O$ to point $M$, BS is located at point $P$; zones $4a$ and $4b$ define dependences between LoS states at $O$ and $M$ \cite{samuylov2016characterizing}.}
\label{fig:meth_MobileUE}
\vspace{-2mm}
\end{figure}
\subsubsection{Static UE and Mobile Blockers}
Consider the case when a static UE is surrounded by blockers moving according to random direction model (RDM, \cite{nain2005properties}) considered in \cite{gapeyenko2017temporal}. Here, the main emphasis is on the UE state evolution in time. In addition to the metrics related to the time UE spends in the blocked and non-blocked states, one is also interested in the conditional probability of blockage at time $t_1$, given that the state at $t_0$, $t_0<t_1$ is either blocked or non-blocked. The latter can be further utilized to obtain CDF and pdf of time in blocked and non-blocked states.
To determine these characteristics, the authors in \cite{gapeyenko2017temporal} rely upon the renewal theory. Particularly, the time UE state evolution in time is illustrated in Fig. \ref{fig:renewal_process}. The arrival process of blockers to the LoS blockage zone is assumed to be homogeneous Poisson. The time a single blocker spends in the LoS blockage zone follows the general distribution obtained in \cite{gapeyenko2017temporal}. Alternatively, to simplify the model, observe that the length of LoS blockage zone is often much larger than the width \cite{gapeyenko2016analysis}, implying that one may assume that the blockers enter the blockage zone at the right angle to the long side leading to the constant zone residence time. Further, by utilizing the analogy with queuing theory, the alternating blocked and non-blocked periods coincide with the free and busy periods in equivalent M/G/$\infty$ queuing system, where the service time is the time spent by a single blocker in the LoS blockage zone, leading to the structure represented in Fig. \ref{fig:renewal_process}. Although the busy interval is readily available from \cite{daley1998idle}, the structure of its CDF is rather complicated. Alternatively, one may replace M/G/$\infty$ model with a simpler equivalent M/M/$\infty$ queue having exponential LoS zone residence time with the same mean.
The approach utilized to determine the sought conditional probabilities is based on convolutions in the time domain. Particularly, the following relation is established
\begin{align}\label{eqn:meth_sum}
p_{00}(\Delta{t}) = \hspace{-1mm}\sum_{i=0}^{\infty}P\{A_{i}(\Delta{t})\},p_{01}(\Delta{t}) = \hspace{-1mm}\sum_{i=1}^{\infty}P\{B_{i}(\Delta{t})\},
\end{align}
where the events $A_{i}(t)$ describe the cases of being initiated in the non-blocked state at $t_{0}$ and ending up in the non-blocked state in $\Delta{t}=t_{1}-t_{0}$, while having exactly $i$, $i=0,1,\dots$, blocked periods during $\Delta{t}$. Similarly, $B_{i}(t)$ are the events corresponding to starting in the non-blocked interval at $t_{0}$ and ending up in the blocked interval, while having exactly $i$, $i=1,2,\dots$, non-blocked periods during $\Delta{t}$. Observe that the absolute values of $A_i(t)$ and $B_i(t)$ diminishes quickly making computation of $p_{00}(\Delta{t})$ and $p_{01}(\Delta{t})$ feasible.
\begin{figure}[b!]
\vspace{-2mm}
\centering
\includegraphics[width=0.9\columnwidth]{renewal_process.pdf}
\caption{Renewal process associated with the LoS blockage: blocked period is initiated by the arrival of a blocker to the LoS blockage zone and terminated when the last blocker leaves the LoS blockage zone empty; then, the non-blocked period is initiated forming a renewal process \cite{gapeyenko2017temporal}.}
\label{fig:renewal_process}
\vspace{-0mm}
\end{figure}
\subsubsection{Mobile UE and Mobile Blockers}
The generic model when blockers and UEs are both mobile is much more difficult to handle. The only study that addressed this case the authors are aware of is \cite{moltchanov2019analytical}, where a Markov model has been developed to capture the mean duration of blocked and non-blocked periods. Several mobility models have been considered. For uniform rectilinear movement of UE in a field of blockers moving according to RDM, the infinitesimal generator of the Markov blockage models takes the following form
\begin{align}\label{eqn:ctmc_two}
\Lambda(g(0))=\left[
\begin{matrix}
-\alpha(g(0))&\alpha(g(0))\\
\beta(g(0))&-\beta(g(0))\\
\end{matrix}\right],
\end{align}
where $\alpha(g (0))=1/E[\Theta (g (0))]$, $\beta(g (0)) = 1 /E[\Omega (g (0))]$ are the mean duration of intervals when UE is in blocked and non-blocked conditions. These parameters depend on the UE and blockers mobility models and are derived in \cite{moltchanov2019analytical}. Since the model presumes exponentially distributed blocked and non-blocked intervals, it is approximate in nature capturing the dynamics of the means of these intervals \cite{gapeyenko2017temporal}.
\subsubsection{Spatial and Temporal Consistencies}
There are two critical requirements propagation models for THz and mmWave bands need to satisfy to represent real propagation conditions evolving in time. These are spatial and temporal consistencies ensuring that the model provides consistent prediction in time and space. The correlated channel behavior is caused by both macro objects such as buildings and micro objects including the human crowd or vehicles around the UE of interest. Ensuring spatial and temporal consistencies is complicated by the presence of dynamic blockers in the channel.
The 3GPP 3D cluster-based model has been extended to capture spatial correlation caused by large static objects in the channel such as buildings. Particularly, the standard in \cite{umi} suggests three different methods. According to the first one, known as \textit{the method of spatially-consistent RVs}, the correlation is artificially introduced to clusters by altering RV utilized for their generation. In the second alternative, called \textit{the geometric stochastic approach}, a grid is added to the plane, where UEs are located. The large-scale channel model parameters are generated in a correlated manner for all UEs located within the same grid cell. As a result, in this model, two nearby UEs may still have completely independent conditions. Furthermore, the grid dimensions are chosen rather arbitrarily. Finally, according to the last method, \textit{method of geometrical cluster locations}, small-scale 3D cluster model parameters such as cluster delays, AoD and AoA, ZoD and ZoA are generated in a correlated manner. It is critical that all the considered models the parameters affecting the correlation distance are chosen arbitrarily without direction relation to the blockers density and geometry
There have been only a few attempts other than those standardized by 3GPP to capture spatial correlation caused by mobile objects including vehicles and human crowds. The study in \cite{MacCartney_GC_cor} measured the UE blockage probability to multiple BSs and reported correlation states between multiple links. The authors in \cite{Aditya} proposed a mathematical model to derive blockage probability to multiple BS simultaneously. Note that their model is principally similar to the one described above for the case of mobile UE and static blockers. Based on the results of \cite{samuylov2016characterizing} the authors in \cite{gapeyenko2019spatially} provided a model ensuring spatial consistency that does not require the correlation distance to be known in advance. They revealed that the correlation distance in mmWave band for a wide range of blockers density is limited to just a few meters.
\begin{figure}[!b]
\vspace{-2mm}
\centering
\includegraphics[width=0.8\columnwidth]{block_building_new.pdf}
\caption{LoS blockage probability by buildings: LoS path can be occluded by a series of buildings \cite{gapeyenko2021line}.}
\label{fig:block_building}
\vspace{-0mm}
\end{figure}
\subsection{Blockage by Large Static Objects}
In addition to blockage by small dynamic objects such as humans or vehicles, propagation paths in mmWave and THz systems can be blocked by large static objects such as buildings \cite{heath2,gapeyenko2021,Baccelli_manhattan,Heath_LoS_ball}, see Fig. \ref{fig:block_building}. To distinguish from dynamic blockage, in 3GPP terminology, blockage by large static objects is referred to as non-LoS conditions.
There have been several models proposed in the past to model building blockage phenomena. The critical part of these models affecting their analytical tractability is the choice of the city deployment. Particularly, in \cite{heath2} the authors propose a random shape theory to model irregular deployment of buildings. The buildings are represented as rectangles with random sizes having their centers forming a homogeneous PPP. The proposed approach suits well for those deployments, where building locations are purely stochastic. The authors in \cite{Heath_LoS_ball} formalized the so-called ``ball'' model, where there is always LoS in a certain circularly shaped area around UE. In addition to the stochastic city deployments, studies addressing the regular city grids have also been performed. In \cite{Baccelli_manhattan} the city grid has been captured using the Manhattan Poisson line process (MPLP), where the lines represent the streets. In general, analysis of LoS probability in semi-regular deployments is more involved compared to stochastic ones.
The regular city grid deployment has also been considered by standardization bodies including both ITU-R and 3GPP. Specifically, ITU-R P.1410 \cite{ituBlock} considers the frequency band $20-50$ GHz and presents LoS probability in the following form
\begin{align}
\hspace{-2mm}P_{LoS}^{ITU} = \prod_{n=0}^{m}\left[1-\exp\left[\frac{[h_T - \frac{(n+\frac{1}{2})(h_T - h_R)}{m+1}]^2}{2\gamma^{2}}\right]\right],
\end{align}
where $m=\lfloor{}r\sqrt{(\alpha \beta)}\rfloor{} - 1$ is the mean number of buildings in between UE and BS, $r$ is the 2D distance measured in kilometers, $h_T$, and $h_U$ and are BS and UE heights. The parameters $\alpha$, $\beta$, and $\gamma$ are the input model parameters representing the deployment specifics including building dimensions, density, and height. One of the limitations of the model is that it does not capture 2D spatial locations of buildings concentrating on buildings locations on a LoS projection between UAV and BS to $\Re^2$. Although this model accounts for different mean heights of BS and UE, it does not capture their height distributions as well as LoS AoD.
In TR 36.777 3GPP has also proposed a large-scale LoS blockage model. This model differentiates between deployment types providing separate solutions for them. The structure of the model is also unique for different heights of BS and UE. For UMi environment with appropriate heights of BS and UE, the LoS blockage probability is
\begin{align}
\hspace{-2mm}P_{LoS}^{3GPP} =
\begin{cases}
1, &l_{2D}\leq d, \\
\frac{d}{l_{2D}} + \left[1-\frac{d}{l_{2D}}\right]\exp\left[\frac{-l_{2D}}{p_{1}}\right], &l_{2D}> d,\\
\end{cases}
\end{align}
where the variables $p_1$ and $d$ are defined as
\begin{align}
&p_{1} = 233.98 \log_{10}(h_R) - 0.95\nonumber\\
&d = \max (294.05 \log_{10} (h_R) - 432.94,\,\,18).
\end{align}
The generic structure of the 3GPP model makes it complicated to apply it for the specific city deployment with unique dimensions. In general, the 3GPP model also requires a careful choice of parameters to assess the performance related to the specific deployment.
The ITU-R model has been extended to 3D deployments by the authors in \cite{gapeyenko2021}. Although the model has been originally developed for UAV LoS blockage it can also be applied to the case of BS to terrestrial UE communications. Following their study, the LoS probability in Manhattan Poisson line process (MPLP \cite{morlot2012population}) is provided by, see Fig. \ref{fig:block_building},
\begin{align}\label{eqn:prop1}
&P_{\text{LoS}}(l_{2D}, \phi_{D}) = \nonumber\\
&=F_{H_B}(h_{m}^{0})\exp\Bigg(-\lambda \int\limits_{x_0}^{l_x}\Big[1-F_{H_B}\big(h_{m}^{x}(x)\big)\Big]\text{d}x-\nonumber\\ &-\lambda \int\limits_{y_0}^{l_y}\Big[1-F_{H_B}\big(h_{m}^{y}(y)\big)\Big]\text{d}y\Bigg),
\end{align}
where $F_{H_B}(x)$ is the CDF of building block height, $F_{H_B}(h_{m}^{0})$ is the probability that the height of the first building along the LoS path is lower than LoS height, $h_{m}^{0}$, $F_{H_B}\big(h_{m}^{x}(x)\big)$ and $F_{H_B}\big(h_{m}^{y}(y)\big)$ are the probabilities that the sides perpendicular to the $Ox$ and $Oy$ axes are lower than the LoS heights, $h_{m}^{x}(x)$ and $h_{m}^{y}(y)$, at the point of their intersection, respectively. The authors have also derived closed-form solutions for uniformly, exponentially and Rayleigh distributed building heights.
The large-scale static and small-scale dynamic blockage models need to be utilized together for performance assessment of mmWave and THz deployments. This can be done similarly to \cite{margarita2018multicon}, where the authors determined zones corresponding to exhaustive superposition of nLoS and blockage states, i.e., (LoS,blocked), (LoS,non-blocked), (nLoS,blocked), (nLoS, non-blocked). Further, the performance of UEs located in these zones can be analyzed separately and then combined by weighting with probabilities of UE being located in these zones. We also note that due to inherent limitations on the communications range, blockage by buildings may not be relevant for THz cellular systems.
\begin{figure*}[!t]
\vspace{-0mm}
\begin{align}\label{eqn:overallPDF}
f_{T_A}(t)&=\frac{\frac{e^{-\frac{(\log (t)-\mu_x)^2}{2 \sigma_x^2}}}{\sigma_x} \left[2-\text{erfc}\left(\frac{\mu_y-\log (t)}{\sqrt{2} \sigma_y}\right)\right]+\frac{e^{-\frac{(\log (t)-\mu_y)^2}{2 \sigma_y^2}}}{\sigma_y} \left[2-\text{erfc}\left(\frac{\mu_x-\log (t)}{\sqrt{2} \sigma_x}\right)\right]}{ 4 \sqrt{2 \pi } t \left[1-\frac{1}{2} \text{erfc}\left(\frac{\mu_\phi-\log (t)}{\sqrt{2} \sigma_\phi}\right)+\frac{1}{2} \text{erfc}\left(\frac{\mu_\theta-\log (t)}{\sqrt{2} \sigma_\theta}\right)\right]^{-1}}
+\nonumber\\
&\qquad{}\qquad{}\qquad{}\qquad{}\qquad{}\frac{\frac{e^{-\frac{(\log (t)-\mu_\phi)^2}{2 \sigma_\phi^2}}}{\sigma_\phi} \left[2-\text{erfc}\left(\frac{\mu_\theta-\log (t)}{\sqrt{2} \sigma_\theta}\right)\right]+\frac{e^{-\frac{(\log (t)-\mu_\theta)^2}{2 \sigma_\theta^2}}}{\sigma_\theta} \left[2-\text{erfc}\left(\frac{\mu_\phi-\log (t)}{\sqrt{2} \sigma_\phi}\right)\right]}{ 4 \sqrt{2 \pi } t \left[1-\frac{1}{2} \text{erfc}\left(\frac{\mu_x-\log (t)}{\sqrt{2} \sigma_x}\right)+\frac{1}{2} \text{erfc}\left(\frac{\mu_y-\log (t)}{\sqrt{2} \sigma_y}\right)\right]^{-1}}.
\end{align}
\normalsize
\hrulefill
\vspace{-0mm}
\end{figure*}
\begin{figure}[b!]
\vspace{-2mm}
\centering
\includegraphics[width=0.63\columnwidth]{microUpdated.pdf}
\caption{Illustration of the UE micromobility process: motions over Cartesian $Ox$, $Oy$, and $Oz$ axes represented by $x(t)$, $y(t)$, and $z(t)$ processes; rotations over vertical (yaw), transverse (pitch), and roll (longitudinal) axes represented by $\phi(t)$, $\theta(t)$ and $\zeta(t)$, respectively, \cite{petrov2020capacity}.}
\label{fig:micromobility}
\vspace{-0mm}
\end{figure}
\subsection{UE Micromobility Models}
In addition to static and dynamic blockage affecting the performance of users, for mmWave/THz systems micromobility, manifesting itself in fast UE displacements and rotations, have to be considered \cite{hur_dynamic_mmWave,petrov2018effect,kokkoniemi2020impact}, see Fig. \ref{fig:micromobility}. This phenomenon happens during the communications process may cause frequent misalignments of the highly-directional THz beams, resulting in fluctuations of the channel capacity and outage events \cite{peng_dynamic_thz}. The preliminary studies indicate that the outage in THz systems might happen at much smaller timescales compared to blockage, i.e., on the order of few tens of milliseconds \cite{petrov2018effect,petrov2020capacity}. This property challenges the development of efficient beamtracking algorithms that are critical for mmWave and THz communications.
To date, only a few mocromobility models have been proposed. The authors in \cite{petrov2020capacity} first demonstrated that small displacements over $Oz$ axis as well as roll (longitudinal axis) motion do not affect link performance. They further observed that movements over $Oz$ and rotation over roll (longitudinal) axes does not affect beamalignment and proceeded with the decomposition technique by modeling motion over Cartesian $Ox$ and $Oy$ axes as well as rotations over vertical (yaw) and transverse (pitch) axes, $\phi(t)$ and $\theta(t)$, see Fig.~\ref{fig:micromobility}, by mutually independent Brownian motions. The authors revealed that the pdf of time to outage due to beam misalignment $f_{T_A}(t)$ follows (\ref{eqn:overallPDF}), where $\text{erfc}(\cdot)$ is the complementary error function, $\mu_{(\cdot)}$ and $\sigma_{(\cdot)}$ are the parameters of the corresponding displacement and rotation components that can be estimated from the empirical data.
We specifically note that the model in (\ref{eqn:overallPDF}) represents only the essentials of the UE micromobility process as it does not capture potential dependence between movements, distance-dependent velocity and drift to the origin. Observing that micromobility may lead to outage conditions, for performance evaluation purposes one needs to jointly represent the blockage and micromobility processes. This can be done by, e.g., superposing blockage process on top of micromobility process or abstracting both processes by a certain stochastic process with the joint intensity of link interruptions. Additional attempts have been done recently by the authors in \cite{stepanov2021accuracy,stepanov2021statistical} who performed detailed measurements campaigns for different applications and demonstrated that two-dimensional Markov models can accurately capture micromobility when application does not directly control user's behavior, e.g., video/VR viewing.
\begin{figure}[t!]
\vspace{-0mm}
\centering
\includegraphics[width=0.8\columnwidth]{sphere_cut_new.pdf}
\caption{Illustration of the 3D antenna radiation pattern models: right -- realistic $15\times{}4$ pattern obtained using the algorithm in 3GPP TR 37.977; left -- 3D HPBW approximation by following \cite{kovalchukov2018evaluating}.}
\label{fig:coneModel}
\vspace{-2mm}
\end{figure}
\subsection{Antenna Array Models}
The ability to accurately capture essential features of BS and UE antenna radiation patterns is critical for performance analysis of mmWave and THz communications systems. A very detailed model based on correlated superposition of individual antenna elements can be produced by utilizing the 3GPP procedure specified in 3GPP TR 37.977, see Fig. \ref{fig:coneModel}. However, this model is not analytically tractable. As a result, various approximations are utilized in the literature. Below, we consider typical models utilized for these purposes.
\subsubsection{2D Cone and Cone-Plus-Sphere Models}
The simplest models capturing the essential feature of mmWave and THz systems is the so-called 2D cone model and the extended 2D cone-plus-sphere model, see Fig.~\ref{fig:antennas}, considered in many early studies of mmWave and THz systems \cite{petrov2017interference,singh2011interference,park2013incremental,petrovGlobecom,biason2019multicast,zhang2012wireless}. According to the first model, illustrated in Fig.~\ref{fig:antenna_a},
a cone-shaped pattern parameterized by a single parameter $\alpha$ -- HPBW of the main lobe -- is utilized for representing the antenna radiation pattern. The second model, shown in Fig.~\ref{fig:antenna_b}, attempts to account for imperfections of antenna design by modeling back and side lobes as a sphere around UE. To filly parameterize the former model one needs to determine the antenna gain $G$ as a function of the directivity angle $\alpha$. The second model requires gain values corresponding to the main and side lobes, $G_1$ and $G_1$, associated with a chosen directivity angle $\alpha$ and the power loss parameter to back and side lobes $k$.
\begin{figure}[!b]
\vspace{-2mm}
\centering
\subfigure[2D cone antenna model]
{
\includegraphics[width=0.75\columnwidth]{antenna_pattern_twc_cone_new.pdf}
\label{fig:antenna_a}
}\vspace{+3mm}\\
\subfigure[2D cone-plus-sphere model]
{
\includegraphics[width=0.75\columnwidth]{antenna_pattern_twc_cps_new.pdf}
\label{fig:antenna_b}
}
\caption{Illustration of the 2D approximate antenna models: $G_1$ -- gain over the main lobe, $G_2$ -- approximate gains of side and back lobes \cite{petrov2017interference}.}
\label{fig:antennas}
\end{figure}
The power spectral density (PSD) $P_{R}$ at a distance $r$ is
\begin{align}
P_R=\frac{P_{A}}{S_A}=\frac{P_{A}}{2\pi r h},
\end{align}
where $\alpha$ is the antenna directivity, $P_A$ is the emitted power, and $S_A$ is the area of the wavefront surface. The latter is known to be $h=r[1-\cos(\alpha/2)]$. By applying the free-space propagation model (FSPL), the power spectral density at the wavefront surface $P_{R}$ is given by
\begin{align}
P_{R}=\frac{P_{A}}{S_A}=P_{A} \frac{G}{4\pi r^{2}},
\end{align}
leading to the following for the main lobe gain
\begin{align}
G = \frac{2}{1-\cos(\alpha/2)}.
\end{align}
Consider now the 2D cone-plus-sphere model. Let $k_1$ and $k_2$ denote the fractions of power split between the main lobe and back and side lobes, i.e., $k_1+k_2=1$. By applying the same logic as in the case of the cone model we may write
\begin{align}
\begin{cases}
P_{R,1} 2\pi r^2 [1-\cos(\alpha/2)] = k_{1}P_{A}\\
P_{R,2} 2\pi r^2 [1+\cos(\alpha/2)] = k_{2}P_{A}\\
k_{1}+k_{2} = 1
\end{cases},
\end{align}
where, according to the FSPL, we have
\begin{align}
\begin{cases}
P_{R,1} = G_{1} P_{A}/4\pi r^2\\
P_{R,2} = G_{2} P_{A}/4\pi r^2
\end{cases}.
\end{align}
Thus, there exists the following relationship
\begin{align}
G_{1}[1-\cos(\alpha/2)] + G_{2}[1+\cos(\alpha/2)] = 2.
\end{align}
Using $k=k_{1}/k_{2}$ we see that $G_{2}=kG_{1}$ and $G_{1}$, $G_{2}$ are
\begin{align}
\begin{cases}
G_{1} = 2[(1-\cos(\alpha/2))+k(1+\cos(\alpha/2))]^{-1}\\
G_{2} = k G_{1}
\end{cases}.
\end{align}
\subsubsection{3D Models}
One of the critical issues of the considered models is their 2D nature implying that they cannot be utilized for mmWave and, especially, THz systems featuring antennas forming radiation patterns in horizontal and vertical dimensions, simultaneously. Following \cite{kovalchukov2019evaluating,kovalchukov2018analyzing} we consider an antenna pattern approximated by a pyramidal zone, see Fig.~\ref{fig:coneModel}. This model is fully defined by angles, $\alpha_{V}$ and $\alpha_{H}$.
To obtain the gain $G$ as a function of $\alpha_{V}$, and $\alpha_{H}$, we first notice that the wavefront surface area is provided by the area of the spherical rectangle, see Fig.~\ref{fig:coneModel}. Applying the law of cosines~\cite{Petrera2014}, we obtain $\cos\chi$ as
\begin{align}\nonumber
\cos\chi&=\frac{\cos\left(\frac{\pi}{2}-\frac{L_H}{2}\right)-\cos\left(\frac{\pi}{2}-\frac{L_H}{2}\right)\cos\left(L_V\right)}{\sin\left(\frac{\pi}{2}-\frac{L_H}{2}\right)\sin\left(L_V\right)}=\\
&=
\frac{\sin\left(\frac{L_H}{2}\right)}{cos\left(\frac{L_H}{2}\right)}\frac{1-\cos\left(L_V\right)}{\sin\left(L_V\right)}\nonumber=\\
&=\tan\left(\frac{L_H}{2}\right)\tan\left(\frac{L_V}{2}\right).
\end{align}
The quarter of the spherical excess is $(\rho-\pi/2)$ leading to
\begin{align}
\cos\left(\rho-\frac{\pi}{2}\right)=\tan\left(\frac{L_H}{2}\right)\tan\left(\frac{L_V}{2}\right),
\end{align}
where $L_H$ and $L_V$ are spherical geodesics corresponding $\alpha_{H}$ and $\alpha_{V}$. Hence the sought area is
\begin{align}
S_A=4\arcsin\left(\tan\frac{\alpha_V}{2}\tan\frac{\alpha_H}{2}\right).
\end{align}
Since the wavefront psd is provided as $P_{R}=A r^{-\zeta}$, the gain of the main lobe is obtained as follows
\begin{align}
G(\alpha_V,\alpha_H) =\frac{4 \pi}{S_A}=\frac{\pi}{\arcsin\left(\tan\frac{\alpha_V}{2}\tan\frac{\alpha_H}{2}\right)}.
\end{align}
\begin{comment}
Hence, the received power takes the following form
\begin{align}
P_R(r)=\frac{\left[\arcsin\left(\tan\frac{\alpha_{V,R}}{2}\tan\frac{\alpha_{H,R}}{2}\right)\right]^{-1}}{\arcsin\left(\tan\frac{\alpha_{V,T}}{2}\tan\frac{\alpha_{H,T}}{2}\right)}P_T\pi^2r^{-\zeta},
\end{align}
where one can determine the path loss exponent $\zeta$ for a particular technology by using empirical data, see, e.g.,~\cite{umi} for the frequency range of $0.5-100$GHz. Note that for simplicity we assume no power control on the end nodes.
\end{comment}
\subsubsection{Antenna Parameterization}
\begin{comment}
To complete the parametrization of the propagation model, one requires antenna gains. Following~\cite{constantine2005antenna}, the antenna factor is defined as
\begin{align}
AF(\theta,\beta) = \frac{\sin(N[\pi\cos(\theta)+\beta]/2)}{\sin([\pi\cos(\theta)+\beta]/2)},
\end{align}
where $N$ is the total number of elements in an array, $\beta$ specifies the direction of the array, and $\theta$ is the azimuth angle. In what follows, we assume $\beta=0$ and the distance between the neighboring elements to be $\lambda/2$, where $\lambda$ is the wavelength.
\end{comment}
The introduced antenna arrays model requires directivity angles as the input, $\alpha$ for 2D antenna models and $\alpha_V$ and $\alpha_H$ for 3D antenna models. To determine them, recall that HPBW of the antenna array is determined by the number of antenna elements in the considered plane. By utilizing the array maximum $\theta_m$ and the 3-dB point, $\theta_{3dbh}$, the following relation holds for the HPBW of the linear array \cite{constantine2005antenna}
\begin{align}
\alpha = 2|\theta_m - \theta_{3db}|,
\end{align}
where $\theta_m$ is related to the phase excitation difference, $\beta$ as
\begin{align}
\theta_m=\arccos(-\beta/\pi),
\end{align}
leading to $\theta_m=\pi/2$ for $\beta=0$.
The upper and lower $3$-dB points are given by\cite{constantine2005antenna}
\begin{align}
\theta_{3db}^{\pm}=\arccos[-2.782/(N\pi)].
\end{align}
Table~\ref{tab:array_comp} shows HPBWs and their approximation via empirical law $102/N$ for linear arrays, where $N$ specifies the number of array elements. We also note that instead of calculating the antenna gains for considered models analytically based on wavefront area one may utilize \cite{constantine2005antenna}
\begin{align}
G = \frac{1}{\theta_{3db}^+-\theta_{3db}^{-}}\int_{\theta_{3db}^-}^{\theta_{3db}^+} \frac{\sin(N\pi\cos(\theta)/2)}{\sin(\pi\cos(\theta)/2)}d\theta.
\end{align}
The antenna gains are summarized in Table~\ref{tab:gain}.
\begin{table}[t!]
\centering
\caption{Antenna HPBW and its approximation, reproduced from \cite{gerasimenko2018multicon}}
\label{tab:array_comp}
\begin{tabular}{p{2cm}p{3cm}p{2cm}}
\hline
\textbf{Array}&\textbf{Value, direct calculation} &\textbf{Approximation}\\
\hline\hline
64x1 & 1.585 & 1.594\\
\hline
32x1& 3.171 & 3.188\\
\hline
16x1& 6.345 & 6.375\\
\hline
8x1& 12.71 & 12.75\\
\hline
\end{tabular}
\vspace{-2mm}
\end{table}
\begin{table}[b!]
\vspace{-2mm}
\centering
\caption{Antenna array gains, reproduced from \cite{gerasimenko2018multicon}}
\label{tab:gain}
\begin{tabular}{p{2cm}p{3cm}p{2cm}}
\hline
\textbf{Array}&\textbf{Gain, linear} &\textbf{Gain, dB}\\
\hline\hline
64x1 & 57.51 & 17.59\\
\hline
32x1& 28.76 & 14.58\\
\hline
16x1& 14.38 & 11.57\\
\hline
8x1& 7.20 & 8.57\\
\hline
4x1& 3.61 & 5.57\\
\hline
\end{tabular}
\end{table}
\subsection{Beamsearching Algorithms}
The beam misalignment caused by micromobility and blockage affects the already strict time budget for beamtracking in mmWave and THz communications. Inherently requiring high gains at both BS and UE sides, these systems would require antenna arrays with tens (mmWave band) or even hundreds (THz band) of array elements to form "pencil-wide" beams \cite{akyildiz2016realizing}. This would lead to extremely large beamforming codebooks at both communications sides drastically increasing the beamsearching time. This time can be reduced by minimizing the arrays switching time. However, given the expected order of magnitude increase in the number of antenna array elements, the array switching time has to be decreased down to nanoseconds from the current state-of-the-art few microseconds that may not be feasible for modern arrays design options \cite{piazza2008design,kim201828}.
\begin{table*}[!t]\footnotesize
\centering
\caption{Details of the considered deployment and radio part models}
\begin{tabular}{l|l|l|l}
\hline
Model&Type&Specifics and parameterization&Complexity\\
\hline\hline
\multirow{2}{*}{Deployment} & Indoor & Regular & High \\
\cline{2-4}
& Outdoor, open area & PPP & Low \\
\cline{2-4}
& Outdoor, street grids & Semi-regular & High \\
\hline
\multirow{2}{*}{Blockage} & By large buildings & Empirical 3GPP \cite{umi}, analytical ITU-R model \cite{ituBlock}, MLNP-based \cite{gapeyenko2021} & Low \\
\cline{2-4}
& Human blockage & Mobile/static UE and blockers, RDM mobility & Low-high\\
\hline
\multirow{2}{*}{Antenna array} & Analytical & Cone, cone-plus-sphere, parameterized via Tables \ref{tab:array_comp} and \ref{tab:gain} & Low \\
\cline{2-4}
& Empirical & Fitted to measurements & Low \\
\hline
\multirow{2}{*}{Micromobility} & Analytical & Brownian motion, explicit pdf of link active time & Low \\
\cline{2-4}
& Empirical & Fitted to measurements in \cite{stepanov2021statistical}, 1D/2D discrete Markov chains & High \\
\hline
\multirow{3}{*}{Propagation} & Averaged & 3GPP UMi/UMa from \cite{umi} & Low \\
\cline{2-4}
& Cluster-based & Fitted to the model in \cite{umi}, e.g., \cite{gapeyenko2018analytical} & High \\
\cline{2-4}
& THz specific & Averaged with exponential path loss component, $e^{-Kx}$ & Low \\
\hline
\multirow{2}{*}{Beamalignment} & Type of search & Full/iterative search, parameterized by the array switching time/number of elements \cite{gerasimenko2018multicon} & High \\
\cline{2-4}
& Design type & Cellular periodic, WLAN-style on-demand, see \cite{petrov2020capacity} & High\\
\hline
\end{tabular}
\label{tab:radioCookbook}
\vspace{-0.0cm}
\end{table*}
The algorithmic beamtracking improvements are nowadays considered as the main option for efficient utilization of mmWave and THz resources. The approaches originally proposed for beamtracking design in mmWave systems, in addition to hierarchical iterative mechanisms putting one of the sides in omnidirectional regime similarly to IEEE 802.11ad/ay technologies \cite{wigig2012,wei2017exhaustive} and various algorithmic improvements \cite{va2016beam,lim2019beam}, may utilize: (i) external localization information provided by e.g., GPS or 5G/6G positioning services \cite{shim2014application,alrabeiah2020viwi,brambilla2020sensor} or radar information \cite{petrov2019unified}, (ii) lower-band RATs for provisioning of direction towards BS/UE \cite{gui2021network,liu2018millimeter}, (iii) information available in the past when the connection has been up \cite{kutty2015beamforming,aykin2020mamba,jeong2020online}.
To abstract specifics of the beamsearching procedure, models for performance evaluation purposes need to specify two parameters as a function of beamsearching algorithm and antenna array: (i) beamsearching time and (ii) time instance when beamsearching is initiated. Consider exhaustive search as an example. Here, to establish a direction to the BS, both UE and BS need to attempt all feasible configurations leading to the beamsearching time of $T_S=N_UN_A\delta$, where $N_U$ and $N_A$ are the number of UE and BS configurations and $\delta$ is the array switching time. For hierarchical search, UE and BS perform beamsearching by switching the other side to omnidirectional mode. Here, the beamsearching time is $T_S=(N_U +N_A)\delta$. By analogy, the beamsearching time of any algorithm can be defined as a function (possibly probabilistic) of $N_U$, $N_A$ and $\delta$. As one may deduce, the array switching time, $\delta$, is a crucial parameter for future mmWave and THz systems. In general, it heavily depends on array implementation and may vary on the timescale from microseconds to milliseconds. As an example, IEEE 802.11ad recommends utilizing arrays with $\delta=1$ ms leading to $4$ ms and $0.41$ ms of beamsearching time for exhaustive and hierarchical search, respectively, and $64$ and $4$ antenna elements at BS and UE sides.
Addressing the time, when beamsearching is initiated we distinguish between two system design options, cellular and WLANs \cite{petrov2020capacity}. In the former case, beamsearching is performed periodically with interval $T_P$ . Note that the frame duration in mmWave NR and THz systems (1 ms for mmWave NR \cite{nrmcs} and might get smaller for THz radio interface) is smaller than the time to the outage, caused by the micromobility reported in \cite{petrov2020capacity}. Thus, in this case, one may assume that only blockage leads to outage situations. According to WLAN design \cite{wigig2012}, beamsearching is performed once the connection is lost. Thus, not only blockage but micromobility may cause an outage.
\subsection{Summary and Usage of Models}
The choice of deployment and radio part models heavily depends on the desired accuracy of the resulting performance evaluation framework and also lead to different levels of complexity when combining them to abstract the radio channel specifics (see Section \ref{sect:param} for examples) in the models of session service process considered further in Section \ref{sect:perf}. To this aim, Table \ref{tab:radioCookbook} provides a concise summary of these models and also verbally comments on the complexity of the resulting combined framework.
First of all, we would like to note that all of these models provided in Table \ref{tab:radioCookbook} are inherently analytically tractable, that is, they can be utilized to build appropriate performance evaluation frameworks for mmWave/THz systems. In terms of deployment, the simplest for analysis is the PPP distribution of both BSs and UEs while the most complex are those models presuming semi-regular deployments, i.e., those utilized for outdoor city center deployment options. To provide an abstraction of radio part specifics these models may require additional link-level or system-level simulations, see \cite{begishev2018connectivity,moltchanov2021performance}. Building indoor models is the most complicated from the radio part point of view. Here, not only deployment models need to be assumed to be semi-regular but the propagation model needs to be more detailed than the average ones, preferably, based on ray-tracing or 3D cluster-based model. This significantly complicates radio channel abstraction particularly, estimation of the coverage range of BS and associated resource request distribution of sessions.
The human body blockage model capturing both mobility of UEs and blockers simultaneously is scarce and generally capture the first moment of blockage statistics only. Forcing either blockers or UEs to stationary random locations, one may potentially obtain detailed knowledge of blockage phenomena but looses in the model's ability to capture real-life users behavior. As compared to human body blockage, the nature of micromobility is still not fully studied with just a few recently published studies revealing Markov nature of micromobility for applications that does not control user behavior rejecting this hypothesis for other applications \cite{stepanov2021statistical,stepanov2021accuracy}. For the former class, inherently Markov in nature Brownian motion or discrete two-dimensional empirically fitted models reported in \cite{stepanov2021statistical} can be utilized without compromising accuracy.
\begin{table*}[!t]\footnotesize
\centering
\caption{Traffic types, corresponding service models and metrics of interest}
\begin{tabular}{p{0.225\textwidth}|p{0.225\textwidth}|p{0.225\textwidth}|p{0.225\textwidth}}
\hline
Traffic type&Non-elastic/adaptive traffic &Elastic traffic &Adaptive traffic\\
\hline\hline
No blockage/micromobility & Baseline RQS, Section \ref{sect:RQSformal}, \ref{sec4-1} & PS models with service coefficients, Section \ref{sec:servcoefs} & Stochastic geometry \cite{haenggi2012stochastic,elsawy2013stochastic,elsawy2016modeling} \\
\hline
Blockage/micromobility & RQS with events causing service interruptions, Section V-D & Not available & Stochastic geometry \cite{moltchanov2021ergodic,shafie2020coverage} \\
\hline
Reservation functionality & RQS with partial resource availability, Section \ref{sec4-3} & Not available & Not available, Section \ref{sect:adaptive} \\
\hline
Priorities & RQS with priorities, Section \ref{sect:priorities} & Not available & Stochastic geometry \cite{haenggi2012stochastic,elsawy2013stochastic,elsawy2016modeling} \\
\hline
Multiconnectivity & RQS network, Section \ref{sec4-4} & Not available & Stochastic geometry \cite{shafie2021coverage,moltchanov2021ergodic}\\
\hline
Reservation/mulitconnectivity & RQS network with partial availability, Section \ref{sec4-4} & Not available & Not available\\
\hline
\multicolumn{4}{c}{Typical performance metrics}\\
\hline
User-centric & New and ongoing session loss probabilities & Session service time & UE spectral efficiency/rate, fraction of time in outage\\
\hline
Operator-centric & System resource utilization & Fairness & Fairness\\
\hline
\end{tabular}
\label{tab:serviceCookbook}
\vspace{-0.0cm}
\end{table*}
The most well-understood sub-models in terms of usage are propagation models for mmWave and THz bands. Here, the incremental accuracy is usually expected by going from averaged models to 3D cluster-based, to ray-traced empirical models. For the first two models, a completely mathematical abstraction of the radio part can be utilized as demonstrated in, e.g., \cite{begishev2021joint,begishev2019quantifying}, while for the latter one ray-tracing simulations are required for a given scenario. Also, some of the studies indicate that system-level performance metrics are not heavily affected by the choice of the propagation model. Particularly, the authors in \cite{gapeyenko2018analytical} demonstrated that the outage probability computed analytically for averaged and 3D cluster-based models coincide implying that the latter one does not provide any substantial accuracy improvement. Furthermore, while all these models are already available for mmWave band only a few steps are made towards standardization of these classes of model for THz band.
The most frequently utilized model for directional antenna arrays is the simple cone model. However, the use of this model is known to provide biased results for highly directional antenna radiation patterns as shown in \cite{petrov2017interference} making it not suitable for system-level analysis of THz systems. Cone-plus-sphere model allows to characterize interference more precisely. Finally, we note that the radio abstraction part provided in Section \ref{sect:param} may also accept the measured antenna radiation pattern without a significant increase in modeling complexity. Finally, we note that beamalignment time and, generally, beamsearching processes are rarely accounted for in mathematical system-level performance evaluation studies. The rationale is that this process is deterministic making it difficult to account for in stochastic models. Nevertheless, it is still feasible as shown in \cite{moltchanov2021ergodic,gerasimenko2018multicon}. The difference between different types of beamsearching procedure is mainly related to the time it takes to locate the beam and the time instant when beamsearching is initialed. In the former case, the performance metrics are often more difficult to obtain \cite{petrov2020capacity}.
\section{Radio Abstraction and Parameterization}\label{sect:param}
In this section, we outline the basic techniques for parameterizing the models introduced in the previous section. Recall that the queuing part accepts the following parameters as the input: the pmf of the amount of requested resources, $\{p_j\}_{j\geq0}$, and the temporal intensity of the UE stage changes, $\alpha$. These parameters abstract the propagation and antenna specifics, UE locations, blockage, and micromobility and represent them in the form suitable for queuing analysis. Below, we first specify the parameterization procedure in detail for the baseline model having PPP deployment of mmWave/THz BSs and UEs randomly located in the BS coverage area. Whenever possible we also sketch the extension for other deployment cases.
\begin{figure}[t!]
\centering\hspace{-5mm}
\includegraphics[width=0.8\columnwidth]{interruption_new.pdf}
\caption{Performance metrics for prioritized service at BSs: enforcing pre-emptive priority at the mmWave/NR air interface efficiently isolates higher priority traffic, e.g., URLLC, from the lower priority one, e.g., eMBB.}
\label{fig:interup}
\vspace{-2mm}
\end{figure}
\subsection{Resource Request Characterization}
For certainty, consider the propagation model defined in Section \ref{sect:system} excluding the exponential component responsible for atmospheric absorption. To derive the pmf of the amount of requested resources, we start with SINR at the UE located at the distance of $y$ from the mmWave/THz along the propagation path is provided by
\begin{align}\label{eqn:sinr_derive}
S(y)=\frac{C}{N_0+I}[{y}^{-\zeta_1}[1-p_{B}(y)]+{y}^{-\zeta_2}p_{B}(y)],
\end{align}
where $C=P_AG_AG_U/A$, $P_{A}$ is the BS transmit power, $G_A$ and $G_{U}$ are the antenna array gains at the BS and UE sides, respectively, $N_0$ is the thermal noise, $I$ is the interference, $A$, $\zeta_1$ and $\zeta_2$ are the propagation coefficients provided in (\ref{eqn:prop_coeff}).
There is a single unknown to determine in (\ref{eqn:sinr_derive}), the interference, $I$. Observe that this is a RV that depends on the plethora of deployment factors including BS deployment model, utilized antenna arrays, emitted power, the density of blockers, etc. For a given deployment scenario, interference can be estimated by utilizing conventional stochastic geometry approaches, e.g., \cite{kovalchukov2019evaluating,kovalchukov2018analyzing,chen2021coverage,petrov2017interference,shafie2021coverage,shafie2021coverage}. Finally, if one wants to account for more detailed propagation specifics, e.g. fast and shadow fading, these can also be added to the numerator of (\ref{eqn:sinr_derive}). For example, shadow fading distribution is known to follow Normal distribution with zero mean and standard deviation that can be found in \cite{umi}.
Analyzing the structure of (\ref{eqn:sinr_derive}) one may observe that coefficients $P_A$, $G_A$, $G_U$, $N_0$ are all constants. The blockage probability $p_B(y)$ can be derived utilizing the blockage models specified in (\ref{eqn:blockage}). On the other hand, the distance between UE and BS, $y$, interference, $I$ as well as additional components such as shadow fading and fast fading are all RVs. The presence of multiple RVs drastically complicates the derivation of pmf of resources requested by a session as shown in \cite{samuylov2015random,samuylov2017analytical,kovalchukov2019evaluating}. Thus, to simplify derivations, interference is often captured by an interference margin corresponding to the mean value in a given deployment of interest. In what follows, we illustrate how to derive the mean value of interference when the fast fading component is neglected while the shadow fading is captured by the shadow fading margin.
\subsubsection{Interference Characterization}
For a considered deployment, $I$, the interference can be written as
\begin{align}\label{eqn:interference}
I=\sum_{i=1}^{N}C(y_i^{-\zeta_1}[1-p_{B}(y_i)]+y_i^{-\zeta_2}p_{B}(y_i)),
\end{align}
where $Y_i$ are the distances to interfering BS.
Observe, that interference in (\ref{eqn:interference}) is a random function of RVs. Unfortunately, there are no effective methods to derive its distribution. For dense deployments, however, one may approximate it utilizing the Normal distribution. Alternatively, when approximating interference in (\ref{eqn:sinr_derive}), one may utilize the mean values of interference as an interference margin. The latter can be obtained by applying the Campbell theorem expressing the moments of aggregated interference at a randomly selected (tagged) UE as follows \cite{chiu2013stochastic}
\begin{align}\label{eqn:campbell}
E[I^{n}]=&\int_{0}^{{r}_I}C[x^{-\zeta_1}(1 - p_B(x)) + x^{-\zeta_2}p_B (x)]^n\times\nonumber\\
\times &p_{C}(x)2\xi\pi{}xdx,
\end{align}
where $2\xi\pi{}xdx$ is the probability that there is BS in the radius increment of $dx$, $p_{C}(x)$ is the so-called exposure probability, that is, the probability that the antennas of interfering BSs are oriented towards the considered UE, and $p_{B}(x)$ is the blockage probability at the distance $x$, $r_I$ is the maximum radius, where BSs contribute non-negligible interference at the tagged UE.
The only unknown component in (\ref{eqn:campbell}) is the exposure probability, $p_C(x)$. For 2D deployments or when the vertical directivity is much smaller compared to the horizontal one, one may determine it following \cite{petrov2017interference} as
\begin{align}
p_C(x)=p_C=\alpha_A\alpha_U/4\pi^2,
\end{align}
where $\alpha_A$ and $\alpha_U$ are HPBW angles of antennas at BS and UE sides. These parameters can be estimated as a function of the number of antenna elements and the type of utilized antenna model as discussed in Section \ref{sect:system}. For 3D radiation patterns the exposure probability $p_C$ has a more complex structure but can still be obtained in closed-form as shown in \cite{kovalchukov2019evaluating}.
\subsubsection{SINR Distribution}
Recall that the distance from BS to UE uniformly distributed over the circularly shaped area is given by pdf in the form of $f_{Y}(y)=2y/r_E^2$, $0<y<r_E$, where $r_E$ is the BS coverage radius. Observe, that depending on the density of BS in the environment the effective coverage radius, $r_E$, can be limited by SINR (sparse deployments) or by cell boundaries (dense deployments). This, in turn, affects the distribution of UE locations in the cell and, the received signal strength, and SINR. Thus, the coverage radius, $r_E$, is determined by two distances -- inter-BS distance, $r_{E,V}$, and the maximum coverage of BSs, $r_{E,S}$, i.e., $r_{E}=\min(r_{E,V},r_{E,S})$. The latter can be obtained by determining the maximum distance between the UE and the BS, such that the UE in the LoS blocked conditions is not in the outage state. By utilizing the propagation model defined in Section \ref{sect:system} the sought 2D distance $r_{E,S}$ can be written as
\begin{align}\label{eqn:dist_00}
S= C \left(r_{E,S}^2+(h_A-h_U)^2\right)^{-\frac{\zeta_2}{2}}=S_{th},
\end{align}
where $S_{th}$ is the SINR threshold associated with the worst possible MCS defined for a given technology, e.g., see \cite{nrmcs} for mmWave NR, $h_A$ is the BS height, $h_U$ is the UE height.
Solving for $r_{E,S}$, we obtain
\begin{align}\label{eqn:11}
r_{E,S} = \sqrt{\left(C/S_{th}\right)^{\frac{2}{\zeta_2}}-(h_A-h_U)^2}.
\end{align}
The second component -- inter-BS distance, $r_{E,V}$ heavily depends on the type of deployment. For hexagonal cellular deployments with tri-sector antenna BS it is specified by as $D=3 R$~\cite{3gpp2018rel15}, where $R$ is the radius of a cell. For semi-regular deployments considered in Section \ref{sect:system} it is defined by the scenario geometry. Finally, for random deployments, one may obtain the sought radius by determining the half distance between typical BS locations. For the PPP field of BSs, the BS coverage area is known to form Voronoi cells. Thus, one may approximate it by the circle with the corresponding mean area. Since there is no analytical expression for the area of a Voronoi cell, one needs to resort to computer simulations or utilize approximations available in, e.g., \cite{kumar1992properties,tanemura2003statistical}.
Once the pdf of the distance to the tagged UE, $f_{Y}(y)=2y/r_E^2$, $0<y<r_E$, as well as interference margin (\ref{eqn:campbell}) are both determined, one can proceed with characterizing SINR distribution. The impact of the shadow fading can also be accounted by utilizing the constant shadow fading margins, $M_{S,i}$ for the LoS non-blocked and blocked states, i.e.,
\begin{align}
M_{S,i}=\sqrt{2}\sigma_{S,i}
\end{align}
where $\sigma_{S,i}$ is the standard deviations of the shadow fading distribution in LoS non-blocked and blocked states provided in \cite{umi}. Then, the SINR CDF can be obtained using RV transformation technique as a function of a single RV -- distance from UE to BS as described in \cite{ross}.
To illustrate the derivations, let $S_{nB}$ be a RV denoting the SINR in non-blocked state and $F_{S_{nB}}(x)$, $x>0$, be its CDF. Since UEs are assumed to be uniformly distributed in the circularly shaped BS coverage, the CDF of the distance between UE and BS can be obtained as
\begin{align}
F_Y(y)=(y^2-(h_A-h_U)^2)/r_{E}^2,
\end{align}
where $y\in(|h_A-h_U|,\sqrt{r_{E}^2+(h_A-h_U)^2})$.
Observe that SINR is a monotonously decreasing function of distance $y$. Thus, the CDF of SINR can be expressed as
\begin{align}
F_{S_{nB}}(y)=1 - F_Y(C/(N_0+I)y^{\zeta_1/2}).
\end{align}
\begin{figure*}[!!t]
\vspace{-0mm}
\begin{align}\label{eqn:pmfShadow}
F_{S^{dB}_{nB}}(y)&=\frac{1}{2 r_E^2}\Bigg[A^{2/\zeta_1 } 10^{-\frac{y}{5 \zeta_1 }} e^{\frac{\sigma_{S,nB} ^2 \log ^2(10)}{50 \zeta_1^2}} \Bigg[\text{erf}\left(\frac{50 \zeta_1 \log (A)-25 \zeta_1 ^2 \log \left(r_E^2+(h_A-h_U)^2\right)+\sigma_{S,nB}^2 \log ^2(10)-5 \zeta_1 y \log (10)}{5 \sqrt{2} \zeta_1 \sigma_{S,nB} \log (10)}\right)-\nonumber\\
&-\text{erf}\left(\frac{50 \zeta_1 (\log (A)-\zeta_1 \log (h_A-h_U))+\sigma_{S,nB}^2 \log ^2(10)-5 \zeta_1 y \log (10)}{5 \sqrt{2} \zeta_1 \sigma_{S,nB} \log (10)}\right)\Bigg]+\left(r_E^2+(h_A-h_U)^2\right)\times{}\nonumber\\
&\times{}\text{erf}\left(\frac{-10 \log (A)+5 \zeta_1 \log \left(r_E^2+(h_A-h_U)^2\right)+y \log (10)}{\sqrt{2} \sigma_{S,nB} \log (10)}\right)-(h_A-h_U)^2\times{}\nonumber\\
&\times{}\text{erf}\left(\frac{\sqrt{2} (-10 \log (A)+10 \zeta_1 \log (h_A-h_U)+y \log (10))}{\sigma_{S,nB} \log (100)}\right)+r_E^2\Bigg].
\end{align}
\hrulefill
\normalsize
\vspace{-2mm}
\end{figure*}
One may utilize the described technique to obtain SINR distribution for the blocked state. Further, if one wants to include the effect of the shadow fading distribution the following step needs to be performed. Specifically, let $F_{S_{nB}}^{dB}(y)=F_{S_{nB}}(10^{y/10})$ be CDF of SINR in dB scale. Recall that shadow fading is known to follow Log-Normal distribution in linear scale resulting in Normal distribution in dB scale. By utilizing these observations, the SINR distribution in non-blocked state can be written as
\begin{align}
S_{nB,S}^{dB}=S_{nB}^{dB}+N(0,\sigma_{S,nB}),
\end{align}
where $N(0,\sigma_{S,nB})$ is the Normal distribution with zero mean and standard deviation $\sigma_{S,nB}$ specifying shadow fading.
Finally, the SINR CDF accounting for both path loss and shadow fading can be obtained as a sum of two RVs, that is, by convolving $F_{S_{nB}}^{dB}(y)$ and $N(0,\sigma_S)$, immediately leading to
\begin{align}\label{eqn:shadowFading}
F_{S_{nB,S}}^{dB}(y)=\int_{-\infty}^{\infty}F_{S_{nB}}^{dB}(y+u)\frac{e^{-u^2/2\sigma_S^2}}{\sqrt{2\pi}\sigma_S}du.
\end{align}
Unfortunately, no closed-form expression for \ref{eqn:shadowFading} can be obtained by utilizing the conventional RV transformation technique \cite{ross}. However, one may still obtain the final results in terms of an error function, $\text{erf}(\cdot)$, as provided in (\ref{eqn:pmfShadow}), where
\begin{align}
A=\frac{P_A10^{G_AG_U/10}}{f_c^2 10^{3.24+L_B/10} 10^{\frac{1}{10} (M_{S,1})} N_0},
\end{align}
$M_{S,1}$ is the interference margin, $L_B$ is the additional losses induced by the blockage. By weighting SINR CDFs corresponding to LoS blocked and non-blocked states with probabilities $p_B$ and $(1-p_B)$ one obtains the final result. Finally, we note that $p_B$ -- the averaged blockage probability, can be estimated as follows
\begin{align}
\pi_B=\int_{0}^{r_E}p_B(x)\frac{2x}{r_E^2}dx,
\end{align}
where $p_B(x)$ is available from (\ref{eqn:blockage}). The authors in \cite{kovalchukov2019accurate} demonstrated that the resulting SINR CDF can be well approximated by Normal distribution.
\subsubsection{Resource Request Distributions}
To determine resource request distribution we now introduce SINR thresholds corresponding to MCS schemes, $S_j$, $j=1,2,\dots,J$. Further, we define the probability that UE assigned MCS $j$ by $\epsilon_j$. By discretizing SINR CDF $F_{S}(s)$, we obtain
\begin{align}\hspace{-1mm}
\begin{cases}
\epsilon_0=F_{S}(S_1),\\
\epsilon_j=F_{S}(S_{j+1})-F_{S}(S_j),\, j=1,2,\dots,J-1, \\
\epsilon_J=1-F_{S}(S_J).\\
\end{cases}\hspace{-2mm}
\end{align}
The probability $\epsilon_j$ that a session requests $r_j$ RBs can now be used to determine the resource requirements of sessions characterized by a certain requested rate. Note that the latter can be fixed or random depending on the considered scenario.
\subsubsection{Usage of 3D Cluster-Based Propagation Model}
One may characterize the resource request distribution more precisely by utilizing 3D cluster-based propagation model as discussed in \cite{begishev2021multi}. Here, the most complex part is the derivation of the pdf of the received power at a distance $x$ from BS. Assuming that UE always utilizes the strongest cluster the sought pdf is provided by
\begin{align}\label{eqn:strongestCluster}
f_{P_R}(z;x)=\hspace{-1mm}\sum_{i=1}^{W}\left[(1-p_{B,i}(x))\prod_{j=1}^{i-1}p_{B,j}(x)\right]\hspace{-1mm}f_{P_{n}}(z;x),
\end{align}
$p_{B,i}(x)$ is the cluster blockage probability at distance $x$, $f_{P_{n}}(z;x)$ is the pdf of power of cluster $n$ at the distance $x$. The latter parameters is obtained by utilizing RV transformation technique as follows \cite{ross}
\begin{align}\label{eqn:clusterpower}
f_{P_{n}}(z;x) = \frac{f_{P_{s,n}}\Big(\frac{P_{n}(x)}{10^{[P_{A} - L_{dB}(x)]/10}}\Big)}{10^{[P_{A}-L_{dB}(x)]/10}},
\end{align}
where $L_{dB}(x)$ is the pass loss in dB, $f_{P_{S,n}}$ is provided in (\ref{eqn:theta_Ai}).
Integrating (\ref{eqn:strongestCluster}) over the cell radius one obtains
\begin{align}
f_{P_R}(z)=\int_{0}^{r_{E}}f_{P_R}(z;x)\frac{2x}{r_{E}^2}dx.
\end{align}
The other unknowns in (\ref{eqn:strongestCluster}) are the cluster blockage probabilities at distance $x$, $p_{B,i}(x)$. Here, the LoS cluster blockage is obtained similarly to (\ref{eqn:blockage}). However, to estimate probabilities $p_{B,i}$, $i=2,3,\dots$ one needs ZoA pdf, $f_{\theta_i}(y;x)$, provided in (\ref{eqn:theta_Ai}). Particularly, following \cite{gapeyenko2018analytical}, the cluster $i$, $i=2,3,\dots,N$, blockage probability conditioned on ZoA $y_i$ is given by
\begin{align}\label{eqn:p_Aiy}
p_{B,i}(y;x)= 1 - e^{-2\lambda_B r_B(\tan y_i (h_B - h_U) + r_B)}.
\end{align}
leading to the cluster blockage probability in the form of
\begin{align}
p_{B,i}(x)=\int_{-\pi}^{\pi}f_{\theta_i}(y;x)p_{B,i}(y;x)dy,
\end{align}
which can be estimated by numerical integration.
By using $p_{B,i}$, $i=1,2,\dots,N$ one may also obtain outage probability required in those deployments, where blockage leads to outage conditions as shown in \cite{gapeyenko2018analytical}
\begin{align}\label{eqn:outage1}
p_{O}(x)=\prod_{i=1}^{N}p_{B,i}(x)+\int_{0}^{S_T}f_{P_R}(z;x)dz,
\end{align}
where $S_T$ is the UE sensitivity threshold.
For complex scenario geometries and/or service rules involving a field of BS and multiconnectivity one may further extend the baseline parameterization models. Particularly, the case of multiconnectivity in square mmWave BS deployments with multiconnectivity operation is considered in \cite{begishev2021joint}.
\subsection{UE State Changes}
There are two critical impairments that may affect session continuity of applications served by mmWave or THz systems -- micromobility and blockage. In the presented framework both can be abstracted using the external Poisson process of ``signals'' associated with sessions currently served at BSs. Below, we first characterize UE state changes caused by micromobility process and then proceed describing state changes induced by dynamic blockage phenomenon. We also specifically note that the queuing framework assumes only one type of impairment to be taken into account. However, it can be extended to the case of more than a single external process associated with sessions. Finally, notice that the Poisson nature of state changes also limits the modeling capabilities to mean values of the state holding times. Extending the framework to more complex external signal patterns is more complicated.
\subsubsection{State Changes due to Micromobility}
Consider first the process of UE state changes caused by micromobility of UE. Here, UE transitions between ``connectivity'' and outage states. The duration of both states heavily depends on the considered beamsearching strategy, i.e., on the time instant, when beamsearching is initiated. Let $T_C$ and $T_O$ be RVs denoting connectivity and outage time, respectively. In the simplest ``on-demand'' beamsearching scheme, where beamsearching is invoked when the connection is lost the pdf of the connectivity time $f_{T_C}(t)$ coincides with the time to outage $f_{T_A}(t)$ provided in \cite{petrov2020capacity} and given in (\ref{eqn:overallPDF}) while the outage time, $T_O$ coincides with the duration of the beamsearching procedure, $T_B$, discussed in Section \ref{sect:system}. Note that the latter is affected by the utilized beamsearching algorithm and, generally, depends on the number of antenna elements and array switching time.
Another type of the beamalignment strategy is periodic alignment. Here, the beam realignment procedure runs regularly with a period $T_{U}$. Note that this scheme reflects the cellular-style system design with centralized control, while the former ``on-demand'' one is characteristic for WLANs. Here, the connectivity time can be determined as the minimum of $T_A$ provided in (\ref{eqn:overallPDF}) and constant $T_U$, i.e.,
\begin{align}
f_{T_C}(t)=
\begin{cases}
f_{T_A}(t),&T_A<T_U\\
f_{T_A}(t)\big/\int_{0}^{T_U}f_{T_A}(x)dx,&T_A\geq{}T_U\\
\end{cases},
\end{align}
while the outage time again coincides with $T_B$.
\begin{figure}[t!]
\vspace{-0mm}
\centering
\includegraphics[width=0.6\columnwidth]{dynBlock_new.pdf}
\caption{Translation of spatial blocker intensity into temporal domain: shaded areas around the LoS blockage zone reprsent potential locations of blockers that may enter the LoS blockage zone in a unit time \cite{gapeyenko2018flexible}.}
\label{fig:temporal_intensity}
\vspace{-2mm}
\end{figure}
\subsubsection{State Changes due to Blockage}
Consider now temporal dynamics of the blockage process. For illustrative purposes, we consider only one dynamic blockage model introduced in Section \ref{sect:system}, where UE is assumed to be static in a field of human blockers with density $\lambda_B$ moving according to RDM \cite{nain2005properties}. Particularly, we are interested in the mean duration of blocked and non-blocked intervals. Similar derivations can be performed for other dynamic models.
We start by determining the intensity of blockers entering the LoS blockage zone of UE located at the distance $x$ from BS, $\epsilon(x)$. To this aim, we draw an area around the LoS blockage zone and divide it into $i$, $i= 1,2,...7$ sub-zones as shown in Fig. \ref{fig:temporal_intensity}. Now, the generic expression binding the density of blockers in the environment with the temporal intensity of blockers entering the LoS blockage zone is
\begin{align}\label{eqn:temporalInt_1}
\hspace{-1mm}\epsilon(x)=\sum_{i=1}^{7}\iint\limits_{M_i}g_{i}(x, y) Pr\{E\}Pr\{T>1\}\lambda_BM_idxdy,\hspace{-1mm}
\end{align}
where $M_i$ is the area of zone $i$, $g_{i}(x,y)$ is the pdf of blockers locations in sub-zone $i$ provided by $g_{i}(x, y)=1/M_i$, $E$ is the event that blockers move towards the LoS blockage zone, and $Pr\{T>1\}=\exp(-1/\tau)$ is the probability that a blocker moves longer than a unit time without changing the movement direction. The unknown event, $E$, can be obtained by considering that there is a range of angles leading to the blocker hitting the LoS blockage zone $\eta_{i}(x,y)$. That is, $Pr\{E\}=\eta_{i}(x,y)/2\pi$. With these observations in hand, we may rewrite (\ref{eqn:temporalInt_1}) as follows
\begin{align}\label{eqn:temporalInt_2}
\epsilon(x)&=\frac{\lambda_B e^{-1/\tau}}{2\pi}\sum_{i=1}^{7}\iint\limits_{M_i} \eta_{i}(x,y) \,dx\,dy,
\end{align}
where ranges of movements, $\eta_{i}(x,y)$, can be estimated as
\begin{align}
&\eta_{i}(x,y) = ([x_D - x]/vt),\,i=1,3,5,7,\nonumber\\
&\eta_{i}(x,y) = 2\cos^{-1}([x_E - x]/vt),\,i=2,6,\nonumber\\
&\eta_{4}(x,y) = 2\tan^{-1}([x-x_E]/[y-y_E]),
\end{align}
where $x_{(\cdot)},y_{(\cdot)}$ are the coordinates in Fig.~\ref{fig:temporal_intensity}. Finally, the mean intensity of blockers crossing LoS blockage zone is
\begin{align}
\epsilon=\int_{0}^{r_E}\epsilon(x)2x/r_E^2dx,
\end{align}
where $r_E$ is the BS service radius.
\begin{figure*}[!!t]
\vspace{-1mm}
\begin{align}\label{eqn:busyPeriod}
\hspace{-3mm}F_{\eta}(x)=1\hspace{-1mm}-\hspace{-1mm}\Bigg[[1-F_{T_B}(x)]\left[1-\hspace{-2mm}\int\limits_{0}^{x}(1-F_{\eta}(x-z))\exp(-\lambda_{B,T} F_{T_B}(z))\lambda_{B,T}{}dz\right]
+\hspace{-2mm} \int\limits_{0}^{x}(1-F_{\eta}(x-z))|de^{-\lambda_{B,T} F_{T_B}(z)}|\Bigg].
\end{align}
\hrulefill
\normalsize
\vspace{-3mm}
\end{figure*}
Alternatively to the described method, one may utilize the result of \cite{groenevelt} revealing that the inter-meeting time between a point moving according to RDM in a certain convex region $A$ and a static convex region $A_1\subset{}A$ is approximately exponentially distributed. The parameter of exponential distribution depends on the areas of $A$, $A_1$ and the speed of a moving point. This implies that the process of meetings in Poisson in nature. By utilizing the superposition property of the Poisson process \cite{kingman1993poisson} one may determine the temporal intensity of blockers crossing the LoS blockage zone.
To proceed further, we recall that the blockage process at UE is known to have an alternative renewal structure \cite{gapeyenko2017temporal}. In the same study the authors also demonstrated that under Poisson assumption of blockers entering the LoS blockage area the non-blocked interval follows exponential distribution parameter coinciding with the intensity of the Poisson process. In its turn, the blocked period may be formed by multiple blockers passing through the LoS blockage zone. By utilizing the analogy with the $M/GI/\infty$ queuing system, the duration of the blocked interval is shown to coincide with the busy period distribution. This distribution can be calculated numerically by using the results of \cite{daley1998idle} provided in (\ref{eqn:busyPeriod}). The only unknown required is the distribution of the time it takes for a blocker to cross the LoS blockage zone. This can be found by assuming a random entrance point to the LoS blockage zone as shown in \cite{gapeyenko2017temporal}. To simplify derivations, one may observe that the length of the LoS blockage zone is often significantly larger than its width. Thus, one may assume that blockers cross the LoS blockage zone following a direction perpendicular to its short side. In this case, the service time in the equivalent queuing model is deterministic and equals $2r_B/v$, where $r_B$ and $v$ are the radius and speed of the blocker.
The intensity of state changes caused by blockage, $\alpha$, can be estimated by utilizing the mean blocked and non-blocked periods. Note that to avoid the complexity of estimating CDF in (\ref{eqn:busyPeriod}) one may resort to M/M/$\infty$ approximation for which the mean busy period is available in the closed form \cite{cohen2012single}.
\section{Service Models}\label{sect:perf}
In this section, we introduce the performance evaluation models suitable for performance assessment of traffic service performance at mmWave/THz BSs. We start by describing the traffic types and corresponding service models and metrics of interest. Then, we introduce the overall structure of the framework defining the type of models, requirements, and interfaces between them. We treat in detail the models suitable for baseline, multiconnectivity, resource reservation functionalities as well as priority-based service.
\subsection{Type of Service Models and Performance Metrics}\label{sect:metrics}
\subsubsection{Traffic Types and Corresponding Service Models}
The choice of the service model to be utilized heavily depends on the type of traffic. Recall, that performance of previous generations of cellular systems, e.g., LTE, have been evaluated silently assuming inherently adaptive traffic patterns adaptive to the network state (via application layer rate adaptation mechanisms) and thus mainly utilized the elements of stochastic geometry \cite{haenggi2012stochastic,haenggi2009stochastic}. The rationale is that the service time of these sessions is not affected by the current rate provided by the network. As a consequence, the additional assumption is that all the system resources are utilized and thus the interference is maximized for a given frequency reuse ratio. In such systems performance metrics of interest are related to principal connectivity measures of UEs, i.e., outage and coverage probabilities, spectral efficiency, Shannon channel capacity, and fairness of resource allocations, etc., as a function of UE and BS densities. Furthermore, these models are not suitable to evaluate performance in underloaded conditions at all.
Evaluating the performance of non-adaptive applications requires much more comprehensive models than those utilized for analysis of adaptive applications utilizing the tools of stochastic geometry. This applied to elastic applications whose service time is dictated by the rate they receive at the air interface (e.g. large file transfers) and applications with high, guaranteed, and constant bitrates over mmWave and THz air interfaces. The latter type of applications such as VR/AR, 8/16K, remote video gaming, telepresence \cite{hu2021vision,vannithamby2017towards,agiwal2016next} are expected to be inherent for rate-rich mmWave and THz air interfaces. These applications are inherently prone to outage events caused by blockage and micromobility and its performance analysis requires not only taking into account radio part specifics but the traffic service dynamics at BSs by joining the tools of stochastic geometry and queuing theory.
Despite in this study we will mainly concentrate on performance evaluation models for non-elastic/adaptive applications, we also briefly cover those utilized for adaptive and elastic ones. Table \ref{tab:serviceCookbook} provides the so-called service models cookbook targeted to different types of applications, where PS stands for processor sharing service disciple. For non-elastic/adaptive applications, it also provides references to the forthcoming sections, where appropriate models will be considered.
\subsubsection{Metrics of Interest}
In our work we concentrate on system-level performance metrics of interest. Contrarily to physical and link-level studies concentrating on optimizing a certain functionality of interest, e.g., \cite{zeng2016millimeter,chen2021hybrid}, these type of models characterize application layer performance as a function of lower layer mechanisms, channel specifics, and traffic type. The latter defines not only service models but performance measures of interest that are also provided in Table \ref{tab:serviceCookbook}.
System-level performance evaluation frameworks for mmWave and THz systems need to address both user- and system-centric KPIs. For user-centric KPI we consider: (i) the new session drop probability and (ii) the ongoing session drop probability. The former is defined as the probability that a new session arriving session to BS is lost due to the lack of resources needed to serve it. The ongoing session drop probability is interpreted as the probability that a session already accepted for service is lost during the ongoing service. These metrics describe the so-called session continuity of applications characterizing how reliable the provided service is and can be used to benchmark the advanced service mechanisms at BSs \cite{kovalchukov2018improved,begishev2021joint,begishev2019quantifying,begishev2021multi}. Finally, the system-centric KPIs in these systems are mainly related to the efficiency of resource utilization at BSs.
\subsection{Methodology at the Glance}
We will consider a performance evaluation framework capable of quantifying the user- and system-centric KPI defined in Section \ref{sect:system}. The overall framework is divided into two complementary parts: (i) a queuing part specified in this section and (ii) a radio abstraction (parametrization) part introduced in Section \ref{sect:param}. The latter captures the specifics of propagation properties of mmWave/THz bands as well as additional phenomena such as micromobility and blockage. The queuing part characterizes the resource allocation dynamics at the BS and accepts the pmf of the amount of requested resources, $\{p_j\}_{j\geq0}$, and the temporal intensity of the UE stage changes between outage and non-outage conditions, $\alpha$, as the input. The former parameter is responsible for abstracting the random UE locations with respect to BSs in the deployment of interest as well as antenna and propagation specifics. The latter parameter is responsible for capturing outage prone nature of considered RATs caused by blockage and micromobility dynamics. Thus, these two parameters characterize the type of deployment providing the interface between two parts of the framework. Supplementing these two with the conventional session arrival and service characteristics that are not directly related to the radio part, the intensity of session arrivals, session services times, and required rate of sessions, one fully specifies the framework.
\begin{figure}[t!]
\centering
\includegraphics[width=1.0\columnwidth]{framework.pdf}
\caption{Illustration of the general structure of the framework for assessing KPIs of the non-elastic/adaptive traffic in mmWave/THz RATs: the core part is the queuing model representing the process of session service at mmWave/THz BSs; the rest of the model are combined to provided abstraction of the radio part specifics.}
\label{fig:framework}
\vspace{-2mm}
\end{figure}
The overall structure of the proposed framework is illlustrated in Fig. \ref{fig:framework}. By design, it allows for reuse of the core parts for investigating alternative mmWave/THz deployments by selecting appropriate models specified in the previous section. Here, the radio abstraction part estimates the intermediate ``interface'' parameters as a function of the considered deployment scenario, selected models as well as the system and environmental characteristics. As a result, the framework delivers KPIs of interest for selected advanced resource allocation policies at the BS, i.e., the resource reservation fraction, the number of simultaneously supported links, priorities, etc.
The queuing framework is characterized by a hierarchical structure. The baseline considered below first introduces the model with a single traffic type, no priorities and no session continuity mechanisms. Then, we proceed gradually extending the baseline to more sophisticated scenarios in incremental order of complexity, first, to resource reservation, then to multiconnectivity, further -- to priorities. Note that additional models can be built on top of these, e.g., by uniting multiconnectivity and priorities and defining additional rules to utilizing the former, one could formalize a model of a network segment with multiconnectivity capabilities servicing two or more traffic types.
The framework is based on resource queuing systems (RQS). The main difference between RQS and conventional queuing systems is that sessions require not only a server but also some random volume of a finite resource. This difference makes it possible to take into account the heterogeneity of the session resource requirements at mmWave/THz BSs arising from the random locations of UEs and, as a consequence, the random spectral efficiency of the wireless channel associated with the data sessions.
Note that this part does not pretend to be a complete review of the RQS theory. We present only the main results that are most often used in the analysis of mmWave/THz networks. We invite the interested reader to refer to the review of the RQS in two parts ~\cite{rsmo_review1, rsmo_review2}, which describes in detail the state-of-the-art of the RQS theory.
\subsection{Baseline Resource Queuing Systems}\label{sec4-1}
First, we consider a baseline resource model, see Fig. \ref{fig:smo}, that is, a multiserver queuing system with $N\leq \infty$ servers and a finite volume of resources, $R$. Assume that the arriving flow is Poisson with parameter $\lambda$, and service times of sessions are independent of each other, independent of the arrival process, and are exponentially distributed with parameter $\mu$. Each session requires one server and a random volume of the resources. Here, the amount of servers may represent the maximum number of active connections, if there is such a limit, while resources abstract time-frequency resources at the air interface and can be expressed in terms of resource blocks (RB). In what follows, we will assume that the distribution of resource requirements by a session is discrete and is described by the pmf $\{p_j\}_{j\geq0}$, where $p_j$ is the probability that the session requires $j$ resource units. An arriving session is lost if the amount of resource required for it exceeds the amount of unoccupied resources. At the end of the service, the session leaves the system and the total amount of occupied resources is decreased by the amount of resources allocated to the session. The schematic illustration of the considered system is shown in Fig. \ref{fig:smo}. Note that this model captures only the randomness of session resource requirements caused by UE locations, propagation model, utilized antenna arrays and session rate.
The system behavior is described by a random process $X_1(t)=\{\xi(t), \gamma(t)\}$, where $\xi(t)$ is the number of sessions in the system at the time $t$, and $\gamma(t)=(\gamma_1(t),\dots, \gamma_{\xi(t)}(t))$ is the vector that represents the number of resources allocated to each session. Let us introduce the notation for the stationary distribution of the process $X_1(t)$
\begin{align} \label{eq1}
&Q_k(r_1,\dots, r_k)=\nonumber \\
&=\lim_{t \to \infty} P \left\{ \xi(t)=k, \gamma_1(t)=r_1,\dots, \gamma_k(t)=r_k \right\}.
\end{align}
In \cite{naumov2016} it was shown that stationary probabilities (\ref{eq1}) can be obtained as follows
\begin{align} \label{eq2}
&Q_k(r_1,\dots, r_k)=Q_0\frac{\rho^k}{k!}\prod_{i=1}^{k}p_{r_i}, \, 1 \leq k\leq N, \sum_{i=1}^k r_i \leq R, \nonumber \\
&Q_0=\left( 1+\sum_{k=1}^N \sum_{r_1+...+r_k\leq R} \frac{\rho^k}{k!}\prod_{i=1}^{k}p_{r_i}, \right)^{-1},
\end{align}
where $\rho=\lambda/\mu$ is the offered load.
Note that the state space of the process $X_1(t)$ grows very quickly with the increase in $N$ and $R$, which leads to significant difficulties in calculating the stationary probabilities and the performance measures of the system, despite availability of analytical expressions in \eqref{eq2}. Moreover, the process $X_1(t)$ includes a lot of redundant information, which is unnecessary in most cases. By applying the state aggregation technique \cite{bobbio1986aggregation,ciardo1999etaqa}, to analyze the performance indicators of the system, it is sufficient to track only the number of sessions in the system and the total amount of the resource occupied by all the sessions. The stationary probabilities for the aggregated states are provided by
\begin{align} \label{eq3}
P_k(r)=\lim_{t \to \infty} P \left\{ \xi(t)=k, \sum_{i=1}^k \gamma_i(t)=r \right\}.
\end{align}
\begin{figure}[t!]
\centering
\includegraphics[width=0.65\columnwidth]{smo_new.pdf}
\caption{Illustration of the baseline resource queuing system: the principal difference with Erlang's loss model is presence of finite pool of resources that are allocated for arriving sessions.}
\label{fig:smo}
\vspace{-2mm}
\end{figure}
By summing up the probabilities in \eqref{eq2}, we obtain
\begin{align} \label{eq:4}
&P_k(r)=P_0\frac{\rho^k}{k!}p_r^{(k)}, \, 1 \leq k\leq N, r \leq R, \nonumber \\
&P_0=\left( 1+\sum_{k=1}^N \sum_{r=0}^R \frac{\rho^k}{k!}p_r^{(k)} \right)^{-1},
\end{align}
where $\{p_r^{(k)}\}_{r\geq 0}$ is a $k$-fold convolution of distribution $\{p_j\}_{j\geq0}$. Note that $p_r^{(k)}$ can be interpreted as the probability that $k$ sessions totally occupy $r$ resources. In practice, discrete convolutions are calculated using the recurrence relation
\begin{align} \label{eq:5}
p_r^{(k)}=\sum_{i=0}^r p_i p_{r-i}^{(k-1)}, \quad k \geq 2,
\end{align}
where $p_r^{(1)}=p_r$, $r \geq 0$.
Using the probabilities of the aggregated states $P_k(r)$, we can obtain expressions for the main characteristics of the model, namely, the new session drop probability $\pi_b$ and the average number of occupied resources $\bar{R}$ as follows
\begin{align} \label{eq:pi}
&\pi_b=1-P_0\sum_{k=0}^{N-1} \frac{\rho^k}{k!} \sum_{r=0}^R p_r^{(k+1)},\\
&\bar{R}=P_0\sum_{k=1}^{N} \frac{\rho^k}{k!} \sum_{r=1}^R rp_r^{(k)}.
\end{align}
\subsubsection{Simplified System} \label{sec4-1-1}
Consider a simplified process $X_2(t)=\{ \xi(t), \delta(t) \}$, where, differently from $X_1(t)$ considered above, the second component $\delta(t)$ denotes the total number of resources occupied by all the sessions. This simplification leads, on the one hand, to the decrease in the dimension of the state space, and, on the other hand, to the loss of important information about the queuing process. As a result, it is impossible to say exactly how many resources are released by a session upon its departure. In this case, one may utilize the following Bayesian approach. Assume that the system is in the state $(k,r)$ at the moment just before the session departure from the system. The probability that a session will release $j$ resources can be determined by the Bayes formula as $p_j p_{r-j}^{(k-1)}/p_r^{(k)}$. Then, the system of equilibrium equations for stationary probabilities $q_k(r)$ of the process $X_2(t)$ can be written in the following form
\begin{align} \label{eq:6}
&\lambda q_0 \sum_{r=0}^R p_r = \mu \sum_{r=0}^R q_1(r), \nonumber \\
&q_k(r) \left( \lambda \sum_{r=0}^{R-r} p_r + k\mu \right) = \lambda \sum_{j=0}^r q_{k-1}(j) p_{r-j} +(k+1) \times \nonumber\\
&\times\mu\sum_{j=0}^{R-r} q_{k+1}(r+j) \frac{p_j p_r^{(k)}}{p_{r+j}^{(k+1)}}, 1\leq k \leq N-1, 0 \leq r \leq R, \nonumber \\
&N\mu q_N(r) = \lambda \sum_{j=0}^r q_{N-1}(j) p_{r-j}, 0 \leq r \leq R.
\end{align}
As shown in ~\cite{naumov2016}, by substituting $P_k(r)$ from \eqref{eq3} into the system \eqref{eq:6}, one can prove that \eqref{eq:4} is its solution. Thus, the stationary probabilities of the simplified process $X_2(t)$ coincide with the probabilities of the aggregated states $P_k(r)$ of the initial process $X_1(t)$. As we will see in the following sections, the established fact is of critical importance for the analysis of more complex systems involving additional rules and service mechanisms at BSs. Generally, in more complex systems, it is not possible to obtain analytical expressions for stationary probabilities, which means that to analyze those systems one has to resort to a numerical solution of the system of equilibrium equations. However, in most practical cases it is not feasible due to the large state space of the process. Therefore, the proposed simplification makes it possible to numerically calculate performance measures of the considered class of systems in a reasonable time.
\subsubsection{Multiple Arriving Flows} \label{sec4-1-2}
Consider now a resource queuing system with multiple arriving flows of sessions. Particularly, differently from the systems considered above, we assume $L$ arriving mutually independent Poisson flows of sessions with intensities $\lambda_l$, $l=1,2,\dots,L$. Sessions of the $l$-th type are served with rates $\mu_l$, and their distribution of resource requirements is given by $\{p_{l,r}\}_{r \geq 0}$. The stationary probabilities $Q_{k_1,\dots,k_L}(r_1,\dots,r_L)$ that there are $k_l$ sessions of type $l$ occupying totally $r_l$ resources, $l=1,2,...,L$, are then provided by
\begin{align} \label{eq:7}
&Q_{k_1,\dots,k_L}(r_1,\dots,r_L)=\nonumber \\
&= Q_0\prod_{i=1}^{L}\frac{\rho_1^{k_i}}{k_i!}\prod_{i=1}^{L}p_{r_i}^{(k_i)}, \sum_{l=1}^L k_l \leq N, \, \sum_{l=1}^L r_l \leq R, \\
& Q_0=\hspace{-1mm}\left( 1+\hspace{-6mm}\sum_{1 \leq k_1+\dots+k_L \leq N} \sum_{0 \leq r_1+\dots+r_L \leq R} \hspace{-7mm}Q_{k_1,\dots,k_L}(r_1,\dots,r_L) \right)^{-1}. \nonumber
\end{align}
where $\rho_l=\frac{\lambda_l}{\mu_l}$, $l=1,2,...,L$.
Note that \eqref{eq:7} are also not overly useful for numerical calculations. However, in \cite{sopin_aggregation}, it was shown that a resource queuing system with $L$ flows of sessions is equivalent to the resource queuing system with one aggregated flow having a weighted average distribution of resource requirements. In other words, the stationary probabilities $Q_k(r)$ that there are $k$ sessions of all types in the system that totally occupies $r$ resources, are determined by
\begin{align} \label{eq:8}
& Q_{k}(r)=Q_0\frac{\rho^{k}}{k!} \bar{p}_{r}^{(k)}, 1 \leq k \leq N, r \leq R \nonumber\\
& Q_0=\left( 1+\sum_{k=1}^N \sum_{r=0}^R Q_{k}(r) \right)^{-1},
\end{align}
where $\rho=\rho_1+\dots+\rho_L$, and $\bar{p}_r$ are given by
\begin{align} \label{eq:9}
\bar{p}_r= \sum_{l=1}^L \frac{\rho_l}{\rho} p_{l,r}.
\end{align}
The mean amount of occupied resources can be found similarly to \eqref{eq:pi}, and the session drop probability of a $l$-type session takes the form of
\begin{align} \label{eq:10}
\pi_{b,l}=1- \sum_{k=0}^{N-1} \sum_{r=0}^R Q_k(r) p_{l,R-r}.
\end{align}
\subsubsection{Numerical Algorithm} \label{sec4-1-3}
The direct calculation of performance measures associated with resource queuing systems is complicated. The main reason is the need for evaluating multiple convolutions of the resource requirements distribution as discussed above. However, the authors in \cite{sopin_algorithm}, developed a recursive algorithm for calculating the normalization constant $Q_0$, which allows for efficient numerical analysis.
The algorithm proceeds as follows. First, denote
\begin{align}
G(n,r)=\sum_{k=0}^n\frac{\rho^k}{k!} \sum_{j=0}^r p_j^{(k)}.
\end{align}
Utilizing this notation, the normalization constant in \eqref{eq:8}, interpreted as the probability that the system is empty, can be written as $Q_0=G(N,R)^{-1}$. The function $G(n,r)$ can be calculated using the following recursion
\begin{align} \label{eq:11}
& G(n,r)=G(n-1,r)+\nonumber \\
& +\frac{\rho}{n} \sum_{j=0}^r p_j \left( G(n-1,r-j)-G(n-2,r-j) \right),
\end{align}
with initial conditions
\begin{align} \label{eq:12}
G(0,r)=1,\quad G(1,r)=1+\sum_{j=0}^r p_j, \quad r \geq 0.
\end{align}
Using $G(n,r)$, any performance measure of the system can be calculated. For example, the session drop probability $\pi_b$ and the average amount of occupied resources $\bar{R}$ take the form
\begin{align} \label{eq:13}
&\pi_b=1- \frac{1}{G(N,R)} \sum_{j=0}^R p_j G(N-1,R-j),\nonumber\\
&\bar{R}=R- \frac{1}{G(N,R)} \sum_{j=1}^R G(N,R-j).
\end{align}
\begin{figure*}[!!t]
\begin{align}\label{eq:20}
&\mathbf{D_n}(I(n,i),(n,j))=
\begin{cases}
-\left( \lambda \displaystyle\sum_{j=0}^{R-i} p_j +n\mu + n\alpha\left(1-\sum_{m=0}^i \theta_m(n,i) p_m \right)\right), \quad i=j, \\
n\alpha \displaystyle\sum_{m=0}^i \theta_m(n,i) p_{j-i+m}, \quad i<j, \\
n\alpha \displaystyle\sum_{m=i-j}^i \theta_m(n,i) p_{j-i+m}, \quad i>j,
\end{cases}(n,i), (n,j) \in \Psi_n, \quad 1 \leq n \leq N-1, \nonumber\\
&\mathbf{D_N}(I(N,i),(N,j))=
\begin{cases}
-\left( N\mu + N\alpha(1-\sum_{m=0}^i \theta_m(N,i) p_m \right), \quad i=j, \\
N\alpha \displaystyle\sum_{m=0}^i \theta_m(N,i) p_{j-i+m}, \quad i<j, \\
N\alpha \displaystyle\sum_{m=i-j}^i \theta_m(N,i) p_{j-i+m}, \quad i>j,
\end{cases}(N,i), (N,j) \in \Psi_N.
\end{align}
\hrulefill
\normalsize
\vspace{-2mm}
\end{figure*}
\subsection{Resource Queuing System with Service Interruptions} \label{sec4-2}
Consider now the extension of the system to the case of external flow of events that may potentially change the characteristics of the service process of sessions, currently served at the BS. In mmWave and THz systems these events can be utilized to capture impairments caused by the blockage process of LoS path, leading to either change in the resource requirements to maintain the target session rate \cite{begishev2019quantifying,begishev2021joint} or to outage events completely interrupting the session service process \cite{begishev2021multi}. In addition, these events can also model outage events caused by micromobility \cite{petrov2020capacity,petrov2018effect}. Due to a wide scope of the application area of these systems, in what follows, the external events are referred to as ``signals''.
Unlike the model considered in Section \ref{sec4-1}, we assume that each session is associated with a Poisson flow of signals with intensity $\alpha$. For certainty, in further exposition we consider LoS blockage process associated with UEs, where the blockage does not lead to outage conditions, i.e., in case of blockage the connection may still be maintained but more resources are required to provide the target session rate. In this case, upon signal arrival, the resources allocated for a session are all released and the session tries to occupy a new volume of resources according to the same or different probability distributions. In what follows, for certainty, we assume that the distribution remains intact. Note that this could be a pmf of session resource requirements obtained for blocked and non-blocked states and then weighted with blockage probability as discussed in Section \ref{sect:param}.
For analysis of this system, one may utilize the simplified method considered in Section \ref{sec4-1-1} that implies tracking only the total amount of the occupied resources. Accordingly, the behavior of the system is described by the stochastic process $X(t)=\{ \xi(t), \delta(t) \}$, where the first component denotes the number of sessions in the system at time $t$, and the second represents the total amount of resources occupied by all the sessions. The state space of the system is given by
\begin{align} \label{eq:15}
\Psi=\bigcup_{k=0}^N \Psi_k, \, \Psi_k=\left\{ (k,r): 0\leq r \leq R, p_r^{(k)} > 0 \right\},
\end{align}
where the states in the subsets $\Psi_k$ are ordered according to the ascending of the number of resources. Let $I(k, r)$ denote the sequential number of the state $(k, r)$ in the set $\Psi_k$.
\subsubsection{Stationary Distribution} \label{sec4-2-1}
First, we introduce an supplementary variable facilitating our exposition in what follows. Let $\theta_i(k,r)$ be the probability that a session occupies $i$ resources, provided that $k$ sessions totally occupy $r$ resources. Then, according to Bayes' law we have
\begin{align} \label{eq:16}
\theta_i(k,r)=\frac{p_i p_{r-i}^{(k-1)}}{p_r^{(k)}}.
\end{align}
To construct the infinitesimal generator of the process $X(t)$, consider possible transitions between the states of the system in more detail. Let the system be in the state $(k,r)$ at some time $t$. With probability $p_j$, an arriving session occupies $j$ resources, $j \leq R-r$, and the system goes to the state $(k+1,r+j)$. On the departure of a session, it releases $i$ resources with probability $\theta_i(k,r)$. In this case, the system state changes to the state $(k-1,r-i)$. Upon signal arrival, a session releases $i$ resources with probability $\theta_i(k,r)$ and requests $j$ resources with probability $p_j$. If $j \leq i$, then the session continues its service the system. If $j<i$, the system state changes to $(k,r-i+j)$ with probability $\theta_i(k,r) p_j$ while in the case of $j=i$ the state of the system does not change. Finally, if the new volume of resources requested by a session exceeds its previous volume ($j>i$), then the session remains in the system only when $j \leq R-r+i$. Otherwise, the session is lost (dropped) and the system goes to the state $(k-1,r-i)$.
The infinitesimal generator of the process $X(t)$ is a block tridiagonal matrix with diagonal blocks $\mathbf{D_0}, \mathbf{D_1}$, \dots, $\mathbf{D_N}$, superdiagonal blocks $\mathbf{\Lambda_1}$, \dots, $\mathbf{\Lambda_N}$ and subdiagonal blocks $\mathbf{M_0}, \dots, \mathbf{M_{N-1}}$, provided by
\begin{align} \label{eq:17}
&\mathbf{D_0}=-\lambda \sum_{j=0}^R p_j, \nonumber\\
&\mathbf{\Lambda_1}=(\lambda p_0, \dots, \lambda p_R),\nonumber\\
&\mathbf{M_0}=(\mu, \dots, \mu)^T.
\end{align}
\begin{figure*}[t!]
\vspace{-0mm}
\begin{align}\label{eq:sur3}
&\text{(i)}\qquad{}\lambda Q_0 \sum_{j=0}^{R_0} p_j=\mu\sum_{j:(1,j)\in \Psi_1} Q_1(j) + \alpha \sum_{j:(1,j)\in \Psi_1}Q_1(j)\left( 1-\sum_{s=0}^{R} p_s\right),\nonumber\\ \nonumber\\
&\text{(ii)}\qquad{}\left( \theta (R_0 - j)\lambda \sum_{j=0}^{R_0-r}p_j + k\mu +k \alpha \right)Q_k(r) = \theta (R_0 - j)\lambda\hspace{-10mm}\sum_{j \geq 0:(k-1,r-j)\in \Psi_{k-1}}\hspace{-10mm}Q_{k-1}(r-j)p_j+(k+1)\mu \times \nonumber\\
&\qquad{}\qquad{}\qquad{}\times\hspace{-10mm}\sum_{j \geq 0:(k+1,r+j)\in \Psi_{k+1}}\hspace{-10mm}Q_{k+1}(r+j) \theta_j(k+1,j+r) +(k+1)\alpha \left( 1-\sum_{s=0}^{R-r} p_s \right) \hspace{-2mm}\sum_{j \geq 0:(k+1,r+j)\in \Psi_{k+1}}\hspace{-12mm}Q_{k+1}(r+j) \theta_j(k+1,j+r) + \\
&\qquad{}\qquad{}+ k\alpha\hspace{-5mm}\sum_{j \geq 0:(k,j)\in \Psi_{k}}\hspace{-5mm}Q_{k}(j) \sum_{i=0}^{min(j,r)} \theta_{j-i}(k+1,j+r) p_{r-i},\quad 1 \leq n \leq N-1, \; 0 \leq r \leq R,\nonumber\\ \nonumber\\
&\text{(iii)}\qquad{} N(\mu + \alpha)Q_N(r) =\theta (R_0 - j)\lambda \hspace{-11mm}\sum_{j \geq 0:(N-1,j)\in \Psi_{N-1}}\hspace{-11mm} Q_{N-1}(r-j)p_j+N \alpha \hspace{-8mm}\sum_{j \geq 0:(N,j)\in \Psi_{N}}\hspace{-7mm} Q_N (j) \sum_{i=0}^{min(j,r)} \hspace{-3mm}\theta_{j-i}(N,j) p_{r-i}, \quad 1 \leq r \leq R.\nonumber
\end{align}
\hrulefill
\normalsize
\vspace{-2mm}
\end{figure*}
Omitting zero elements from the block $\mathbf{\Lambda_1}$, the number of columns in $\mathbf{\Lambda_1}$, as well as the number of rows in the block $\mathbf{M_0}$, are equal to the number of states in the subset $\Psi_1$. The blocks $\mathbf{D_n}(I(n,i),(n,j))$ and $\mathbf{D_N}(I(N,i),(N,j))$ are provided in (\ref{eq:20}). The blocks $\mathbf{\Lambda_n}(I(n-1,i),(n,j))$ are provided by
\begin{align} \label{eq:22}
\mathbf{\Lambda_n}(I(n-1,i),(n,j))=
\begin{cases}
\lambda p_{j-i}, & i \leq j \leq R, \\
0, & j<i,
\end{cases}
\end{align}
where $(n-1,i) \in \Psi_{n-1}$, $(n,j) \in \Psi_n$, $2 \leq n \leq N$.
Finally, the blocks $\mathbf{M_n}(I(n+1,i),(n,j))$ are specified as
\begin{align} \label{eq:23}
\mathbf{M_n}&(I(n+1,i),(n,j))= \nonumber \\
&=\begin{cases}
(n+1)\mu \theta_{i-j}(n+1,i), & j \leq i \leq R, \\
0, & j>i,
\end{cases}
\end{align}
where $(n+1,i) \in \Psi_{n+1}$, $(n,j) \in \Psi_n$, $1 \leq n \leq N-1$.
The stationary probabilities $Q_k(r)$ of the process $X(t)$ are the unique solution of the system of equilibrium equations with the normalization condition, that can be written as
\begin{align} \label{eq:24}
\mathbf{Q}\mathbf{A}=\mathbf{0}, \, \mathbf{Q} \mathbf{1}=1,
\end{align}
where $\mathbf{Q}$ is the row vector of stationary probabilities, $\mathbf{1}$ is a column vector of ones of appropriate size. The system \eqref{eq:24} can be solved by any numerical method, including those using the special block structure of the described infinitesimal generator.
\subsubsection{Performance Metrics} \label{sec4-2-2}
In this subsection, we will proceed to the analysis of system's performance indicators including the drop probability of a session upon arrival, $\pi_b$, and the average amount of occupied resources, $\bar{R}$. These metrics can be directly calculated using stationary probabilities as
\begin{align} \label{eq:25}
&\pi_b=1-\sum_{k=0}^{N-1} \sum_{r=0}^R Q_k(r) \sum_{j=0}^{R-r} p_r,\nonumber\\
&\bar{R}=\sum_{k=0}^{N} \sum_{r=0}^R rQ_k(r).
\end{align}
In the considered system, we are also interested in the probability $\pi_t$ that a session initially accepted for service is eventually lost due to the signal arrival. In our interpretation, this implies that upon blockage, the amount of resources at BS is insufficient to maintain the target bitrate of the session. To derive this metric, we first calculate the intensity of sessions that are eventually dropped, $\nu$, as
\begin{align} \label{eq:27}
\nu=\alpha\bar{N}\sum_{k=1}^{N} \sum_{r=0}^R Q_k(r) \sum_{j=0}^r \theta_j(k,r) \left(1-\sum_{i=0}^{R-r+j} p_i \right),
\end{align}
where $\bar{N}$ is the mean number of sessions in the system
\begin{align} \label{eq:28}
\bar{N}=\sum_{k=1}^{N} \sum_{r=0}^R kQ_k(r).
\end{align}
Then, the sought probability $\pi_t$ can be defined as the limit of the ratio of the number of accepted sessions that have been eventually dropped to the total number of accepted sessions during the time interval of duration $T$. Accordingly, we have
\begin{align} \label{eq:29}
\pi_t=\lim_{T \to \infty} \frac{\nu T}{\lambda(1-\pi_b)T}=\frac{\nu }{\lambda(1-\pi_b)}.
\end{align}
We specifically note that the probability that a session initially accepted to the system is eventually dropped is known to drastically affect quality of user experience (QoE) of a service \cite{seitz2003itu,serral2010overview,de2012quantifying,dobrian2011understanding}. As these events may often happen in mmWave and THz communications, recently, a number of approaches for improving it have been proposed. Most of these mechanisms can be modeled by utilizing the resource queuing systems framework described above. In what follows, we consider some of these mechanisms as examples.
\subsection{Resource Reservation}\label{sec4-3}
Reserving resources for sessions that sharply increase their resource requirements due to blockage of a LoS path, is one of the mechanisms to improve session continuity in mmWave and THz systems \cite{begishev2019quantifying,moltchanov2018improving}, especially, in early rollouts of these systems, where BS will be sparsely deployed. In this case, only part of the BS resources is available for the new arriving sessions, and the rest is reserved to support the sessions already accepted for service.
\subsubsection{Model Description} \label{sec4-3-1}
Consider a resource queuing system with $N$ servers and a finite amount of resources $R$, only part of which $R_0=(1-\gamma) R$, $0<\gamma<1$, is available for new arriving sessions. Here $ \gamma $ is the reservation coefficient and is interpreted as a fraction of reserved resources. The behavior of the system is described by a stochastic process $X(t)=\{\xi(t),\delta(t)\}$, where $\xi(t)$ is the number of sessions in the system, and $\delta(t)$ is the total the amount of the occupied resource. The state space of the system is described by \eqref{eq:15}.
Unlike the system considered in Section \ref{sec4-2}, when a session arrives to the system, it can occupy only a part of the resources, $R_0<R$. In other words, let the system be in the state $(k,r)$ and assume that an arriving session requires $j$ resources, then: (i) if $r>R_0$, any new arriving session is dropped, (ii) if $r \leq R_0$ and $j>R_0-r$, then an arriving session is dropped, and (iii) if $r \leq R_0$ and $j \leq R_0-r$, an arriving session is accepted into the system.
Once the session is accepted for service, the whole amount of resources, $R$, becomes available for it. When a signal arrives for a session when the system is in the state $(k,r)$, the session releases $i$ resources and tries to occupy $j$ resources. In this case, it is dropped only when $j>R-r+i$. Otherwise, the system operates similarly to the system described in Section \ref{sec4-2}. The typical subset of states and associated transitions for this system are illustrated in Fig. \ref{fig:state3}.
\begin{figure}[t!]
\centering
\includegraphics[width=0.55\columnwidth]{state_new.pdf}
\caption{Feasible transitions for the central state of the model represent the session service process with resource reservation \cite{begishev2019quantifying}.}
\label{fig:state3}
\vspace{-2mm}
\end{figure}
\subsubsection{Equilibrium Equations} \label{sec4-3-2}
By utilizing
\begin{align} \label{eq:30}
\theta (R_0-j) =
\begin{cases}
0, &\text{$j>R_0$,}\\
1, &\text{j $\leq R_0$,}
\end{cases}
\end{align}
the system of equilibrium equations can be written as in (\ref{eq:sur3}).
Using the system \eqref{eq:sur3}, together with the normalization condition provided in \eqref{eq:30}, one may calculate the stationary state probabilities of the system. Here, the infinitesimal generator of the process $X(t)=\{\xi(t),\delta(t)\}$ is obtained similarly to Section \ref{sec4-2} based on the system of equations \eqref{eq:sur3}.
\subsubsection{Performance Metrics} \label{sec4-3-3}
Consider the performance metrics of the system. Since the system with resource reservation differs from the system from Section \ref{sec4-2} only in the connection admission control (CAC) functionality, all the expressions for performance metrics except for the new session drop probability remain the same. The abovementioned unknown metric, $\pi_b$, is provided by
\begin{align} \label{eq:31}
\pi_b=1-\sum_{k=0}^{N-1} \sum_{r=0}^{R_0} Q_k(r) \sum_{j=0}^{R_0-r} p_r,
\end{align}
\subsubsection{Illustrative Example}
An example of application of the abovementioned framework to the case of mmWave BS utilizing the resource reservation strategy for sessions already accepted to the system is considered in \cite{begishev2019quantifying}. Consider a single cell system with session arrivals governed by the Poisson process whose geometric locations are uniformly distributed in the BS service area. Since resource reservation may only show gains when blockage does not lead to an outage the cell service area is computed accordingly. In Fig. \ref{fig:6cnew} we show typical new and ongoing session drop probabilities as a function of the amount of resources reserved for sessions accepted for service, required session rate of $10$ Mbps and different blockers intensity in the environment, $\lambda_B$ bl/m$^2$. As one may observe, there is a clear trade-off between two considered types of session drop probabilities. Unfortunately, the new session drop probability increases at a slightly faster rate as compared to the decrease in the ongoing session drop probability. Nevertheless, by utilizing this simple strategy a network operator may control the balance between these two probabilities in early 5G mmWave systems rollouts when NR BSs are installed in hotspot areas with high traffic demands.
\begin{figure}[t!]
\centering
\includegraphics[width=0.8\columnwidth]{fig6cnew.pdf}
\caption{New and ongoing session drop probabilities: reserving resources for sessions that are already accepted for service increases the new session drop probability but increases the service reliability at mmWave/THz BSs by decreasing the ongoing session drop probability \cite{begishev2019quantifying}.}
\label{fig:6cnew}
\vspace{-2mm}
\end{figure}
\subsection{Multiconnectivity and Resource Reservation} \label{sec4-4}
Another method for improving session continuity in mmWave and THz systems is standardized by 3GPP multiconnectivity operation \cite{3gpp_MC}. According to it, UE may maintain more than a single link to nearly BSs. UE may utilize all the links simultaneously via division duplex (TDD) mode or use one link for data transmission while keeping the rest as backup option in the case the currently active link experiences outage conditions due to blockage and/or micromobility. These connectivity strategies and associated resource allocation policies fall within the class of resource queuing networks -- an extension of resource queuing systems considered in the previous sections. Below, we describe the solution method for the case, where both multiconnectivity and resource reservation are simultaneously utilized.
\begin{figure}[b!]
\vspace{-0mm}
\centering
\includegraphics[width=1.0\columnwidth]{system_model_new.pdf}
\caption{Illustration of the resource queuing network: upon blockage active sessions are handed over to other BS available in the area inducing dependence in the session service process \cite{begishev2021joint}.}
\label{fig:queue}
\vspace{-0mm}
\end{figure}
\subsubsection{Model Description} \label{sec4-4-1}
Consider a queuing network consisting of $K$ BSs. The $k$-th BS has $N_k$ servers and $R_{k,1}$ resources. The $k$-th BS receives a Poisson flow of sessions with intensity $\lambda_k$, $k=1,2,\dots,K$, and $\lambda = \sum_{k=1}^{K}\lambda_k$. Each session arriving to the $k$-th BS is characterized by a random resource requirements with pmf $\{p_{0,r}\}_{r>0}$. For new arriving sessions, only a part of the resources is available, $R_{k,0}=R_{k,1}(1-\gamma)$, $0<\gamma<1$. Similarly to the previous section, if an arriving session finds that there are not enough resources in the system for its service, then this session is dropped. Service times are assumed to be exponentially distributed with the parameter $\mu$. Further, each session which is currently in service at the $k$-th BS is associated with a Poisson flow of signals with the intensity of $\alpha_k$, $k=1,2,\dots,K$, that represents channel state transitions between outage and connectivity states that might be caused by either blockage or micromobility or both. Upon a signal arrival, the session releases the occupied resources and generates a new value of resource requirements according to pmf $\{p_{1,r}\}_{r>0}$. If these resources are not available at the current BS, the session is routed to BS $k$ with probability $1/(K-1)$. Rerouted sessions are called ``secondary'' sessions. We also introduce the ``level'' a secondary session as the number of reroutes a session experienced. Secondary sessions form an additional Poisson arriving flow to each BS with intensities $\varphi_k$, $k=1,2,\dots,K$. All available resources at BSs are available for secondary sessions. If there is an insufficient amount of resources available, the session is dropped. Due to the memoryless property of the exponential distribution, the residual service time of a secondary session also follows an exponential distribution with the same parameter $\mu$. The illustration of the considered model is sketched in Fig. \ref{fig:queue}.
\begin{figure}[!b]
\vspace{-0mm}
\centering
\includegraphics[width=1.0\columnwidth]{calcAlgo_new.pdf}
\caption{Iterative algorithm for calculating performance metrics: at each stage the flow variables between BSs are updated the the difference in performance metrics at the current and previous iteration is assessed to decide on the convergence \cite{begishev2021joint}.}
\label{fig:algorithm}
\end{figure}
To analyze the described model, we rely upon the network decomposition method, which is commonly utilized in the analysis of complex queuing networks \cite{jia2009solving,kuehn1979approximate,gershwin1987efficient}. As usual, the key assumption here is that the service process of sessions at each BS does not depend on the service processes at other BSs in the network. Based on the decomposition approach, we develop a recurrent algorithm for the evaluation of the performance metrics as shown in Fig. \ref{fig:algorithm} and discussed below. First, the system parameters are initialized assuming the arrival intensity of the secondary sessions to be zero, $\varphi_k=0$, $k=1,2,\dots,K$. Then, the stationary probabilities of each BS are calculated, from which the network-wide measures are obtained. Further, the arrival intensities of the secondary sessions are recalculated by taking into account the next level of session rerouting. These new values of the arrival intensities $\varphi_k=0$, $k=1,2,\dots,K$ are used at the next iteration of the algorithm. The algorithm stops as the difference between the network characteristics at the consequent iterations becomes less than a certain specified level of accuracy.
\subsubsection{Single BS Performance} \label{sec4-4-2}
Consider BS with two Poisson flows of sessions: the flows of primary and secondary sessions with rates $\lambda_k$ and $\varphi_k$, respectively. By utilizing the memoryless property of exponential distribution we observe that the sojourn time of the session at the BS is also exponential with the parameter $\mu+\alpha_k$, $i=1,2,\dots,K$. Here, we again apply the simplified approach, where only the total amount of the occupied resources is tracked at BS. Then, by taking into account the number of primary and secondary sessions, the behavior of the system is described by a three-dimensional process $X(t)=\{\xi_1(t),\xi_2(t),\delta(t)\}$, where $\xi_1(t)$ is the number of primary sessions in the system at time $t$, $\xi_2(t)$ is the number of secondary sessions at time $t$, and $\delta(t)$ is the total amount of the resource occupied by all the sessions. The state space of the process is thus given by
\begin{align}
&\Psi = \hspace{-4mm}\bigcup_{0\leq n_1+n_2 \leq N} \hspace{-4mm}\Psi_{n_1,n_2}, \nonumber\\
&\Psi_{n_1,n_2} =\nonumber\\
&\hspace{-3mm}=\left\{(n_1,n_2,r):0\leq r \leq R_1, \hspace{-3mm}\sum_{i=0}^{\min(r,R_0)}\hspace{-2mm}p_{0,i}^{(n_1)}p_{1,r-i}^{(n_2)}>0\right\},
\end{align}
where, the superscript denotes the order to convolution.
Stationary probabilities $Q_{n_1,n_2}(r)$ that the system is in the state $(n_1,n_2,r) \in \Psi$ are defined as
\begin{align} \label{eqn:statprob}
Q_{n_1,n_2}(r)=\nonumber\\
&\hspace{-7mm}=\lim_{t \to \infty} P\{ \xi_1(t)=n_1, \xi_2(t)=n_2, \delta(t)=r \}.
\end{align}
Consider the amount of resources that a session releases upon departure. Denote by $\beta_{0,j}(n_1,n_2,r)$ the probability that, $j$ resources are released as a result of the primary session departure provided that the system is in the state $(n_1,n_2,r)$. For $r\leq R_{0}$, the probabilities $\beta_{0,j}(n_1,n_2,r)$ can be calculated using the Bayes law
\begin{align} \label{eq:beta0_r0}
\beta_{0,j}(n_1,n_2,r)=\frac{p_{0,j}\sum_{i=0}^{r-j}p_{0,i}^{(n_1-1)}p_{1,r-j-i}^{(n_2)}}{\sum_{i=0}^{r}p_{0,i}^{(n_1)}p_{1,r-i}^{(n_2)}}.
\end{align}
Similarly, define by $\beta_{1,j}(n_1,n_2,r)$ the probability that as a result of the secondary session departure, $j$ resources are released provided that the system is in the state
$(n_1,n_2,r)$,
\begin{align} \label{eq:beta1_r0}
\beta_{1,j}(n_1,n_2,r)=\frac{p_{1,j}\sum_{i=0}^{r-j}p_{0,i}^{(n_1)}p_{1,r-j-i}^{(n_2-1)}}{\sum_{i=0}^{r}p_{0,i}^{(n_1)}p_{1,r-i}^{(n_2)}}.
\end{align}
In the case of $r>R_0$, estimation of $\beta_{0,j}(n_1,n_2,r)$ and $\beta_{1,j}(n_1,n_2,r)$ is complicated as these probabilities depend on the arrival order of primary and secondary sessions, which cannot be determined from the state of the process. However, since the arrivals of the primary and secondary sessions are independent of each other and taking into account the known number of sessions of each type, any permutation of them in terms of the arrival time is equiprobable. Thus, the probability that the latest primary session takes the $k$-th place is
\begin{align}
\binom{k-1}{n_1 -1} \Big/ \binom{n_1 + n_2}{n_1},
\end{align}
where $\binom{k-1}{n_1 -1}$ is the number of ways to place $n_1 - 1$ the primary session in the first $k-1$ places (since the last one will take the $k$-th place), and $\binom{n_1 + n_2}{n_1}$ is the overall number of ways to place $n_1$ primary sessions. The probability that $n_1$ primary sessions and $k-n_1$ secondary sessions occupy $i \leq R_0$ is calculated using the convolution
\begin{align}
\sum\limits_{s=0}^{i}p_{0,s}^{(n_1)}p_{1,i-s}^{(k-n_1)},
\end{align}
Further, the probability that $n_1$ primary and $n_2$ secondary sessions occupy $r$ resources, provided that the latest primary session takes the $k$-th place, is estimated as
\begin{align}
\sum\limits_{i=0}^{\min(r,R_0)} p_{1,r-i}^{(n_2+n_1-k)} \sum\limits_{s=0}^{i}p_{0,s}^{(n_1)}p_{1,i-s}^{(k-n_1)}.
\end{align}
Finally, the probability that $n_1$ primary and $n_2$ secondary sessions together occupy $r$ resources has the following form
\begin{align}
\sum\limits_{k=n_1}^{n_1+n_2}\frac{\binom{k-1}{n_1 -1}}{\binom{n_1 + n_2}{n_1}}\sum\limits_{i=0}^{min(r,R_0)} p_{1,r-i}^{(n_2+n_1-k)} \sum\limits_{s=0}^{i}p_{0,s}^{(n_1)}p_{1,i-s}^{(k-n_1)}.
\end{align}
Estimation of $\beta_{0,j}(n_1,n_2,r)$ and $\beta_{1,j}(n_1,n_2,r)$ in the case $r>R_0$ is not an easy computational problem. To reduce the computational complexity, one may utilize approximation obtained by neglecting the order of session arrivals, i.e.,
\begin{align}\label{eq:beta_0}
& \beta_{0,j}(n_1,n_2,r)=\frac{p_{0,j}\sum\limits_{i=0}^{\min(r-j,R_0-j)}p_{0,i}^{(n_1-1)}p_{1,r-j-i}^{(n_2)}}{\sum\limits_{i=0}^{\min(r,R_0)}p_{0,i}^{(n_1)}p_{1,r-i}^{(n_2)}},\nonumber\\
& \beta_{1,j}(n_1,n_2,r)=\frac{p_{1,j}\sum\limits_{i=0}^{\min(r-j,R_0)}p_{0,i}^{(n_1)}p_{1,r-j-i}^{(n_2-1)}}{\sum\limits_{i=0}^{\min(r,R_0)}p_{0,i}^{(n_1)}p_{1,r-i}^{(n_2)}}.
\end{align}
\begin{figure}[t!]
\centering
\includegraphics[width=0.9\columnwidth]{state4_new.pdf}
\caption{Typical set of states and associated transition intensities for model representing session service process with multiconnectivity and resource reservation \cite{begishev2021joint}.}
\label{fig:state4}
\vspace{-2mm}
\end{figure}
By utilizing $\beta_{0,j}(n_1,n_2,r)$ and $\beta_{1,j}(n_1,n_2,r)$ the system of equilibrium equations for the process $X(t)$ takes the form of (\ref{eq:equilibrium}). The typical subset of states and associated transition intensities are illustrated in Fig. \ref{fig:state4}.
\begin{figure*}[!!t]
\vspace{-0mm}
\begin{align}\label{eq:equilibrium}
&\text{(i)}\qquad{}Q_0\left[ \lambda_k \sum_{j=0}^{R_0}p_{0,j}+\varphi_k\sum_{j=0}^{R_1}p_{1,j}\right]=(\mu+\alpha_k)\left[\sum_{j:(1,0,j)\in \Psi_{1,0}}\hspace{-3mm}Q_{1,0}(j)+\sum_{j:(0,1,j)\in \Psi_{0,1}}Q_{0,1}(j)\right],\nonumber\\ \nonumber\\
&\text{(ii)}\qquad{}Q_{n_1,n_2}(r)\left[ \lambda_k\sum_{j=0}^{R_0-r}p_{0,j}+\varphi_k\sum_{j=0}^{R_1-r}p_{1,j}+(n_1+n_2)(\mu+\alpha_k)\right]= \lambda_k\hspace{-7mm}\sum_{j:(n_1-1,n_2,r-j)\in \Psi_{n_1-1,n_2}}\hspace{-12mm}p_{0,j}Q_{n_1-1,n_2}(r-j)+ \nonumber\\
&\hspace{11mm}+\varphi_k\hspace{-12mm}\sum_{j:(n_1,n_2-1,r-j)\in \Psi_{n_1,n_2-1}}\hspace{-12mm}p_{1,j}Q_{n_1,n_2-1}(r-j)+(n_1+1)(\mu+\alpha_k)\hspace{-12mm}\sum_{j:(n_1+1,n_2,r+j)\in \Psi_{n_1+1,n_2}}\hspace{-12mm}Q_{n_1+1,n_2}(r+j)\beta_{0,j}(n_1+1,n_2,r+j)+\nonumber\\
&\hspace{11mm}+(n_2+1)(\mu+\alpha_k)\hspace{-12mm}\sum_{j:(n_1,n_2+1,r+j)\in \Psi_{n_1,n_2+1}}\hspace{-12mm}Q_{n_1,n_2+1}(r+j)\beta_{1,j}(n_1,n_2+1,r+j), \quad n_1+n_2<N, \; r\leq R_0, \nonumber \\ \nonumber\\
&\text{(iii)}\qquad{}Q_{n_1,n_2}(r)\left[\varphi_k\sum_{j=0}^{R_1-r}p_{1,j}+(n_1+n_2)(\mu+\alpha_k)\right]= \varphi_k\hspace{-7mm}\sum_{j:(n_1,n_2-1,r-j)\in \Psi_{n_1,n_2-1}(r-j)}\hspace{-14mm}p_{1,j}Q_{n_1,n_2-1}(r-j)+ \\
&\hspace{12mm}+(n_1+1)(\mu+\alpha_k)\hspace{-12mm}\sum_{j:(n_1+1,n_2,r+j)\in \Psi_{n_1+1,n_2}}\hspace{-12mm}Q_{n_1+1,n_2}(r+j)\beta_{0,j}(n_1+1,n_2,r+j) + \nonumber\\
&\hspace{12mm}+(n_2+1)(\mu+\alpha_k)\hspace{-12mm}\sum_{j:(n_1,n_2+1,r+j)\in \Psi_{n_1,n_2+1}}\hspace{-12mm}Q_{n_1,n_2+1}(r+j)\beta_{1,j}(n_1,n_2+1,r+j), \quad n_1+n_2<N, \; r>R_0,\nonumber \\ \nonumber\\
&\text{(iv)}\qquad{}(n_1+n_2)(\mu+\alpha_k)Q_{n_1,n_2}(r)=\nonumber \\
&\hspace{12mm}=\lambda_k\hspace{-12mm}\sum_{j:(n_1-1,n_2,r-j)\in \Psi_{n_1-1,n_2}}\hspace{-12mm}p_{0,j}Q_{n_1-1,n_2}(r-j)+\varphi_k\hspace{-6mm}\sum_{j:(n_1,n_2-1,r-j)}\hspace{-6mm}p_{1,j}Q_{n_1,n_2-1}(r-j), \quad n_1+n_2=N, \; r\leq R_0.\nonumber \\ \nonumber\\
&\text{(v)}\qquad{}(n_1+n_2)(\mu+\alpha_k)Q_{n_1,n_2}(r)=\varphi_k\hspace{-12mm}\sum_{j:(n_1,n_2-1,r-j)\in \Psi_{n_1,n_2-1}}\hspace{-12mm}p_{1,j}Q_{n_1,n_2-1}(r-j),\quad n_1+n_2=N, \; r>R_0. \nonumber
\end{align}
\hrulefill
\normalsize
\vspace{-3mm}
\end{figure*}
\begin{comment}
The \eqref{eq:equilibrium} equations are derived from the following considerations:
\begin{enumerate}
\item{ On the left-hand side of the equation, $\lambda_k \sum_{j=0}^{R_0}p_{0,j}+\varphi_k\sum_{j=0}^{R_1}p_{1,j}$ represents the exit rate from the state $(0,0,0)$. On the right-hand side $(\mu+\alpha_k)$ is the intensity of the transition from all states of the form $(1,0,j)$ and $(0,1,j)$ to the state $(0,0,0)$, which corresponds to the end of service and the transition of the session to another node.}
\item{ The second equation is valid for $n_1+n_2<N$, $r\leq R_0$. The expression on the left is $\lambda_k\sum_{j=0}^{R_0-r}p_{0,j}+\varphi_k\sum_{j=0}^{R_1-r}p_{1,j}+(n_1+n_2)(\mu+\alpha_k)$ is equal to the exit rate from the state $(n_1,n_ 2,r)$. Further, the first term $\lambda_k \sum_{j:(n_1-1,n_2,r-j)\in \Psi_{n_1-1,n_2}}p_{0,j}Q_{n_1-1,n_2}(r-j)$ is the transition intensity from the state $(n_1-1,n_2,r-j)$ to the state $(n_1,n_2,r)$ caused by the arrival of a primary session to the node $k$. The second term is the transition intensity to $(n_1,n_2,r)$ associated with the rerouting of the secondary session to the node $k$. The next two terms define the transitions in $(n_1,n_2,r)$ associated with the arrival of signals. }
\item{ The third equation is valid for $n_1+n_2<N$ and $r > R_0$. The logic for constructing the equation is similar to the previous one.}
\item{ The fourth equation describes state transitions in which $n_1+n_2=N$, $r\leq R_0$. The first term on the left $(n_1+n_2)(\mu+\alpha_k)$ is the transition intensity from state $(n_1,n_2,r)$ to states $(n_1-1,n_2,r_j)$ or $(n_1,n_2-1,r_j)$ caused by service completion or signal arrival, respectively. On the right-hand side, the expression $\lambda_k\sum_{j:(n_1-1,n_2,r-j)\in \Psi_{n_1-1,n_2}}p_{0,j}Q_{n_1-1,n_2}(r-j)$ is the transition intensity from the state $(n_1-1,n_2,r-j)$ to the state $(n_1,n_2,r)$ associated with the arrival of a primary session. The second term reflects the transitions caused by the arrival of a secondary session.}
\item{The fifth equation is derived similarly to the previous one.}
\end{enumerate}
\end{comment}
\subsubsection{Performance Metrics} \label{sec4-4-3}
The system of equilibrium equations defined in (\ref{eq:equilibrium}) needs to be solved numerically. Due to the fact that the number of equations in the system can reach $N(N+1)R_1/2$, we recommend using special libraries for sparse matrices and associated iterative methods, i.e., Gauss-Seidel method \cite{he2014fundamentals,latouche1999introduction}.
\begin{comment}
The stationary probabilities and the performance metrics of the system are calculated iteratively following \ref{fig:algorithm}, where at each iteration the next level of secondary sessions is added. The procedure ends when the required accuracy of the is achieved. At the first iteration, the intensities of secondary sessions are assumed to be zero $\varphi_k=0$, $k=0,1,\dots,K$. Then the following is performed:
\begin{enumerate}
\item per-BS: using $\lambda_k$, $\mu$, $\alpha_k$, $\varphi_k$, and the pmfs $\{p_{0,j}\}$, $\{p_{1,j}\}$, we calculate performance indicators of each BS separately: the new session session drop probability, $\pi_{b,k}$, the probability that the rerouted session is dropped, $\pi_{s,k}$, the mean number of sessions $\bar{N_k}$ in the system and the mean number of occupied resources $\bar{R_k}$;
\item network-wide: the new session drop probability $\pi_b$, the probability that a transition to another node will block a secondary entity $\pi_{s}$, the average number of the occupied resource $\bar{R}$;
\item If the required accuracy is reached, the algorithm stops. Otherwise, the arrival rates of secondary sessions of the next level $\varphi_k^{v+1}$ are calculated, the next iteration is started.
\end{enumerate}
\end{comment}
Once the stationary state distribution is obtained, performance metrics immediately follow. The new session drop probability $\pi_{b,k}$ at BS $k$ and the probability $\pi_{s,k}$ that rerouting leads to the drop of a session take the form
\begin{align}\label{eq:pib}
&\pi_{b,k}=1-\hspace{-9mm}\sum_{0\leq n_1+n_2\leq N-1}\sum_{r\leq R_{0,k}:(n_1,n_2,r)\in \Psi_{n_1,n_2}}\hspace{-12mm}Q_{n_1,n_2}(r)\sum_{j=0}^{R_{0,k}-r}p_{0,j},\nonumber \\
&\pi_{s,k}=1-\hspace{-9mm}\sum_{0\leq n_1+n_2\leq N-1}\sum_{r:(n_1,n_2,r)\in \Psi_{n_1,n_2}}\hspace{-10mm}Q_{n_1,n_2}(r)\sum_{j=0}^{R_{1,k}-r}p_{1,j}.
\end{align}
The intensities of secondary sessions are given by
\begin{align}\label{eq:phi}
&\varphi_k=\sum_{v=1}^{\infty}\varphi_{k}^{v}, \nonumber\\
&\varphi_k^1=\sum_{i=1}^{K}\lambda_{i} (1-\pi_{b,i})\frac{\alpha_i}{\mu+\alpha_i}\varphi_{i,k}^{0},\nonumber\\
&\varphi_{k}^{v}=\sum_{i=1}^{K}\varphi_{i}^{v-1}(1-\pi_{s,i})\frac{\alpha_i}{\mu+\alpha_i}\varphi_{i,k}^{v-1}, v>1,
\end{align}
where $v$ denotes the level of the second session.
The network-wide counterparts of these metrics are
\begin{align}\label{eq:pb}
\pi_b=\sum_{k=1}^{K}\frac{\lambda_k}{\lambda}\pi_{b,k},\, \pi_s=\sum_{k=1}^{K}\frac{\varphi_k}{\varphi}\pi_{s,k},
\end{align}
and they need to be utilized as shown in Fig. \ref{fig:algorithm}.
Finally, the probability that the initially accepted for service session is eventually dropped is given by
\begin{align} \label{eq:piO}
\pi_O=\lim_{t\rightarrow\infty} \frac{\varphi\pi_s t}{\lambda(1-\pi_b) t} = \frac{\varphi\pi_s}{\lambda(1-\pi_b)},
\end{align}
where the numerator is the mean number of accepted sessions that have been dropped during time $t$, and the denominator is the overall number of accepted sessions during time $t$.
\subsubsection{Illustrative Example}
\begin{figure}[t!]
\centering
\includegraphics[width=0.8\columnwidth]{fig9anew.pdf}
\caption{New and ongoing session drop probabilities: increasing the number of mmWave/THz BS accessible for UE drastically imrpoves service reliability including both new and ongoing session drop probability \cite{begishev2021joint}.}
\label{fig:fig9anew}
\vspace{-2mm}
\end{figure}
The new and ongoing session drop probabilities in presence multiconnectivity obtained using the framework discussed above are shown in Fig. \ref{fig:fig9anew} for the session rate of $10$ Mbps. Following \cite{begishev2021joint} we consider a circular deployment with a number of BSs evenly spaced over the circumference. As one may observe, increasing the degree of multiconnectivity leads to the dramatic reduction in both new and ongoing session drop probability. This is in contrast to resource reservation that improves ongoing session drop probability at the expense of new session loss probability inducing a trade-off between these two metrics. However, this gain comes at the expense of increased implementation complexity, signaling load and the decreased energy efficiency of UEs. On top of this, the efficient use of this functionality requires dense mmWave BS deployments that are only feasible at later stages of 5G rollouts. Using the described framework one may also capture the joint effects of resource reservation and multiconnectivity. For in-depth analysis of this scenario we refer to \cite{begishev2021joint}.
\begin{comment}
\begin{figure*}[!t]
\centering
\subfigure[{New session drop probability}]
{
\includegraphics[width=0.7\columnwidth]{figures/fig11anew.pdf}
\label{fig:guardOnlyDrop}
}~
\subfigure[{Ongoing session drop probability}]
{
\includegraphics[width=0.7\columnwidth]{figures/fig11bnew.pdf}
\label{fig:guardOnlyUtil}
}
\caption{User- and system-centric metrics in presence of guard capacity and multiconnectivity.}
\label{fig:guardOnly}
\vspace{-2mm}
\end{figure*}
\end{comment}
\subsection{Multiple Flows with Priorities}\label{sect:priorities}
Finally, we consider how to incorporate session priorities in the considered framework. To this aim, consider a resource queuing system with two types of sessions, (e.g., URLLC and eMBB), pre-emptive priority service discipline, $N$ servers and resource volume $R$. Here, we refer to prioritized sessions as first type sessions. Other sessions are referred to as second type sessions. Both types of sessions arrive according to mutually independent Poisson processes with parameters $\lambda_1$ and $\lambda_2$, respectively, and their service times are exponentially distributed with intensities $\mu_1$ and $\mu_2$. Besides, the resource requirements distributions are $\{p_{1,r}\}$ and $\{p_{2,r}\}$, $r \geq 0$.
The behavior of the considered system can be described by four-dimensional Markov process $\left( \xi_1(t), \delta_1(t), \xi_2(t), \delta_2(t) \right)$, where $\xi_i(t)$ is the number of $i$-th type sessions in the system and $\delta_i(t)$ is the total number of resources occupied by $i$-th type sessions at time $t$. However, the straightforward approach to obtain steady-state distribution of the number of sessions via numerical solution of the system of equilibrium equations is not feasible. The reason is the state space explosion with the number of states reaching $(N+1)(N+2)(R+1)(R+2)/4$. To decrease computational complexity of the solution, one may resort to the approximation by deducing performance metrics via marginal distributions of both types of sessions in the system. To demonstrate the basic principles, denote by $Q_i(n_i,r_i)$ the marginal distribution that $n_i$, $i=1,2$, sessions of $i$th type totally occupy $r_i$ resources. Observe that under the pre-emptive priority service discipline, the service process of the first type of sessions is not affected by the service process of the second type of sessions. Thus, the marginal distribution $Q_1(n_1,r_1)$ can be obtained by solving \eqref{eq:4} for the system with only first type of sessions.
To determine $Q_2(n_2,r_2)$ knowing $Q_1(n_1,r_1)$ one may utilize the following idea. Observe that when there are $n_2$ second type sessions that totally occupy $r_2$ resources, the number of priority sessions and resources occupied by them is given by the marginal distribution $Q_1(n_1,r_1)$ given that there are no more than $N-n_2$ of them, and they totally occupy no more than $R-r_2$ resources. Applying this idea, one can estimate the following auxiliary probabilities that depend on the number of second type sessions in the system and volume of resources occupied by them: (i) the probability that an arriving session of the second type is dropped and (ii) the probability that an arriving session of the first type interrupts the service process of $k$ sessions of the second type. With these probabilities in hand, one may further derive the system of equilibrium equations for the marginal distribution $Q_2(n_2,r_2)$, which is then solved numerically. The performance metrics of interest include drop probabilities of both types of sessions as well as the probability that a session of the second type will be interrupted during the service will immediately follow.
\subsubsection{Illustrative Example}
The described framework has been applied in \cite{sopin2020resource} to evaluate priority-based service between URLLC and eMBB sessions served as mmWave BS. We consider a single cell system with session arrivals governed by the Poisson process whose geometric locations are uniformly distributed in the cell service area. We illustrate high-priority and low-priority session drop probabilities as well as low-priority session interruption probability in Fig. \ref{fig:interup} as a function of high-priority session arrival intensity $\lambda_1$. As expected the high-priority traffic, e.g., URLLC, is well-isolated from the low-priority one. However, there is a complex interplay between low-priority session drop probability and session interruption probability, where the latter first decreases and then, starting from $\lambda_1\approx{}17$ sessions/s, increases. To reduce the latter undesirable effect of dropping sessions already accepted to service one may apply resource reservation for low-priority traffic. This type of system can also be analyzed within the proposed framework by combining the priority model with the resource reservation model considered above. Note that priority service, and thus, the proposed framework can also be applied to enable slicing at the air interface \cite{sallent2017radio,koucheryavy2021quantifying}.
\subsection{Multiconnectivity with Reservation for Adaptive Sessions}\label{sect:adaptive}
So far we have considered scenarios with intra-RAT multiconnectivity, where this functionality is utilized exclusively for mmWave or for THz RATs. A viable option is to utilize intra-RAT multiconnectivity, where UE may support active links with LTE or sub-6 GHz NR BSs along and with mmWave/THz BS simultaneously. Being inherently unaffected by blockage microwave BS in this scenario may provide an option for temporal offloading of sessions from mmWave/THz BS in case of blockage or micromobility. To address this case, consider a scenario with one BS operating in microwave band and several mmWave/THz BSs in its coverage area \cite{moltchanov2021performance}. Sessions from mmWave BSs are rerouted to the microwave BS in case of an outage. Due to inherent rate mismatch between microwave and mmWave/THz band we consider inherently adaptive traffic (also known as a full buffer in 3GPP specifications) that utilizes application layer adaptation to changing rate at the air interface. Since in this deployment the microwave BS is a natural bottleneck, we concentrate on performance assessment of sessions bottlenecked at this BS. To protect original traffic from the rerouted one, explicit reservations for both traffic types are utilized.
\subsubsection{Model Description}
The microwave BS is modeled as a resource queuing system with $R$ units of resources (PRBs). A part of the resources $R_1$ is reserved for sessions that initially arrive at the microwave BS, and another part $R_2$, $R_1+R_2<R$, is reserved for sessions that are rerouted from mmWave BS in case of outage. In what follows, we refer to the former and latter as first and second type of sessions, respectively. Assume that both types of sessions arrive according to Poisson processes with intensities $\lambda_1$ and $\lambda_2$, respectively. Service times are exponentially distributed with intensities $\mu_1$ and $\mu_2$. Since sessions are adaptive in nature, the resources are divided equally between them, accounting for the reserved resource volumes and minimal requirements $x_1$ and $x_2$.
The behavior of the considered system can be described by a two-dimensional Markov process $X(t)=\{\xi_1(t),\xi_2(t)\}$, where $\xi_i$ is the number of $i$-type sessions in the system. The first type sessions may occupy no more than $R-R_2$ resources, while sessions of the second type -- $R-R_1$ resources. The rest of the resources is shared by both types of sessions. Then, the maximum number of the first type sessions is $K_1=\lfloor (R-R_2)/x_1 \rfloor$ and the maximum number of the second type sessions is $K_2=\lfloor (R-R_1)/x_2 \rfloor$. The set of states $\Psi$ is
\begin{equation}
\Psi \hspace{-1mm}=\hspace{-1mm} \left\{ (k_1,k_2)\hspace{-1mm}: k_1x_1+k_2x_2 \leq R, k_1 \leq K_1, k_2 \leq K_2 \right\}.
\end{equation}
\subsubsection{Equilibrium Equations}
The stationary probabilities $Q(k_1,k_2)$ can be found as the solution of the following set of equilibrium equations
\begin{align} \label{eq:elset}
&Q(k_1,k_2)\left[ \lambda_1 I(x_1(k_1+1)+x_2k_2 \leq R, k_1<K_1)+ \right. \nonumber \\
&+\lambda_2 I(x_1k_1+x_2(k_2+1) \leq R, k_2<K_2)+ \nonumber \\
&\left.+k_1\mu_1 +k_2\mu_2 \right]=\lambda_1 I(k_1>0)Q(k_1-1,k_2)+ \nonumber \\
&+\lambda_2 I(k_2>0)Q(k_1,k_2-1)+ \nonumber \\
&+(k_1+1)\mu_1 I(x_1(k_1+1)+x_2k_2 \leq R, k_1<K_1)+ \nonumber \\
&+(k_2+1)\mu_2 I(x_1k_1+x_2(k_2+1) \leq R, k_2<K_2),
\end{align}
where $I(\cdot)$ is the indicator function.
Since the Markov chain is reversible, it is easy to see that the solution of \eqref{eq:elset} has the following product form
\begin{align}
&Q(k_1,k_2)=Q_0\frac{\rho_1^{k_1}}{k_1!}\frac{\rho_2^{k_2}}{k_2!}, \nonumber \\
&Q_0=\left( \sum_{(k_1,k_2)\in \Psi} \frac{\rho_1^{k_1}}{k_1!}\frac{\rho_2^{k_2}}{k_2!} \right)^{-1},
\end{align}
where $\rho_i=\lambda_i/\mu_i$, $i=1,2$, is the load of $i$-type sessions.
\subsubsection{Performance Metrics}
Once the stationary-state probabilities are obtained, the session drop probabilities can be calculated. Let $\Psi_{b,i} \subset \Psi$, $i=1,2$, be the subset of states, where arriving $i$-type session is dropped, i.e.,
\begin{align}
\Psi_{b,i}&=\left\{ (k_1,k_2) \in \Psi: k_i=K_i \right\} \cup \nonumber \\
& \cup \left\{ (k_1,k_2) \in \Psi : k_1x_1+k_2x_2>R-x_i \right\}.
\end{align}
Then, the new session drop probability $\pi_b$ expressed by
\begin{align}
&\pi_b=\sum_{(k_1,k_2) \in \Psi_{b,1}} Q(k_1,k_2).
\end{align}
Observe that the drop of the sessions initially arriving to microwave BS affects the ongoing session drop probability of sessions temporarily offloaded from mmWave/THz BSs. Also note that sessions originally arriving to the mmWave/THz BSs may suffer multiple outage events and thus temporal reroutes to microwave BS until their service completion. Thus, we first characterize the section type sessions drop intensity $\nu$ as
\begin{align}
\nu=\lambda_2 \sum_{(k_1,k_2) \in \Psi_{b,2}} Q(k_1,k_2).
\end{align}
Then, the ongoing session drop probability of sessions that originally arrive to mmWave/THz BS is given by the ratio of the drop intensity and arrival intensity, i.e.,
\begin{align}
\pi_t=\nu/\lambda_{\bullet},
\end{align}
where $\lambda_{\bullet}$ is the total arrival intensity at all mmWave BSs.
Finally, having defined $r_i(k_1,k_2)$ as the number of resources occupied by each $i$-type session provided that there are $k_1$ 1-type and $k_2$ 2-type sessions in the system, one can evaluate the average bitrate achieved for both type of sessions for a given fairness criterion using standard stochastic geometry technique \cite{moltchanov2021performance}, see also Section \ref{sect:approaches}.
\subsection{Performance Models for Elastic Traffic}\label{sec:servcoefs}
The least investigated type of traffic in mmWave/THz cellular systems is an elastic one, where application level rate adaptation is utilized similarly to adaptive traffic but the session itself requires a certain amount to bytes to be transferred. In other words, the service time for this traffic type depends on the rate provided to sessions during the service. Consider now a scenario with a mmWave/THz BS serving elastic sessions, whose service times depend on the volume of occupied resources. Assume that all the resources of the BS are equally divided between all sessions. Note that depending on the selected MCSs, the resulting bitrate may differ among sessions. Such types of service models are significantly more complex as compared to those utilized for adaptive traffic and similarly to non-elastic/adaptive traffic requires the use of queuing models with PS service discipline \cite{yashkov2007processor}.
\subsubsection{Model Description}
Consider single a single server queue with PS discipline and unit service rate. Sessions arrive according to the Poisson process with intensity $\lambda$, and the session volumes (e.g., file size) have exponential distribution with parameter $\mu$. Each session is associated with a random service rate coefficient $v$ with values from the set $V=\{v_1,v_2,\dots,v_L\}$. Without loss of generality, we assume that values in set $V$ are arranged in the ascending order, i.e. $v_1<v_2<\dots<v_L$. Service rate coefficients of different sessions are assumed to be independent identically distributed (iid) random variables with probability distribution $\{p_{v_i}\}, i=1,2,\dots,L$. These coefficients abstract the impact of MCSs by inducing different service rates to the currently served sessions. They are determined on arrival time instant of a session by utilizing a propagation model and remain unchanged during the service time.
The system operates as follows. If there are $n$ sessions with service rate coefficients $u_1,u_2,\dots,u_n$, each session receives $\frac{1}{n}$ of the processing rate, and the service rate of the $i$th session is $\frac{u_i}{n}$. Note that the total service intensity in this state is $\frac{1}{n} \sum_{i=1}^n u_i$. The number of simultaneously served sessions is no more than $N$, which is determined as the maximum number of sessions such that $\frac{v_1}{N}$ is still greater or equal to the minimum required bitrate. Based on these facts, the behavior of the system can be described by the number of sessions and the vector of their service rate coefficients. However, to simplify the description, one can use a state aggregation approach similar to the one applied for the resource queuing systems. According to it, the system's behavior is described by two-dimensional Markov process $X(t)=\{\xi(t), \delta(t)\}$, where $\xi(t)$ is the number of sessions and $\delta(t)$ is the sum of their service rate coefficients. The set of states is then
\begin{equation}
\Psi=\left\{ (n,u): 0 \leq n \leq N, p_u^{(n)}>0 \right\},
\end{equation}
where $p_u^{(n)}$ is the probability that the sum of service rate coefficients of $n$ sessions is equal to $u$. As in previous sections, these probabilities can be evaluated by utilizing $n$-fold convolution of the distribution $\{p_{v_i}\}, i=1,2,\dots,L$.
Similarly to the resource queuing systems, we cannot exactly determine the exact amount of resources freed upon the departure of a session. Contrarily, we can utilize the Bayesian approach to evaluate probabilities $\theta_i(n,u)$ that the service rate coefficient of a departing session is $i$, given that before the departure, the sum of $n$ serving rate coefficients was $u$
\begin{equation}
\theta_i(n,u)=\frac{p_i p_{u-i}^{(n-1)}}{p_u^{(n)}}, i \leq u, (n,u) \in \Psi.
\end{equation}
\subsubsection{Equilibrium Equations}
The stationary probabilities $q_n(u)$ that there are $n$ sessions in the system, and the sum of their service rate coefficients is $u$, can be found as the solution of the following balance equations
\begin{align}\label{eq:surservrate}
&\lambda q_0=\mu \sum_{l=1}^L v_l q_{v_l}(v_l); \nonumber \\
&\left( \lambda+\frac{\mu u}{n} \right) q_n(u)=\lambda \sum_{l=1}^L p_{v_l}q_{n-1}(u-v_l) + \nonumber \\
&+\frac{\mu}{n+1} \sum_{l=1}^L (u+v_l)q_{n+1}(u+v_l) \theta_{v_l}(n+1,u+v_l), \\
& n=1,2,..,N-1, (n,u) \in \Psi; \nonumber \\
& \frac{\mu u}{n}q_N(u)=\lambda \sum_{l=1}^L p_{v_l} q_{N-1}(u-v_l), (N,u) \in \Psi. \nonumber
\end{align}
The system \eqref{eq:surservrate} together with the normalization condition can be solved by any appropriate numerical method. Note that by introducing the proper order in the set of states, the generator matrix can be written in block-tridiagonal form suitable for numerical algorithms \cite{meyer2000matrix}.
\subsubsection{Performance Metrics}
Once the stationary state distribution is obtained performance metrics can be calculated. For example, an arriving session is dropped if it finds that there are $n$ sessions in the system. Therefore, the session drop probability $\pi$ is provided by
\begin{equation}
\pi=\sum_{(N,u) \in \Psi} q_N(u).
\end{equation}
Other important metrics are characteristics of the session serving time. The moments of the session serving time can calculated by employing the phase method \cite{asmussen}. For more details please refer to \cite{sopin2021coefs}. We note that the proposed approach can be further extended similarly to the resource queuing systems to include the outage events caused by blockage and/or micromobility as well as to the support of resource reservation and multiconnectivity.
\section{Conclusions and Future Challenges}\label{sect:concl}
MmWave and THz communications systems are expected to build the foundation of future cellular access providing the extreme amount of resources at the air interface. These systems are primarily targeted to support principally new applications such as AR/VR, holographic telepresence, characterized by high bitrate non-elastic/adaptive traffic patterns. However, intrinsic characteristics of mmWave and THz frequency bands such as extreme path losses, blockage, and micromobility makes provisioning of QoS guarantees to these applications an extremely complex task inherently requiring complex mechanisms to maintain session continuity.
In this paper, we provided a tutorial on mathematical analysis of mmWave and THz deployments with non-elastic/adaptive traffic patterns. Particularly, we extended the conventional methods of stochastic geometry that are inherently limited to systems supporting adaptive (full buffer) traffic only, to the case of composite models capturing both radio specifics of mmWave and THz bands as well as traffic service dynamics at BSs. These two parts of the composite framework are interrelated to each other via a well-defined interface parameters. The two main blocks in the framework are: (i) radio part abstraction and (ii) service model. The former is specified in terms of radio part sub-models in Section \ref{sect:system} and is then abstracted by utilizing the predefined set of parameters suitable for the service model as shown in Section \ref{sect:param}. To this aim, we also provided a comprehensive review of analytically tractable models of various components utilized for building the modeling scenarios including deployment, propagation, antenna, blockage, micromobility, beamsearching , traffic and service models under different system and environmental conditions. The service models utilized at the last stage of the framework are provided in Section \ref{sect:perf}. We note that depending on the investigators’ needs some of the radio part models can be dropped, e.g., if the antenna arrays are not extremely directional one may drop micromobility model out of consideration or when the density of human crowd is not significant the blockage model can be omitted. Additionally, one is also free to select the required models based on the needs, e.g., the required accuracy and/or the resulting framework complexity. That is, we provide our readers with a set of building blocks for specifying their own models suitable for a given scenario.
The modular structure of the framework allows for a potential reuse of its core parts for studying various mmWave and THz deployments (including combinations of them) characterized by different scenario geometry, blocker types and their mobility, antenna arrays, micromobility patterns of applications, network associations, reliability and rate improvement mechanisms. Finally, we considered several applications including systems with resource reservation, multiconnectivity, and priorities between arriving sessions.
\subsection{Future Challenges In Performance Modeling}
The emergence of bandwidth-rich access interfaces in 5G/6G systems utilizing mmWave/THz bands brings principally new challenges to system designers. As compared to previous generation of cellular systems the access becomes truly unreliable with blockage and micromobility leading to frequent and these challenges cannot be solved by utilizing physical- or link-layer functionalities. To ensure reliable service, future 5G/6G RAT system will include networking functionalities, where UEs will be serviced collectively by a set of BS by utilizing multiconnectivity functionality Along these lines, is the future integrated access and backhaul (IAB) architecture recently proposed by 3GPP \cite{3gpp_iab}. By utilizing state-of-the-art mechanisms such as multiconnectivity, multi-beam directional antennas as well as being inherent based on multi-hop topology these system will form the basis for future reliable access in 5G/6G networks.
As indicated in radio part ``cookbook'' provided in Table \ref{tab:radioCookbook}, the radio models including propagation, antenna array, blockage, micromobility, and beamalignment models have been well developed so far. These components can be joined together to abstract the radio part as demonstrated in Section \ref{sect:param} to provide the input to appropriate service models. Contrarily, the service part cookbook provided in Table \ref{tab:serviceCookbook} is half-empty implying that critical service models having essential networking feature are still missing. This is specifically the case of non-elastic/adaptive and elastic applications with minimum rate guarantees. Thus, in general, we may conclude that the mathematical theory of future 5G/6G cellular system lacks appropriate service models. Below, we provide few examples of research directions related to the field of advanced queuing theory that would allow to build new service models.
One of the natural generalizations of resource queuing systems is the addition of the waiting buffer, as some type of user sessions may tolerate waiting. However, unlike conventional queues, the main feature of resource queuing systems -- heterogeneity of session requirements -- cause many new previously unexplored problems. As an example, consider the case when, at some moment of time, there are $r$ occupied resources and $R-r$ are available for new sessions. If a new session arrives and requires $r_1>R-r$ resources, it cannot be served immediately and, thus, joins queue. However, if another session arrives and requires $r_2 \leq R-r$ resources, the system should decide, whether to accept the last arrived session or to force it to wait until the first session is accepted for service. Another problem is associated with moments of session departures. If a "heavy" session departs from the system, then more than one sessions from the queue can be accepted for service. The number of sessions that can replace the departing "heavy" session strongly depends on the session service strategy.
Analysis of resource queuing systems with waiting and external events representing outages caused by blockage and/or micromobility arrivals that change the resource requirements of sessions also has its own specifics. For example, the LoS blocked/non-blocked states can change even for session that currently wait for service, so that the blockage and micromobility will affect not only those sessions that are currently being served. Besides, the waiting buffer provides several opportunities for processing of the interrupted sessions. For example, upon the change of LoS state, a session increased its resource requirements so that unoccupied resources of the system are not enough to meet the new requirements. The session can be dropped, as it is done in resource queuing systems without buffer, or placed to the waiting buffer, or even placed to the special prioritized buffer. The theory of resource queuing systems should be further developed to capture these additional specifics.
The research on the queuing systems with random service rate coefficients suitable for modeling elastic traffic with minimum rate requirements described in Section \ref{sec:servcoefs} has just been initiated. Similarly to the models for non-elastic/adaptive applications, those models can be expanded to include evens signaling outages caused by mmWave/THz specific blockage and micromobility that would change the rate coefficients dynamically during the service process of sessions. Besides, the waiting buffer can be easily incorporated, since the serving rate coefficients do not affect the acceptance procedure.
Finally, yet another direction is supplementing the resource queuing systems with random service rate coefficients, where a part of resources is reserved for non-elastic/adaptive sessions, and the rest -- for elastic or adaptive sessions.
\balance
\bibliographystyle{IEEEtran}
| {'timestamp': '2021-11-19T02:13:11', 'yymm': '2109', 'arxiv_id': '2109.08651', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08651'} | arxiv |
\section{Introduction}
\textit{Off-policy evaluation} (OPE) is the method that attempts to estimate the performance of decision making policies using historical data generated by different policies without conducting costly online A/B tests~\cite{dudik2011doubly,gilotte2018offline}.
Accurate OPE is essential in domains such as healthcare, marketing or recommender systems to avoid deploying poor performing policies, as such policies may hart human lives or destroy the user experience.
Thus, many OPE methods with theoretical backgrounds have been proposed, including \textit{Direct Method} (DM), \textit{Inverse Probability Weighting} (IPW), and \textit{Doubly Robust} (DR).
One emerging challenge with this trend is that a suitable estimator can be different for each application setting.
For example, DM has low variance but has a large bias, and thus, performs better in small sample settings.
On the other hand, IPW has a low bias but has a large variance, and thus reveals better performance in large sample settings.
It is often unknown for practitioners which estimator to use for their specific applications and purposes.
To find out a suitable estimator among many candidates, we use a data-driven estimator selection procedure for off-policy policy performance estimators as a practical solution.
As proof of concept, we use our procedure to select the best estimator to evaluate coupon treatment policies on a real-world online content delivery service.
In the experiment, we first observe that a suitable estimator might change with different definitions of the outcome variable, and thus the accurate estimator selection is critical in real-world applications of OPE.
Then, we demonstrate that, by utilizing our estimator selection procedure, we can easily find out suitable estimators for each purpose.
We believe that our estimator selection procedure and case study help practitioners identify the best OPE method for their environments.
\section{Setup and Method}
We denote $X \in \mathcal{X}$ as a context vector and $T \in \mathcal{T} = \{0, 1\}$ as a binary treatment assignment indicator\footnote{Note that our OPE procedure can easily be extended to multiple treatment cases.}.
When an individual user $i$ receives the treatment, $T_i = 1$, otherwise, $T_i = 0$.
We assume that there exist two potential outcomes denoted as $(Y(0), Y(1))$ for each individual.
$Y(0)$ is a potential outcome associated with $T=0$, and $Y(1)$ is associated with $T=1$.
Note that each individual receives only one treatment, and only a potential outcome for the received treatment is observed.
We can represent the observed outcome as: $Y = T Y(1) + (1-T) Y(0) $.
A \textit{policy} automatically assigns treatments to users aiming to maximize the outcome.
We denote a policy as a function that maps a context vector to one of the possible treatments, i.e., $\pi: \mathcal{X} \rightarrow \mathcal{T}$.
Then, the performance of a policy is defined as $ V (\pi) = \mathbb{E}_{(X, Y)} [ Y (\pi (X)) ] $.
The goal of OPE is to estimate $ V (\pi) $ for a given \textbf{new} policy $\pi$ using log data $\mathcal{D} = \{ (X_i, T_i, Y_i) \}_{i=1}^{n}$ collected by an \textbf{old} policy different from $\pi$.
Our strategy to select the suitable estimator is to use two sources of logged bandit feedback collected by two different behavior policies.
We denote log data generated by $\pi_A$ and $\pi_B$ as $\mathcal{D}_A = \{ (X^A_i, T^A_i, Y^A_i) \}_{i=1}^{n_A}$ and $\mathcal{D}_B = \{ (X^B_i, T^B_i, Y^B_i) \}_{i=1}^{n_B}$, respectively.
To evaluate the performance of an estimator $\hat{V}$, we first estimate policy performances of $\pi_A$ and $\pi_B$ by $\hat{V}(\pi_A; \mathcal{D}_B)$ and $\hat{V}(\pi_B; \mathcal{D}_A)$.
Then, we use \textit{on-policy} estimates as the ground-truth policy performances, i.e., $ V(\pi_A) \approx \hat{V} (\pi_A; \mathcal{D}_A) = n_A^{-1} \sum_{i=1}^{n_A} Y^A_i$ and $ V(\pi_B) \approx \hat{V} (\pi_B; \mathcal{D}_B) = n_B^{-1} \sum_{i=1}^{n_B} Y^B_i$.
Finally, we compare the off-policy estimates $\hat{V}(\pi_A; \mathcal{D}_B)$ and $\hat{V}(\pi_B; \mathcal{D}_A)$ with their ground-truths (on-policy estimates) $V(\pi_A)$ and $V(\pi_B)$ to evaluate the estimation accuracy of an estimator $\hat{V}$.
We evaluate the estimation accuracy of an estimator $\hat{V}$ by the \textit{relative root mean-squared-error} defined as $\sqrt{ K^{-1} \sum_{k=1}^K (\frac{ \hat{V} (\pi_A; \mathcal{D}_B^{(k)}) - V(\pi_A) }{V(\pi_A)})^{2} }$ (same for $\pi_B$) where $k$ denotes a different subsample of logged bandit feedback made by the sample splitting or bootstrap sampling.
By applying the above procedure to several candidate estimators, we can select the estimator having the best estimation accuracy among candidates in a data-driven manner.
\begin{table*}[t]
\begin{minipage}[t]{.48\textwidth}
\centering
\caption{Relative RMSE of off-policy estimators when $Y$ is \textbf{content consumption indicator}}
\scalebox{.9}{
\begin{tabular}{ccccc}
\toprule
&& \multicolumn{3}{c}{OPE Estimators} \\\cmidrule{3-5}
OPE Situation && DM & IPW & DR \\ \midrule \midrule
$ \mathcal{D}_A \rightarrow \pi_B $ && \textbf{0.0897} & 0.1958 & 0.0955 \\
$ \mathcal{D}_B \rightarrow \pi_A $ && \textbf{0.0653} & 0.1589 & 0.0798 \\
\bottomrule
\end{tabular}}
\end{minipage}
%
\hfill
%
\begin{minipage}[t]{.48\textwidth}
\centering
\caption{Relative RMSE of off-policy estimators when $Y$ is \textbf{revenue from users}}
\scalebox{.9}{
\begin{tabular}{ccccc}
\toprule
&& \multicolumn{3}{c}{OPE Estimators} \\\cmidrule{3-5}
OPE Situation && DM & IPW & DR \\ \midrule \midrule
$ \mathcal{D}_A \rightarrow \pi_B $ && 0.2231 & 0.1997 & \textbf{0.1118} \\
$ \mathcal{D}_B \rightarrow \pi_A $ && 0.4382 & \textbf{0.0981} & 0.2936 \\
\bottomrule
\end{tabular}}
\end{minipage}
\vskip 0.05in
\raggedright
\fontsize{8.5pt}{9.5pt}\selectfont \textit{Note}:
$ \mathcal{D}_A \rightarrow \pi_B $ is a case where we attempt to estimate the performance of $\pi_B$ using log data generated by $\pi_A$.
In contrast, $ \mathcal{D}_B \rightarrow \pi_A $ is a case where we attempt to estimate the performance of $\pi_A$ using log data generated by $\pi_B$.
The \textbf{bold fonts} represent the best off-policy estimator among DM, IPW, and DR for each setting (lower value is better).
\end{table*}
\section{A Case Study}
To show the usefulness of our procedure, we constructed $\mathcal{D}_A$ and $\mathcal{D}_B$ by randomly assigning two different policies ($\pi_A$ and $\pi_B$) to users on our content delivery platform.
Here, $X$ is a user's context vector, $T$ is a coupon assignment indicator, and $Y$ is either a user's content consumption indicator (binary) or the revenue from each user (continuous).
We report the estimator selection results for each definition of $Y$ in Table 1 and 2.
We used DM, IPW, and DR as candidate off-policy estimators.
The tables show that different estimators should be used for each setting and purpose.
This is because the prediction accuracy of the outcome regressor used in DM and DR can be different for each definition of $Y$.
We conclude from the results that we should use DM when we want to maximize the users' content consumption probability.
In contrast, we use IPW or DR when we consider the revenue from users as the outcome.
After the successful empirical verification, our data-driven estimator selection method has been used to decide which estimators to use to create coupon allocation policies on our platform.
\bibliographystyle{ACM-Reference-Format}
| {'timestamp': '2021-09-20T02:20:14', 'yymm': '2109', 'arxiv_id': '2109.08621', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08621'} | arxiv |
\section{Conclusions}
\label{sec:conclusions}
In this work, we aim to improve naturalness of interaction with an information navigation dialogue system.
When a user is not primed by instructions, most user queries in the restaurant search domain include out-of-schema search preferences. Such queries cannot be handled by a purely schema-driven dialogue system, resulting in ineffective and unnatural conversations.
To address this problem, we propose an entity retrieval method by incorporating a snippet relevance classifier into the pipeline of a schema-driven dialogue system.
{\bf We present an effective methodology for extending schema-driven dialogue systems to use unstructured knowledge and handle out-of-schema user preferences.}\footnote{The project was completed during during a four month internship and the annotation costs were under \$300.}
We update the Cambridge restaurants database, and extend it with text knowledge snippets.
To simulate a naive user, we collect restaurant queries from users without biasing them with specific instructions
In our experimental restaurant search domain, the snippets were obtained from publicly available restaurant reviews and descriptions and annotated by Amazon Mechanical Turk workers. We build a supervised text relevance classification model on the annotated data and compare its performance with an unsupervised method.
We show that on the annotated dataset an {\bf unsupervised/supervised classifier achieves a weighted F1 of .661/.856}.
In future work, we will incorporate the proposed approach into the Cambridge restaurant search dialogue system and evaluate it with users.
\section{Data}
\label{sec:data}
To develop and evaluate an entity retrieval component for a dialogue system that handles unconstrained user queries, it is necessary to construct a dataset that includes text snippets associated with the entities, collect unconstrained user queries, and identify a set of matching entities for the queries. We collect a new extended dataset of Cambridge restaurants (\cref{sec:data:camdb}), a set of unconstrained search queries (\cref{sec:data:queries}), and annotate query-snippet pairs with relevance labels~(\cref{sec:data:annotation}).
\subsection{Cambridge Restaurants 2021}
\label{sec:data:camdb}
\begin{comment}
\begin{table*}[ht!]
\resizebox{\textwidth}{!}{%
\caption{The restaurants knowledge base structure.}
\begin{tabular}{|l|l|}
\hline
\multicolumn{1}{|c|}{\textbf{Type}} & \multicolumn{1}{c|}{\textbf{Example}} \\ \hline
cuisines & Italian, Asian. \\ \hline
meals & Breakfast, lunch, dinner \\ \hline
special diets & vegan, vegeterian, gluten free \\ \hline
price range & Cheap, moderate, expensive \\ \hline
features & Delivery, takeaway, parking \\ \hline
location & Centre, west, east \\ \hline
summary & \begin{tabular}[c]{@{}l@{}}We cook everything fresh and on site. We try to give best\\ possible value for the quality........\end{tabular} \\ \hline
reviews & \begin{tabular}[c]{@{}l@{}}Review 1:The restaurant allows dogs. Brilliant!....\\ Review2: I was positively surprised by the quality of the haggis.\\ -\\ -\\ Review N:-----\end{tabular} \\ \hline
\end{tabular}
}
\label{tab:data:resDataEx}
\end{table*}
\end{comment}
In previous work~\cite{henderson-thomson-williams:2014:W14-43}, the authors used a now outdated dataset of 102 Cambridge restaurants, which did not have review information.
In this work, we created an up-to-date database with 422 restaurants in Cambridge, UK.\footnote{The dataset is compiled by crawling the Web in January 2021.} Following the schema used in previous work, each restaurant is associated with {\em cuisine, price range, location,} and {\em description}. As in the past systems, the price range is mapped to {\em cheap, moderate, expensive} and location to {\em east, west, centre, south}. However, {\em cuisine} in our database is associated with a list of values rather than a single value for each entity. In addition, the new dataset includes information on {\em meals} (breakfast, lunch, dinner), {\em special diets} (e.g., vegan, gluten free) and {\em reviews}.
A standard restaurant database may not always contain information relating to the unconstrained user's search preferences (example, {\it cosy family friendly pub}). In such regards, we theorise that personalised messages, such as {\it reviews}, are an acceptable source to handle such requests. We collect 62.3K reviews with an average and standard deviation of 145(256) per restaurant. The reviews together with text in each data fields are used as {\it text snippets} to retrieve items relevant to the query in the experiments. Only positive reviews (rating 4 or 5 stars) are used, as we expect user queries to mention desirable properties of the restaurant.
\subsection{Unconstrained Queries}
\label{sec:data:queries}
To simulate natural unbiased user requests in a restaurant search domain, we created an online form with one question:
{\it Please type a sentence describing your restaurant preference to your smart virtual assistant.'}
The form was distributed to several university and company mailing lists. Each participant was asked to enter one query.\footnote {As the task was very short, the participants were not paid.}
We found that only 30 out of 105 collected queries specified a constraint corresponding to one of the pre-defined fields of the database schema (area, cuisine, or price range) that may be used to search for a restaurant in a purely schema-driven system. Although only 14 of these queries contained an entity exactly matching a value in the database and only 7 had no other preferences besides the slot value. For example, {\it `I would like to eat in a fine dining establishment, preferably \textbf{french} cuisine.'} contains a mention of cuisine as well as a vague preference for a {\it `fine dining establishment'}. The unbiased queries are highly diverse and most frequently contain a menu item (46), a subjective (31) or an objective preference (25) about a restaurant (see~\cref{tab:data:qproperties}).
We removed 5 queries that mention proximity, e.g. {\it `near me'}. Such queries would not be handled with the proposed method as it would require additional geographical location information. We use the remaining 100 queries in our experiments.
\begin{table*}[t!]
\centering
\caption{Preferences (number of queries) mentioned by the users in 105 unbiased queries. }
\begin{tabular}{|p{2cm}|p{9cm}|}
\hline
preference & examples \\ \hline\hline
menu item (46)& burger, veggie burger, pizza, curry, steak, fried rice, meat, sushi, seafood, noodle bar, dim-sum, shark, eel, alcohol, wine, mulled wine, beer, whisky, milkshake, dessert\\\hline
objective (25) & live music, music, quiet, dogs, kids, fireplace, free delivery, local food, new place, biggest pizza, spicy food, large groups, Burn's night, big pizza,sweet tooth, traditional, portion size, restaurant name, parking, quick, outdoor seating, spaced out tables, byob \\\hline
subjective (31) & ambience, friendly, gourmet, authentic, romantic, cozy, small, local, safe, different, inventive, stylish, exotic, interesting, hygienic, fine dining, best value, fancy, nothing too fancy\\\hline
\end{tabular}
\label{tab:data:qproperties}
\end{table*}
\subsection{Query-Snippets Annotation}
\label{sec:data:annotation}
For extracting relevant entities using unstructured data, we need to develop supervised models, which require preferably a balanced training dataset.
We create a REStaurant Query Snippet (ResQS) dataset of query-snippet pairs, where the snippets include text from reviews and each of the database fields, labelled with `1' if the snippet is {\it relevant } to the query and `0', otherwise. For each query, most of the snippets from our set of 62.3K candidates will be irrelevant. Thus, a random selection of snippets for each query would result in an unbalanced dataset of mostly irrelevant snippets.
Instead, unsupervised and transfer learning methods are used to select a set of relevant snippets for each query. We then use manual annotation on the selected set to create query-snippet pairs with annotated relevance information.
For each of the 100 queries, we first score all snippets using two unsupervised and one transfer learning method (see the first three methods shown in~\cref{fig:method:models}).
Next, we compute a relevance score for each of the 422 restaurants in the dataset and use it to rank them (see~\cref{sec:method}). Finally, we randomly sample one of the five top-ranked restaurants for the query\footnote{The number of top results (5) was chosen empirically since a user of a dialogue system may navigate over multiple search results.} and manually label the top five snippets that were used to compute the relevance score of this restaurant. Manual labels are used for the evaluation of the unsupervised methods as well as for training the supervised models. Using three methods to select five snippets per query we generate $1500$ query-snippet pairs.
Additionally, to simulate the hybrid system where both relevance ranking and database match are used to extract a relevant item, we use the 14 queries that specify a value for one of the system slots (\emph{area}, \emph{cuisine}, or \emph{price range}). This subset is then used to select a recommended restaurant for the query. Thus by using three methods to select five snippets for the 14 queries we extend the dataset by $210$ query-snippet pairs resulting in $1710$ examples.
For annotation, we use crowd workers from Amazon Mechanical Turk. Each Human Intelligence Tasks (HIT) consists of 23 randomized query-snippet pairs and is annotated by three crowd workers.\footnote{3 query-snippet pairs with a known label are used to monitor work quality. The workers that did not pass the quality test were rejected.} The workers were compensated according to government pay guidance.\footnote{\url{https://www.gov.uk/national-minimum-wage-rates}} We use the majority vote amongst the three crowd workers to select the final label. The pairwise agreement between each annotator and the majority vote is very good with Fleiss Kappa~$k>.7$~\cite{fleiss1973equivalence}.
\section{Experiments and Results}
\label{sec:exp}
Evaluating the overall relevance of a recommended restaurant is challenging, as the information presented to the user would bias their judgement. We assume that the restaurants preferred by the user are associated with the snippets that are relevant to the query. The models are evaluated based on the scores they assign to the snippets.
We use the two unsupervised and the transfer learning from SNLI models for {\em information retrieval} to extract a recommended restaurant for each query by ranking restaurants based on the relevance score of the snippets (see~\cref{sec:exp:info-ret}). The dataset produced with the information retrieval is then manually annotated and used to train supervised {\em snippet relevance classification} models.
To compare snippet relevance classification methods, we use a threshold to classify each snippet's relevance to the query and compute the classifier's precision, recall, and F1 (see \cref{sec:exp:rel-score}).
\subsection{Information Retrieval}
\label{sec:exp:info-ret}
\begin{table}[!t]
\centering
\caption{Snippet Relevance and the overall recommendation of information retrieval.}
\resizebox{\textwidth}{!}{
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline
\multirow{2}{*}{\textbf{Model}} & \multicolumn{4}{c|}{\textbf{Snippet Relevance }} & \multicolumn{2}{c|}{\textbf{Overall Recommendation}} \\ \cline{2-7}
& \begin{tabular}[c]{@{}c@{}}~~~~All~~~~\\~~~~(500)~~~~~\end{tabular} & \begin{tabular}[c]{@{}c@{}}Menu Item\\ (230)\end{tabular} & \begin{tabular}[c]{@{}c@{}}Objective\\ (125)\end{tabular} & \begin{tabular}[c]{@{}c@{}}Subjective\\ (155)\end{tabular} & \begin{tabular}[c]{@{}c@{}}\% with at least one\\ relevant snippet\end{tabular} & \multicolumn{1}{l|}{\begin{tabular}[c]{@{}l@{}}avg number of \\ relevant snippets\end{tabular}} \\ \hline
Cos-TF-IDF & \textbf{65 \%} & 59\% & 53\% & \textbf{67\%} & 83\% & \textbf{3.25} \\ \hline
Cos-BERT & 57 \% & \textbf{61\%} & \textbf{55\%} & 60\% & \textbf{86\%} & 2.86 \\ \hline
Transfer-BERT (SNLI) & 16 \% & 10\% & 13\% & 20\% & 41\% & 0.79 \\ \hline
\end{tabular}
}
\label{tab:exp:snip-relevance-result}
\end{table}
For each of the queries we apply unsupervised and transfer learning methods to score each snippet and use these scores to rank the restaurants. As a dialogue system can present multiple options in response to a query, we randomly select one of the top five recommended restaurants and manually annotate the top five matching snippets with a binary label {\it relevant/not-relevant} (see~\cref{sec:data:annotation}).
For the two unsupervised cosine-similarity (Cos-TF-IDF and Cos-BERT) and transfer (Trans-BERT-SNLI) methods we report the {\it snippet relevance} (the percent of snippets extracted by the model labelled as {\it relevant}) and the {\it overall recommendation} quality
(see~\cref{tab:exp:snip-relevance-result}).
We further analyze the relevance scoring performance across three query types that mention a menu item, objective, or subjective information.
Cosine similarity approach using TF-IDF encoding (Cos-TF-IDF), which relies on exact keyword match, achieves the highest overall snippet relevance of 65\%, followed by Cos-BERT with 57\%. Transfer learning did not work well, yielding only 16\% snippet relevance. We observe that Cos-TF-IDF performance is the highest (67\%) on the queries with {\em subjective} information that contain adjectives (`excellent', `great'). However, its performance is below Cos-BERT model on the queries with {\em objective} and {\em menu item} information (`fireplace', `dogs', 'desserts'). For a user query {\em `Find me a restaurant with great desserts'},
Cos-TF-IDF model extracts a restaurant with generic positive reviews which are not relevant to the query:
\begin{quote}
\begin{enumerate}
\item \textbf{Review}: Great service, great food, had a great night! Good value for money and great atmosphere, definitely coming back.
\item \textbf{Review}: Great find in cambridge
\end{enumerate}
\end{quote}
However, Cos-BERT model extracts a restaurant with the snippets relevant to this query that focus on the quality of deserts:
\begin{quote}
\begin{enumerate}
\item \textbf{Review}: The food in this restaurant is very good. However, it is the desserts that steal the show. I have sometimes been there just for dessert.
\item \textbf{Review}: Fabulous french style food and cocktails. we plan to return for dessert only as the selection looked amazing and we were quite full from our meal.
\end{enumerate}
\end{quote}
Using BERT for embedding the query and the snippets appears to capture the semantics which is especially important for the queries with objective information.
\begin{comment}
\begin{figure*}[t!]
\centering
\includegraphics[width=\textwidth]{images/example-relevance.jpg}
\caption{An example of query and knowledge snippet pairs. The highlighted text shows the constraints present in the query.}
\label{fig:experiment:example-relevance}
\end{figure*}
Figure \ref{fig:experiment:example-relevance} shows the example shown to the participants.
In Figure \ref{fig:experiment:example-relevance}, the request is:
\begin{quote}
\textbf{R}: {\em I am in the mood for vegan food in a restaurant where dogs are allowed.}
\end{quote}
with two requirements, namely: \emph{vegan food} and \emph{allow dogs}. We can see that knowledge snippet 1, satisfies the first requirement and thus supports the request. Knowledge snippet 2 does not satisfy any of the requirement and thus does not support the request. Finally, knowledge snippet 3 satisfies both the requirement and thus supports the request.
\end{comment}
The overall recommendation accuracy is the proportion of recommended restaurants that would satisfy the user. We approximate the subjective user satisfaction with
1) the percentage of the queries for which at least one of the top five snippets was labelled as {\em relevant} and 2) the average number of the top five snippets labeled as {\em relevant}.
Cos-BERT model outperforms the Cos-TF-IDF on the first metric (86\% vs 83\%) and Cos-TF-IDF outperforms Cos-BERT on the second one (3.25 vs 2.86).
Our dataset contains 62.3K snippets. Exact word match (TF-IDF) may have outperformed the semantic method (Cos-BERT) because it was likely to find exact word match for each query. However, for smaller datasets, where vocabulary in a query may not match any of the text snippet, semantic methods may be more beneficial.
The overall relevance scoring accuracy is 48\%, resulting in a balanced dataset of 1710 query-snippet (ResQS) pairs which we use to train and evaluate supervised relevance labeling models described in the next section.
\subsection{Snippet Relevance Classification}
\label{sec:exp:rel-score}
\begin{table}[t!]
\centering
\caption{Relevance classification performance on ResQS dataset.}
\begin{tabular}{|l|c|c|c|c|}
\hline
\textbf{Model Type} & \textbf{Training data } & \multicolumn{1}{l|}{\textbf{Avg Precision}} & \multicolumn{1}{l|}{\textbf{Avg Recall}} & \multicolumn{1}{l|}{\textbf{Weighted F1}} \\ \hline \hline
\begin{tabular}[c]{@{}l@{}}Always-relevant\\ baseline\end{tabular}& - & 0.240 & 0.490 & 0.322 \\ \hline
\multicolumn{5}{c}{Unsupervised methods} \\\hline
Cos-TF-IDF & - & 0.752 & 0.519 & 0.365 \\ \hline
Cos-BERT & - & 0.703 & 0.672 & 0.661 \\ \hline
\multicolumn{5}{c}{Transfer learning methods} \\\hline
Trans-BERT& SNLI & 0.429 & 0.493 & 0.368 \\ \hline
Trans-BERT& DSTC9 & 0.771 & 0.768 & 0.769 \\ \hline
\multicolumn{5}{c}{Supervised in-domain training methods} \\\hline
Dom-BERT & ResQS & 0.829 & 0.825 & 0.824 \\ \hline
Dom-BERT & ~~~ResQS + DSTC9~~~ & \textbf{0.859} & \textbf{0.857} & \textbf{0.856} \\ \hline
\end{tabular}
\label{tab:sec:experimets:supervised}
\end{table}
We compare the snippet relevance classification performance of the unsupervised (Cos-TF-IDF, Cos-BERT), transfer (Trans-BERT) and supervised (Dom-BERT) methods. The unsupervised cosine similarity methods use a threshold of 0.5 to determine relevance of a snippet to a query.
The Trans-BERT models are trained on the publicly available SNLI and DSTC9 datasets.
The model trained on SNLI dataset outputs a 3-way classification with the classes {\em contradiction}, {\em entailment}, and {\em neutral}. To apply it on our binary query relevance detection task, we combine {\em contradiction} and {\em neutral} into the {\em not relevant} class and use {\em entailment} as the {\em relevant} class.
The unsupervised and transfer methods are evaluated on the full ResQS corpus as they do not use any of its data for training and the supervised methods are evaluated with 10-fold cross-validation.
\cref{tab:sec:experimets:supervised} shows the average precision, recall, and weighed F1 scores on the ResQS dataset. Cos-TF-IDF method achieves F1 of 0.365, slightly higher than the baseline that predicts all snippets as {\em relevant} (F1=0.322) while Cos-BERT achieves F1 of 0.661. We observe that Cos-TF-IDF which relies on word match has a lower recall than Cos-BERT which captures semantic meaning (0.519 vs 0.672).
The Transfer-BERT trained on SNLI achieves F1 of 0.368, slightly higher than the {\it always-relevant} baseline but lower than the unsupervised Cos-BERT model. The Trans-BERT model trained on DSTC9, a dataset more closely resembling to the target data, achieves F1 of 0.769 outperforming both of the unsupervised methods.
The model trained on in-domain ResQS dataset achieves F1 of 0.824 and outperforms all unsupervised and transfer learning models. The best result (F1=0.856) is obtained by training on the combined in-domain ResQS and DSTC9 dataset.
\subsection{Discussion}
Our aim was to collect data that covers most of the aspects of the individual restaurants. In addition to the standard aspects (cuisine, location) provided by the restaurants, we also used reviews which augmented the restaurant information with further non-standard (fireplace, dogs, exotic) aspects thus providing a comprehensive unstructured dataset for handling unconstrained queries.
We then test how accurately an unsupervised method can extract relevant items using unstructured data. Cosine similarity with the BERT encoder method resulted in 57\% relevant snippets on the information retrieval task and achieved F1 score of .661 on the snippet relevance classification task. With this approach 86\% of top-5 recommended restaurants had at least one relevant snippet (the estimated recommendation accuracy). Assuming that an item with more relevant snippets is a better match for a user query, we expect to achieve even higher restaurant recommendation accuracy using a more accurate supervised snippet relevance scoring model. The supervised model achieves F1 score of 0.856 on the snippet relevance classification task.
Although we achieve improvements with the supervised models, it should be noted that they are slower compared to unsupervised methods\footnote{Experiments were conducted with i7-6 cores CPU and single GTX 1080 GPU.}. If using a supervised model to extract relevant information from unstructured data is not real-time, it becomes unfeasible for use in a dialogue system. To reduce latency while maintaining accuracy, we could use a combination of models by first filtering snippets with an unsupervised method and then applying a supervised model on a smaller dataset.
\section{Introduction}
\begin{figure}[t!]
\centering
\caption{Process for building a supervised relevance scoring model. }
\includegraphics[width=0.8\textwidth,scale=0.5]{images/relevance-process.png}
\label{fig:method:process}
\end{figure}
A conversation is a natural user interface for accessing information.
In {\it information navigation} dialogue, such as search (for restaurants, hotels, or tourist attractions), a user specifies search constraints and navigates over search results using text-based, spoken, or multi-modal interface. Information navigation tasks are typically handled with a schema-driven approach~\cite{budzianowski-etal-2018-multiwoz,schema-guided,stoyanchev-asu-2021}. While a schema-driven system may be effectively bootstrapped for a new application using the structure and content of the corresponding database, a user is limited in the range of constraints they may specify.
For example, in a restaurant search domain with the schema fields {\em area}, {\em price range} and {\em food type}, a user may specify any combination of these fields but not others~\cite{henderson-thomson-williams:2014:W14-43}.
To evaluate a schema-driven information navigation system, the recruited experiment participants are typically given a conversation `goal' based on the database schema, e.g. {\em ``you are looking for a cheap Italian place in the center"}, and are instructed to retrieve matching venues using spoken or text chat interaction. These instructions guide the user to specify in-domain preferences that can be handled by the dialogue system.
An initial user request based on the above `goal' may be:
\begin{quote}
User: {\em `A cheap Italian restaurant in the centre'} \\
User: {\em `I am looking for a cheap place'}\\
User: {\em `A restaurant in the center'}\\
User: {\em `An Italian restaurant in cheap price range'}\footnote{A system may ask to narrow down the search criteria and a user may specify additional preferences in consecutive turns.}\\
User: {\em ...}
\end{quote}
While there is variability in the natural language utterances of a recruited user for a predefined `goal', the preference type specified in the goal is limited to the schema.
Unlike the recruited subjects, real users come up with personalised search preferences and formulate their requests to the system without a bias of the instructions. The challenge is that a user request with preferences outside of the domain schema, e.g. {\em `Find me a cosy family friendly pub that serves pizza.'} can not be handled by a purely schema-driven system. The majority of user queries (75 out of 105) that we collected without priming the user by a predefined `goal' do not mention any of the domain-specific schema fields, indicating that a purely schema-driven system is not sufficient to handle naturally constructed user requests.
In contrast to a schema-driven dialogue system, a search interface handles such unconstrained user queries using information retrieval methods from unstructured (text) data. Search interfaces, however, are not interactive and do not handle query changes or follow-up questions. In this work, we aim to {\bf improve the naturalness of interaction } with an information navigation dialogue system. We propose to {\bf extend the schema-driven dialogue system to handle out-of-schema user queries} by incorporating an entity retrieval module in the dialogue system pipeline.
An entity retrieval model requires domain-specific data to extract the requested information. For this study, we create an annotated dataset for the Cambridge Restaurants domain following the process outlined in~\cref{fig:method:process}.
We first collect a database from the Web, including text snippets composed from restaurant reviews and descriptions along with a set of unconstrained restaurant search queries. Next, unsupervised and transfer learning methods are used to obtain a set of query-snippet pairs which are then annotated using Amazon Mechanical Turk. The resulting annotated dataset is then used to build supervised relevance scoring models and compared with the performance of unsupervised and transfer learning approaches. We show that using a pretrained transformer model as an encoder, an {\bf unsupervised/supervised classifier of the snippet relevance to the query achieves a weighted F1 of .661/.856}.
The contributions of this paper are:
\begin{itemize}
\item A methodology for extending a schema-driven dialogue system to support natural user preferences.
\item A manually annotated dataset with 1.7K query and text snippet pairs.
\item Evaluation of supervised, unsupervised, and transfer learning approaches for snippet relevance classification.
\end{itemize}
The rest of the paper is organized as follows. In~\cref{sec:relwork}, we outline related research. In~\cref{sec:data}, we present an extended Cambridge Restaurants 2021 dataset and annotated REStaurant Query Snippet dataset (ResQS). In ~\cref{sec:method}, we describe the approaches used to detect text snippets relevant to a query and present experimental results in~\cref{sec:exp}. Finally, the conclusions are presented in~\cref{sec:conclusions}.
\section{Method}
\label{sec:method}
In this work, we extend a schema-driven dialogue system to support users' unconstrained search requests. Our goal is to extract the items most relevant to the users' query. A dialogue system then presents these items as recommendations to the user and responds to follow-up questions.
This work only addresses the extraction of the relevant items, leaving the evaluation of information presentation and handling of interaction to future work. We apply and evaluate our approach using the Cambridge Restaurants search domain.
\cref{algo:method:rel-item} is used to extract an item most relevant to the user's query. First the snippets are scored (line 9) then the top recommended restaurants are obtained by ranking the list of restaurants based on the average score of the top 5 snippets.\footnote{We use empirically chosen J=5 and N=5 in this work.}
For snippets scoring, we explore two unsupervised approaches: Cos-TF-IDF and Cos-BERT, and two supervised approaches: transfer learning from another domain (Trans-BERT), and in-domain training approach (Dom-BERT) illustrated on~\cref{fig:method:models}. The input to each of the models are two strings (query and text snippet) and the output is a score where the scores closer to 1 indicate a higher relevance.
\begin{figure}[t!]
\centering
\caption{Relevance scoring methods.}
\includegraphics[width=\textwidth]{images/methods-type.png}
\label{fig:method:models}
\end{figure}
\subsection{Unsupervised Approach}
\label{sec:method:sim-apprch}
We expect relevant text snippets to have a higher word overlap and semantic similarity with the corresponding query.
For example, for a user query:
\begin{quote}
\textbf{Query}: {\em I am looking for a place that serves vegan food and also allows dogs inside.}
\end{quote}
the two relevant snippets have overlapping vocabulary:
\begin{quote}
\begin{enumerate}
\item \textbf{Special diets}: vegan friendly
\item \textbf{Review}: It was such a happy surprise that they allowed dogs inside their premises. Fanta was woofing with delight.
\end{enumerate}
\end{quote}
We map the user query ($Q_i$) and each snippet ($S_j$) for all of the restaurants into a fixed-sized vector using a mapping function $M$. We then compute the cosine similarity score between the user request and each snippet:
$$
Score(Q_i, S_{j}) = cos(M(Q_i), M(S_{j}))
$$
The cosine score estimates the distance between the query $Q_i$ and snippet $S_j$.
\vspace*{5px}
\noindent \textbf{Cos-TF-IDF: Cosine similarity with TF-IDF Encoding }\\
As a baseline, we use Term Frequency-Inverse Document Frequency(TF-IDF), an efficient and simple algorithm for matching words in a query to documents that are relevant to that query, to encode the query and the knowledge snippets~\cite{salton1988term}.
Text snippet for each restaurant is taken as a separate document to calculate TF-IDF for each word in the snippet. TF-IDF score for each word in the query is also calculated.
Then, the words in the query and the words in the text snippet are replaced by their TF-IDF score to form vocabulary-sized vectors.\footnote{The vocabulary size in our domain is 30124.} The cosine score corresponds to the vocabulary overlap between $Q_i$ and $S_j$.
\vspace*{5px}
\noindent \textbf{Cos-BERT: Cosine similarity using BERT encoding} \\
We use pretrained Sentence-BERT (SBERT) model to encode the query and the snippets~\cite{reimers2019sentence}. SBERT uses a pooling operation to obtain the mean of all output vectors of BERT, fine-tuned on the SNLI corpus, to derive a fixed-sized sentence embedding~\cite{devlin2019bert}. The cosine score corresponds to the semantic distance between $Q_i$ and $S_j$.
\subsection{Supervised Approach}
We build a classifier using a DNN with a single fully-connected linear layer that takes as input encoded representation of a query and a snippet. The input
($<CLS>query<SEP>snippet$)
is encoded with the pretrained BERT model and the encoding of the special symbol ($CLS$) is passed into a linear layer that outputs a 2- or 3-way classification. The model is trained to minimize cross-entropy on the training set.
\vspace*{5px}
\noindent \textbf{Trans-BERT: Transfer Learning Approach}\\
\label{sec:model:class-bert}
For transfer learning we use Stanford Natural Language Inference (SNLI) and DSTC9 datasets~\cite{10.5555/3298023.3298238,kim-etal-2020-beyond}. SNLI corpus is a collection of 570,000 sets of premises and hypotheses sentences annotated with the labels {\em contradiction}, {\em entailment}, and {\em neutral} as in the following example:
\begin{quote}
\textbf{Premise}: A boy is jumping on skateboard in the middle of a red bridge.\\
\textbf{Entailment}: The boy does a skateboarding trick.\\
\textbf{Contradiction}: The boy skates down the sidewalk.\\
\textbf{Neutral}: The boy is wearing safety equipment.\\
\end{quote}
\vspace{-5mm}
The intuition behind using a model trained on the SNLI dataset is that the relevant snippet for the user's query would be classified as {\em entailment} while the irrelevant snippets would be classified as {\em neutral} or {\em contradiction}. Hence, we train a 3-way classification and use the score of {\em entailment} class to estimate relevance.
DSTC9 dataset was constructed for the purpose of extracting answers to follow-up questions in a dialogue system. It contains 938 question and answer pairs for the train, hotel, and restaurant domains as shown in following examples.
\begin{quote}
\textbf{Request}: Are children welcomed at this location?\\
\textbf{Reply}: Yes, you can stay with children at A and B Guest House.\\\\
\textbf{Request}: Can my small dog stay with me?\\
\textbf{Reply}: Pets are not allowed at the A and B Guest House.\\
\end{quote}
\vspace{-5mm}
We use the question-answer pairs as the positive examples (relevant) for training the model. The negative examples for training a binary classifier are extracted by randomly sampling answers from different questions following the approaches used by the authors.
\vspace*{5px}
\noindent \textbf{Dom-BERT: In-domain Training Approach }\\
The models that are trained on in-domain data usually achieve better performance. To compare the models trained with the in-domain data with the transfer/unsupervised approaches, we train a supervised binary classifier on ResQS and the combination of ResQS and DSTC9 datasets. A pre-trained BERT encoder was fine-tuned on the in-domain classification task using the pruning method that removes the task-irrelevant neural connections from the BERT model to better reflect the data for the task~\cite{DBLP:journals/corr/abs-2105-03343}.
\begin{comment}
\subsection{Attribute Models}
To simulate a behaviour where requirements/attributes in the query can be at least partially handled by the slot-filling approach we selected queries with slots including \emph{area}, \emph{cuisine}, and \emph{cost}. We then select only the restaurants that satisfy the requirement of these three slots.
For example, the query:
\begin{quote}
\textbf{R}: {\em Place with good food with pleasant environment, music and reasonably priced.}
\end{quote}
has a slot for \emph{price}. Thus we only select restaurants that has value \emph{reasonably priced} for slot/attribute \emph{price}.
As mentioned in section \ref{sec:data:queries}, we selected 14 queries that mention one of the attributes (area, cuisine, or cost). For all the 14 queries we retrieved only restaurants that satisfied the requirements for the above attributes. We then apply each of our three models tf-idf, cos-BERT, and class-BERT to extract relevant information for the requests. We name these models tf-idf\_a, cos-BERT\_a, and class-BERT\_a respectively.
\end{comment}
\section{Related Work}
\label{sec:relwork}
Conversational search aims at providing users with an interactive natural language interface for access to unstructured open-domain information~\cite{trippas2018informing}. Similarly, task-oriented information navigation dialogue systems often involve search, e.g. for venues or catalogue items ~\cite{budzianowski-etal-2018-multiwoz,10.5555/3298023.3298238}.
While open-domain conversational search has a wider scope than closed-domain search in task-oriented dialogue, empirical analysis shows that both tasks result in a similar conversational structure
~\cite{10.1007/978-3-030-15712-8_35}.
Open-domain search interfaces and task-oriented information navigation dialogue systems both take unconstrained natural language as input. However, dialogue system users are typically limited in expressing their preferences by the domain schema. In response to an out-of-schema user request, a task-oriented dialogue system may produce an informative help message guiding the user to adapt to its limitations
~\cite{DBLP:journals/umuai/KomataniUKO05,tomko-rosenfeld-2004-speech}. Alternatively, system capabilities may be extended beyond a domain API. For example, Kim et al. \cite{kim-etal-2020-beyond} proposes a method for handling users' follow-up questions in task-oriented dialogue systems. To support pragmatic interpretation, Louis at al. \cite{louis-etal-2020-id} explores users' indirect responses to questions. To extend a task-oriented system to handle natural preferences, a corpus of natural requests for movie preferences was collected using a novel approach to preference elicitation \cite{Radlinski2019}.
Task-oriented dialogue systems require accurate models to extract information from unstructured text. Pretrained transformer models, such as BERT~\cite{devlin2019bert}, have shown to be effective in extracting information from text, leading to significant improvements on
many NLP tasks, including open-domain question answering, FAQ retrieval, and dialogue generation \cite{wang2019multi,sakata2019faq,kim-etal-2020-beyond}.
Following previous work, we use BERT both in a supervised and an unsupervised setting~\cite{izacard2021leveraging, 10.1145/3397271.3401325}.
We also explore transfer learning from a general natural language entailment task using publicly available corpora~\cite{conf/emnlp/BowmanAPM15}.
| {'timestamp': '2021-09-20T02:21:20', 'yymm': '2109', 'arxiv_id': '2109.08650', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08650'} | arxiv |
\section{Introduction}\label{sec1}
Incorporating spatial dependence in the process of analysing large image, and other spatial image--like, data sets can be a difficult problem largely due to the computational requirements.
An important example of such data sets include PET (Positron Emission Tomography) images of the brain, where a whole image typically requires analysis of up to $10^{6}$ time series \citep{Hammers2007}.
Current state of the art analysis of such data generally either assumes spatial independence of pixels or performs large-scale aggregation over space to overcome computational restrictions. In this paper, a novel computational method to incorporate spatial dependence in the process of model selection is presented.
The technique presented here extends the well-known pseudo-marginal Markov Chain Monte Carlo (MCMC) algorithm originally presented by \cite{Beaumont2003}, and characterised by \cite{Andrieu2009}.
More specifically, a Potts model \citep{Potts1952} is first utilised as a prior distribution to encode spatial dependence over a \emph{local} model associated with each node of a graph.
Imposing further assumptions, of conditional spatial independence for local model parameters given the local model then
gives rise to significant simplifications in computations.
This Markov random field model is used on the discrete space of model orders to describe spatial dependence between neighbouring nodes (pixels).
Finally, a standard component-wise MCMC updating scheme is used in conjunction with the above assumptions.
This then allows for the use of node-level marginal likelihood estimators to be used within a pseudo-marginal MCMC method.
The end results is a tractable, accessible computational method that uses model selection at the individual (node/pixel) level to perform spatially dependent model selection on the whole (graph/image) data set.
This method provides a flexible but efficient algorithm that can be readily implemented ---
in fact, the proposed methods allows for the use of existing unbiased non-spatial estimators to be used within a framework which incorporates spatial dependence.
In addition, the proposed method can be further extended through augmentation of the state space of the MCMC chain; in this specialised setting careful specification of the proposal distributions can lead to many further computational approaches and techniques.
The remainder of this paper is structured as follows.
Section~\ref{section:Background} presents relevant background material including the motivating problem and reviews the use of Potts models in related contexts. Section~\ref{sec:existing-monte-carlo} reviews existing methods for sampling from distributions of this type.
Section~\ref{section:Method} presents a hierarchical model and develops methods for using it in the context of interest alongside a formal justification of the approach and a number of extensions. Finally, the performance of the developed method, and some variants thereof, is studied empirically in applied settings in Section~\ref{section:EmStudy}.
\section{ Background}
\label{section:Background}
\subsection{Preliminaries}
A graph $G=(V,E)$ is the pair of sets of nodes, or vertices, denoted $V$ and edges denoted $E$.
In particular, each element of the edge-set $E$ is some pair of elements of the nodes-set $u,v \in V$, denoted $\langle u,v \rangle \in E$.
Two nodes $u,v$ are said to be connected by the edge $\langle {u,v} \rangle$ if $\langle u,v \rangle \in E$.
In this case we may say that $u$ and $v$ are neighbours, or adjacent, and denote this by the relation $u \sim v$.
Here, we will look only at undirected graphs, so the relation $\sim$ will be symmetric and $\langle {u,v} \rangle$ is an \emph{unordered} pair.
Denote by $\partial(v) = \{u \in V : v \sim u \}$ the set of neighbours of $v$, by convention $v$ is not a neighbour of itself.
Given a graph, $G,$ a collection of random variables, $\bm{X} = (X_v : v \in V)$, indexed by the nodes-set, $V$, is called a random field on $G$.
Let $P$ be the law of $\bm{X}$; and define, for any $A \subset V$, $\bm{X}_A = \{X_v : v \in A \}$ and $ \bm{X}_{-A} = \{X_v : v \in V \setminus A \}$. With a slight abuse of this notation, we will write $\bm{X}_{-v}$ to denote $\bm{X}_{V \setminus \{v\}}$ for $v \in V$.
$\bm{X}$ is called a Markov random field \citep{Besag1974} on a discrete graph if and only if we have that:
$$P(X_{v} \vert \bm{X}_{-v}) = P(X_{v}\vert\bm{X}_{\partial(v)}),$$
where each component $X_v$ takes value in some set $\mathcal{X}$.
Thus, $\bm{X}$ takes values in $\mathcal{X}^{V}$, the collection of maps from $V$ to $\mathcal{X}$.
In this paper, $\mathcal{X}$ will always be finite.
Denote a parametric model for data $Y \in \mathcal{Y}$, by \( S =(\mathcal{Y},\{ P_\theta: \theta \in \Theta \})\); where $P_\theta$ is a probability distribution over $\mathcal{Y}$, with $\theta$ taking values in the parameter space $\Theta \subset \mathbb{R}^d$ with $d < \infty$.
We will use $f(\cdot \vert \theta)$ to denote the density (w.r.t some dominating measure, usually the Lebesgue or counting measures) of the distribution $P_{\theta}$.
Allow $Y \sim P_\theta $ and, where the density exists, $ Y \sim f(\cdot \vert \theta),$ to mean that $Y$ is distributed according to the distribution $P_\theta$.
A finite set of statistical models, called the model space, is denoted $\mathcal{S} = \{ S_M : M \in \mathcal{M} \}$. Here, each model is indexed by the model order $M$, which is an element of a finite index set $\mathcal{M} \subset \mathbb{N}$.
For a model $S_M$, of order $M$, let $f_M(\cdot \vert \theta)$ for parameter $\theta \in \Theta_M$, be the associated density.
We write $\Theta_M$ to emphasis that the parametric space is often dependent on the model order.
A straightforward example of such models are the compartmental models, see \citep{Gunn2001} or Section \ref{PET} below.
Bayesian model selection, averaging and comparison involves inference of the model order $M \in \mathcal{M}$, where $M$ is a random variable to which some prior distribution is attached \citep[Chapter 7]{Robert2007}.
\subsection{Position Emission Tomography}
\label{PET}
An application that motivates the methodological development that follows is
Positron Emission Tomography (PET; \citet{Phelps2006}).
Dynamic PET is an increasingly important neuroimaging technique used to study
different functions of the brain \emph{in vivo}. PET images have been used to investigate
many biochemical processes in the brain, in both control and atypical subjects.
This invasive imaging modality uses the detection of high-energy photons,
released as a consequence of an injected tracer's positron emissions, as a
signal to form a dynamical three-dimensional image.
Given that there will be greater radioactivity in regions where there are higher amounts of the tracer, the signal intensity in each voxel will be proportional to the concentration of the tracer. Thus, by taking a sequence of measurements over time, the constructed image represents the time course of the tissue concentration of the tracer \emph{in vivo}.
As a result of the nature and number of observations recorded in the
reconstructed PET image, the data is usually modelled using a system of linear
differential equations such as compartmental models \citep{Gunn2001}. We restrict our attention here to the plasma input compartment models. Given data $y = (y_1, \dots,y_k)^{\top}$, at
a voxel, an $M-$compartment model can be formally written as:
\begin{align}
y_j = C_{\mathrm{T}}(t_j;\phi_{1:M}, \vartheta_{1:M}) + \sqrt{\frac{C_{
\mathrm{T}}(t_j;\phi_{1:M}, \vartheta_{1:M})}{t_j - t_{j-1}}} \epsilon_j, \label{eq:comp_signal} \\
C_{\mathrm{T}}(t_j;\phi_{1:M}, \vartheta_{1:M}) = \sum_{i=1}^{M} \phi_i \int_{0}^{t_j}C_{\mathrm{P}}(s)e^{-\vartheta(t_j-s)}ds,\label{eq:comp_model}
\end{align}
for $j = 1, \dots, k$; where $C_{\mathrm{T}}$ is the tissue concentration, $t_j$ is the measurement time of
observation $y_j$, $\epsilon_j$ is the additive measurement error and the
plasma input function $C_{\mathrm{P}}$ is treated as known.
The parameters \(\phi_{1:M} = (\phi_1, \dots, \phi_M)\) and \( \vartheta_{1:M} = ( \vartheta_1, \dots, \vartheta_M )\)
determine the dynamics of the model.
Importantly, these parameters are
indistinguishable, \citep[Theorem 2.2]{Gunn2001}, and are often called the micro-parameters. In contrast, the macro-parameter
$$V_{\mathrm{D}} = \sum_{i=1}^{M}\frac{\phi_i}{\vartheta_i},$$
termed the volume of distribution is uniquely identifiable. This macro-parameter
is very often the quantity of principal interest in statistical analysis of PET
data.
The additive error variable $\epsilon_j$ is typically modelled using a normal distribution:
$$\epsilon_j \sim \mathcal{N}(0,\sigma^2),$$
where $\mathcal{N}(0,\sigma^2)$ is the normal distribution with mean zero and variance $\sigma^2$.
This class of statistical models have proven to be very effective in Bayesian analysis of PET
data, as studied and presented by \citet{Peng2008} and \citet{Jiang2009}.
Recently, computer-intensive Monte Carlo methods have also been successfully
applied to these models towards meaningful statistical inference of PET data.
Specifically, \cite{Zhou2013} investigated an
application specific MCMC approach to Bayesian model comparison for this class
of models; and studied both vague non--informative and biologically informed priors. In
this work, samples from a MCMC chain were used in the harmonic mean estimator to
approximate the model evidence in order to perform model comparison, selection and
averaging. This work also demonstrated the possibility that Monte Carlo approaches could be used
to investigate
and meaningfully compare more complex models, containing up to $m=3$ compartments, rather
than the typical up to $m=2$ compartmental models.
\cite{Zhou2013} further showed that within a Bayesian framework, a $t-$distributed error structure may be far more plausible. This can be written as
$$\epsilon_j \sim \mathcal{T}(0,\tau, \nu),$$
where $\mathcal{T}(0,\tau,\nu)$ denotes the Student's $t-$distribution with mean zero, scale $\tau$, and $\nu$ degrees of freedom.
Expressions for prior and posterior densities, of both cases, can be found in Appendix \ref{App:Model_Equations}.
Importantly, with regard to model selection within this context, \citet{Zhou2013} also showed that a Bayesian approach \emph{exhibited some spatial structure} despite assuming spatial independence.
This was in contrast to using the Akaike Information Criteria (AIC;\cite{Akaike1973}) for model selection with a non-linear least square (NLS) method used to approximate the MLE which showed no obvious spatial structure, see also Section \ref{sec:data-analys}.
More recently, \cite{Zhou2016} used an adaptive variant of the sequential Monte Carlo (SMC)
sampler algorithm of \cite{DelMoral2006} to estimate the model evidence (marginal likelihood). The class of algorithms
presented in this work, use adaptive MCMC kernels together with adaptive
annealing schemes to minimise tuning requirements to further the accessibility of
Monte Carlo approaches to this problem. In addition, the model evidence can be
directly approximated using the set of weights from the sampler. The
computational method proposed in this present paper, builds upon this approach
and thus inherits many of these advantages.
\subsection{Potts Model}
\label{sec:potts-model}
The Potts model \citep{Potts1952}, a generalisation of the Ising model \citep{Ising1925}, was used originally to model interacting spins on a lattice.
However, these models have been shown to be also very effective in analysis of image data; for a detailed discussion and review of such applications see \citet{Winkler1995}, \citet{Geman1990} and references therein.
For example, \citet{Geman1984}, is an early study demonstrating the effectiveness of the Ising model for restoration of images under a Bayesian framework.
More recently, the Potts model has been used very successfully within the more broader but still growing sub-field of Bayesian image analysis \cite{Hurn2003}.
In the present context, the Potts model is an ideal prior for model orders, due to its discrete state space, minimal parametrisation and ability to encode the general principle that nearby vertices are \emph{a priori} likely to be best described by the same model.
Following the Bayesian approach, in this study, the model order of the data will be Markov random field with a Potts prior distribution.
For a review of Potts distributions, particularly in the image analysis context, see \cite{Hurn2003}.
Given a graph $G = (V,E)$, finite state space $\mathcal{X}$ and coupling constant $J>0$, the Potts model specifies a family of parametric probability distributions on $\mathcal{X}^{V}$; characterised by the joint mass function:
$$p(\bm{x} \vert J,G) = \frac{1}{\zeta(J)}\exp\left( J \sum_{v \sim u} \delta_{x_v, x_u}\right).$$
Here, recall $v \sim u$ denotes neighbouring pairs and $\delta_{x_v, x_u}$ is the Kronecker delta, i.e. $\delta_{x_v, x_u}$ is one if $x_v = x_u$, and zero otherwise.
The intractable normalising constant (or partition function), written
$$\zeta(J) = \sum_{\bm{x'} \in \mathcal{X}^{V}} \exp\left( J \sum_{v \sim u} \delta_{x_v', x_u'} \right),$$
is a function of $J$.
The parameter $J$ dictates how likely neighbouring random variable $X_v$ and $X_u$ are to have the same value.
Given that the normalisation depends upon this parameter, \(J\) is typically very difficult to infer; and will be treated as known in this setting as discussed at the end of this section.
Given some graph $G = (V,E)$, and the associated random variable $\bm{X} = (X_v \in \mathcal{X}: v \in V)$, we write
$$\bm{X} \sim \text{Potts}(J, G, \mathcal{X})$$
to mean that the random variable $\bm{X}$, taking values in state space $\mathcal{X}^{V}$, is distributed according to the Potts model with given coupling constant $J$.
Where no ambiguity arises, the parameters will be omitted from notation in the interests of clarity.
The Potts model exhibits phase transition behaviour.
This has significant implications when using single-site update scheme MCMC methods, which could result in slow mixing.
That is, if the chain is in a configuration such as the case described above, changes to single variables will mean proposing to move to states of lower probability.
Furthermore, phase transition behaviour happens close to or higher than critical values of the coupling constant, which we denote as $J_\text{critical}$.
In the Monte Carlo setting, there is a sharp transition from fast mixing below $J_{\text{critical}}$ and slow mixing above it.
\citet{Onsager1944} showed that for the Ising model on the two dimensional first order square lattice the exact value was
$$J_\text{critical} = \log\left( 1+\sqrt{2} \right) \approx 0.881.$$
More recently, see for instance \citet{Matveev1996} or \citet{Wu1982}, this has been extended: Let $D= \vert \mathcal{X} \vert $, then for a
$D-$state Potts model,
$$J_\text{critical} = \log\left( 1 + \sqrt{D} \right).$$
In applications, since the intractable normalising constant $\zeta(J)$ is dependent on $J$, it is difficult to infer in the model fitting process \citep{Everitt2012}.
Within the Monte Carlo context, these types of distributions are referred to as \emph{doubly-intractable}.
\cite{Moller2006} introduced an ingenious method to address such problems for the Ising model.
For a more recent work, and for a concise but detailed review of developments since \cite{Moller2006}, see \cite{Moores2020} and references therein.
Additionally, $J$ is a parameter of a prior distribution, thus under the Bayesian analysis framework it would not be too unreasonable for it to be pre-specified.
As such, in what follows, we will treat $J$ as known.
For example, in the numerical studies below we use the value that roughly gives the best model selection performance in pilot studies.
\section{Existing Monte Carlo Methods}
\label{sec:existing-monte-carlo}
Having established the problem of interest and reviewed the relevant distribution for encoding spatial information, we now turn our attention to a brief review of existing computational methods for investigating the characteristics of such complex distributions.
We begin by first looking at the relatively simple Gibbs sampling method for the Potts model.
However, ultimately we would like to sample from, and subsequently characterise, a posterior distribution that consists of the Potts model as a prior, together with an intractable likelihood (detailed in Section \ref{section:Method}).
To this end, a common and standard approach to sampling
from densities expressed in terms of intractable integrals, known as the pseudo-marginal method, is also discussed.
In this paper, we use the SMC normalising constant estimator, to approximate said intractable integrals.
Thus, the section ends with a brief discussion on the SMC estimator and its properties.
However, generic pseudo-marginal methods would be computationally infeasible in the context of high-dimensional discrete latent spaces of the sort considered here; this then leads to the
proposal of a novel computational method in the subsequent section.
\subsection{ Gibbs Sampler for the Potts Model}\label{sec:gibbs-sampler-potts}
There exist efficient samplers for the Potts model, most notably Glauber Dynamics \cite{Glauber1963} corresponding to single-site Gibbs updates, and the elegant Swendsen-Wang algorithm \citep{Swendsen1987}.
Typically, the Swendsen-Wang algorithm is used in simple Potts models, where there is an absence of a ``strong external filed'' i.e. the (graph) likelihood in this context. In this regime, the Swendsen-Wang algorithm has appealing convergence properties for all values of the coupling strength, $J$, see \cite{Hurn2003}.
However, this excellent performance deteriorates markedly in the presence of an external field \citep{Higdon1998} and hence is less appealing in the presence of an informative likelihood.
We focus on the Gibbs sampling approach \citep{Glauber1963,Geman1984}, variants of which will extend naturally to the context of interest in this paper.
The full conditionals required for a Gibbs sampler are readily computed for the Potts model:
$$ p(x_v \vert \bm{x}_{-v}) = \frac{\exp\left( J \sum_{u \in \partial(v)} \delta_{x_u,x_v}
\right) }{ \sum_{x' \in \mathcal{X}} \exp\left( J \sum_{u \in \partial(v)}
\delta_{x_u, x'} \right)} .$$
As is typical in Gibbs samplers, the use of full conditionals results in a simple node--wise update schedule.
However, computing full conditionals for posterior densities such as that of interest here is not possible because the likelihood cannot be evaluated even up to a normalising constant.
So we turn to another Monte Carlo method to tackle this problem.
\subsection{Pseudo-Marginal Monte Carlo Markov Chain}
\label{sec:PM monte carlo markov chain}
Consider, first, MCMC in the simpler case of a tractable target density; one which can be evaluated point-wise.
Denote the target probability density $\mu(x)$,
where $x \in \mathcal{X}$, and $\mathcal{X} \subseteq \mathbb{R}^d$ is the state
space. MCMC algorithms construct a $\mu-$invariant Markov chain denoted
$(X^{(i)})_{i=1}^{n}$ and like all time-homogeneous Markov chains are completely characterized by their initial distribution and their transition kernel.
The Metropolis-Hastings (MH) \citep{Metropolis1953, Hastings1970} algorithm is a
particularly widely-used MCMC algorithm that may be used to target any
analytically tractable density $\mu$. The algorithm can be described very
briefly as follows:
Given that the MH Markov chain is at some state $x\in\mathcal{X}$, a new
state $x^*\in\mathcal{X}$ is proposed from a proposal density, denoted here
$q(x,\cdot)$. The proposed state $x^*$ is accepted with
probability $ \min \{1,R(x,x^*)\}$, where the acceptance ratio is defined
$$ R(x,x^*): = \frac{\mu(x^*)q(x^*,x)}{\mu(x)q(x,x^*)}; $$
or remains in the current state otherwise. The MH algorithm specifies the kernel to
be of the form:
$$ K_{\text{MH}}(x,\dd x^*):= \min \{1,R(x,x^*)q(x,x^*)\}+\alpha_x\delta_x(\dd x^*),$$
where,
$$ \alpha_x := 1 - \int \min\{ 1,R(x,x^*) \} q(x,x^*) \dd x^*,$$
is the probability of remaining in the same state and $\delta_{x}$ denotes a probability measure concentrated at $x$.
The requirement of $\mu$ being known point--wise arises when computing $R$. Thus, a very natural approach for intractable target
densities is to approximate $\mu$ instead.
\citet{Beaumont2003} and \cite{Andrieu2009} show that as long as the
approximation of $\mu$ is unbiased, the Markov chain of this approximate version will have the same invariant distribution as when the ``exact'' target distribution had been used. This approximation results in a class of techniques called ``pseudo-marginal'' algorithms.
Many intractable target densities, including those of interest here, can be expressed in terms of marginals of tractable densities: integrals that cannot be evaluated analytically. An obvious example is when we wish to use marginal likelihoods as will be the case in our context; see~\eqref{eq:PosteriorDensity} below.
More formally, let the target density be of the form
$$ \mu(x) = \int_\Theta \mu(x,\theta) \dd\theta,$$
where the integrals cannot be solved analytically; and
$\theta \in \Theta$ may be considered a latent (or nuisance) variable that is not necessarily of
current interest.
Let $\widehat{\mu}(x)$ be an estimator of $\mu(x)$ and suppose that $\widehat{\mu}(x)$
is unbiased, for all $x \in \mathcal{X}$.
That is, if we let $g(\cdot \vert x)$ denote the density of $\widehat{\mu}(x)$, then we have that $\mathbb{E}[\widehat{\mu}(x)] = \mu(x)$ for every $x\in\mathcal{X}$,
where the expectation is taken with respect to $g(\cdot \vert x)$.
Note that $g$ need not be known.
The estimator $\widehat{\mu}(x)$ is random, and its variance will play an important part in producing accurate results --- we postpone further discussion until Section~\ref{section:NodewiseAlgoSection}.
Grouped independence Metropolis Hastings (GIMH), a pseudo-marginal algorithm
first presented by \cite{Beaumont2003} and subsequently interpreted by \citet{Andrieu2009}, can now be presented. Using the simpler reformulation (without auxiliary variables) given by \citet{Andrieu2015}, the pseudo-code description of GIMH is presented in Algorithm \ref{algo:GIMHAlgorithm}.
\begin{algorithm}
\caption{ The GIMH Pseudo-Marginal Algorithm}\label{algo:GIMHAlgorithm}
\begin{enumerate}
\item Given $x^{(i-1)}$ and unbiased estimate
$\widehat{\mu}_{(i-1)}(x^{(i-1)})$.
\item Sample:
\begin{enumerate}
\item $x^{*} \sim q(x^{(i-1)}, \cdot)$
\item $\widehat{\mu}_*(x^{*}) \vert x^* \sim g(\cdot \vert x^{*} )$
\end{enumerate}
\item Compute \[ \widehat{r}(x^{(i-1)},x^{*}):=
\frac{\widehat{\mu}_{*}(x^*)q(x^*,x^{(i-1)})}{\widehat{\mu}_{(i-1)}(x^{(i-1)})q(x^{(i-1)},x^*)} \]
\item With probability $\min\{1,\hat{r}\}$ let:
\[ x^{(i)} = x^{*} \text{ and } \widehat{\mu}_{(i)}(x^{(i)}) = \widehat{\mu}_{*}(x^{*}); \hspace{1cm} \]
otherwise
\[ x^{(i)} = x^{(i-1)} \text{ and } \widehat{\mu}_{(i)}(x^{(i)}) = \widehat{\mu}_{(i-1)}(x^{(i-1)}).\hspace{1cm} \]
\end{enumerate}
\end{algorithm}
Here, we have used subscripts $(i)$ and $*$ for $\widehat{\mu}$ to emphasis precisely where the estimate for the marginal likelihood has been (re-)estimated.
Henceforth these subscripts will be suppressed for clarity of notation.
Note in particular, Algorithm \ref{algo:GIMHAlgorithm} is analogous to the marginal MH algorithm,
with the difference being that the acceptance ratio, \(R\), is now approximated by
$$ \widehat{R}(x,x^*): =
\frac{\widehat{\mu}(x^*)q(x^*,x)}{\widehat{\mu}(x)q(x,x^*)}.$$
As \citet{Andrieu2009} point out, the pseudo-marginal Markov chain should be intuitively thought of as a Markov chain on the extended space of the random variable $\left(X, \widehat{\mu}(X)\right)$, rather than just $X$ itself.
They further show that a Markov kernel with this acceptance ratio produces a Markov chain with (and converging to) invariant distribution with marginal $\mu$.
A similar justification applies to the algorithm proposed below which is a natural extension of GIMH specialised to the setting of interest.
We detail this in Section \ref{sec:exact-samples-from}, Proposition \ref{prop_1}.
\subsection{ Estimating the marginal likelihood using an SMC Sampler}
\label{sec:SMC Samplers}
Unbiased likelihood estimators are commonly constructed using particle filters, or SMC samplers, as in \citet{Andrieu2010}.
SMC samplers \citep{ DelMoral2006} are a class of algorithms that generate collections of weighted samples approximating
each of a sequence of target distributions $\{ \mu_t\}_{t\geq 1}$ over essentially any random variable defined on some spaces
$(\mathcal{X}_t){t\geq 1}$. Standard SMC methods achieve this through a combination of
sequential IS and variance reduction resampling methods on spaces with increasing
dimensions (see, for example, \citet{Doucet2011}). However, SMC
samplers allow for sequence of distributions defined on some common space
$\mathcal{X}$.
SMC samplers accomplish this by creating a sequence of auxiliary
distributions
on spaces of increasing dimensions.
SMC samplers can also be readily applied to simpler spaces through the use of annealing schemes.
See \cite{Zhou2016} and Section \ref{section:EmStudy} for details on specification of the annealing scheme within the present Bayesian analysis context.
The sequence of auxiliary distributions are specified
using Markov kernels called ``backward kernels'', which critically impact the variance of the estimators. See \cite{DelMoral2006} for more details on these so called backward kernels.
Conventional sequential importance re-sampling algorithms can then be applied to
the auxiliary distribution sequence. More precisely, assume that at iteration $t-1$ the set of
$N$ weighted particles approximate $\widetilde{\mu}_{t-1}$, denote this
$\{W_{t-1}^{(i)},X_{0:t-1}^{(i)}\}_{i=1}^{N}$.
Here, $W_{t}^{(i)}$ denotes the \emph{normalised} weight of particle $X_{0:t}^{(i)}$ for all $i = 1, \dots, N$.
For iteration $t$, the path of
each particle $X_{0:t-1}^{(i)}$ is extended with a Markov kernel say,
$K_t(x_{t-1},x_t)$, yielding the set of particles $\{X_{0:n}^{(i)}\}_{i=1}^{N}$
to which IS is applied. Subsequently, the weights are updated by a factor
called incremental weights.
Importantly, particularly when interested in approximating marginals such as the
model evidence (marginal likelihood); if $\mu_t(x_t) = {\gamma_t(x_t)}/{Z_t}$ is only known up to
a normalising constant, the unnormalised incremental weights
$$w_t(x_{t-1},x_{t}) = \frac{\gamma_{t}(x_{t-1})}{\gamma_{t-1}(x_{t-1})}.$$
can be used.
Note: here, and as practised in the studies below, we assume that $K_t$ is constructed to be $\mu_t$-invariant,
$\mu_t \ll \mu_{t-1}$ and the associated time-reversal kernel is used for the backward kernel.
In fact, this collection of algorithms provide unbiased (see \citet[Proposition 7.4.1]{DelMoral2004}) estimates of ${Z_t}/{Z_{t-1}}$ via
\begin{align}
\widehat{\frac{Z_t}{Z_1}} = \prod_{p=2}^{t}\widehat{\frac{Z_p}{Z_{p-1}}} = \prod_{p=2}^{t}\sum_{i=1}^{N}W^{(i)}_{p-1}w(X^{(i)}_{p-1:p}).\label{eq:smc_norm_const}
\end{align}
These normalising constant estimators satisfy a Central Limit Theorem \citep[Proposition 9.4.1]{DelMoral2004} and have asymptotic variance that are inversely proportional to the number of particles $N$ (see also \cite{Chopin2020} for a recent review).
As such, $N$ is an important tuning parameter when this sampler is used within a pseudo-marginal algorithm \citep{Doucet2015}.
\section{Methodology}\label{section:Method}
We now turn our attention to the the development and presentation of the models to encode spatial dependence together with computational methods that can be used to perform inference under, and characterise, these models.
There is a considerable literature on spatial modelling in Bayesian data analysis (see, for example, \citet{Gelfand2010}).
However, some specialised settings, such as that encountered when dealing with PET images, are yet to be explored to the same extent.
In these cases, there may be significantly large amounts of data to be analysed and relatively sophisticated models may be required for meaningful investigation.
Such approaches may need to incorporate application-specific structure and information. For example, \cite{Bezener2018} presents a method of variable selection which models spatial dependence using hierarchical spatial priors and parcellation for the analysis of MRI images.
Studies that attempt to model spatial relationships in PET images are scarce, and tend not to use a Bayesian approach.
One such example is \citet{Zhou2002} who proposes a method that extends on current standard PET data analysis to allow for spatial dependence.
That is, spatial constraint using nonlinear ridge regression is used to improve upon parametric images produced by conventional weighted NLS methods.
They showed that doing so reduced the percentage mean square error by $60-80\%$ in simulation studies.
These promising results motivate the incorporation of spatial dependence when analysing PET images, particularly in Bayesian frameworks where such studies have been largely absent.
On the other hand, there exists many computationally efficient methods for complex settings, such as PET data analysis. These include, in the PET context, among many others: \citet{Gunn2002,Peng2008,Jiang2009,Zhou2013,Zhou2016}. Computational tractability in these methods is typically attained through the assumption of spatial independence.
A natural strategy is, therefore, to adapt existing non-spatial methods to a model that does incorporate spatial dependence. This strategy is particularly natural when modelling spatial dependence via a Potts model as it can be efficiently targeted by MCMC methods with single-site update schemes. In this section we construct a class of models that allows for such computational methods.
Having presented the model that allows for effective incorporation of spatial dependence, we then present a natural extension of the generic pseudo-marginal approach, discussed in Section \ref{sec:existing-monte-carlo} above, to this specialised setting in Section~\ref{section:NodewiseAlgoSection} along with the theoretical justification of the method, which follows from that of the standard pseudo-marginal approach and some additional considerations. Further extensions of the method are described in Section~\ref{sec:Mult-augM-pseudo}, and a straightforward approximation of the proposed algorithm is introduced in Section~\ref{sec:Approximations}.
\subsection{Spatial Inference using the Potts Model Prior}
\label{ssection:S-T Inference using Potts model}
Given spatial data (or spatio-temporal data, such as PET) $\bm{Y} = (Y_v : Y_v \in \mathbb{R}^k, v \in V )$, associate a graph $G_{\bm{Y}}=(V_{\bm{Y}},E_{\bm{Y}})$ that encodes the geometry of spatial dependence.
That is, data points $Y_u$ is conditionally independent of $Y_v$ given $Y_{-\{u,v\}}$ unless $\langle u,v \rangle \in E_{\bm{Y}}$.
For example, for image data a simple (finite) lattice would suffice. We will call $Y_v$ the node data point at the node $v \in V$.
Building good statistical models for $\bm{Y}$ can be difficult; model selection would involve selecting among many complex and computationally intensive models from the model space.
Analysis in this setting can be simplified by using existing simpler models such as those that assume spatial independence and model data at the node-level.
Such an approach has two prominent strengths.
Firstly, as aforementioned, many existing analysis and methodology would naturally make spatial-independence assumptions.
This approach can readily exploit these technique, and allow them to be readily used to incorporate spatial dependence. Secondly, using this approach allows for considerable computational simplifications as will be seen later.
Formally, consider parametric models for the node data point $Y_v$, for all $v \in V_{\bm{Y}}$, rather than the whole data set $\bm{Y}$.
Denote the parameter of these models by $\theta_v$, with parametric space $\Theta_v$ for each node $v \in V$.
It is immediate that a Potts model can be used to encode spatial relationships between models at different locations in space; define
$\bm{X} =( X_v \in \mathcal{X} : v \in V_{\bm{Y}})$ a Markov random field with respect to the graph $G_{\bm{Y}}$.
Here, the coupling constant $J$ is treated as known and constant.
The parametric distribution for $Y_v$, now has parameters $(\theta_v, X_v)$.
Importantly, $X_v$ is a component of the Potts random variable $\bm{X}$, and so has spatial dependence dictated by $E_{\bm{Y}}$.
Importantly, $X_v$ will determine the model associated with node $v$ --- more precisely, the model order at node $v$ is given by $X_v$.
Given a family of parameterised prior densities for each possible model denoted generically $p$, over the parameter space; we may compactly summarise this hierarchical model as:
\begin{align}
\bm{X} \vert J, G_{\bm{Y}}&\sim \text{Potts}(J, G_{\bm{Y}}), \label{eq:XModelPotts}\\
\theta_{v} \vert X_{v}, \xi_v &\sim p_{X_{v}}(\cdot \vert \xi_v) \text{ for all }v \in V_{\bm{Y}},\label{eq:XModelPrior}\\
Y_{v} \vert \theta_{v},X_{v} &\sim f_{X_{v}}(\cdot \vert \theta_v) \text{ for all }v \in V_{\bm{Y}}. \label{eq:XModelLikelihood}
\end{align}
Here, recall that $f_M$ denotes the density associated to statistical model $S_M$ with model order $M$.
A similar convention is used for the (parameter) prior to denote that a different prior distribution must be used for each model order in the Bayesian context.
Specifically, here we have that the model order is $m=X_v$ for each node $v \in V$.
This generic model is represented as a plate diagram in Figure \ref{fig:platesDiagram2}.
\begin{figure}
\centering
\input{plateDiagram3}
\caption{Plate diagram of the proposed generic model.}\label{fig:platesDiagram2}
\end{figure}
Here, $\xi_v$ is a parameter of the distribution $p$. In principle a hyperprior could be attached to this parameter with no particular difficulty; we work with this simple setting in the interest of parsimony.
To this end, we fix $\xi_v$ to be a known hyperparameter common to all nodes, $v$, and so we write $\xi$ instead of $\xi_v$ in what follows.
Additionally, given that we now treat the model order as a random variable, henceforth we use the convention that $f(\cdot \vert \theta_v,m) = f_M(\cdot \vert \theta_v)$.
Note that, at the nodal (pixel) level, Bayesian model selection would often involve the computation of the marginal likelihood, $f(y_v \vert m) = \int_{\Theta_v} f(y_v \vert \theta_v,m)p(\theta_v\vert m, \xi)\mathrm{d} \theta_v$.
We are interested in the marginal likelihood of the whole image $\bm{Y}$, which may involve multiple intractable high-dimensional integrals.
We impose an assumption of conditional independence, discussed next, which allows us to make significant simplifications.
In realistic settings, it may be that the parameter $\bm{\theta} = (\theta_v)_{v \in V}$ also exhibits spatial dependence.
The above hierarchical model, makes the underlying assumption that it does not and this setting is the focus of the present paper, where we have found the incorporation of spatial structure at the level of model sufficient to improve upon the state of the art for problems of interest. Further generalisation would be possible and provides an interesting direction for further work.
We encode this in Assumption~\ref{ass:cip} which will be a standing assumption throughout this paper and is discussed in Section~\ref{sec:dcip}.
\begin{assumption}[Conditional Independence]\label{ass:cip}
$$\theta_v \vert X_v,\xi \perp \bm{X}_{-v}, \bm\theta_{-v} \textrm{ for all }v \in V.$$
\end{assumption}
The primary interest of the proposed methodology is to infer $\bm{X}$.
Although $\bm{\theta}$ \emph{is} inferred as a by-product of the proposed method,
it can be thought of as a latent variable in this framework and may be a nuisance parameter in some settings which mitigates the impact of modelling the parameters in this way.
Finally, note that, as a direct consequence of the above model and assumption, the marginal likelihood of $\bm{Y}$ can be written as the product of the marginal likelihoods of $Y_v$ over all $v \in V$ --- see Section~\ref{sec:infer-froM-prop-1} below.
\subsection{ Spatial Bayesian Model Selection using the Potts Model}
\label{sssection:S-T model selection with Potts}
To exploit the presented model, denote by $\mathcal{S}_v = \{S_{v,M_v} : M_v \in \mathcal{M}\}$ the model space used at each nodal data point $Y_v$. I.e. every node in the graph is associated with a model $M_v$ from a set common to all nodes, $\mathcal{M}$.
Thus a statistical model is associated with each node in the graph and hence each data point,
$$S_{v,M_v} = \{f(\cdot \vert {\theta_v},M_v): \theta_v \in \Theta_{v,M_v} \}.$$
The notation $\Theta_{v,M_v}$ is used here to emphasis that since $M_v$ is the model order at node $v$, the parameter space will be dependent on it.
For example, for compartmental models, the model order dictates the dimension of the parameter space.
These collections of models can be used to generate a model space for the whole data set $\bm{Y}$. Specifically, a set of candidate models for $\bm{Y}$ can be formulated as
$$\mathcal{S}_{\bm{Y}} = \{(S_{v,M_v}) : M_v \in \mathcal{M}\}_{v \in V}.$$
Writing $\bm{M} = (M_v)_{v \in V} \in \mathcal{M}^{V}$, Bayesian model selection of spatial data $\bm{Y}$ can be thought of as inference of the model order parameter $\bm{M}$ in the space $\mathcal{M}^{V}$.
Each realisation of $\bm{M}$ is called a configuration, note that there are $ \vert \mathcal{M} \vert ^{ \vert V \vert }$ candidate models for $\bm{Y}$.
As mentioned before, the Potts model is a natural choice for the prior distribution over model order. For model selection, we adapt the hierarchical model above such that:
\begin{enumerate}
\item $\bm{M} = (M_v)_{v \in V} $ is a Markov random field with a Potts distribution, with spatial dependence represented by $E_{\bm{Y}}$ as before;
\item Each $\theta_v$, for all $v \in V$, is dependent on $M_v$ (e.g. model order determines parameter dimension in some cases, accordingly we denote the prior $p(\cdot \vert \xi,M_v)$) and known constant hyper-parameter $\xi$, importantly it is spatially independent (given the model order $M_v$);
\item $Y_v$, the observed data, has likelihood $f(\cdot \vert \theta_v,M_v)$, where the model $M_v$ dictates which model is selected, for all $v \in V$.
\end{enumerate}
Formally, the above can be summarised:
\begin{align}
\bm{M} && \sim& \text{Potts}(J, G_{\bm{Y}}) && \label{eq:PottsPrior} \\
\theta_v& \vert M_v,\xi & \sim& p(\cdot;M_v, \xi) \text{ for all }v \in V, &&\label{eq:ParametersPrior}\\
Y_{v}& \vert \theta_v, M_v &\sim& f(\cdot; \theta_v,M_{v}) \text{ for all } v \in V. &&\label{eq:YLikelihood}
\end{align}
\subsubsection{Discussion of Assumption~\ref{ass:cip}}\label{sec:dcip}
Assumption~\ref{ass:cip} may not hold in general: if there is spatial dependence between the generative model which describes each vertex then there may also be dependence between the parameters of those models.
In some settings it can be viewed as an approximation which may be tolerable in order to allow inference under a model which is, at least, better than the assumption of full spatial independence.
In other settings, this assumption may not be unrealistic. It is also noteworthy that, if the model order dictates the dimensions of the parameter space at that node, and the space contains dependent parameters, it may be difficult to incorporate spatial dependence at a the parameter level in a meaningful manner.
For example, if considering compartmental models: if two adjacent pixels were to contain different number of compartments, it may be difficult to say anything meaningful about the spatial dependence of the micro-parameters such as the transfer rates.
Such considerations make it difficult to impose some more general Markov random field over the parameters.
Furthermore, incorporating spatial dependence at a model order level will typically take some precedence over spatial dependence at the parameter level.
For instance, in the PET setting, generally we would like to know if two adjacent pixels have the same compartments (i.e. whether or not the localised area contains receptors) before we think about the transfer rates.
To summarise the problem of interest in general terms: the image $\bm{Y}$ is modelled node-wise using the density $f(\cdot;\theta_v, M_v)$, with priors over the parameters $\bm{\theta}$ and $\bm{M}$.
In particular, we propose the use of the Potts model as a prior over discrete parameters $\bm{M}$ to allow for tractable incorporation of spatial dependence in images.
As mentioned above, $\bm{\theta}$ will be treated as a latent variable --- this is discussed in detail next.
\subsubsection{Inference from the Proposed Model}
\label{sec:infer-froM-prop-1}
Having specified this class of models, we now turn to the task of inference.
Let $p(\bm{M})$ denote the Potts prior probability mass function over $\bm{M} \in \mathcal{M}^{V}$.
Then, the model posterior density, for $\bm{Y}$, is denoted
$$\pi(\bm{M} \vert \bm{y}) \propto f(\bm{y} \vert \bm{M})p(\bm{M}).$$
Here, $f(\bm{y} \vert \bm{M})$ will be called the \emph{graph} marginal likelihood of $\bm{y}$; it encodes a generative description of the data under the proposed model.
The proposed method allows us to incorporate spatial dependence at the level of the discrete parameter $\bm{M}$ only.
Subsequently, for computational tractability we impose Assumption~\ref{ass:cip}: given the model order $M_v$ the random variable $Y_v$ at each node $v\in V$ is independent.
In other words, as per \eqref{eq:XModelPrior} and \eqref{eq:XModelLikelihood}, we have that
$$ f(\bm{y} \vert \bm{M}) = \prod_{v \in V} f(y_v \vert M_v).$$
Here $f(y_v \vert M_v)$ denotes the likelihood at each node $v$, and will be henceforth called the \emph{node-wise} likelihood.
This assumption is important as it makes the graph likelihood tractable, and provides computational simplifications discussed later.
Typically, as described above, a parametric model is used, thus $f(y_v \vert M_v)$ will in fact be a marginal likelihood or evidence (i.e. an integral, which is likely to be analytically intractable).
We finally have the probability mass function of primary computational interest
\begin{align*}
\pi(\bm{M} \vert \bm{y}) \propto& \left\{ \prod_{v \in V} f(y_{v} \vert M_{v})\right\}p(\bm{M})\\
\propto&\left\{ \prod_{v \in V} \int_{\Theta_v} f(y_{v} \vert \theta_v,M_v)p(\theta_v \vert M_v, \xi)\dd\theta_v \right\}\times \exp\left(J \sum_{v\sim u} \delta_{M_v,M_u}\right)\numberthis \label{eq:PosteriorDensity}.
\end{align*}
Recall the mild assumption that hyper-parameter $\xi$ is known and henceforth suppressed in notation.
Even in this general formulation, this mass function is not particularly attractive.
There are some positives:
It is straightforward to evaluate up to the intractable normalizing constant; and Assumption~\ref{ass:cip} does seemingly lead to a simpler computation even at this stage, as only the node-wise marginal likelihoods $f(y_v \vert M_v)$ need to be computed rather than the high-dimensional integration of the full marginal likelihood $f(\bm{y} \vert \bm{M})$.
However, even in this simpler setting, the graph marginal likelihood poses two computational difficulties: i) it is a product of $ \vert V \vert $ integrals and ii) these integrals in general are analytically intractable in most cases of interest.
\subsection{The Node-Wise Pseudo-Marginal Algorithm}\label{section:NodewiseAlgoSection}
We now turn to extending the techniques discussed in Section \ref{sec:existing-monte-carlo}, to build the novel computational method for use in the class of models constructed above.
The aim is to characterise the posterior density, $\pi(\bm{M} \vert \bm{y})$, of the model given in \eqref{eq:PottsPrior}-\eqref{eq:YLikelihood}.
Suppose, for now, that a generic MH algorithm could be used in this setting.
That is, to generate a MH Markov chain that targets the posterior density.
This then gives the acceptance ratio: $$R(\bm{M},\bm{M}^*) = \frac{\pi(\bm{M}^* \vert \bm{y})q(\bm{M}^*,\bm{M})}{\pi(\bm{M} \vert \bm{y})q(\bm{M},\bm{M}^*)}. $$
Even with a tractable marginal likelihood, computing this acceptance ratio would be costly. Under Assumption~\ref{ass:cip} (given $\bm{M}$ the parameters $\bm{\theta} = (\theta_v)_{v \in V}$, of the model over the data $\bm{y}$, are independent) the computational complexity of the problem is reduced considerably; now, only the node-wise marginal likelihoods need to be computed.
However, every time a new configuration is proposed, up to $ \vert V \vert $ new integrals would then need to be computed and the acceptance probability is likely to be very small. Given that the number of possible Potts configurations is $ \vert \mathcal{M} \vert ^{ \vert V \vert }$, growing geometrically with the number of nodes (i.e. pixels, for image data), the computational costs are not appealing.
Under Assumption~\ref{ass:cip} it is natural to employ a Metropolis--within--Gibbs approach to mitigate these difficulties and to obtain significant computational simplifications.
Suppose that the MCMC sampler is currently at some configuration $\bm{M}=(M_v)_{v \in V}$.
Under a single variable updating schedule: \emph{only} the model order $M_v$, at some node $v\in V$, will be proposed to be changed in a given step.
We will refer to this as node-wise updating schedule, since we update the model order at a single node $v$ only.
Denote the proposed state to be $M^*_v$; and $\bm{M}^*_{[v]}$ to be the vector equivalent to $\bm{M}$ but with $M^*_v$ as the $v$-th coordinate.
For simplicity, assume that the proposal distribution is symmetric, and the acceptance ratio is
\begin{align*}
\frac{\pi(\bm{M}_{[v]}^* \vert \bm{y})}{\pi(\bm{M} \vert \bm{y})} =& \frac{f(\bm{y} \vert \bm{M}_{[v]}^*)p(\bm{M}_{[v]}^*)}{ f(\bm{y} \vert \bm{M})p(\bm{M})}\\
=& \frac{f(y_v \vert M^*_v)p(\bm{M}^*_{[v]})}{f(y_v \vert M_v)p(\bm{M})}\\
=&\frac{\int f(y_v \vert \theta_{v},M^*_v)p(\theta_v \vert M_v^*)\dd\theta_vp(\bm{M}_{[v]}^*)}{\int f(y_v \vert \theta_v,M_v)p(\theta_v \vert M_v)\dd\theta_vp(\bm{M})}.
\end{align*}
Thus, the acceptance probability of each Metropolis-within-Gibbs step requires the computation of only a single integral. A complete sweep over the graph thus requires $ \vert V \vert $ such integrals but one could expect a reasonable proportion of these proposed moves to be accepted, in contrast to a global proposal which sought to update every node simultaneously.
Typically, even the node-wise marginal likelihood $f(y_v \vert M_v)$ will be difficult or impossible to evaluate analytically. A pseudo-marginal MH algorithm is a natural choice in such cases and is explored in the next section.
\subsubsection{Graph Model Selection using Node-Wise Likelihood Marginal Estimates}
\label{sec:whole-graph-model}
The node-wise update schedule, gives rise to nested iterations. For clarity, term the outer iteration, indexed with $i$, of a full pass through the whole graph as the graphical iteration.
The inner iteration over $V$ will be termed the node-wise iteration.
Suppose that the MH Markov chain denoted, $(\bm{M}^{(i)})_{i =1}^{n}$, is at graphical iteration $i$ and that the state at node $v$ is being proposed to be changed.
Next, since the node-wise marginal likelihood is a normalising constant, for simplicity denote
$$Z_{v}(M) = f(y_v \vert M_v=M)\text{ for all } M \in \mathcal{M}.$$
That is, $Z_v(M)$ is the normalising constant at node $v$ when the model order $M_v=M$.
At graphical iteration $i$, node $v$, for given model order proposal $m^{(i)}_v$, let
$(\widehat{Z}_v)^{(i)}$ denote the approximation of the marginal $f(y_v \vert M_v=M^{(i)}_v).$
Associate with this generic estimator, the computation cost parameter $N$ (for the SMC sampler this was the number of particles).
As mentioned before this is a tuning parameter for the pseudo-marginal, thus also the algorithm presented below.
It is important to note the slight abuse of notation here --- $(\widehat{Z}_v)^{(i)}$ is dependent on the model order proposal $M_v^{(i)}$.
As previously stated, we require that $(\widehat{Z}_v)^{(i)}$ is unbiased.
Additionally, recall we denote $g(\cdot \vert M_v = M_v^{(i)})$ the possibly unknown density of $(\widehat{Z}_v)^{(i)}$.
Following the node-wise updating schedule, whenever a new state $M_v^* \sim q(m_{v}^{(i-1)}, \cdot)$ is proposed, a new node-wise marginal estimation, denoted $(\widehat{Z}_v)^{*}$, is recomputed.
The node-wise acceptance ratio,
$\widehat{r}(\bm{M}^{(i-1)},\bm{M}_{[v]}^{(i-1)*})$,
is then $$\frac{p(\bm{M}^{*}_{[v]})(\widehat{Z}_v)^{*}q(M_v^*,M_v^{(i-1)})}{p(\bm{M}^{(i-1)})(\widehat{Z}_v)^{(i-1)}q(M_v^{(i-1)},M_v^*)}.$$
We emphasise that the computation of $\widehat{r}$, precisely speaking, involves not just the standard MH proposal of a new configuration in $\mathcal{M}^{V}$, but also a proposal of the random variable $\widehat{Z}_v$: it is
a pseudo-marginal algorithm in the sense of \cite{Andrieu2009}, with the added subtlety that the unbiased estimates of the marginal likelihood associated with every other node in the graph are also retained as a part of the extended state.
The justification for using this acceptance ratio will be detailed in Section \ref{sec:exact-samples-from}
The above choices and assumptions lead to the algorithm which we term the ``Node-Wise Pseudo-Marginal'' (NWPM) algorithm; presented in pseudo-code in {Algorithm \ref{algthm: Node-wise PM}}.
\begin{algorithm}
\caption{ The Node-Wise Pseudo-Marginal Algorithm}\label{algthm: Node-wise
PM}
Given: (i) target density $\mu(\bm{M}) := \pi(\bm{M} \vert \bm{y})$; (ii)
unbiased node-wise marginal likelihood estimators $\widehat{Z}_v(M) \approx
\int f(y_v \vert M,\theta_v)p(\theta_v \vert M,\xi)\dd \theta_v $ for all $M \in \mathcal{M}$, $v \in V$;
and (iii) coupling constant $J$, tuning parameter $N$.
\begin{enumerate}
\item At $i=1$:
\begin{enumerate}
\item Initialize $\bm{M}^{(1)}$.
\item Sample $(\widehat{Z}_v)^{(1)} \sim g(\cdot \vert M_v^{(1)})$ for each $v \in V$.
\end{enumerate}
\item For $i=2, \dots$:
\begin{enumerate}
\item For $v \in V$:
\begin{enumerate}
\item Sample:
$M_v^* \sim q(M_v^{(i-1)},\cdot).$
\item Sample:
$ (\widehat{Z}_v)^{*} \vert m_{v}^{*} \sim g(\cdot \vert M_v^*).$
\item Compute:
$$\hat{r} = \frac{p(\bm{M}_{[v]}^{*})(\widehat{Z}_v)^*q(M_v^*,M_v^{(i-1)})}{ p(\bm{M}^{(i-1)})(\widehat{Z}_v)^{(i-1)}q(M_v^{(i-1)},M^*_v,)}$$
\item With probability $\min\{1,\widehat{r}\}$ take:
$$M_v^{(i)} = M_v^*\text{ and } (\widehat{Z}_v)^{(i)} = (\widehat{Z}_v)^{*}$$
otherwise,
$$M_v^{(i)} = M_v^{(i-1)} \text{ and } (\widehat{Z}_v)^{(i)} = (\widehat{Z}_v)^{(i-1)}$$
\end{enumerate}
\end{enumerate}
\end{enumerate}
\end{algorithm}
Within the context of this paper, the NWPM algorithm proposed here is a broadly applicable extension of the GIMH algorithm described above in Algorithm \ref{algo:GIMHAlgorithm}.
The output of this algorithm, the Monte Carlo sample $(\bm{M}^{(i)})_{i=1}^{n}$, can be used to perform model selection in a principled manner.
For example, this could be done using the node-wise marginal modal model order :
That is, at each node $v \in V$ the model order which occurs the most in the (marginal) chain $(M_v^{(i)})^{n}_{i=1}$ is selected.
Additionally, samples of the latent variables $\bm{\theta}$ are typically available as byproducts of the marginal likelihood estimates and can be used to perform parameter inference as demonstrated in the numerical studies below.
An advantage of this pseudo-marginal based approach in this setting is its flexibility. It can be used with essentially any unbiased estimator of marginal likelihood and hence allows existing technology from any application domain to be employed.
The incorporation of spatial dependence via the modelling framework and algorithm developed here can come at the very little computational cost by approximating or making pragmatic adaptations to Algorithm \ref{algthm: Node-wise PM}.
We employ such techniques in the simulation studies presented in Section \ref{section:EmStudy} and discus in more detail in Section \ref{sec:SENWPM} below.
Finally, note that for convenience we assume that the tuning parameter $N$ is fixed to the same value for all $v \in V$.
This parameter typically determines the variance of the estimator $\widehat{Z}_v(M)$ and additional flexibility could be obtained by allowing it to vary between vertices.
Unsurprisingly, a larger $N$ should give a better performance at the expense of greater computational cost.
Indeed \cite{Andrieu2009}, and more recently \cite{Andrieu2016}, showed that when the dispersion of the marginal likelihood estimates are larger the mixing rate of any pseudo-marginal MH algorithm decreases.
Of course, there is a higher computational cost when using larger $N$ to reduce the estimate variance.
The effects of this tuning parameter, and the trade off, on the mixing of the Markov chain in a standard pseudo-marginal algorithm have been studied by \citet{Sherlock2015,Doucet2015,Sherlock2016}.
These works give theoretical justification and numerical studies for the recommendation that $N$ should be chosen such that the variance of the log-likelihood estimator is close to one.
\subsubsection{Marginal invariant distribution of NWPM}
\label{sec:exact-samples-from}
Here we establish the formal validity of a class of algorithms which includes the NWPM, allowing for more general moves than those described in Algorithm~\ref{algthm: Node-wise PM}. We show that this class of algorithms leads to a Markov chain with an invariant distribution coinciding with $\pi$, as given in \eqref{eq:PosteriorDensity}.
For further discussion on specifying proposals within this setting see Section \ref{sec:prop-dens-augm}.
Recalling Assumption~\ref{ass:cip}, we may write the target distribution of the NWPM algorithm as
$$ \mu(\bm{M}) \propto p(\bm{M})\prod_{v \in V} \int_{\Theta_v} f(y_v \vert \theta_v,M_v)p(\theta_v \vert M_v, \xi)\dd\theta_v ,$$
for $\bm{M}=(M_v)_{v \in V} \in \mathcal{M}^{V}$.
Given $\bm{M}$, denote the random vector of the unbiased node-wise marginal likelihoods estimators as $\widehat{\bm{Z}} \vert \bm{M} \sim g(\cdot \vert \bm{M})$, i.e.,
$$\bm{\widehat{Z}} = (\widehat{Z}_v(M_v):v\in V).$$
Henceforth using the shorthand $\widehat{Z}_{v}^M:=\widehat{Z}_{v}(M)$ for all $M \in \mathcal{M}$; we note that, due to independence,
$$g(\widehat{\bm{Z}} \vert \bm{M}) \propto \prod_{v \in V }g(\widehat{Z}_{v}^{M_v} \vert M_v).$$
Finally, define the extended target density
\begin{align}
\widehat{\mu}(\bm{M},\widehat{\bm{Z}})
&= \frac{p(\bm{M}) \prod_{v \in V} \widehat{Z}_{v}^{M_v}g(\widehat{Z}_{v}^{M_v} \vert M_v)}{\sum_{\bm{M}'\in\mathcal{M}^V}
p(\bm{M}') \prod_{v \in V} f(y_v \vert M_v')}\\
&= \frac{p(\bm{M})\prod_{v \in V}\widehat{Z}_{v}^{M_v}g(\widehat{Z}_{v}^{M_v} \vert M_v)}{f(\bm{y})}.\label{eq:pM_target_density}
\end{align}
Here, we let $f(\mathbf{y})$ denote the marginal probability of the observed data, integrating out unknown parameters and unknown model orders; Given observation $\bm{Y} = \bm{y}$, we treat it as a normalising constant.
The NWPM algorithm has similar theoretical properties as GIMH. As such, the remainder of the argument of formal justification then follows the same as the GIMH case, see \cite{Andrieu2009}.
\begin{proposition}\label{prop_1}
Let $\bm{M}$ denote a random variable in the graph model order space $\mathcal{M}^{V}$.
Let $\bm{\widehat{Z}} \vert \bm{M}$, $g$, $\mu$ and $\widehat{\mu}$ be defined as above.
For any $U \subset V$, let $q_U$ denote a Markov kernel on $(\mathcal{M} \times \mathbb{R}_+)^V$ of the form
\begin{align*}
q_U((\bm{M},\bm{\widehat{Z}}),(\bm{M}^*&,\bm{\widehat{Z}}^*)) = \delta_{(\bm{M}_{-U},\bm{\widehat{Z}}_{-U})}(\bm{M}_{-U}^*,\bm{\widehat{Z}}^*_{-U})
q^{\mathcal{M}}_U(\bm{M}_U,\bm{M}_U^*) \prod_{v\in U} g(\widehat{Z}^*_v \vert M_v^*) ,
\end{align*}
where $q^{\mathcal{M}}_U$ denotes a Markov kernel on $\mathcal{M}^U$ and we slightly abuse density notation using the Dirac delta functions to indicate that variables associated with nodes outside $U$ are unchanged (absolute continuity of the numerator and denominator of the Metropolis-Hastings ratio is ensured by the symmetry of this singular part of the kernel).
The standard Metropolis-Hasting acceptance probability with target distribution $\widehat\mu$ can be expressed as:
\begin{equation}
1 \wedge \frac{p(\bm{M}^*)(\prod_{v \in U}\widehat{Z}_v^* )q_U^{\mathcal{M}}(\bm{M}_U^*,\bm{M}_U)}{p(\bm{M}) (\prod_{v \in U}\widehat{Z}_v) q_U^{\mathcal{M}}(\bm{M}_U,\bm{M}_U^*)}
\end{equation}
and the marginal distribution of $\bm{M}$ under $\widehat\mu$ is $\mu$.
\end{proposition}
\begin{proof}
First, consider the acceptance ratio of a MH (Metropolis-Hastings) algorithm with target distribution $\widehat\mu$ and proposal kernel $q_U$:
\begin{align*}
\hat{r} =& \frac{\widehat{\mu}(\bm{M}^*,\widehat{\bm{Z}}^*) q_U((\bm{M}^*,\widehat{\bm{Z}}^*), (\bm{M},\widehat{\bm{Z}}))}{\widehat\mu(\bm{M},\widehat{\bm{Z}}) q_U((\bm{M},\widehat{\bm{Z}}), (\bm{M}^*,\widehat{\bm{Z}}^*))}
\end{align*}
upon inserting the definition of $q_U$ one observes that the numerator is absolutely continuous with respect to the denominator and the singular elements simply impose that $\bm{M}_{-U} = \bm{M}^*_{-U}$ and $\widehat{\bm{Z}}_{-U} = \widehat{\bm{Z}}_{-U}^*$, and we have:
\begin{align*}
\hat{r} =& \frac{\widehat{\mu}(\bm{M}^*,\widehat{\bm{Z}}^*) q_U^{\mathcal{M}}(\bm{M}^*_U, \bm{M}_U) \prod\limits_{v\in U} g(\widehat{Z}_v \vert M_v)}{\widehat{\mu}(\bm{M},\widehat{\bm{Z}}) q_U^{\mathcal{M}}(\bm{M}_U, \bm{M}^*_U) \prod\limits_{v\in U} g(\widehat{Z}_v^* \vert M_v^*)}\\
=& \frac{p(\bm{M}^*)}{p(\bm{M})} \prod_{v\in V} \frac{\widehat{Z}_v^* g(\widehat{Z}_v^* \vert M_v^*)}{\widehat{Z}_v g(\widehat{Z}_v \vert M_v)}\times
\frac{q_U^{\mathcal{M}}(\bm{M}^*_U, \bm{M}_U)}{q_U^{\mathcal{M}}(\bm{M}_U, \bm{M}^*_U) } \prod\limits_{v\in U}\frac{ g(\widehat{Z}_v \vert M_v)}{g(\widehat{Z}_v^* \vert M_v^*)}\\
=& \frac{p(\bm{M}^*)}{p(\bm{M})} \prod_{v \in U} \frac{\widehat{Z}_v^*}{\widehat{Z}_v}\times \frac{q_U^{\mathcal{M}}(\bm{M}^*_U, \bm{M}_U)}{q_U^{\mathcal{M}}(\bm{M}_U, \bm{M}^*_U) } \underset{=1}{\underbrace{ \prod_{v\not\in U} \frac{\widehat{Z}_v^* g(\widehat{Z}_v^* \vert M_v^*)}{\widehat{Z}_v g(\widehat{Z}_v \vert M_v)}}},
\end{align*}
where the final factor is equal to one almost surely under the proposal distribution, and the result follows.
The marginal distribution of $\bm{M}$ follows by the essentially the same argument as in the standard pseudo-marginal context.
\begin{align*}
&\int_{\mathbb{R}_+^{V}} \widehat{\mu}(\bm{M},\widehat{\bm{Z}}) \dd\widehat{\bm{Z}} \\
& = \frac{p(\bm{M})}{f(\bm{y})}\prod_{v \in V} \int_{\mathbb{R}_+}\widehat{Z}_{v}^{M_v}g(\widehat{Z}_{v}^{M_v} \vert M_v)\dd\widehat{Z}_{v}^{M_v} \\
&= \frac{p(\bm{M})}{f(\bm{y})}\prod_{v \in V}\mathbb{E}_g[\widehat{Z}_{v}(M_v)]\\
&= \frac{p(\bm{M})\prod_{v \in V}f(y_v \vert M_v)}{f(\bm{y})}\\
&= \mu(\bm{M}).
\end{align*}
\end{proof}
Clearly, the node-wise proposals described previously fit this framework with $U=\{u\}$ being the single node being updated, although this framework would allow a somewhat broader class of proposals and blocked Metropolis-within-Gibbs type strategies to be explored. Standard arguments mean that a mixture or cycle of such kernels will also preserve $\widehat\mu$ as the invariant distribution.
Next, we discuss some immediate extensions and innovations of this proposed methodology; resulting in further algorithms, approximations and future approaches.
\subsection{Multiple Augmentation Pseudo-marginal Algorithms}
\label{sec:Mult-augM-pseudo}
In this section we will explore the potential of further augmentation of the state space.
The specialised setting of the problem, allows approaches which to the authors' knowledge, have not been previously studied.
The strategy developed here allows for a number of further extensions.
Some simple approaches are discussed below --- methods based on these approaches will also be evaluated in the numerical studies.
The augmentation of the state space used to justify node-wise pseudo-marginal algorithms can be further extended by adding an estimate of the marginal likelihood associated with \emph{every} possible model at \emph{every} node to the state space. Although doing so may seem counter-intuitive and leads to a rather large state space, it allows a number of algorithmic innovations. In particular, by considering the following extended state space it will be possible to use a variety of standard MH moves in order to explore this space.
Let $\bar{\bm{Z}} := (\widehat{Z}_{v}(M): v \in V, M \in \mathcal{M})$ be a vector of marginal likelihood estimator for each model order $M \in \mathcal{M}$, at every node $v \in V$.
Consider, next, a further extended form of the target density \eqref{eq:pM_target_density} :
$$\bar{\mu}(\bm{M},\bar{\bm{Z}}) = \frac{p(\bm{M})}{f(\bm{y})}\prod_{v \in V} \widehat{Z}_{v}^{M_v} \left(\prod_{m' \in \mathcal{M}} g(\widehat{Z}_{v}^{M'} \vert M')\right).$$
The extended joint density $\bar{\mu}$ is constructed such that its marginal over $\bm{M}$ coincides exactly with the \emph{correct posterior distribution}. Indeed, using essentially the same argument as in Proposition~\ref{prop_1}, we have:
\begin{align*}
&\int_{\mathbb{R}^{V \times \mathcal{M}}_+} \bar{\mu}(\bm{M},\bar{\bm{Z}}) d\bar{\bm{Z}} \\
&= \frac{p(\bm{M})}{f(\bm{y})}\prod_{v \in V} \int_{\mathbb{R}_{+}^{\mathcal{M}}}\widehat{Z}_{v}^{M_v}\left(\prod_{m' \in \mathcal{M}}g(\widehat{Z}_{v}^{M'} \vert M') \dd\widehat{Z}_v^{m'}\right) \\
&= \frac{p(\bm{M})}{f(\bm{y})}\prod_{v \in V} \int_{\mathbb{R}_+}\widehat{Z}_{v}^{M_v} g(\widehat{Z}_{v}^{M_v} \vert M_v) \dd\widehat{Z}_{v}^{M_v} \\
&= \mu(\bm{M}).\\
\end{align*}
This further extended target distribution allows for some generalisations of the standard pseudo-marginal algorithm in the context of interest; it depends fundamentally on the fact that the variables associated with each node of the graph take values within a small finite set. It is possible to consider a variety of MH like moves applied to this extended target density. For simplicity we will consider only two types of proposal here: one which changes a single node's associated model and another which refreshes the likelihood estimates for a single node.
\subsubsection{Proposal Densities for the Augmented Space}
\label{sec:prop-dens-augm}
Denote the proposal of the random vector $\bar{\bm{Z}} = (\widehat{Z}^{M}_{v}: v \in V, M \in \mathcal{M})$ by $\bar{\bm{Z}}^*:=((\widehat{Z}^{M}_v)^*: v \in V, M \in \mathcal{M})$.
Intuitively, $\bar{\bm{Z}}^*$ denotes a re-computation of all the components of $\bar{\bm{Z}}$.
First consider a proposal $Q_u^1$ for the model associated with node $u$.
Recalling that $\bm{M}^*_{[u]}$ is equivalent to $\bm{M}$ with component $M^*_{u}\neq M_{u}$, we have
\begin{align*}
&Q_u^1\left((\bm{M}, \bar{\bm{Z}}),(\bm{M}^*, \bar{\bm{Z}}^*)\right)\\
=& \left( q_u^1(M_u,M^*_u) \prod_{v \neq u} \delta_{M_v,M_v^*} \right) \prod_{v\in V}\prod_{M \in \mathcal{M}} \delta_{\widehat{Z}_v^{M}} ((\widehat{Z}_v^{M})^*)\\
=& \underbrace{\delta_{\bm{M}_{-u},\bm{M}^*_{-u}} q_u^1(M_u,M^*_u)}_{\text{Gibbs-like state proposal}} \underbrace{\prod_{v\in V}\prod_{M \in \mathcal{M}} \delta_{\widehat{Z}_v^{M}}((\widehat{Z}^M_v)^*)}_{ \text{Same marginal estimates} }.
\end{align*}
Here $\delta_{x,y}$ is the Kronecker delta, taking value $1$ if $x=y$ and $0$ otherwise and $\delta_z(z^*)$ is, with the obvious abuse of notation, the singular measure concentrated at $z$ evaluated over an infinitesimal neighbourhood of $z^*$. In this proposal, only a change of $M^*_u$ is proposed --- in particular, $\bar{\bm{Z}}$ and $\bm{M}_{-u}$ do not change.
Subsequently, the usual Metropolis-Hastings acceptance probability for this move is:
\begin{align*}
& 1 \wedge \frac{ \bar{\mu}(\bm{M}^*_{[u]}, \bar{\bm{Z}}) q_u^1(M_u^*,M_u)}{ \bar{\mu}(\bm{M}, \bar{\bm{Z}}) q_u^1(M_u,M_u^*)}\\
=& 1 \wedge \frac{\widehat{Z}^{M^*_u}_u p(\bm{M}^*_{[u]}) q_u^1(M_u^*,M_u) }{\widehat{Z}^{M_u}_{u} p(\bm{M}) q_u^1(M_u,M_u^*)}.
\end{align*}
For simplicity we have assumed that $q_u^1(M_u,M_u^*)$ is independent of the remaining state variables, but this is not necessary for its correctness and proposals which depend upon their values could easily be implemented.
Similarly, consider a proposal $Q_u^2$ which refreshes the augmenting variables associated with node $u$:
\begin{align*}
&Q_u^2\left((\bm{M}, \bar{\bm{Z}}), (\bm{M}^*, \bar{\bm{Z}}^*) \right)\\ =&
\delta_{\bm{M},\bm{M}^*} \prod_{M \in \mathcal{M}} \left( g( (\widehat{Z}_u^M)^* \vert m) \prod_{v \neq u} \delta_{\widehat{Z}_v^m}((\widehat{Z}_{v}^{M})^* ) \right),
\end{align*}
for which the Metropolis-Hastings acceptance probability is simply
$$ 1 \wedge \frac{(\widehat{Z}_u^{M_u})^*}{\widehat{Z}_u^{M_u}} $$
by exploiting the same cancellation as in the standard pseudo-marginal setting. Clearly moves which update only some of the augmenting variables associated with node $u$ could be justified in the same way.
Standard arguments allow the combination of moves of these types, and others, within mixtures or cycles to provide an irreducible chain allowing considerable flexibility. In particular, it is no longer necessary to sample a marginal likelihood estimate for every proposed move in the state space.
In the numerical studies below, we evaluate the performance of using combinations of such proposals.
\subsection{Approximations of the NWPM Algorithm}\label{sec:Approximations}
We finish this section with a brief exploration of approximations of the exact pseudo-marginal algorithm described above with the aim of obtaining inference which is almost as good at a fraction of the computational cost by allowing for a small bias in those estimates.
Clearly, a significant portion of the computational load is used to compute the marginal likelihood; this is especially the case when using more sophisticated methods such as the SMC sampler.
For the NWPM method, as presented in Algorithm \ref{algthm: Node-wise PM}, the pseudo-marginal MH Markov chain of length $n$ requires $n \vert V \vert $ marginal likelihood estimates. This quickly becomes infeasible with large data sets such as PET images, which may contain up to $10^6$ voxel time series to be analysed.
It is, therefore, worthwhile to consider strategies that reduce the number of marginal likelihood estimates that are required.
\subsubsection{NWSE : Single Estimation Approximation of the NWPM Algorithm}
\label{sec:SENWPM}
The multiple-augmentation approach to the NWPM algorithm decouples the estimation of marginal likelihoods from moves within the state space. Taken to the extreme, one can significantly reducing the frequency of calling SMC sampler is to only call it once for each model at each node. Naturally, this approach leads to a Markov chain which is not irreducible on the extended space and which can no-longer be considered a pseudo-marginal algorithm.
Such an algorithm would simply sample each of the marginal likelihood of all the model orders only once, for each node, before starting the chain; then, follow Algorithm \ref{algthm: Node-wise PM} otherwise, using only these initial single estimates. This amounts to making a stochastic approximation which will change the invariant distribution of the resulting Markov chain.
Doing leads to a (now marginal) MH Markov chain, that targets an approximation of the target density rather than the target density itself.
As such, it would not be formally justified under the pseudo--marginal framework, and there would be a loss of accuracy with any subsequent results, since it is an approximation.
Since we only do a single estimation of the marginal likelihoods we will refer to this method as the Node-wise Single-Estimation (NWSE) algorithm.
The biggest appeal of the NWSE is that, for a chain of the same length $n$, the sampler would only need to be used $ \vert V \vert \vert \mathcal{M} \vert $ times, reducing the costs by $n / \vert \mathcal{M} \vert $ times.
Any reduction in accuracy and performance could be adjusted for by using some of the saved residual computational resources towards reducing the variance of the sampler marginal likelihood estimates.
This approximation would allow at least preliminary spatial analyses to be conducted with little additional computational cost beyond that required for the associated mass-univariate analysis:
if existing analysis has been done, and thus some estimates of the marginal likelihood have already been obtained then these can be readily used within the algorithm to incorporate spatial dependence.
The following elementary proposition demonstrates that in the context of small discrete spaces the error introduced by approximating marginal likelihoods can be controlled under reasonable conditions.
\begin{proposition}
For each model $M \in \mathcal{M}$, let $\widehat{Z}^M:=\widehat{Z}(M)$ be a RV with expectation $Z^M:=f(y\vert M)$, corresponding to the associated marginal likelihood, and variance $\sigma_M^2 < \sigma_{*}^2 < \infty$. If the $(\widehat{Z}^M)_{M\in\mathcal{M}}$ are mutually independent, then, letting $M^* = \arg\max \{Z^M\}_{M\in\mathcal{M}}$ which we assume to be unique the probability of selecting the correct model via maximization of the marginal likelihood (equivalently, the posterior mode of the distribution over models given a uniform prior over $\mathcal{M}$) is at least:%
\begin{align*}
1 - ( \vert \mathcal{M} \vert -1)\left(1 + \frac{\Delta^2}{2\sigma_*^2}\right)^{-1},
\end{align*}
where $\Delta = \min_{L\neq M^*} Z^{M^*} - Z^L$ and $\sigma_*^2 = \max_{L\in\mathcal{M}} \sigma_L^2$.
\end{proposition}
\begin{proof}
Let $M^* = \arg\max \{Z^M\}_{M\in\mathcal{M}}$, then:
\begin{align*}
\mathbb{P}(\{\widehat{Z}^{M^*}& > \widehat{Z}^L \forall L \neq M^*\})\\
=& 1 - \mathbb{P}(\cup_{L\neq M^*} \{\widehat{Z}^{M^*} \leq \widehat{Z}^L\})\\
\geq& 1 - \sum_{L \neq M^*} \mathbb{P}(\{\widehat{Z}^{M^*} \leq \widehat{Z}^L\})\\
\geq& 1 - ( \vert \mathcal{M} \vert -1)\left(1 - \min_{L \neq M^*} \mathbb{P}(\widehat{Z}^{M^*} > \widehat{Z}^L)\right),
\end{align*}
by the Union bound.
Applying Cantelli's inequality, noting that $Z^{M^*} - Z^L > 0$:
\begin{align*}
\mathbb{P}(\{&\widehat{Z}^{M^*} > \widehat{Z}^L\})\\ = & \mathbb{P}(\{\widehat{Z}^{M^*} - \widehat{Z}^L - (Z^{M^*} - Z^L) > - (Z^{M^*} - Z^L)\})\\
\geq & 1 - \frac{\sigma_{M^*}^2 + \sigma_L^2}{\sigma_{M^*}^2 + \sigma_L^2 + (Z^{M^*} - Z^L)^2}\\
= & 1 - \left(1 + \frac{(Z^{M^*} - Z^L)^2}{\sigma_{M^*}^2 + \sigma_L^2}\right)^{-1}.
\end{align*}
Combining these expressions yields:
\begin{align*}
\mathbb{P}(&\{\widehat{Z}^{M^*} > \widehat{Z}^L \forall L \neq M^*\})\\
\geq& 1 - ( \vert \mathcal{M} \vert -1) \max_{L\neq M^*} \left[1 - 1 + \left(1 + \frac{(Z^{M^*} - Z^L)^2}{\sigma_{M^*} + \sigma_L^2}\right)^{-1}\right]\\
\geq& 1 - ( \vert \mathcal{M} \vert -1) \left(1 + \frac{\min_{L\neq M^*} (Z^{M^*} - Z^L)^2}{2\max_{L\in\mathcal{M}} \sigma_L^2}\right)^{-1}\\
=& 1 - ( \vert \mathcal{M} \vert -1) \left(1 + \frac{\Delta^2}{2\sigma_*^2}\right)^{-1}.
\end{align*}
\end{proof}
This bound can be made arbitrarily close to 1 by choosing estimators with sufficiently small variance. As the variance of the normalizing constant estimates needs to be assessed to allow pseudo-marginal algorithms to be tuned, it is reasonable to suppose that this information could be obtained in settings in which this type of method is used and hence that a reasonable degree of confidence can be obtained that the use of this approximation does not substantially influence the resulting inference. Naturally, this result suggests that if estimating each marginal likelihood once rather than for every algorithmic step as in a pseudo-marginal algorithm, a relatively small variance might be required to obtain good performance.
In the numerical study, presented below, we investigate, evaluate and compare the effects when using the NWSE algorithm in different settings.
\section{Applications}\label{section:EmStudy}
In this section, the NWPM algorithm and some variants are applied to a simple toy model in which the true marginal likelihood is known and to a compartmental model for PET data with both simulated and real data.
The software implementation of these methods can be found in the R package \texttt{bayespetr}, available at: \url{https://github.com/dt448/bayespetr}. The proposed algorithms are somewhat computationally intensive and here we focus on rather short Markov chains, a situation which we expect to be most widely useful; in Appendix~\ref{app:Mcmc-traces-long} we establish that running these chains for much longer does not materially change the resulting inference (as we have found to be the case in all settings which we have explored).
The $20 \times 20$ image displayed in Figure \ref{fig:GTconfig1} will be used to generate the ground truth Potts configuration for all simulated-data experiments. It was adapted from \cite{Bezener2018} and includes a range of spatial structures of varying complexity.
The image is split into four regions, labelled $R_0, \ldots,\linebreak[1] R_3$; all pixels within a given region have a common model order; the details vary between experiments and are given below.
\begin{figure}
\centering
\input{GTSimImage}
\caption{ Ground Truth Configuration: spatial structure used to produce ground truth Potts configuration for the simulated data studies. A $20 \times 20$ grid, with four homogeneous regions.}
\label{fig:GTconfig1}
\end{figure}
Whenever the NWPM algorithms are used in the numerical studies below, $\bm{M}$ was initialised using the Gibbs a sampler targeting the prior (Potts) distribution.
However, when analysing measured PET data in Section \ref{sec:real-pet-data-analysis}, the algorithms were initialised from the output of the spatially independent SMC sampler method.
In the empirical studies below, we investigated a simple proposal strategy based on the multiple augmentation space, as discussed in Section \ref{sec:prop-dens-augm}.
In brief, the proposal kernel $Q^1$, together with $Q^2$ at every $\kappa \in \mathbb{N}$ graphical iteration, is used.
Essentially, upon initialising the chain, only the change of the model at the node is proposed.
After every $\kappa-$th graphical iterations, changes in the auxiliary variable or marginal likelihood estimates for every model order at every node is proposed to change.
In this section, we will refer to this variant as the NWMA algorithm, with tuning parameter $\kappa$.
\paragraph{SMC Sampler:}
The algorithms considered require unbiased estimates of $\int f(y_v\vert\theta_v,M_v)p(\theta_v\vert M_v)d\theta_v$ at node $v \in V$, for each model order $M \in \mathcal{M}$.
The SMC sampler can be used to compute these node-wise marginal likelihoods by targeting the parameter posterior distribution $\pi(\theta_v\vert y_v,M_v)$ using an annealing schedule.
More precisely, for each model order $M \in \mathcal{M}$, let the sequence of target distribution of the SMC sampler be $\{\pi_t\}_{t \geq 1}$;
Here, we define
$$\pi_t(\theta_{v,t} \vert y_v,M_v) \propto p(\theta_{v,t} \vert M_v,y_v)f(y_v \vert \theta_{v,t},M_v)^{\alpha(t/T)},$$
where the total number of intermediate distributions $T$ and annealing scheme, $\alpha:[0,1]\rightarrow[0,1]$, may be different for each model order \citep[Algorithm 2]{Zhou2016}.
For example, the annealing scheme could be a simple fixed schedule such as $\alpha(t):[0,1]\rightarrow (t/T)^5$, which following \citet{Zhou2016}, we refer to as the ``Prior 5'' annealing scheme.
Alternatively, $\alpha_t$ can be determined adaptively based on metrics of the distance between intermediate distributions, such as the ESS \citep{Jasra2010,Kong1994} or CESS \citep{Zhou2016}.
For the numerical studies below, we use the SMC sampler.
Pilot studies showed that Prior 5 and the CESS-adaptive annealing scheme produced similar results in these examples, thus the Prior 5 scheme is used for simplicity.
\subsection{Toy Model Simulation Studies} \label{section:NormalDistrToyExample}
\paragraph{Toy Model:}
A simple toy model in which both the prior and model likelihood are normal, at every node, is used to validate the proposed methodology.
The data-set comprises a 2-dimensional digital image, each pixel having a scalar intensity. The graph $G=(V,E)$ used to represent the spatial structure is a finite square lattice, i.e., it has vertex set $V \subset \mathbb{Z}^2$ with nodes $v=(v_1,v_2)^\top$ and
edge set $E=\{ \langle u,v \rangle : d(u,v) = 1 \}$, where $d(u,v) = \sum_i \vert u_i-v_i \vert $ is the $L^1$ (Manhattan) distance.
In the notation of Section \ref{sssection:S-T model selection with Potts}, given an image $\bm{Y} = (y_v \in \mathbb{R} : v \in V)$, the model studied here is:
\begin{align*}
\bm{M} &\sim \text{Potts}(J, G_{\bm{Y}}), &&\\
\mu_v \vert M_{v} &\sim \mathcal{N}(\mu_{0}^{(M_v)}, \sigma_0^2) \text{ for all }v \in V,&&\\
Y_{v} \vert M_{v}, \mu_v &\sim \mathcal{N}(\mu_v,\sigma^2) \text{ for all }v \in V;&&
\end{align*}
where
$\mathcal{N}(\mu,\sigma^2)$ denotes the normal distribution of mean $\mu$ and variance $\sigma^2>0$.
At each pixel, $v$, we model the data point $Y_v$ as a normal random variable with mean $\mu_v$ and variance $\sigma^2$, which is assumed known and is common to all pixels.
The prior over the latent variable $\mu_v$ is normal with mean $\mu_0^{(M_v)}$determined entirely by the model order $M_v$ and fixed variance $\sigma_0^2$.
As before, the model order configuration will be the random variable $\bm{M}$ with a Potts prior distribution.
The node-wise marginal likelihood can be straightforwardly evaluated:
\begin{align*}
f(y \vert M) &= \int_{\mathbb{R}} \mathcal{N}(\mu;\mu_0^{(M)},\sigma_0^2)\mathcal{N}(y;\mu,\sigma^2)\dd\mu&\\
&= \mathcal{N}(y;\mu_0^{(M)},\sigma^2+\sigma_0^2),
\end{align*}
for all $M \in \mathcal{M}$.
This is trivial to compute since all these terms are known.
The spatial configuration of model order used to simulate the data was specified to represent simple spatial structures; the ground truth value of $\bm{M}$ was fixed to be the Potts configuration shown in Figure~\ref{fig:GTconfig1}.
\paragraph{Toy Model Ground Truth:}
Ground Truth Configuration, as shown in Figure \ref{fig:GTconfig1} was used to generate a ground truth model order image.
For this toy model, this is a $20 \times 20$ Potts configuration with model order space $\mathcal{M} = \{\mathrm{A},\mathrm{B}\}$.
Region $R_0$ was fixed to model order $M_v = \mathrm{A}$ and the remaining three regions $R_1, R_2$ and $R_3$ where fixed to model order $M_v= \mathrm{B}$.
At each node $v \in V$, the mean parameter $\mu_0^{(M_v)}$ will depend on $M_v$.
In other words, the lighter pixels have nodes with hyper-parameter $\mu^{(A)}_0 = +5$ and the darker pixels have nodes with hyper-parameter $\mu^{(B)}_0 = -5$.
Finally, we specified $\sigma_0^2 = 5^2$ and $\sigma^2 = 1^2$.
\subsubsection{Simulation Study 1: The Coupling Constant}\label{subsection: simulation study 1}
As discussed in Section \ref{sec:potts-model}, typically it is difficult to infer the coupling constant $J$ of the Potts distribution \citep{Moller2006,Moores2020}.
In this work, we make the assumption that $J$ is known when using the NWPM algorithm --- this is not too unreasonable as $J$ is a parameter of the prior distribution.
In this vein, here we evaluate the performance of the algorithm for various values of $J$.
The following design was used: An image data set of $20 \times 20 = 400$ pixels(nodes) from the toy model and model order ground truth as dictated by the Toy Model Ground Truth above, was generated.
This simulated image was then analysed using the NWPM algorithm, for varying values of the coupling constant $J$.
Coupling constants ranging from $J=0$ to $J=5$ were investigated.
Based on pilot studies, an SMC sampler with $N=200$ particles and $T=500$ distributions was used within the NWPM algorithms.
The pseudo-marginal Markov chain was ran for $n=100$ iterations.
As mentioned above, the pseudo-marginal MH Markov chain was initialised using a Gibbs sampler, with the respective coupling constant.
This was done for 50 replicates of the NWPM Markov chain.
Model selection was carried out by selecting the modal model order marginally at each node $v \in V$.
In other words, the modal state in which each $M_v^{(i)}$, for $i=1, \dots, 100$ was selected for each pixel $v \in V$.
The empirical averages, over the $50$ replicates was calculated.
The mean percentages of the nodes for which the correct model order was selected for the different variations of the NWPM algorithm is shown in Figure \ref{graph:Study1State5}.
\begin{figure}
\includegraphics[width = 0.8\textwidth]{FigAltJConstant2.pdf} \centering
\caption{Empirical average, and standard deviations (s.d.), of the percentages(\%) of the total (400) pixels where the correct model order was selected, for different values of the coupling constant $J$. Mode selection was done on simulated toy model data using NWPM with an SMC estimator (with $N=200$, and $T =500$) for the marginal likelihood.
The configuration selected for estimation by looking at the percentage of time each node spent in each model order state.
The line plot shows the empirical average of the correct percentage of pixels.
The lighter and darker region show the $2\times$ s.d. and $1\times$ s.d. error bands, respectively.}
\label{graph:Study1State5}
\end{figure}
It is evident that, in this simulation study, the performance of the algorithm peaks for coupling constant $J=0.4$.
This is smaller than the critical threshold $J_{\text{critical}}$, as discussed in Section \ref{sec:potts-model}.
This is noteworthy, as there is typically a sharp decrease in speed of mixing of the Markov chain above this critical value.
In fact, the graph shows that the variance of the percentage of correctly selected model orders increases with the coupling constant; Importantly, there is a jump in the rate of increase between $J=1$ and $J=1.5$.
An important question to consider here is how much of the performance difference is due to poor approximation of the posterior by the Markov chain, and how much to the posterior itself.
It is reasonable to argue that below the critical value, reasonably good mixing is obtained and this probably reflects a good approximation of the posterior as indicated by the low variability.
In contrast, above this critical value the results are largely dominated by the poor mixing of the Markov chain over this rather short period.
We also note that the graph shows good performance for even this relatively short chain, for the appropriate coupling constant values.
Based on evaluating the performance for a range of coupling constant and due to the similar qualitative features of the different settings; for all the following studies we will fix $J=0.4$.
\subsubsection{Simulation Study 2: Sample Size vs Chain length} \label{sebsection: simulation study 2}
\begin{figure*}
\includegraphics[width = \textwidth]{FigToyChainVParts.pdf} \centering
\caption{Average percentages (\%) of the whole image ($20 \times 20 = 400$ pixels, Toy Model) where the correct model order was selected at each iteration of the MCMC chain, using NWPM, NWSE and NWMA for varying Markov Chain length, $n,$ and number of particles, $N,$ in the SMC sampler. The dashed line shows the average percentage when using spatially independent SMC model selection.
The cumulative average over the graphical iterations $i=1, \dots, n$ is shown.
}
\label{graph:Study2State5}
\end{figure*}
Next, the computational trade--off between the number of particles used in the SMC sampler and the length of the pseudo-marginal MH Markov Chain was investigated.
The same design as the study in Section \ref{subsection: simulation study 1} was used, with the exception of the Markov Chain length varying from $n=50$ to $n=200$, and the number of particles varying between $N=50$ and $N=200$.
Additionally spatially independent model selection, using an SMC sampler to estimate the model evidence was also investigated.
The NWSE approximation was also used to analyse the image.
Similarly, the NWMA algorithm, as described above, with updates to the marginal likelihood estimates every $\kappa=5$ graphical iterations was also used.
In all three of the methods described here, marginal likelihoods were estimated using an SMC sampler with $N=400, T=500$;
For the two, less resource--intensive, Markov chain methods, $n=200$ graphical iterations were used.
Model selection was carried out in the same manner as described above, and the percentage of correctly selected nodes was used as the metric of performance.
This was done for 100 replicates, for each method used.
Results are shown in Figure \ref{graph:Study2State5}.
These results suggest that, at least in this simple setting, the algorithm is not particularly sensitive to the allocation of computational resources.
Importantly, we can see that the selected graph model/configuration stabilises fairly quickly for all the combination of tuning parameters.
In particular, from looking at the longer $n=200$ chain we can see that the convergence is to around $92\%$ of nodes having the correct model order selected when using the NWPM algorithm.
This is considerably higher than the performance of the spatially independent SMC sampler, which was $79\%$; confirming that exploiting spatial structure can significantly improve estimation in this type of model.
We also observe that the NWSE approximation method and the simple NWMA algorithm achieved almost identical results to the full NWPM algorithm: suggesting that, in this simple setting, there is enough signal to allow for the use of the approximation to achieve very similar results, with very little additional computational cost.
Intermediate chain lengths not shown in the graph, i.e. $n=75$ and $N=134$, also produced similar results.
The long term behaviour for the NWSE and NWMA MCMC chains was also explored and results (i.e. that much longer chains lead to very similar conclusions) are shown in Appendix \ref{app:Mcmc-traces-long}, Figure \ref{graph:long_run_toy}.
\subsection{Simulated PET Data Studies}
Before we investigate the performance of the proposed algorithms on measured PET data, we verify and investigate tuning factors when applied to simulated PET data.
\subsubsection{Preliminaries}
Consider a time series from a single voxel site of a PET image, denoted $y=(y_1, \dots, y_k)^{\top}$.
Recall the $M-$compartmental model for PET data (see \eqref{eq:comp_signal} and \eqref{eq:comp_model} , Section \ref{PET}).
In particular, note that the latent parameters $\phi_{1:M} = (\phi_1, \dots, \phi_M)$ and $\vartheta_{1:M} = (\vartheta_1, \dots, \vartheta_M)$ determined the dynamics of this model.
For the PET simulation study in this section, we simulate data from this collection of models with normally distributed errors as described in Section \ref{PET}.
For simplicity, we simulate data using a common parameter vector for every voxel associated with a given model order.
These parameter values were taken from \cite{Jones1994} (and have subsequently been used for simulation studies by \cite{Gunn2002,Peng2008,Jiang2009} and \cite{Zhou2013}).
For the $m=1$ and $m=2$ compartmental models we use $\phi_1 = 4.9 \times 10^{-3} s^{-1}$, $\phi_2= 1.8 \times 10^{-3}$, $\vartheta_1 = 5 \times 10^{-4} s^{-1}$ and $\vartheta_2 = 0.011 s^{-1}$; For the $m=3$--compartmental model we use $\phi_{1:3} = (4.4 \times 10^{-3}s^{-1}, 1 \times 10^{-4}s^{-1}, 1.4 \times 10^{-3}s^{-1})$ and $\vartheta_{1:3} = (4.5 \times 10^{-4}s^{-1}, 2.7\times10^{-3}s^{-1}, 1 \times 10^{-2}s^{-1})$.
In each of these cases the volume of distributions is roughly $V_{\mathrm{D}} \approx 10$.
Synthetic data was simulated using the same plasma input function and integration periods as in the measured PET data set studied in Section \ref{sec:real-pet-data-analysis} and normally-distributed noise, with zero mean, was added.
The variance was such that it was proportional to the true time activities divided by the length of the frame duration; and scaled such that the highest variance in the sequence is equal to the noise level.
A noise level of $0.5$, which lies within the representative range (between $0.01$ and $1.28$) of real data \citep{Jiang2009}, was used when simulating the 2-D PET image.
We employed vague uniform priors over $\phi$ and $\vartheta$, which were constrained to lie within $[10^{-5}, 10^{-1}]$ and $[10^{-4},10^{-1}]$, respectively.
These ranges are based on pilot and previous studies, and ensure that the parameters are physiologically meaningful \citep{Cunningham1993}.
The precision parameter of the measure noise is denoted $\lambda = 1/\sigma^2$. A gamma distribution, with both parameters equal to $10^{-3}$, was used as the prior for $\lambda$ -- a proper approximation to the improper Jeffrey's prior.
Details of the relevant distributions can be found in Appendix~\ref{App:Model_Equations}.
\paragraph{PET Simulation Ground Truth}
As before, the ground truth of the model order configuration were based on spatial structure pattern of Ground Truth Configuration, shown in Figure \ref{fig:GTconfig1}.
In this PET simulation study, a $20 \times 20$ Potts configuration with model order space $\mathcal{M} = \{1,2,3\}$, representing the number of compartments was generated.
Region $R_0$ corresponds to model order $2$; region $R_2$ and $R_3$ to model order $1$ and region $R_1$ to model order $3$.
\subsubsection{Simulation Study: Algorithm Comparison}
Pilot studies were initially carried out to evaluate the model selection performance and estimator variance of the SMC sampler.
For the variance of the estimates, on agreement with numerical studies by \cite{Zhou2016}: the numerical study showed that, there was a decrease linearly for higher values of $N$ and similarly in $T$.
However, beyond a certain threshold, the reduction were no longer useful.
Similar results were seen in pilot studies for model selection performance, for 1-D data simulated from just the $2-$compartment model with noise level $0.5$, performance could not be increased beyond $65\%$ regardless of any increase in tuning parameter values.
Next, the simulated 2-D PET image was analysed using the NWPM algorithm, and the effect of the pseudo-marginal MH chain was investigated.
Based on the above pilot study, an SMC sampler with the Prior 5 annealing scheme, $T=400$ intermediate distributions, was used as the estimator of the normalising constants at all pixels for all models.
These values, and the values of the number of particles $N$ in the design below, were chosen as they allow for the variance of the likelihood estimates to be within a suitable range to allow for optimal scaling \citep{Doucet2015}.
Chain lengths of $n=50$, $n=75$, $n=100$ and $n=200$ were investigated, with particles $N=200$, $N=134$, $N=100$ and $N=50$, respectively.
These, relatively smaller, graphical iteration lengths were chosen due to the computational overhead of this algorithm in this resource intensive setting.
Note that, since model selection here uses the marginal modal state from a space of just $3$ model orders --- these shorter chains can still produce reliable results.
Additionally, the image was also analysed using spatially independent SMC sampler and the NWSE approximation; using an SMC sampler with $N=400$ particles and $T=600$.
The NWMA algorithm, with SMC sampler using $N=200$ and $T=600$, at every $\kappa=50$ iterations, was also evaluated.
Given their significantly reduced computational costs, for the two pseudo-marginal methods, $n=500$ iterations were used.
Following Algorithm \ref{algthm: Node-wise PM}, all the chains where initialised using the Gibbs sampler to target the prior distribution.
$30$ independent replicates of each algorithm were used to obtain the results shown in Figure \ref{graph:PETSimStudy} and Table \ref{tab:1} (performance for the intermediate ranges of tuning parameters of the NWPM algorithm is shown in Appendix \ref{app:Mcmc-traces-long}, Figure \ref{graph:PETSimStudyInterRange}).
\begin{figure*}[h!]
\includegraphics[width = \textwidth]{FigPET_SEMA.pdf} \centering
\caption{Average percentages(\%) of the whole image ($20 \times 20 = 400$ pixels, simulated PET data) where the correct model order was selected at each iteration of the pseudo-marginal MH chain, using: NWPM for varying Markov Chain length, $n,$ and number of particles, $N,$ in the SMC sampler; NWSE with $N=400$ particles and $T=600$ distributions and NWMA using SMC sampler with $N=200$ and $T=600$ at every $\kappa=50$. The dashed line shows the average percentage when using spatially independent SMC($N=400,T=600$) model selection.}
\label{graph:PETSimStudy}
\end{figure*}
Looking at Figure \ref{graph:PETSimStudy}, the results show notable improvements in model selection performance when using the different variants of the NWPM algorithms compared to spatially independent model selection using the SMC sampler.
Analysing the simulated 2-D PET image using the spatially independent method gave $61.4\%$ pixels correctly selected, compared to the NWPM algorithms all giving around $76\%$, even for as short as $n=50$ graphical iterations.
On average, this is a $23.4\%$ increase in the number of pixels selected correctly when using the proposed NWPM approaches compared to the spatially independent SMC sampler method.
On large data-sets, like PET images, this is a considerable number of pixels.
Furthermore, since this is spatially dependent model selection, the improvement in correctly selected pixels when compared to SMC independent will be towards revealing the underlying spatial structures.
These results suggest that incorporating spatial dependence does results in better model selection performance.
For the chains where higher iterations were used, we can see that this increase in results was maintained.
To verify long term behaviour of the algorithms: long-run MCMC chains, of the less expensive NWSE and NWMA algorithms, are shown in Appendix \ref{app:Mcmc-traces-long}, Figure \ref{graph:long_run_PET}.
Figure \ref{graph:PETSimStudy} also shows that the performance of the NWSE approximation and the NWMA variant both provide similar performance to the full NWPM algorithm.
Pragmatically, this is very promising as it suggests that even with an approximation current state of the art methods can be outperformed with very little additional costs.
Alternatively, rather than using an approximation, algorithms based on the multiple augmented state space with significantly reduced computational overhead can be used.
For example, the simple NWMA algorithm studied here.
Similar to the toy model, there does not seem to be any notable difference when using higher chain length and lower particles.
Additionally, there is only a small increase in performance when using more a computationally intensive algorithm, on average.
That is, the full NWPM performs slightly better than the NWMA variant; which in turn also has a minute increase in performance compared to the NWSE approximation.
Table \ref{tab:1} shows the average mean squared error (MSE) of the $V_\text{D}$ estimates for each variant of computational method.
The quantity was calculated by taking the average MSE over all the pixels in the 2-D PET image, and then over all the replicates (the empirical variance of these quantities are shown in the parenthesis).
We can see that the non-spatial SMC sampler method has the highest empirical MSE.
The NWPM algorithms, including all chain lengths and the SE variant, produce a noticeably smaller MSE compared to the spatially independent SMC method.
There is a small improvement when using the full pseudo-marginal NWPM, compared to its approximation, in this case but it is within the range that could be plausibly explained by random fluctuations.
\begin{table}[h!]
\centering
\caption{Average RMSE (and s.e.) of $V_D$ estimates for simulated PET data.}
\label{tab:1}
\begin{tabular}{lll}
\hline\noalign{\smallskip}
Method & Model Averaging $V_\text{D}$ & Posterior $V_\text{D}$ \\
\noalign{\smallskip}\hline\noalign{\smallskip}
NWPM $n=$50 & 0.1319 (0.0061) & 0.1321 (0.0061) \\
NWPM $n=$75 & 0.1321 (0.0061) & 0.1323 (0.0061) \\
NWPM $n=$100 & 0.1320 (0.0061) & 0.1323 (0.0061) \\
NWMA & 0.1319 (0.0061) & 0.1323 (0.0061) \\
NWSE & 0.1322 (0.0061) & 0.1324 (0.0061) \\
INDEP-SMC & 0.1341 (0.0066) & 0.1341 (0.0063) \\
\noalign{\smallskip}\hline
\end{tabular}
\end{table}
\subsection{Real [$^{11}$C]diprenorphine Study} \label{sec:real-pet-data-analysis}
The simulation studies above have verified the effectiveness of the proposed methodology and allowed for the identification of tuning parameters which lead to promising results in settings close to that of interest. We now turn our attention to real data sets.
Analysis of the tracer kinetics of dynamic PET images, that use the [$^{11}$C]-diprenorphine tracer, are generally aimed towards quantification of opioid receptor concentrations in the brain.
Such studies involve investigation of neurological disease which often involve change in brain receptor density.
Investigation of similar PET data sets, using different statistical approaches, have been previously analysed quantitatively by \cite{Gunn2002}, \cite{Peng2008} and \cite{Jiang2009}; However, these works focused on parameter estimation rather than model selection.
\cite{Zhou2013,Zhou2016} are more recent works that investigated model selection; Albeit, in these works, spatial independence is assumed.
\subsubsection{PET Data}
A test-retest pair of measured dynamic PET data of the concentration of the tracer [$\vphantom{C}^{11}$C]–diprenorphine in a normal subject, for which an arterial input functions were available, was analysed using the proposed and other methods. This data was initially measured as part of the dynamic PET study in \citet{Hammers2007}.
In that study, the effects of using lower concentration of tracer was investigated. In addition, the impact of using different slow frequency cutoffs within the analysis of the data was also studied.
\paragraph{PET data acquisition}
The subject underwent 95 min dynamic [$^{11}$C]–diprenorphine PET baseline scan.
[$^{11}$C]–dipre\linebreak[1]norphine is a tracer, of the non-selective antagonist, which binds to neural opioid receptors.
The PET scans were acquired in 3D mode on a Siemens/CTI ECAT EXACT3D PET camera.
After image reconstruction, the spatial resolution is approximately 5mm.
Technical details including the data correction and normalisation methods of the ECAT EXACT3D PET camera can be found in \citet{Spinks2000}.
Thirty seconds after the start of the scan, [$^{11}$C]-diprenorphine was injected and flushed through the cannula as a smooth bolus over a total of 30s.
The subject was injected with 185 MBq (Mega Becquerel) of [$^{11}$C]–diprenorphine.
The PET data was reconstructed using the re-projection algorithm \citep{Kinahan1989} with ramp and Colsher filters cutoff at the Nyquist frequency.
Reconstructed voxel size were $2.096\text{mm} \times 2.096\text{mm} \times 2.43\text{mm}$.
Acquisition was performed in listmode (event-by-event) and scans were rebinned into 32 time frames of increasing duration.
The lengths of these periods, in seconds, are: (variable length background time, $3 \times 10$, $7 \times 30$, $12 \times 120$, $6 \times 300$, $75$, $11 \times 120$, $210$, $5 \times 300$, $450$ \text{ and } $2 \times 600$).
Frame-by-frame movement correction was performed on the PET images.
Overall this resulted in images of dimensions/size $128 \times 128 \times 95$ voxels.
This gives a total of $1, 556, 480$ separate times series respectively to be analysed.
In this study, we will analyse a cross-section of each of the sagittal, coronal and transversal planes of the brain --- the total number of times series studied here is, therefore, roughly 11,000.
Details of further PET data pre-processing can be found in \citet[Material and methods]{Hammers2007}.
\paragraph{Decay Correction}
The PET data is not decay corrected and this should be accounted for within the compartmental model.
\citet{Gunn2002} (similarly, \cite{Cunningham1993} for Spectral Analysis), suggest that the slow frequency cutoff be close to the decay constant of the tracer used.
In other words, given that the half life of [$^{11}$C] is 20.4min, its decay constant is $0.0005663$s$^{-1}$;
Thus, the slow frequency cutoff, denoted $\theta_{\text{min}}$, is fixed close to this constant.
\cite{Hammers2007} showed that actual parametric values depended heavily on the cutoff slow frequencies( between 0.0008 s$^{-1}$ and 0.00063 s$^{-1}$).
Importantly, the prior ranges of $\theta_{1:M}$ should be based upon $\theta_{\text{min}}$, and subsequently this should be taken into consideration when computing the volume of distribution $V_{\mathrm{D}}$.
Following \cite{Zhou2016}, in particular see \cite{Zhou2014}, we will use the cutoff $0.0007s^{-1}$.
\subsubsection{Data analysis and performance evaluation}\label{sec:data-analys}
Normally-distributed errors have been found to poorly model data of this sort \citep{Zhou2013}.
Instead we will use the $t-$distribution to model the additive error variable $\epsilon$.
The the same gamma prior as used for $\lambda$ in the simulation studies above, will be used for the scale parameter, $\tau$. A uniform distribution over the interval $[0,0.5)$ will be used as the prior for $1/\nu$, allowing the likelihood to vary from having a very heavy tail to being arbitrarily close to normality.
The measured data was analysed using the following methods:
Firstly, SMC sampler estimates of the marginal likelihood of each pixel for the three models were computed.
This strategy assumes spatial independence, so, as before, we will refer to this method as the independent SMC method.
The Prior 5 annealing scheme with $N=300$ particles and $T=500$ distributions was used, these values were based on the studies above and numerical results reported by \citet{Zhou2016}.
Three cross-sectional slices (coronal, transverse and sagittal planes) of the 3-D PET image were analysed, the model order and volume of distribution parametric images are shown in Figure \ref{fig:REAL_PET_SMC}.
Next, the NWPM algorithm was used to analyse the same three cross-sections.
An SMC sampler with $N=300$ particles and $T=500$ distributions was used as the marginal likelihood estimator.
Here, the chain was initialised from the output of the SMC spatially independent model selection above (rather than from the prior distribution, as in the simulation studies above).
A pseudo-marginal MH chain of length $n=75$ was generated.
This chain length was based on viability of computation cost for this relatively large data set, and the simulation studies above.
In addition, the sagittal cross-sectional image was analysed using a longer $n=200$ iterations, as discussed below.
The results are shown in Figure \ref{fig:REAL_PET_NWPM}.
Finally, Figure \ref{fig:REAL_PET_NWPM_SE} and \ref{fig:REAL_PET_NWPM_MA} show the model configuration output from analysing the measured PET data using the NWSE approximation and the NWMA variant, respectively.
In this case, an SMC sampler with $N=400$ particles and $T=600$ distributions was used to make the marginal likelihood estimates.
The pseudo-marginal chain was initialised using the output of these estimates, and these initial estimates where re-used within the NWSE algorithm for $n=500$ iterations.
For the NWMA method, the chain was initialised in the exact same manner, but the marginal estimates where updated every $\kappa=100$, for a total of $n=500$ iterations.
For further comparison, the sagittal cross-section was also analysed using NLS (non-linear least squares; \cite{Zhou2013}).
This is shown in Figure \ref{fig:REALPET_ALGO_COMP}.
The spatially independent SMC sample model selection and NWPM method(with a longer chain length $n=200$) model selection are included to show the difference in the final model order parametric image output.
The volume of distribution images, specifically Figure \ref{fig:REAL_PET_SMC} and Figure \ref{fig:REAL_PET_NWPM}, show very similar performance for all methods when considering inference of $V_\text{D}$.
However, Figure \ref{fig:REALPET_ALGO_COMP} shows clear difference in the model order image when using NWPM compared to spatially independent SMC and NLS.
It is evident that analysis using NWPM reveals more spatial structure: Albeit, using the SMC independent approach does reveals some of the underlying spatial information when compared to NLS; NWPM has a de-noising effect and improves the clarity of the roughly formed clusters seen in the spatially independent SMC method.
In particular, the $m=1$ and $m=2$ compartment models are selected to model most of the structural clusters.
In contrast to this there is a decrease in the number of $m=3$ compartment models selected when compared to the non-spatial SMC method.
Note also that, by looking at Figure \ref{fig:REALPET_ALGO_COMP} we see that the NWPM algorithm converges to a noisy version of the final output image even at low iterations as $n=25$.
Importantly, there seem to be only small changes at the higher iterations, suggesting that the chain reaches a stable output relatively quickly.
Similar behaviour is seen in the simulation studies above, albeit in a smaller, simpler settings.
Furthermore, similar model selection output is seen when using the SE estimate approximation and the multiple augmentation variant, NWMA, of the NWPM algorithm.
Comparing both Figure \ref{fig:REAL_PET_NWPM_SE} and \ref{fig:REAL_PET_NWPM_SE} with Figure \ref{fig:REAL_PET_NWPM}, we see that the mode order outputs are not identical, but qualitatively show many similarities.
In particular, we see that the there is a decrease in the total number of $3$-compartment models selected when using the SE approximation or the NWMA variant, compared to the full NWPM.
A similar effect is seen when comparing the independent SMC model selection with the NWPM.
Notably, the NWSE and NWMA model selection outputs are almost identical, differing only at a very small number of pixels.
\begin{figure*}
\includegraphics[width = \textwidth]{FigNLS_SMC_NWPM.pdf} \centering
\caption{Model selection for measured PET images, using: (a.) spatially independent NLS and (b.) SMC; (d.) NWPM with spatial dependence incorporated using Potts model. Part (c.) shows the progress of the NWPM chain. Model orders (MO) shown.}
\label{fig:REALPET_ALGO_COMP}
\end{figure*}
\section{Conclusion}
In this work we have illustrated a novel computational method for effectively incorporating spatial dependence when performing model selection at each location within a graph.
This approach extends the pseudo-marginal method, in a number of directions, within the context that it has been developed and evaluated in.
By exploiting the structure of the problem at hand, the developed methodology allows for considerable flexibility in the updating of state variables and marginal likelihood estimates relative to generic pseudo-marginal algorithms.
The empirical study suggests that this approach can yield better inference than methods which impose assumptions of full spatial independence and, in particular, can reveal clearer spatial structure in the image of underlying model orders.
As with pseudo-marginal algorithms, essentially any unbiased marginal likelihood estimators used in non-spatial analysis can be used within this algorithm.
This methodology was motivated by considering the problem of model selection in PET images.
In such a setting both the amount of data and the complexity of the models lead to substantial computational requirements.
The images of model order provided by this approach supplement the information provided by volume of distribution and similar macroparameters in PET images.
For instance, Figure \ref{fig:REALPET_ALGO_COMP} could be used to make the interpretation that the signal in certain regions of the brain (posterior) requires a higher model order when compared to other (anterior) regions.
In order to reduce the computational cost, a multiple augmentation variant of the pseudo-marginal algorithm is introduced and a more extreme approximate form in which
in which each marginal likelihood is estimated only once. The performance of these methods in the examples explored here is very encouraging:
it suggests that where non-spatial analysis has been performed, spatial dependence can be incorporated with the existing estimates very easily and with little computational costs.
Doing so carefully can result in similar performance to the full NWPM algorithm.
In summary, the NWPM algorithm, together with its approximations and extensions, enables a intuitive, natural approach to incorporating spatial dependence in realistic and complex settings; such as analysis of PET images.
In particular, the methods extensions and approximations means that the subsequent performance and results of incorporating spatial information is very accessible and readily applicable.
\paragraph{Acknowledgments}
This work was supported by funding from the Engineering and Physical Sciences Research Council under grants EP/\linebreak[1]R034710/1 and EP/\linebreak[1]T004134/1, the Lloyd’s Register Foundation Programme on Data-centric Engineering at the Alan Turing Institute and EPSRC Studentship Project: 1943006.
We thank Prof. Alexander Hammers and Prof. Sir John Aston for providing us with the PET data set used in this study.
\bibliographystyle{unsrtnat}
| {'timestamp': '2021-09-20T02:18:53', 'yymm': '2109', 'arxiv_id': '2109.08573', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08573'} | arxiv |
\section{Introduction}
\label{sec:intro}
\noindent
The widespread adoption of automated
decision-making in high-stakes systems has brought about an increased
attention to the underlying algorithms and to their effects across
sensitive groups. Typically, sensitive groups are subpopulations determined by social
and demographic factors, such as race and sex. The unfair
treatment of such demographic groups is ruled out by
anti-discrimination laws and studied by a growing community of algorithmic fairness researchers.
Important works in this space have addressed problems that may arise in the
judicial system \citep{angwin2016machine,larson2016how}, in healthcare
\citep{obermeyer2019dissecting}, in job search
\citep{geyik2019fairnessaware}, and in computer vision
\citep{buolamwini2018:gender}, just to name a few domains that may be impacted. One common trait of these works is
their attention to a careful definition and measurement of
\textit{group fairness}, typically viewed in terms of differences in quantities of interest, such as the acceptance rate, recall, or
accuracy, across the salient subpopulations. According to popular
definitions of fairness, large such differences correspond to low
fairness on the part of the algorithms.
Unfortunately, sensitive demographic data, such as the race and sex of
users, is often hard to obtain, for various reasons. There are several
barriers to demographic data procurement which make measurement of
fairness non-trivial even for the company that is developing and
deploying a model. Legislation plays a major role in this, forbidding
the collection of sensitive attributes in some domains
\citep{bogen2021:ap}. Even in the absence of explicit prohibition,
privacy-by-design standards and a data minimization ethos push
companies in the direction of avoiding the collection of sensitive
attributes from their customers. Similarly, the prospect of negative
media coverage is a clear concern, so companies often err on the side
of caution and inaction \citep{andrus2021:wm}. For these reasons, in a
recent survey of industry practitioners, a majority of respondents
stated that the availability of tools supporting fairness auditing
without access to individual-level demographics would be very useful
\citep{holstein2019:if}. In other words, the problem of
\textit{measuring algorithmic fairness under unawareness of sensitive
attributes} is pressing, and requires ad-hoc solutions.
In the algorithmic fairness literature, much work has been done to
propose techniques directly aimed at improving the fairness of a model
\citep{zafar2017fairness, donini2018empirical, hashimoto2018fairness,
he2020geometric}. Comparably little attention, though, has been
devoted to the problem of reliably measuring fairness. This represents
an important and rather overlooked preliminary step to enforcing
fairness and making algorithms more equitable across groups. More
recent works have studied non-ideal conditions, such as noisy or missing group
labels \citep{chen2019:fu,awasthi2020equalized} and non-iid samples
\citep{singh2021fairness}, showing that naïve fairness-enhancing
algorithms may actually make a model \emph{less} fair
\citep{mehrotra2021:mitigating}.
In this work, we tackle the problem of measuring algorithmic fairness
under unawareness of sensitive attributes, by using techniques from
\textit{quantification} \citep{Gonzalez:2017it}, a supervised learning
task concerned with estimating, rather than the class labels of
individual data points, the class prevalence values for sets (usually
referred to as ``samples'') of such data points. This is precisely
the goal of practitioners looking to measure fairness under
unawareness of sensitive attributes. When auditing an algorithm for
group fairness, the aim is not the development of a model that is
accurate for individual predictions (i.e., classification), which may
be misused to infer people's demographics, such as a user's race, and
may thus lead to the inappropriate and non-consensual utilization of
this information. Rather, the central interest of fairness audits is
the reliable estimation of group-level quantities (i.e.,
quantification), such as the prevalence of women among the instances
to which a certain class has been assigned by the model.
We consider several methods that have been proposed in
the quantification literature and assess their suitability for
estimating the fairness of a classifier under unawareness of sensitive
attributes. More precisely, we adapt quantification approaches to
measure a classifier's \emph{demographic disparity}
\citep{barocas2019fair,wachter2020fairness}, defined as the difference
in acceptance rate across relevant subpopulations. Overall, we make
the following contributions:
\begin{itemize}
\item \textbf{Five experimental protocols for five major
challenges}. Drawing from the algorithmic fairness literature, we
identify five important factors for the problem of estimating
fairness under unawareness of sensitive attributes. These factors
are based on challenges encountered in real-world applications,
including the non-stationarity of processes generating the data, and
the variable cardinality of the available samples. For each factor,
we define and formalize a precise experimental protocol, through
which we compare the performance of quantifiers (i.e., group-level
prevalence estimators) generated by six different quantification
methods
(Sections~\ref{sec:sample_prev_d1}--\ref{sec:sample_prev_d3}).
\item \textbf{Adaptation and ablation study}. We demonstrate a simple
procedure to adapt and integrate quantification approaches into a
wider machine learning pipeline with minimal orchestration
effort. We prove the importance of each component through an
ablation study (Section~\ref{sec:ablation}).
\item \textbf{Quantifying without classifying.}
We consider the problem of potential model misuse to maliciously
infer demographic characteristics at an individual level, which
represents a concern for methods based on proxy attributes. Proxy
methods are estimators of sensitive attributes which exploit the
correlation between available attributes (e.g., ZIP code) and the
sensitive attributes (e.g., race) in order to infer the values of
the latter. Through a set of experiments, we demonstrate two methods
that yield precise estimates of demographic disparity but poor
classification performance, thus decoupling the objectives of
group-level prevalence estimation and individual-level class label
prediction (Section~\ref{sec:q_not_c}).
\end{itemize}
\noindent It is worth noting some intrinsic limitations of fairness
measures and proxy methods which are also applicable to this work. In
essence, proxy methods exploit co-occurrence of membership in a group
and display of a given trait, potentially learning, encoding and
reinforcing stereotypical associations \citep{lipton2018does}. Even
when labels for sensitive attributes are available, these are not all
equivalent. Self-reported labels are preferable to avoid external
assignment (i.e., inference of sensitive attributes), which may be
harmful in itself \citep{keyes2018:misgendering}. More in general,
approaches that define sensitive attributes as rigid and fixed
categories are limited in that they impose a taxonomy onto people,
erasing the needs and experiences of those who do not fit the
envisioned prevalent categories \citep{namaste2000invisible}. While
acknowledging these limitations, we hope our work will help highlight,
investigate and mitigate unfavourable outcomes for disadvantaged
groups brought about by different automated decision-making systems.
The outline of this work is the following. Section \ref{sec:notation} presents the notation employed throughout this manuscript. Section \ref{sec:learningtoquantify} contains a primer on quantification, with emphasis on the approaches considered in this work. Section \ref{sec:adaptation} shows how these approaches can be adapted and integrated to measure demographic disparity. Section \ref{sec:experiments} presents and discusses our experimental results. Section \ref{sec:relatedwork} summarizes the related works. Finally, Section \ref{sec:conclusion} contains concluding remarks, discussing limitations and avenues for future work.
\section{Notation}
\label{sec:notation}
\begin{table}[tb]
\caption{Notation for this work.}
\label{tab:notation}
\begin{center}
\begin{tabular}{|r|p{8cm}|}
\hline
$\mathbf{x} \in \mathcal{X}$ & a data item from domain $\mathcal{X}$, encoding non-sensitive attributes \\
$s \in \mathcal{S}$ & a sensitive attribute, $\mathcal{S}=\{0,1\}$ \\
$y \in \mathcal{Y}$ & a target variable, $\mathcal{Y}=\{\ominus,\oplus\}$ \\
$X, S, Y, \hat{Y}$ & random variables for non-sensitive and sensitive attributes, target variables and predictions \\
$h(\mathbf{x})$ & $h:\mathcal{X} \rightarrow \mathcal{Y} $ a classifier issuing predictions in $\mathcal{Y}$ \\
$k(\mathbf{x})$ & $k:\mathcal{X} \rightarrow \mathcal{S} $ a classifier issuing predictions for sensitive attribute $\mathcal{S}$ \\
$\sigma$ & a sample, i.e., a non-empty set of data
points drawn from $\mathcal{X}$ \\
$p_{\sigma}(s)$ & true prevalence of sensitive attribute $s$ in sample $\sigma$ \\
$\hat{p}_{\sigma}(s)$ & estimate of the prevalence of $s$ in $\sigma$ \\
$\hat{p}_{\sigma}^q(s)$ & estimate $\hat{p}_{\sigma}(s)$ obtained via quantifier $q$ \\
$q$ & $q:2^\mathcal{X} \rightarrow [0,1]$ a quantifier estimating the prevalence of the positive class of sensitive attribute $\mathcal{S}$ in a given sample \\
$\mathcal{D}_1$ & training set for $h(\mathbf{x})$, involving ($\mathcal{X}, \mathcal{Y}$) \\
$\mathcal{D}_2$ & auxiliary set, i.e., training set for quantifier $q$, involving $(\mathcal{X},\mathcal{S})$\\
$\mathcal{D}_3$ & deployment set involving $\mathcal{X}$\\
$\mathcal{D}_{2}^\oplus$ & short for $\mathcal{D}_2^{\hat{Y}=\oplus}=\{ (\mathbf{x}_i,s_i) \in \mathcal{D}_2 \;|\; h(\mathbf{x}_i)=\oplus \}$ \\
$\mathcal{D}_{2}^\ominus, \mathcal{D}_{3}^\oplus, \mathcal{D}_{3}^\ominus$ & analogous sets\\
$\breve{\mathcal{D}}_1$ & a modified training set, derived from $\mathcal{D}_1$ according to a certain experimental protocol. Protocols are detailed in Sections \ref{sec:sample_prev_d1}--\ref{sec:sample_prev_d3}\\
$\breve{\mathcal{D}}_{2},\breve{\mathcal{D}}_{3}$, $\breve{\mathcal{D}}_{2}^\oplus,$ & \multirow{2}{*}{analogous sets}\\
$\breve{\mathcal{D}}_{2}^\ominus, \breve{\mathcal{D}}_{3}^\oplus, \breve{\mathcal{D}}_{3}^\ominus$ & \\
\hline
\end{tabular}
\end{center}
\end{table}
\noindent In this paper, we use the following notation, summarized in Table \ref{tab:notation}. By
$\mathbf{x}$ we indicate a data item drawn from a domain
$\mathcal{X}$, encoding a set of non-sensitive attributes (i.e., features) taken by classifiers and
quantifiers as an input.
We use $\mathcal{S}$ to denote the domain of a sensitive attribute, binarily encoded to $\mathcal{S}=\{0,1\}$ for ease of exposition, and by $s$ a value that $\mathcal{S}$ may take.
By $y$ we indicate a class taking values on a binary domain $\mathcal{Y}=\{\ominus,\oplus\}$, representing the target of a prediction task.\footnote{In this paper we assume the existence of a single binary sensitive attribute
$\mathcal{S}$; however, there is no loss of generality in this, since everything
we say can straightforwardly be extended to the case in which multiple
sensitive attributes are present at the same time. Moreover, we focus
on the case in which the classifier that we want to audit is a binary
one, but the definitions and techniques we employ can be
straightforwardly extended to a multiclass setting. See also
Footnote~\ref{foot:multiclass} on this.}
Symbol $\sigma$ denotes a \emph{sample}, i.e., a non-empty set of data
points drawn from $\mathcal{X}$. By $p_{\sigma}(s)$ we indicate the true
prevalence of attribute $s$ in sample $\sigma$,
while by $\hat{p}_{\sigma}^{q}(s)$ we indicate the
estimate
of this
prevalence obtained by means of quantifier $q$, which we define as a
function $q:2^\mathcal{X} \rightarrow [0,1]$.
Since $0\leq p_{\sigma}(s) \leq 1$ and
$0\leq \hat{p}_{\sigma}^{q}(s) \leq 1$ for all $s\in\mathcal{S}$, and
since
$\sum_{s\in\mathcal{S}}p_{\sigma}(s) =
\sum_{s\in\mathcal{S}}\hat{p}_{\sigma}^{q}(s)=1$, the
$p_{\sigma}(s)$'s and the $\hat{p}_{\sigma}^{q}(s)$'s form two
probability distributions across $\mathcal{S}$.
We also introduce random variables $X, S, Y, \hat{Y}$ which denote,
respectively, data points from $\mathcal{X}$, their sensitive attributes, true labels, and predicted labels. By $\Pr(V=v)$ we indicate, as usual, the
probability that random variable $V$ takes value $v$, which we shorten
as $\Pr(v)$ when $V$ is clear from context. By
$h:\mathcal{X}\rightarrow \mathcal{Y}$ we indicate a binary classifier
that assigns classes in $\mathcal{Y}$ to data points; by
$k:\mathcal{X}\rightarrow \mathcal{S}$ we instead indicate a binary classifier
that assigns sensitive attributes $\mathcal{S}$ to data points (e.g., that
predicts if a certain data item $\mathbf{x}$ is ``female''). It is worth re-emphasizing that both $h$ and $k$ only use non-sensitive attributes from $\mathcal{X}$ as input variables. For ease
of use, we will interchangeably write $h(\mathbf{x})=y$ or
$h_{y}(\mathbf{x})=1$, and $k(\mathbf{x})=s$ or $k_{s}(\mathbf{x})=1$.
We consider three
separate datasets, following the workflow of a realistic machine learning pipeline.
\begin{itemize}
\item A \emph{training set} $\mathcal{D}_1$ for $h$, $\mathcal{D}_1 = \{(\mathbf{x}_i,y_i) \;|\; \mathbf{x}_i\in\mathcal{X}, y_i\in\mathcal{Y}\}$, typically of large cardinality. Given the inherent
difficulties in demographic data procurement, we expect this dataset
to contain no explicit information on the sensitive attributes $\mathcal{S}$.
\item A small \emph{auxiliary set} $\mathcal{D}_2 = \{(\mathbf{x}_i,s_i) \;|\; \mathbf{x}_i\in\mathcal{X}, s_i\in\mathcal{S}\}$, employed to learn quantifiers for the sensitive
attribute. This dataset may originate from a targeted effort, such
as interviews \citep{baker2005patients}, surveys sent to customers
asking for voluntary disclosure of sensitive attributes
\citep{andrus2021:wm}, or other optional means to share demographic
information
\citep{beutel2019putting,beutel2019fairness}. Alternatively it could
derive from data acquisitions carried out for other purposes
\citep{gladonclavell2020auditing}. Both $\mathcal{D}_1$ and
$\mathcal{D}_2$ are in the development domain of our machine
learning pipeline.
\item A \emph{deployment set} $\mathcal{D}_3 = \{\mathbf{x}_i \;|\; \mathbf{x}_i\in\mathcal{X}\}$
which emulates the production domain for classifier $h$,
whose demographic parity we aim to measure. Alternatively, acting
proactively rather than reactively, $\mathcal{D}_3$ could also be a
held-out test set available at a company for pre-deployment audits
\citep{raji2020closing}. From the perspective of the estimation task at hand, i.e. estimating the demographic disparity of $h$, $\mathcal{D}_2$ represents the quantifiers' training set, while $\mathcal{D}_3$ is their test set.
\end{itemize}
\section{Learning to quantify}
\label{sec:learningtoquantify}
\noindent \emph{Quantification} (also known as \emph{supervised
prevalence estimation}, or \emph{learning to quantify}) is the task of
training, by means of supervised learning, a predictor that estimates
the relative frequency (also known as \emph{prevalence}, or
\emph{prior probability}) of the classes of interest in a sample of
unlabelled data points, where the data used to train the predictor are
a set of labelled data points; see \citep{Gonzalez:2017it} for a
survey of research on quantification.
Quantification can be trivially solved via classification, i.e., by
classifying all the unlabelled data points by means of a standard
classifier and counting the data points that have been assigned to a
given class. However, it has unequivocally been shown (see e.g.,
\citet{Forman:2008kx, Gonzalez:2017it, Gonzalez-Castro:2013fk,
Moreo:2021lq, Vaz:2019eu}) that solving quantification by means of
this \emph{Classify-and-Count} (CC) method is suboptimal in terms of
accuracy, and that more accurate quantification methods exist.
The reason behind this is the fact that many applicative scenarios
suffer from \emph{distribution shift}, the phenomenon according to
which the class prevalence values in the training set may
substantially differ from the class prevalence values in the
unlabelled data that one needs to issue predictions for
\citep{morenotorres2012:unifying}. The presence of distribution shift
means that the well-known IID assumption, on which most learning
algorithms for training classifiers are based, does not hold; in turn,
this means that CC will perform suboptimally on scenarios that exhibit
distribution shift, and that the higher the amount of shift, the worse
we can expect CC to perform.
A plethora of quantification methods have been defined in the
literature. In the experiments presented in this paper, we compare six
such methods, which we briefly present in this section. One of them is
the trivial CC baseline; we have chosen the other five methods over
other contenders as they are simple and proven, and because some
of them (especially methods ACC, PACC, SLD, and HDy -- see below) have
shown top-notch performance in recent comparative tests run in
other domains~\citep{Moreo:2021sp, Moreo:2021lq}.
An obvious way to solve quantification is, as hinted above, by
aggregating the scores assigned by a classifier to the unlabelled
items. Such methods can use a standard,
``hard'' classifier (i.e., a classifier
$h_{\oplus}:\mathcal{X}\rightarrow \{0,1\}$ that outputs Boolean
decisions regarding membership to class $\oplus$)
or a ``soft'' classifier (i.e., a classifier
$s_\oplus:\mathcal{X}\rightarrow [0,1]$ that outputs posterior probabilities
$\Pr(\oplus|\mathbf{x})$, representing the probability that the
classifier attributes to the fact that $\mathbf{x}$ belongs to class
$\oplus$).\footnote{While in this work quantifiers are used to estimate the prevalence of sensitive attribute $\mathcal{S}$, in this section, we present quantification approaches targeting a generic variable $\mathcal{Y}$, as typical in the literature. Similarly, the hard classifier $h$ in this section should not be confused with the one introduced in Section \ref{sec:notation}. The notational overlap is limited to the current section, where we follow the typical machine learning conventions in presenting the supervised task of quantification.} Of course,
$\Pr(\ominus|\mathbf{x})=(1-\Pr(\oplus|\mathbf{x}))$. The (trivial)
\emph{classify and count} (\textbf{CC}) quantifier then comes down to
computing
\begin{align}
\label{eq:cc}
\hat{p}_{\sigma}^{\mathrm{CC}}(\oplus) & = \frac{\sum_{\mathbf{x}\in \sigma}
h_{\oplus}(\mathbf{x})}{|\sigma|}
\end{align}
\noindent while the \emph{probabilistic classify and count} quantifier
(\textbf{PCC})~\citep{Bella:2010kx} is defined by
\begin{align}
\label{eq:pcc}
\hat{p}_{\sigma}^{\mathrm{PCC}}(\oplus) & = \frac{\sum_{\mathbf{x}\in \sigma}
s_{\oplus}(\mathbf{x})}{|\sigma|}
\end{align}
\noindent Of course, for any quantification method $q$ we have
$\hat{p}_{\sigma}^{\mathit{q}}(\ominus)=(1-\hat{p}_{\sigma}^{\mathit{q}}(\oplus))$.
A popular quantification method consists of applying an
\emph{adjustment} to the prevalence $\hat{p}_{\sigma}(\oplus)$
estimated via ``Classify and Count''. It is easy to check that, in the
binary case, the true prevalence $p_{\sigma}(\oplus)$ and the
estimated prevalence $\hat{p}_{\sigma}(\oplus)$ are such that
\begin{equation}
\label{eq:exactacc}
p_{\sigma}(\oplus) = \frac{\hat{p}_{\sigma}^{\mathrm{CC}}(\oplus) -
\mathit{fpr}_{h}}{\mathit{tpr}_{h} - \mathit{fpr}_{h}}
\end{equation}
\noindent where $\mathit{tpr}_{h}$ and $\mathit{fpr}_{h}$ stand for
the \emph{true positive rate} and \emph{false positive rate} of the
classifier $h_{\oplus}$ used to obtain
$\hat{p}_{\sigma}^{\mathrm{CC}}$. The values of $\mathit{tpr}_{h}$
and $\mathit{fpr}_{h}$ are unknown, but can be estimated via $k$-fold
cross-validation on the training data. In the binary case, this comes
down to using the results $h_{\oplus}(\mathbf{x})$ obtained in the
$k$-fold cross-validation (i.e., $\mathbf{x}$ ranges on the training
items) in equations
\begin{align}
\begin{split}
\label{eq:tprandfpr}
\hat{\mathit{tpr}_{h}} = \frac{\sum_{\mathbf{x}\in
\oplus}h_{\oplus}(\mathbf{x})}{|\{\mathbf{x}\in \oplus\}|}
\hspace{3em} \hat{\mathit{fpr}_{h}} =\frac{\sum_{\mathbf{x}\in
\ominus}h_{\oplus}(\mathbf{x})}{|\{\mathbf{x}\in \ominus\}|},
\end{split}
\end{align}
\noindent where by $\{\mathbf{x}\in\oplus\}$ (resp. $\{\mathbf{x}\in\ominus\}$) we denote the set of positive (resp. negative) instances in our training set. We obtain estimates of $p_{\sigma}^{\mathrm{ACC}}(\oplus)$,
which define the \emph{adjusted classify and count} method
(\textbf{ACC})~\citep{Forman:2008kx} by replacing $\mathit{tpr}_{h}$
and $\mathit{fpr}_{h}$ in Equation \ref{eq:exactacc} with the
estimates of Equation \ref{eq:tprandfpr}, i.e.,
\begin{equation}
\label{eq:acc}
\hat{p}_{\sigma}^{\mathrm{ACC}}(\oplus) = \frac{\hat{p}_{\sigma}^{\mathrm{CC}}(\oplus) - \hat{\mathit{fpr}_{h}}}{\hat{\mathit{tpr}_{h}} - \hat{\mathit{fpr}_{h}}}
\end{equation}
\noindent If the soft classifier $s_{\oplus}(\mathbf{x})$ is used in
place of $h_{\oplus}(\mathbf{x})$, analogues of
$\hat{\mathit{tpr}_{h}}$ and $\hat{\mathit{fpr}_{h}}$ from Equation
\ref{eq:tprandfpr} can be defined as
\begin{align}
\begin{split}\label{eq:tprandfpr2}
\hat{\mathit{tpr}_{s}} = \frac{\sum_{\mathbf{x}\in
\oplus}s_{\oplus}(\mathbf{x})}{|\{\mathbf{x}\in \oplus\}|}
\hspace{3em} \hat{\mathit{fpr}_{s}} =\frac{\sum_{\mathbf{x}\in
\ominus}s_{\oplus}(\mathbf{x})}{|\{\mathbf{x}\in \ominus\}|}
\end{split}
\end{align}
\noindent We obtain $p_{\sigma}^{\mathrm{PACC}}(\oplus)$ estimates,
which define the \emph{probabilistic adjusted classify and count}
method (\textbf{PACC})~\citep{Bella:2010kx}, by replacing all factors
in the right-hand side of Equation \ref{eq:acc} with their ``soft''
counterparts from Equations \ref{eq:pcc} and \ref{eq:tprandfpr2},
i.e.,
\begin{equation}
\label{eq:pacc}
\hat{p}_{\sigma}^{\mathrm{PACC}}(\oplus) = \frac{\hat{p}_{\sigma}^{\mathrm{PCC}}(\oplus) - \hat{\mathit{fpr}_{s}}}{\hat{\mathit{tpr}_{s}} - \hat{\mathit{fpr}_{s}}}
\end{equation}
A further method is the one proposed in \citep{Saerens:2002uq} (which
we here call \textbf{SLD}, from the names of its proposers), which
consists of training a probabilistic classifier and then using the EM
algorithm (i) to update (in an iterative, mutually recursive way) the
posterior probabilities that the classifier returns, and (ii) to
re-estimate the class prevalence values of the test set until convergence.
Lastly, we consider \textbf{HDy} \citep{Gonzalez-Castro:2013fk}, a
probabilistic binary quantification method that views quantification
as the problem of minimising the divergence (measured in terms of the
Hellinger Distance) between two cumulative distributions of posterior
probabilities returned by the classifier, one coming from the
unlabelled examples and the other coming from a validation set. HDy
looks for the mixture parameter $\alpha$ that best fits the validation
distribution (consisting of a mixture of a ``positive'' and a
``negative'' distribution) to the unlabelled distribution, and returns
$\alpha$ as the estimated prevalence of the positive
class.\footnote{\label{foot:multiclass}All the above methods except
HDy admit straightforward extensions from the binary case to the
single-label multiclass case (see~\cite{Moreo:2021lq}). HDy is a
method for binary quantification only, but it can be adapted to the
single-label multiclass scenario by training a binary quantifier for
each class in one-vs-all fashion, estimating the prevalence of each
class independently of the others, and normalizing the obtained
prevalence values so that they sum up to 1. In this paper, we are not
concerned with the single-class multi-label case since in our
experiments we consider sensitive attributes $s$ which range on two
values only; however, the above considerations would be useful for
applying our approach to non-binary attributes.}
\section{Using quantification to measure fairness under unawareness
of sensitive attributes}
\label{sec:adaptation}
\noindent We adapt the above quantification approaches for
estimating a classifier's fairness. We define classifier fairness in
terms of \emph{demographic parity} (also called \textit{statistical
parity} \citep{dwork2012:fairness} or \textit{independence}
\citep{barocas2019fair}), and, in particular,
of a flavour of demographic parity based on the distribution of
sensitive attribute $\mathcal{S}$ conditional on the prediction of the
classifer,
as proposed in \citep{wachter2020fairness} (see
also~\citep{amazon2021}). We call our estimand the \emph{demographic
disparity} of classifier $h:\mathcal{X}\rightarrow \mathcal{Y}$ for
attribute value $s$, and define it as
\begin{equation}
\Delta(s) = \Pr(S=s|\hat{Y}=\ominus) - \Pr(S=s|\hat{Y}=\oplus)
\label{eq:dd}
\end{equation}
\noindent or, more concisely,
\begin{equation}
\Delta(s) = \Pr(s|\ominus) - \Pr(s|\oplus)
\label{eq:dd1}
\end{equation}
It is worth reemphasizing that the sensitive attribute $\mathcal{S}$ does
\emph{not} belong to the set of attributes $\mathcal{X}$ which
generate the feature space on which classifier $h$
operates (in other
words, when training $h$ we are \emph{unaware} of $\mathcal{S}$). Demographic
disparity measures whether the prevalence of the sensitive attribute
in the group assigned to the positive class is the same as in the
group assigned to the negative class; a value $\Delta(s)=0$ indicates
maximum fairness, while values of $\Delta(s)=-1$ or $\Delta(s)=+1$
indicate minimum fairness, with the sign of $\Delta(s)$ indicating
whether, for $S=s$, the classifier is biased towards the $\oplus$ class or the
$\ominus$ class, respectively.
\begin{example}
Assume that $\mathcal{S}$ stands for ``sex'', $s$ for ``female'', and that the classifier is in charge of recommending loan applicants for acceptance, classifying them as ``grant'' ($\oplus$) or ``deny'' ($\ominus$). For simplicity, let us assume the outcome of the classifier to directly translate into a decision without human supervision. The bank might want to check that the fraction of females out of the total number of loan recipients is approximately the same as the fraction of females out of the total number of applicants who are denied the loan. In other words, the bank might want $\Delta(s)$ to be close to 0. Of course, if the bank is aware of the sex of each applicant, this constraint is very easy to check and, potentially, enforce. If the bank is unaware of applicants' sex, as we assume here, the problem is not trivial, and this is where our techniques come in.
\end{example}
In estimating the demographic disparity of $h$, our focus is on the deployment
set where $h$ is supporting the decision-making process. To highlight this fact,
we rewrite Equation~\ref{eq:dd1} by making the dependence of
$\Delta(s)$ on $\mathcal{D}_3$ explicit, i.e.,
\begin{equation}
\Delta(s) = p_{\mathcal{D}_{3}^{\ominus}}(s) - p_{\mathcal{D}_{3}^{\oplus}}(s)
\label{eq:dd2}
\end{equation}
\noindent where we define
\begin{align}
\begin{split}\label{eq:split}
\mathcal{D}_{3}^{\oplus} = & \{\mathbf{x} \in \mathcal{D}_3 \;|\; h(\mathbf{x})=\oplus \} \\
\mathcal{D}_{3}^{\ominus} = & \{\mathbf{x} \in \mathcal{D}_3 \;|\;
h(\mathbf{x})=\ominus \}
\end{split}
\end{align}
\noindent and where we make explicit the fact that, if a value $s$
that attribute $\mathcal{S}$ can take is viewed as a class, the probabilities
$\Pr(s|\ominus)$ and $\Pr(s|\oplus)$ of Equation~\ref{eq:dd1} may be
seen as the prevalence values of class $s$ in the two samples
$\mathcal{D}_{3}^{\oplus}$ and $\mathcal{D}_{3}^{\ominus}$. In other
words, measuring demographic disparity is reduced to estimating the
prevalence values of class $s$ in the two samples
$\mathcal{D}_{3}^{\oplus}$ and $\mathcal{D}_{3}^{\ominus}$, i.e., \emph{it can be framed as a task of quantification}.
This approach can be easily integrated into existing machine learning
pipelines with little orchestration effort. Below, we summarize the
workflow we envision:
\begin{enumerate}
\item A classifier $h:\mathcal{X}\rightarrow\mathcal{Y}$ is trained
(under unawareness of sensitive attribute $\mathcal{S}$) on $\mathcal{D}_1$
and ready for production. The assumption that, at this stage, we are
unaware of sensitive attribute $\mathcal{S}$ is due to the inherent
difficulties in demographic data procurement already mentioned in
Section~\ref{sec:intro}.
\item \label{item:trainquantifiers} Classifier $h$ naturally imposes a
partition of the auxiliary set $\mathcal{D}_2$ into
$\mathcal{D}_{2}^{\ominus}=\{(\mathbf{x}_i, s_i) \in \mathcal{D}_2 \;|\;
h(\mathbf{x})=\ominus \}$ and
$\mathcal{D}_{2}^{\oplus}=\{(\mathbf{x}_i, s_i) \in \mathcal{D}_2 \;|\;
h(\mathbf{x})=\oplus \}$. These two disjoint datasets act as the
training sets for the two quantifiers $q_{\ominus}$ and
$q_{\oplus}$. Quantifier $q_{\ominus}$ (or its dual $q_{\oplus}$) is
trained on $\mathcal{D}_{2}^{\ominus}$ (resp.,
$\mathcal{D}_{2}^{\oplus}$) to estimate the prevalence of data
points where $S=s$ among the data points labelled with $\ominus$
(resp., $\oplus$).
\item Classifier $h$ also imposes a partition of the deployment set
$\mathcal{D}_3$ into
$\mathcal{D}_{3}^{\ominus}=\{\mathbf{x} \in \mathcal{D}_3 \;|\;
h(\mathbf{x})=\ominus \}$ and
$\mathcal{D}_{3}^{\oplus}=\{\mathbf{x} \in \mathcal{D}_3 \;|\;
h(\mathbf{x})=\oplus \}$. Quantifiers $q_{\ominus}$ and $q_{\oplus}$
trained in Step~\ref{item:trainquantifiers} are applied to these
datasets to obtain an estimate of the prevalence of $s$ in
$\mathcal{D}_{3}^{\ominus}$ and $\mathcal{D}_{3}^{\oplus}$. The
demographic disparity of $h$, defined in Equation~\ref{eq:dd}, can
thus be estimated as
%
\begin{equation}
\hat{\Delta}(s) = \hat{p}_{\mathcal{D}_{3}^{\ominus}}^{q_{\ominus}}(s) - \hat{p}_{\mathcal{D}_{3}^{\oplus}}^{q_{\oplus}}(s)
\label{eq:dd_estim}
\end{equation}
%
\noindent where, as we recall from Section~\ref{sec:notation},
$\hat{p}_{\sigma}^q(s)$ denotes the prevalence of attribute value
$s$ in set $\sigma$ as estimated via quantification method $q$.
\end{enumerate}
\noindent This quantification-based way of tackling demographic
disparity is suited for a non-invasive auditing procedure, since it
allows unawareness of the sensitive attribute $\mathcal{S}$ in the set
$\mathcal{D}_{1}$ used for training the classifier $h$ to be audited and
in the set $\mathcal{D}_{3}$ on which this classifier is going to be
deployed; it only requires the availability of an auxiliary data set
$\mathcal{D}_{2}$ where attribute $\mathcal{S}$ is present. Dataset
$\mathcal{D}_{2}$ may originate from a targeted effort, such as
interviews \citep{baker2005patients}, surveys sent to customers asking
for voluntary disclosure of sensitive attributes
\citep{andrus2021:wm}, or other optional means to share demographic
information
\citep{beutel2019putting,beutel2019fairness}. Alternatively it could
derive from data acquisitions carried out for other purposes
\citep{gladonclavell2020auditing}.
Additionally, we note that this approach is extremely suitable
to situations in which the
prevalence of attribute value $s$ in $\mathcal{D}_{2}$ is possibly
very different from the prevalence of $s$ in the test set
$\mathcal{D}_{3}$ (a situation that certainly characterizes many
operational environments) since the best quantification approaches are
robust by construction to distribution drift, as we will show in the next section.
\section{Experiments}
\label{sec:experiments}
\subsection{General setup}
\label{sec:setup}
\begin{table}
\caption{Summary of experimental protocols.}
\label{tab:prot}
\centering
\begin{tabular}{lll}
\hline\noalign{\smallskip}
Protocol name & Variable & Section \\
\noalign{\smallskip}\hline\noalign{\smallskip}
\texttt{sample-prev-$\mathcal{D}_1$} & joint distribution of $(S,Y)$ in $\mathcal{D}_1$, via sampling & \autoref{sec:sample_prev_d1} \\
\texttt{flip-prev-$\mathcal{D}_1$} & joint distribution of $(S,Y)$ in $\mathcal{D}_1$, via label flipping & \autoref{sec:flip_prev_d1} \\
\texttt{sample-size-$\mathcal{D}_2$} & size of $\mathcal{D}_2$, via sampling & \autoref{sec:sample_size_d2} \\
\texttt{sample-prev-$\mathcal{D}_2$} & joint distribution of $(S,\hat{Y})$ in $\mathcal{D}_2$, via sampling & \autoref{sec:sample_prev_d2} \\
\texttt{sample-prev-$\mathcal{D}_3$} & joint distribution of $(S,\hat{Y})$ in $\mathcal{D}_3$, via sampling & \autoref{sec:sample_prev_d3} \\
\noalign{\smallskip}\hline
\end{tabular}
\end{table}
In this section, we carry out an evaluation of different
estimators of demographic disparity. We propose five
experimental protocols (Sections
\ref{sec:sample_prev_d1}--\ref{sec:sample_prev_d3}) summarized in Table
\ref{tab:prot}. Each protocol focuses on a single factor of import for
the estimation problem, varying the size and mutual shift of the
training, auxiliary, and deployment set. Protocol names are in the form
\texttt{action-characteristic-dataset}, as they act on datasets
($\mathcal{D}_1$, $\mathcal{D}_2$ or $\mathcal{D}_3$) modifying their
characteristics (size or class prevalence) through one of two actions
(sampling or label flipping). We investigate the effect of each factor
on the performance of six estimators of demographic disparity, keeping
the remaining factors constant.
Under each experimental protocol, the size or the
prevalence of a given dataset is carefully varied based on the
protocol definition. For every protocol, we perform an extensive empirical evaluation as follows:
\begin{itemize}
\item We compare the performance of each estimation technique on three
datasets (Adult, COMPAS, and Credit Card Default). The
datasets and respective preprocessing are described in detail in
Section~\ref{sec:datasets}. We focus our discussion on experiments carried out on the Adult dataset, depicted and discussed in depth (Figures~\ref{fig:sample_prev_d1}--\ref{fig:q_wo_c_d3}), while experiments on COMPAS and Credit Card Default are summarized numerically (Tables \ref{tab:sample_prev_d1}--\ref{tab:sample_prev_d3}) and only discussed in detail when peculiar.
\item We split a given dataset into
$\mathcal{D}_A, \mathcal{D}_B, \mathcal{D}_C$, three stratified
subsets of identical size and same distribution over $(S,Y)$. Five
such random splits are performed. To test each estimator under the
same conditions, these splits are the same for every method.
\item For each split, we permute the role of the stratified subsets
$\mathcal{D}_A, \mathcal{D}_B, \mathcal{D}_C$, so that each subset
alternatively serves as the training ($\mathcal{D}_1$), auxiliary
($\mathcal{D}_2$), or deployment set ($\mathcal{D}_3$). All (six) such
permutations are tested.
\item Whenever an experimental protocol requires sampling from a
subset, for instance when artificially altering a class prevalence
value, we perform 10 different samplings. To perform extensive experiments at a
reasonable computational cost, every time an experimental protocol
requires changing a dataset $\mathcal{D}$ into a shifted version
$\breve{\mathcal{D}}$, we also reduce its cardinality to
$|\breve{\mathcal{D}}|=500$. Further details and implications of this
choice on each experimental protocol are provided in the context of
the protocol's setup (e.g., Section
\ref{sec:sample_prev_d1:setup}).
\item Different learning approaches can be used to train the sensitive attribute classifier $k$ underlying each quantification method. We test
Logistic Regression (LR) and Support Vector Machines (SVM).\footnote{Some among the quantification methods we test in this study require the classifier to output posterior probabilities (as is the case for LR). If a classifier natively outputs classification scores that are not probabilities (as is the case for SVM), the former
can be converted into the latter via ``probability calibration''; see
e.g., \citep{Platt:2000fk}.} Sections
\ref{sec:sample_prev_d1}--\ref{sec:sample_prev_d3} report results of
quantification algorithms wrapped around a LR classifier. Analogous results obtain for SVMs, reported in Appendix
\ref{app:svm}.
\item The classifier $h$, whose demographic disparity we aim to
estimate, is LR trained with balanced class weights (i.e., loss
weights inversely proportional to class frequencies).
\item To measure the effect of a given factor on the performance of
different quantifiers, we report the signed estimation error, derived
from Equations~\ref{eq:dd2} and~\ref{eq:dd_estim} as follows:
\begin{align}
\begin{split}
e & = \hat{\Delta}(s) - \Delta(s) \label{eq:estim_err1} \\
& =\left [ \hat{p}_{\mathcal{D}_{3}^{\ominus}}^{q_{\ominus}}(s) -
\hat{p}_{\mathcal{D}_{3}^{\oplus}}^{q_{\oplus}}(s) \right ] -
\left [ p_{\mathcal{D}_{3}^{\ominus}}(s) -
p_{\mathcal{D}_{3}^{\oplus}}(s) \right ]
\end{split}
\end{align}
\noindent We summarize the experiments by reporting the Mean
Absolute Error (MAE -- Equation \ref{eq:mae}) and Mean Squared Error (MSE -- Equation \ref{eq:mse}), where the mean of errors $e_i$ is computed over multiple experiments $E$.
\end{itemize}
\begin{align}
\label{eq:mae}
\mathrm{MAE}(E) & = \frac{1}{|E|}\sum_{e_i\in E}|e_i| \\
\label{eq:mse}
\mathrm{MSE}(E) & = \frac{1}{|E|}\sum_{e_i\in E}e_i^2
\end{align}
\noindent Overall, our experiments consist of over 700,000 separate
estimates of demographic disparity.\footnote{Code available at \url{https://github.com/alessandro-fabris/ql4facct}.}
The remainder of this section is organized as follows. Section~\ref{sec:datasets} presents the chosen datasets and the applied preprocessing. Sections~\ref{sec:sample_prev_d1}--\ref{sec:sample_prev_d3} motivate and detail the experimental protocols, reporting the performance of different demographic disparity estimators. Section~\ref{sec:ablation} describes an ablation study, aimed at investigating the benefits of training and maintaining multiple class-specific quantifiers rather than a single one. Finally, Section~\ref{sec:q_not_c} shows that good estimators of demographic
disparity are not necessarily good at classifying the sensitive
attribute at an individual level, so that reliable fairness auditing
may be decoupled from this undesirable misuse of the same models.
\subsection{Datasets}
\label{sec:datasets}
\noindent We perform our experiments on three datasets. We choose
Adult and COMPAS, two standard datasets in the algorithmic fairness community, and
Credit Card Default (hereafter: CreditCard), which serves as a
representative use case for a bank performing a fairness audit of a
prediction tool used internally. For each dataset, we standardize the
selected features by removing the mean and scaling to unit variance.
\textbf{Adult}.\footnote{\url{https://archive.ics.uci.edu/ml/datasets/adult}} One of the most popular resources on the UCI Machine
Learning Repository, the Adult dataset was created as a collection to
benchmark the performance of machine learning
algorithms. It
was extracted from the March 1994 US Current Population Survey and
represents respondents along demographic and socio-economic
dimensions, reporting, e.g., their sex, race, educational attainment
and occupation. Each instance comes with a binary label, encoding
whether their income exceeds \$50,000, which is the target of the
associated classification task. We consider ``sex'' the sensitive
attribute $\mathcal{S}$, with a binary categorization of respondents as
``Female'' or ``Male''. From the non-sensitive attributes $\mathcal{X}$, we remove
``education-num'' (a redundant feature), ``relationship''
(where values ``husband'' and ``wife'' are near-perfect predictors of
``sex''), and ``fnlwgt'' (a variable released by the US
Census Bureau to encode how representative each instance is of the
overall population). Categorical variables are dummy-encoded and
instances with missing values (7\%) are removed.
\textbf{COMPAS}.\footnote{\url{https://github.com/propublica/compas-analysis}} This dataset was curated to audit racial biases in
the Correctional Offender Management Profiling for Alternative
Sanctions (COMPAS) risk assessment tool, which estimates the
likelihood of a defendant becoming a recidivist
\citep{angwin2016machine,larson2016how}. The dataset represents
defendants who were scored for risk of recidivism by COMPAS in Broward
County, Florida between 2013--2014, summarizing their demographics,
criminal record, custody and COMPAS scores. We consider the
\texttt{compas-scores-two-years} subset published by ProPublica on
github,
consisting of defendants that were observed for two years after
screening, for whom a binary recidivism ground truth is available. We
follow the standard preprocessing to remove noisy instances
\citep{propublica2016compas}. We focus on ``race'' as a protected
attribute $\mathcal{S}$, restricting the data to defendants labelled
``African-American'' or ``Caucasian''. Our attributes $\mathcal{X}$
are defendant's age (``age'' - integer), number of juvenile
felonies, misdemeanours, and other convictions
(``juv\_fel\_count'', ``juv\_misd\_count'',
``juv\_other\_count'' - integer), number of prior crimes
(``priors\_count'' - integer) and degree of current charge
(``c\_charge\_degree'' - felony or misdemeanour, dummy-encoded).
\textbf{CreditCard}.\footnote{\url{https://archive.ics.uci.edu/ml/datasets/default+of+credit+card+clients}. Note that we discuss variables with the names they are given in the tabular data (xls file), which do not match the ones in the documentation.} This resource was curated to study automated
credit card default prediction, following a wave of defaults in
Taiwan.
The dataset summarizes the
payment history of customers of an important Taiwanese bank, from
April to October 2005. Demographics, marital status, and education of
customers are also provided, along with amount of given credit and a
binary variable encoding the default on payment within the next month,
which is the associated prediction task. We consider ``SEX'' (binarily encoded) the sensitive attribute $\mathcal{S}$ and keep every other variable in $\mathcal{X}$,
preprocessing the categorical ones via dummy-encoding
(``EDUCATION'', ``MARRIAGE'', ``PAY\_0'',
``PAY\_2'', ``PAY\_3'', ``PAY\_4'', ``PAY\_5'',
``PAY\_6''). Differently from Adult, we keep marital status as its values are not trivial predictors of the sensitive attribute.
A summary of these datasets and related statistics is reported in Table \ref{tab:datastats}.
\def 1.5cm {1.5cm}
\begin{table}[ht!]
\caption{Dataset statistics after preprocessing.}
\label{tab:datastats}
\centering
\resizebox{\textwidth}{!}{%
\setlength\tabcolsep{3pt}
\begin{tabular}{l|r|c|l|l|c|l|c|c}
\multicolumn{1}{m{1.5cm}|}{Dataset} &
\multicolumn{1}{m{1.7cm}|}{\#data items} &
\multicolumn{1}{m{2cm}|}{\#non-sensitive features} &
\multicolumn{1}{m{1.5cm}|}{sensitive attribute} &
\multicolumn{1}{m{1.5cm}|}{$S=1$} &
\multicolumn{1}{m{1.5cm}|}{$Pr(S=1)$} &
\multicolumn{1}{m{1.4cm}|}{target variable} &
\multicolumn{1}{m{1cm}|}{$Y=\oplus$} &
\multicolumn{1}{m{1.5cm}}{$Pr(Y=1)$} \\\hline
Adult & 45,222 \hspace{0.3cm} & 84 & sex & Male & 0.675 & income & $>50$K & 0.248 \\
COMPAS & 5,278 \hspace{0.3cm} & 6 & race & Caucasian & 0.398 & recidivist & no & 0.498\\
CreditCard & 30,000 \hspace{0.3cm} & 81 & sex & Male & 0.396 & default & no & 0.779\\
\end{tabular}}
\end{table}
\subsection{Protocol \texttt{sample-prev-$\mathcal{D}_1$}}
\label{sec:sample_prev_d1}
\subsubsection{Motivation and setup}
\label{sec:sample_prev_d1:setup}
\noindent In the first experimental protocol, we evaluate the impact
of shifts in the training set $\mathcal{D}_1$, by
drawing different subsets $\breve{\mathcal{D}}_1$ as we vary $\Pr(Y=S)$.\footnote{Although $Y$ and $S$ take values from different domains, by $Y=S$ we mean $(Y=\oplus \wedge S=1) \vee (Y=\ominus \wedge S=0)$, i.e. a situation where positive outcomes are associated with group $S=1$ and negative outcomes with group $S=0$.} More specifically, we vary $\Pr(Y=S)$ between 0 and 1 with a step of 0.1. In other words, we sample at
random from $\mathcal{D}_1$ a proportion $p$ of instances $(\mathbf{x}_i,s_i,y_i)$
such that $Y=S$ and a proportion $(1-p)$ such that $Y\neq S$, with
$p \in \left \lbrace 0.0, 0.1, \dots, 0.9, 1.0 \right \rbrace$. It is
worth noting that we defined $\mathcal{D}_1$, in Section
\ref{sec:notation}, as a training set involving $(\mathcal{X},\mathcal{Y})$. Here we exploit
our knowledge of $\mathcal{S}$ to control the dataset shift between training and
test conditions, emulating a biased data collection procedure. Once a
training set has been selected, the classifier $h$ is
learnt exclusively from non-sensitive attributes $\mathcal{X}$,
completely disregarding the sensitive attribute $\mathcal{S}$. We choose a
limited cardinality $|\breve{\mathcal{D}}_1|=500$, which lets us
perform multiple repetitions at reasonable computational costs, as
outlined in Section~\ref{sec:setup}. While this may impact the
quality of the classifier $h$, this aspect is not the central focus of
the present work.
This experimental protocol aligns with biased data collection
procedures, sometimes referred to as \emph{censored data}
\citep{kallus2018residual}. Indeed, it is common for the ground truth
variable to represent a mere proxy for the actual quantity of
interest, with non-trivial sampling effects between the two. For
instance, the validity of arrest data as a proxy for offence has been
brought into question \citep{Fogliato:2021mb}.
Indeed, in this domain, different sources of sampling bias may be in
action, such as uneven allocation of police resources across
jurisdictions and neighbourhoods \citep{malcolm2008:minority} and
lower levels of cooperation in populations who feel oppressed by law
enforcement \citep{xie2012racial}.
By varying $\Pr(Y=S)$ we are imposing a spurious correlation between
$Y$ and $S$, which may be picked up by the classifier $h$. In extreme
situations, such as when $\Pr(Y=S) \simeq 1$, a classifier $h$ may end up
confounding the concepts behind $S$ and $Y$. In turn, we expect this to unevenly impact the acceptance rates for the two demographic groups,
effectively changing the demographic disparity of $h$, i.e., our
estimand $\Delta(s)$.
Pseudocode~\ref{pseudo:sample-prev-d1} describes the main steps
to implement Protocol \texttt{sample-prev-$\mathcal{D}_1$}. The pale
red region highlights the part of the experimental protocol that is
specific to Protocol \texttt{sample-prev-$\mathcal{D}_1$}; the rest is
common to all experimental protocols.
\begin{algorithm}[t]
\LinesNumbered \SetNoFillComment
\begin{footnotesize}
\SetKwInOut{Input}{Input} \SetKwInOut{Output}{Output} \Input{
\textbullet\ Dataset $\mathcal{D}$ ; \\
\hspace{0.35em}\textbullet\ Classifier learner CLS; \\
\hspace{0.35em}\textbullet\ Quantification method Q; \\
} \Output{
\textbullet\ MAE of the demographic disparity estimates ; \\
\hspace{0.35em}\textbullet\ MSE of the demographic disparity
estimates ; }
\BlankLine
$E\leftarrow\emptyset$ ;
\For{5 random splits\label{line:randomsplit}}{
$\mathcal{D}_A,\mathcal{D}_B,\mathcal{D}_C \leftarrow
\mathrm{split\_stratify}(\mathcal{D})$ ;
\For{$\mathcal{D}_1,\mathcal{D}_2,\mathcal{D}_3 \in
\mathrm{permutations}(\mathcal{D}_A,\mathcal{D}_B,\mathcal{D}_C)$}{
\For{10 repeats\label{line:10repeats}}{
\For{$p\in\{0.0, 0.1, \ldots, 0.9, 1.0\}$}{
\tikzmk{A} \tcc{Generate samples from $\mathcal{D}_1$ at desired
prevalence}
$\breve{\mathcal{D}}_1\sim\mathcal{D}_1$ with $P(Y=S)=p$ and
$|\breve{\mathcal{D}}_1|=500$ \label{line:sample:p1};
\tcc{Learn a classifier $h : X \rightarrow Y$} $h\leftarrow$
CLS.fit($\breve{\mathcal{D}}_1$) ;
\tikzmk{B} \boxit{pink} \tcc{Learn quantifiers
$q_y : 2^\mathcal{X} \rightarrow [0,1]$}
$\mathcal{D}_{2}^{\ominus}\leftarrow\{(\mathbf{x}_i,s_i)\in\mathcal{D}_2
\;|\; h(\mathbf{x}_i)=\ominus\}$ ;
$\mathcal{D}_{2}^{\oplus}\leftarrow\{(\mathbf{x}_i,s_i)\in\mathcal{D}_2
\;|\; h(\mathbf{x}_i)=\oplus\}$ ;
$q_{\ominus} \leftarrow $ Q.fit($\mathcal{D}_{2}^{\ominus})$ ;
$q_{\oplus} \leftarrow $ Q.fit($\mathcal{D}_{2}^{\oplus})$ ;
\tcc{Use quantifiers to estimate demographic prevalence}
$\mathcal{D}_{3}^{\ominus}\leftarrow\{\mathbf{x}_i\in\mathcal{D}_3
\;|\; h(\mathbf{x}_i)=\ominus\}$ ;
$\mathcal{D}_{3}^{\oplus}\leftarrow\{\mathbf{x}_i\in\mathcal{D}_3
\;|\; h(\mathbf{x}_i)=\oplus\}$ ;
$\hat{p}^{q_{\ominus}}_{\mathcal{D}_{3}^{\ominus}}(s) \leftarrow
q_{\ominus}(\mathcal{D}_{3}^{\ominus})$ ;
$\hat{p}^{q_{\oplus}}_{\mathcal{D}_{3}^{\oplus}}(s) \leftarrow
q_{\oplus}(\mathcal{D}_{3}^{\oplus})$ ;
\tcc{Compute the signed error of the demographic disparity
estimate}
$e=\left [ \hat{p}_{\mathcal{D}_{3}^{\ominus}}^{q_{\ominus}}(s) -
\hat{p}_{\mathcal{D}_{3}^{\oplus}}^{q_{\oplus}}(s) \right ] -
\left [ p_{\mathcal{D}_{3}^{\ominus}}(s) -
p_{\mathcal{D}_{3}^{\oplus}}(s) \right ]$ ;
$E \leftarrow E \cup \{e\}$ } } } }
$\mathrm{mae}\leftarrow\mathrm{MAE}(E)$ ;
$\mathrm{mse}\leftarrow\mathrm{MSE}(E)$ ;
\Return{$\mathrm{mae}$, $\mathrm{mse}$} \BlankLine
\caption{Protocol \texttt{sample-prev-$\mathcal{D}_1$}.}
\label{pseudo:sample-prev-d1}
\end{footnotesize}
\end{algorithm}
\subsubsection{Results}
\begin{figure}[tb]
\centering
\includegraphics[width=\textwidth]{./plots/adult_gender/protD1_vary_prev_d1.pdf}
\caption{Protocol \texttt{sample-prev-$\mathcal{D}_1$} on the Adult
dataset. Distribution of the estimation error ($y$ axis) as $\breve{\mathcal{D}}_1$ is sampled with a given $\Pr(Y=S)$ ($x$ axis). Each boxplot summarizes the
results of 5 random splits, 6 role permutations and 10 samplings of
$\breve{\mathcal{D}}_1$.}
\label{fig:sample_prev_d1}
\end{figure}
\noindent Figure~\ref{fig:sample_prev_d1} reports the performance of
CC, PCC, ACC, PACC, SLD, and HDy on the Adult dataset under the
\texttt{sample-prev-$\mathcal{D}_1$} experimental protocol. The $y$
axis depicts the estimation error (Equation~\ref{eq:estim_err1}), as
we vary $\Pr(Y=S)$ along the $x$ axis. Each boxplot summarizes the
results of 5 random splits, 6 role permutations, and 10 samplings of
$\breve{\mathcal{D}}_1$, for a total of 300 repetitions for each
combination of 6 methods and 11 values which vary on the $x$ axis.
Each quantification approach outperforms vanilla CC, which
constantly underestimates the demographic disparity of the classifier
$h$, i.e., its estimate is lower than the ground truth value, so that
$\hat{\Delta}^{\text{CC}}(s) < \Delta(s)$. ACC, PACC, SLD and HDy
display a negligible bias and a reliable estimate of demographic
disparity. The absolute error for these techniques is
always below 0.1, except for a few outliers.
PCC stands out as a strong performer, with low bias and low
variance. This is due to the fact that, under this experimental
protocol, no shift is present between the auxiliary set
$\mathcal{D}_2$, where quantifiers are learnt, and the test set
$\mathcal{D}_3$, where they are tested. As the current protocol
focuses on shifts in the training set, $\mathcal{D}_2$ and
$\mathcal{D}_3$ remain stratified subsets of the Adult dataset, with
identical distribution over $(S,Y)$. This in turn favours PCC, which
relies on the posterior probabilities of its classifier $k$ being well
calibrated on $\mathcal{D}_3$.\footnote{Posterior probabilities $Pr(s|\mathbf{x})$ are said to be \emph{well calibrated} when, given a sample $\sigma$ drawn from $\mathcal{X}$ $$\lim_{|\sigma|\rightarrow \infty}\frac{|\{\mathbf{x}\in s|
\Pr(s|\mathbf{x})=\alpha\}|}{|\{\mathbf{x}\in \sigma|
\Pr(s|\mathbf{x})=\alpha\}|}=\alpha.$$ i.e., when for big enough samples, $\alpha$ approximates the true proportion of data items belonging to class $s$ among all data items for which $Pr(s|\mathbf{x})=\alpha$.}
\begin{table}[tb]
\small
\caption{Protocol \texttt{sample-prev-$\mathcal{D}_1$}. The first
and second columns indicate the values of MAE and MSE (lower is
better) obtained in our experiments, while the third and fourth
columns indicate the probability that the Absolute Error (AE) falls below 0.1 and
0.2 (higher is better), respectively. \textbf{Boldface} indicates
the best method for a given dataset and metric. Superscripts $\dag$
and $\ddag$ denote the methods (if any) whose error scores (MAE,
MSE) are \emph{not} statistically significantly different from the
best ones according to a paired sample, two-tailed t-test at
different confidence levels: symbol $\dag$ indicates $0.001<p$-value
$<0.05$, while symbol $\ddag$ indicates $0.05\leq p$-value. The
absence of any such symbol indicates $p$-value $\leq 0.001$ (i.e.,
that the performance of the method is statistically significantly
different from that of the best method). }
\label{tab:sample_prev_d1}
\resizebox{\textwidth}{!}{%
\input{tables/LR/tab_Protocols.VAR_D1_PREV.tex} }%
\end{table}
Results for the COMPAS and CreditCard datasets are reported in Table
\ref{tab:sample_prev_d1}, along with a summary of results for the
Adult dataset we just discussed. Columns labelled MAE and MSE report
the Mean Absolute Error and Mean Squared Error of each technique, as defined in Equations \eqref{eq:mae} and \eqref{eq:mse}. The
last two columns report the frequency with which the absolute error is below
0.1 (second-to-last column) and 0.2 (last column) across the entire
experimental protocol. The trends we discussed also hold for COMPAS
and CreditCard. Most notably, both datasets appear to provide a harder setting for
the inference of the sensitive attribute $\mathcal{S}$ from the non-sensitive
attributes $\mathcal{X}$, as shown by higher MAE and MSE, which, for instance,
increase by one order of magnitude for SLD and PACC moving from Adult
to COMPAS.
\subsection{Protocol \texttt{flip-prev-$\mathcal{D}_1$}}
\label{sec:flip_prev_d1}
\subsubsection{Motivation and setup}
\noindent
\noindent Certain biases in the training set resulting
from domain-specific practices, such as the use of arrest as a
substitute for offence, may be modelled as either a selection bias \citep{Fogliato:2021mb} or a label bias distorting
the ground truth variable $Y$ \citep{fogliato2020:fairness}. With this
experimental protocol, we impose the latter bias by actively flipping
some ground truth labels $Y$ in $\mathcal{D}_1$ based on their sensitive attribute. Similarly to
\texttt{sample-prev-$\mathcal{D}_1$}, this protocol achieves a given
association
between the target $Y$ and sensitive variable $S$
in the training set $\mathcal{D}_1$. However, instead of
sampling, it does so by flipping the $Y$ label of some data
points. More specifically, we impose
$\Pr(Y=\ominus|S=0)=\Pr(Y=\oplus|S=1) = p$ and let $p$ take values across
eleven evenly spaced values between 0 and 1. For every value of $p$,
we firstly sample a random subset $\breve{\mathcal{D}}_1$ of the training set
with cardinality 500. Next, we actively flip some $Y$ labels in both
demographic groups, until both $\Pr(Y=\ominus|S=0)$ and $\Pr(Y=\oplus|S=1)$ reach
a desired value of
$p \in \left \lbrace 0.0, 0.1, \dots, 0.9, 1.0 \right
\rbrace$. Finally, we train a classifier $h$ on the attributes $\mathcal{X}$ and
modified ground truth $Y$ of $\breve{\mathcal{D}}_1$.
This experimental protocol is compatible with settings where the
training data captures a distorted ground truth due to systematic
biases and group-dependent annotation accuracy
\citep{wang2021:fair}. As an example, the quality of medical diagnoses
can depend on race, sex and socio-economical status
\citep{gianfrancesco2018potential}. Moreover, health care expenditures
have been used as a proxy to train an algorithm
deployed nationwide in the US to estimate patients' health care needs, resulting in systematic underestimation
of the needs of black patients
\citep{obermeyer2019dissecting}. In the hiring domain, employer
response rates to resumes have been found to vary with the perceived
ethnic origin of an applicant’s name
\citep{bertrand2004emily}. Finally, the gender gap in mathematical
performance, while negligible in elementary school, has been found to
increase with age \citep{lindberg2010new}, possibly due to gender
stereotypes arising in this domain from an early age
\citep{cvencek2011:mg} and to the prescriptive nature of these
stereotypes \citep{nosek2002:mm,ellemers2018:gs}. These are all
examples where the ``ground truth'' associated with a dataset is
distorted to the disadvantage of a sensitive demographic group.
Similarly to Section~\ref{sec:sample_prev_d1}, we expect this
experimental protocol to bring about sizeable variations in the
demographic disparity of classifier $h$ due to the strong
correlation we are imposing between $S$ and $Y$ via label flipping.
The pseudocode describing this protocol is essentially the same as in
Pseudocode~\ref{pseudo:sample-prev-d1}, simply replacing the sampling in
line~\ref{line:sample:p1} with the label flipping
procedure described above; we hence omit it for the sake of conciseness.
\subsubsection{Results}
\noindent Figure~\ref{fig:flip_prev_d1} illustrates the key trends
brought about by this experimental protocol on the Adult dataset. A
clear trend is visible along the $x$ axis, which reports the true
demographic disparity $\Delta(s)$ for the classifier $h$ (Equation~\ref{eq:dd2}),
quantized with a step of 0.1. We choose to depict the true demographic
disparity on the $x$ axis as it is the estimand, hence a quantity of
interest by definition.
The error incurred by CC displays a linear trend that goes from severe under-estimation (for low values of the $x$ axis) to severe over-estimation (for large values of the $x$ axis).
In other words, the (signed)
estimation error increases with the true demographic disparity of the
classifier $h$, a phenomenon also noticed by \citet{chen2019:fu}.
\begin{figure}[tb]
\centering
\includegraphics[width=\textwidth]{./plots/adult_gender/protD1_vary_prev_d1_flip.pdf}
\caption{Protocol \texttt{flip-prev-$\mathcal{D}_1$} on the Adult
dataset. Distribution of the estimation error ($y$ axis) as $\Delta(s)$ varies ($x$ axis).}
\label{fig:flip_prev_d1}
\end{figure}
All remaining approaches compensate for this weakness and display
a good estimation error: PCC, ACC, PACC, SLD, HDy have low variance
and a median estimation error of zero across different values of the
estimand. PCC stands out as particularly effective, which, just like
for protocol \texttt{sample-prev-$\mathcal{D}_1$}, can be explained
with a complete absence of shift between $\mathcal{D}_2$ and
$\mathcal{D}_3$, which makes the posteriors of the underlying
classifier $k$ reliable during inference.
\begin{table}[tb]
\small
\caption{Protocol \texttt{flip-prev-$\mathcal{D}_1$}.}
\label{tab:flip_prev_d1}
\resizebox{\textwidth}{!}{%
\input{tables/LR/tab_Protocols.VAR_D1_PREVFLIP.tex} }%
\end{table}
As summarized in Table~\ref{tab:flip_prev_d1}, similar trends obtain
for the COMPAS dataset, albeit with worse average performance, already
noticed in Section~\ref{sec:sample_prev_d1}. A notable result on
CreditCard is the solid performance of Classify-and-Count. We notice
that, on CreditCard, the entire range of biased training sets
$\breve{\mathcal{D}}_1$ imposed by protocol
\texttt{flip-prev-$\mathcal{D}_1$} brings about low variability in the
true demographic disparity of classifier $h$ on $\mathcal{D}_3$, such that the maximum and minimum values of
$\Delta(s)$ across the entire
protocol differ by 0.2. This variability is one order of magnitude lower than the
one measured on the Adult dataset, where the maximum and minimum values taken by
$\Delta(s)$ differ by 1, as per Figure
\ref{fig:flip_prev_d1}, making estimation via Classify-and-Count more
challenging on Adult rather than on CreditCard.
\subsection{Protocol \texttt{sample-size-$\mathcal{D}_2$}}
\label{sec:sample_size_d2}
\subsubsection{Motivation and setup}
\noindent A further factor of interest for the estimation problem is
the size of the auxiliary set $\mathcal{D}_2$, whose influence is
studied in this experimental protocol. Our goal is to understand how
low we can go in the small data regime, before degrading the
performance of different estimation techniques. We consider subsets
$\breve{\mathcal{D}}_2$ of the auxiliary set, sampling instances
uniformly without replacement from it. We let cardinality
$|\breve{\mathcal{D}}_2|$ take five values that are evenly spaced on a
log scale, between a minimum sample size
$|\breve{\mathcal{D}}_2|$=1,000 and a maximum size
$|\breve{\mathcal{D}}_2|=|\mathcal{D}_2|$. In other words, we let the cardinality of the auxiliary set take five different values between 1,000 and
$|\mathcal{D}_2|$ in a geometric progression. As described in Section
\ref{sec:setup}, for each cardinality of the auxiliary set we wish to
test, we perform ten samplings over five splits and six permutations,
for a total of 300 repetitions per approach per dataset.
Pseudocode~\ref{pseudo:sample-size-d2} describes the Protocol
\texttt{sample-size-$\mathcal{D}_2$}, with a pale red region
highlighting the parts that are specific to this protocol.
This protocol is justified by the well-documented difficulties in
demographic data procurement for industry practitioners, which vary
depending on domain, company, and other factors of disparate nature
\citep{beutel2019putting,holstein2019:if,gladonclavell2020auditing,bogen2021:ap,andrus2021:wm}. As
an example, \citet{gladonclavell2020auditing} perform an internal
fairness audit of a personalized well-being recommendation app, for
which sensitive features are not collected in production, following
data minimization principles. However, sensitive features were
available from an initial development phase in an auxiliary set, whose
size was determined by prior considerations, likely driven by accuracy
requirements rather than fairness ones. Furthermore, the collection of
sensitive attributes in the US is highly industry-dependent, ranging
from mandatory to forbidden, depending on the fragmented regulation
applicable in each domain \citep{bogen2021:ap}. Finally, high quality
auxiliary sets may be obtained through optional surveys
\citep{wilson2021building}, for which response rates are highly
dependent on trust, and can be improved by making the intended use for
the data clearer \citep{andrus2021:wm}.
For these reasons, the cardinality of the auxiliary set $\mathcal{D}_2$
is an interesting variable in the context of fairness audits. The
estimation methods we consider have peculiar data requirements, with
diverse purposes (e.g., estimation of true positive rates -- $tpr$) and
approaches. For this reason,
interesting patterns should emerge from this protocol. We expect key
trends for the estimation error to vary monotonically with cardinality
$|\breve{\mathcal{D}}_2|$, which is why we let it vary according to a geometric progression.
\begin{algorithm}[t]
\LinesNumbered \SetNoFillComment
\begin{footnotesize}
\SetKwInOut{Input}{Input} \SetKwInOut{Output}{Output} \Input{
\textbullet\ Dataset $\mathcal{D}$ ; \\
\hspace{0.35em}\textbullet\ Classifier learner CLS; \\
\hspace{0.35em}\textbullet\ Quantification method Q; \\
} \Output{
\textbullet\ MAE of the demographic disparity estimates ; \\
\hspace{0.35em}\textbullet\ MSE of the demographic disparity
estimates ; }
\BlankLine
$E\leftarrow\emptyset$ ;
\For{5 random splits\label{line:randomsplit}}{
$\mathcal{D}_A,\mathcal{D}_B,\mathcal{D}_C \leftarrow
\mathrm{split\_stratify}(\mathcal{D})$ ;
\For{$\mathcal{D}_1,\mathcal{D}_2,\mathcal{D}_3 \in
\mathrm{permutations}(\mathcal{D}_A,\mathcal{D}_B,\mathcal{D}_C)$}{
\tcc{Learn a classifier $h : X \rightarrow Y$} $h\leftarrow$
CLS.fit($\mathcal{D}_1$) ;
\For{10 repeats\label{line:10repeats}}{
\tikzmk{A} \For{size $s \in $ logspace(\textbf{from:} 1000,
\textbf{to:} $|\mathcal{D}_2|$, \textbf{steps:} 5)}{
\tcc{Generate samples from $\mathcal{D}_2$ at desired size}
$\breve{\mathcal{D}}_2\sim\mathcal{D}_2$ with
$|\breve{\mathcal{D}}_2|=s$ \label{line:sample:p2};
\tcc{Learn quantifiers $q_y : 2^\mathcal{X} \rightarrow [0,1]$}
$\breve{\mathcal{D}}_{2}^{\ominus}\leftarrow\{(\mathbf{x}_i,s_i)\in\breve{\mathcal{D}}_2
\;|\; h(\mathbf{x}_i)=\ominus\}$ ;
$\breve{\mathcal{D}}_{2}^{\oplus}\leftarrow\{(\mathbf{x}_i,s_i)\in\breve{\mathcal{D}}_2
\;|\; h(\mathbf{x}_i)=\oplus\}$ ;
$q_{\ominus} \leftarrow $
Q.fit($\breve{\mathcal{D}}_{2}^{\ominus})$ ;
$q_{\oplus} \leftarrow $ Q.fit($\breve{\mathcal{D}}_{2}^{\oplus})$
;
\tikzmk{B} \boxit{pink} \tcc{Use quantifiers to estimate
demographic prevalence}
$\mathcal{D}_{3}^{\ominus}\leftarrow\{\mathbf{x}_i\in\mathcal{D}_3
\;|\; h(\mathbf{x}_i)=\ominus\}$ ;
$\mathcal{D}_{3}^{\oplus}\leftarrow\{\mathbf{x}_i\in\mathcal{D}_3
\;|\; h(\mathbf{x}_i)=\oplus\}$ ;
$\hat{p}^{q_{\ominus}}_{\mathcal{D}_{3}^{\ominus}}(s) \leftarrow
q_{\ominus}(\mathcal{D}_{3}^{\ominus})$ ;
$\hat{p}^{q_{\oplus}}_{\mathcal{D}_{3}^{\oplus}}(s) \leftarrow
q_{\oplus}(\mathcal{D}_{3}^{\oplus})$ ;
\tcc{Compute the signed error of the demographic disparity
estimate}
$e=\left [ \hat{p}_{\mathcal{D}_{3}^{\ominus}}^{q_{\ominus}}(s) -
\hat{p}_{\mathcal{D}_{3}^{\oplus}}^{q_{\oplus}}(s) \right ] -
\left [ p_{\mathcal{D}_{3}^{\ominus}}(s) -
p_{\mathcal{D}_{3}^{\oplus}}(s) \right ]$ ;
$E \leftarrow E \cup \{e\}$ } } } }
$\mathrm{mae}\leftarrow\mathrm{MAE}(E)$ ;
$\mathrm{mse}\leftarrow\mathrm{MSE}(E)$ ;
\Return{$\mathrm{mae}$, $\mathrm{mse}$} \BlankLine
\caption{Protocol \texttt{sample-size-$\mathcal{D}_2$}.}
\label{pseudo:sample-size-d2}
\end{footnotesize}
\end{algorithm}
\subsubsection{Results}
\noindent The estimation error under this experimental protocol on the
Adult dataset is depicted in Figure~\ref{fig:sample_size_d2}, as we
vary the cardinality $|\breve{\mathcal{D}}_2|$ along the $x$
axis. Clearly, the variance for each approach decreases with the size
of its training set. Additionally, slight biases may improve, as is the case
with HDy. The most striking trend is the unreliability of ACC and PACC
(and especially the former) in the small data regime.
Indeed, these are adjusted methods, which require splitting
the auxiliary set $\mathcal{D}_2$ into a first subset used for the
actual training of a classifier and a second subset used to compute
its $\mathit{tpr}$ and $\mathit{fpr}$ for the adjustment of prevalence estimates, as per Equations \eqref{eq:acc} and \eqref{eq:pacc}.\footnote{Once the estimations for $\mathit{tpr}$ and $\mathit{fpr}$ have been computed, it would be possible to \emph{retrain} the classifier, using the whole training set (as is customarily done in other areas of machine learning), thus generating a more robust classifier. In this particular case, however, retraining might cause the adjustment of the quantification to become less stable, since the main ingredients of the adjustemnt (the $\mathit{tpr}$ and $\mathit{fpr}$) actually characterize a different classifier. The extent to which this trade-off (more data vs. unstable adjustment) ends up impacting negatively or positively the final computation of the prevalence values is out of scope for this study; we thus avoid retraining in favour of having congruent estimates for the rates.}
\begin{figure}[tb]
\centering
\includegraphics[width=\textwidth]{./plots/adult_gender/protD2_vary_size.pdf}
\caption{Protocol \texttt{sample-size-$\mathcal{D}_2$} on the Adult
dataset. Distribution of the estimation error ($y$ axis) as the cardinality $|\breve{\mathcal{D}}_2|$ is varied ($x$ axis).}
\label{fig:sample_size_d2}
\end{figure}
Similar results hold for COMPAS and CreditCard, as reported in Table
\ref{tab:sample_size_d2}. Across the three datasets, PACC and ACC
perform quite poorly due to the difficulty in estimating the $\mathit{tpr}$ and
$\mathit{fpr}$ with few labelled data points available from
$\breve{\mathcal{D}}_2$. On the other hand, both SLD and HDy are
fairly reliable. Once again, we find PCC to be the best performer, for
the same reasons discussed in Section~\ref{sec:sample_prev_d1}
and~\ref{sec:flip_prev_d1}, i.e., the absence of shift between
$\mathcal{D}_2$ and $\mathcal{D}_3$. This sort of shift is actually a
key variable for the estimation problem at hand and will be the target
of the next experimental protocols, described in
Sections~\ref{sec:sample_prev_d2} and~\ref{sec:sample_prev_d3}.
\begin{table}[tb]
\small
\caption{Protocol \texttt{sample-size-$\mathcal{D}_2$}}
\label{tab:sample_size_d2}
\resizebox{\textwidth}{!}{%
\input{tables/LR/tab_Protocols.VAR_D2_SIZE} }%
\end{table}
\subsection{Protocol \texttt{sample-prev-$\mathcal{D}_2$}}
\label{sec:sample_prev_d2}
\subsubsection{Motivation and setup}
\noindent The auxiliary set $\mathcal{D}_2$ can also display
significant dataset shifts with respect to the the sets
$\mathcal{D}_1$ and $\mathcal{D}_3$ available during training or
at deployment. With this experimental protocol, we assess the estimation error
under shifts which affect either $\mathcal{D}_{2}^{\ominus}$ or
$\mathcal{D}_{2}^{\oplus}$, i.e., the subsets of $\mathcal{D}_2$
labelled positively or negatively by classifier $h$. We consider two
experimental sub-protocols, describing variations in the prevalence of
sensitive variable $S$ in either subset. More specifically, we let
$\Pr(s|\ominus)$ (or its dual $\Pr(s|\oplus)$) take 9 evenly spaced
values between 0.1 and 0.9. We avoid extreme values of 0 and 1 which
would make either demographic group $S=0$ or $S=1$ absent from the
training set of one quantifier. To exemplify, in sub-protocol
\texttt{sample-prev-$\mathcal{D}_{2}^{\ominus}$} we let the prevalence
$\Pr(s|\ominus)$ in $\breve{\mathcal{D}}_{2}^{\ominus}$ take values in
$\left \lbrace 0.1, 0.2 \dots, 0.8, 0.9 \right \rbrace$, while the
remaining subset $\breve{\mathcal{D}}_{2}^{\oplus}$ remains at is
natural prevalence $\Pr(s|\oplus)$.\footnote{The natural prevalence is
matched allowing for small fluctuations due to subsampling.} For each
repetition, we set
$|\breve{\mathcal{D}}_{2}^{\ominus}|=|\breve{\mathcal{D}}_{2}^{\oplus}|=500$. This
makes for a challenging quantification setting and allows for fast
training of multiple quantifiers across many repetitions.
Pseudocode~\ref{pseudo:sample-prev-d2} describes the protocol when
acting on $\mathcal{D}_{2}^{\ominus}$; the case for
$\mathcal{D}_{2}^{\oplus}$ is analogous, and comes down to swapping
the roles of $\mathcal{D}_{2}^{\ominus}$ and
$\mathcal{D}_{2}^{\oplus}$ in Lines~\ref{line:randomsample:d20}
and~\ref{line:randomsample:d21}.
This protocol captures issues of representativeness in demographic
data, e.g., due to non-uniform response rates across subpopulations
\citep{schouten2009indicators,schouten2012evaluating}. Given the
importance of trust for the provision of one's sensitive attributes,
in some domains this practice is considered akin to a \emph{data
donation} \citep{andrus2021:wm}. Individuals from groups that
historically had worse quality or lower acceptance rates for a service
can be hesitant to disclose their membership to said group, fearing it
may be used against them as grounds for rejection or discrimination
\citep{hasnain2006obtaining}. This may be especially true for
individuals who perceive to be at high risk of rejection, bringing
about complex selection biases, jointly dependent on $S$ and
$Y$, or $S$ and $\hat{Y}$ if individuals have some knowledge
of the classification procedure. For example, health care providers
are advised to collect information about patients' race to monitor the
quality of services across subpopulations. In a field study, 28\% of
patients reported discomfort about disclosure of their own race to a
clerk, with black patients significantly less comfortable than white
patients on average \citep{baker2005patients}.
This is the first protocol we describe where quantifiers are trained
on subsets $\breve{\mathcal{D}}_{2}^{\ominus}$,
$\breve{\mathcal{D}}_{2}^{\oplus}$ that have a different prevalence
for the sensitive variable $S$ with respect to their counterparts
$\mathcal{D}_{3}^{\ominus}$, $\mathcal{D}_{3}^{\oplus}$ in the deployment
set. More specifically, with this protocol, we vary the joint
distribution of $(S,\hat{Y})$ to directly influence the demographic
disparity of the classifier $h$ on the auxiliary set $\mathcal{D}_{2}$, and move it away
from the value $\Delta(s)$ of the same measure computed on the deployment set $\mathcal{D}_{3}$. This is a
fundamental evaluation protocol as it makes our estimand different
across $\mathcal{D}_2$ (or, more precisely, its modified version
$\breve{\mathcal{D}}_2$) and $\mathcal{D}_3$, which is typically
expected in practice. If this were not the case, a practitioner could
simply resort to an explicit computation of demographic disparity on the
auxiliary set $\mathcal{D}_2$ and deem it representative of any
deployment condition. Given this reasoning, we borrow this protocol
from the quantification literature to cause sizeable variations in the
demographic disparity of $h$ across $\mathcal{D}_2$ and
$\mathcal{D}_3$, which act as the training and test set to different
quantifiers. We expect these variations to bring about clear trends in
the estimation error of demographic parity for the approaches
considered in this work.
\begin{algorithm}[t]
\LinesNumbered \SetNoFillComment
\begin{footnotesize}
\SetKwInOut{Input}{Input} \SetKwInOut{Output}{Output} \Input{
\textbullet\ Dataset $\mathcal{D}$ ; \\
\hspace{0.35em}\textbullet\ Classifier learner CLS; \\
\hspace{0.35em}\textbullet\ Quantification method Q; \\
} \Output{
\textbullet\ MAE of the demographic disparity estimates ; \\
\hspace{0.35em}\textbullet\ MSE of the demographic disparity
estimates ; }
\BlankLine
$E\leftarrow\emptyset$ ;
\For{5 random splits}{
$\mathcal{D}_A,\mathcal{D}_B,\mathcal{D}_C \leftarrow
\mathrm{split\_stratify}(\mathcal{D})$ ;
\For{$\mathcal{D}_1,\mathcal{D}_2,\mathcal{D}_3 \in
\mathrm{permutations}(\mathcal{D}_A,\mathcal{D}_B,\mathcal{D}_C)$}{
\tcc{Learn a classifier $h : X \rightarrow Y$} $h\leftarrow$
CLS.fit($\mathcal{D}_1$) ;
$\mathcal{D}_{2}^{\ominus}\leftarrow\{(\mathbf{x}_i,s_i)\in\mathcal{D}_2
\;|\; h(\mathbf{x}_i)=\ominus\}$ ;
$\mathcal{D}_{2}^{\oplus}\leftarrow\{(\mathbf{x}_i,s_i)\in\mathcal{D}_2
\;|\; h(\mathbf{x}_i)=\oplus\}$ ;
\For{10 repeats}{
\tikzmk{A} \For{$p \in \{0.1,0.2,\ldots,0.9\}$}{
\tcc{Generate samples from $\mathcal{D}_{2}^{\ominus}$ at desired
prevalence and size, and uniform samples from
$\mathcal{D}_{2}^{\oplus}$ at desired size}
$\breve{\mathcal{D}}_{2}^{\ominus}\sim\mathcal{D}_{2}^{\ominus}$
with $p_{\breve{\mathcal{D}}_{2}^{\ominus}}(s)=p$ and
$|\breve{\mathcal{D}}_{2}^{\ominus}|=500$ \label{line:randomsample:d20}
;
$\breve{\mathcal{D}}_{2}^{\oplus}\sim\mathcal{D}_{2}^{\oplus}$
with
$|\breve{\mathcal{D}}_{2}^{\oplus}|=500$ \label{line:randomsample:d21}
;
\tcc{Learn quantifiers $q_y : 2^\mathcal{X} \rightarrow [0,1]$}
$q_{\ominus} \leftarrow $
Q.fit($\breve{\mathcal{D}}_{2}^{\ominus})$ ;
$q_{\oplus} \leftarrow $ Q.fit($\breve{\mathcal{D}}_{2}^{\oplus})$
;
\tikzmk{B} \boxit{pink} \tcc{Use quantifiers to estimate
demographic prevalence}
$\mathcal{D}_{3}^{\ominus}\leftarrow\{\mathbf{x}_i\in\mathcal{D}_3
\;|\; h(\mathbf{x}_i)=\ominus\}$ ;
$\mathcal{D}_{3}^{\oplus}\leftarrow\{\mathbf{x}_i\in\mathcal{D}_3
\;|\; h(\mathbf{x}_i)=\oplus\}$ ;
$\hat{p}^{q_{\ominus}}_{\mathcal{D}_{3}^{\ominus}}(s) \leftarrow
q_{\ominus}(\mathcal{D}_{3}^{\ominus})$ ;
$\hat{p}^{q_{\oplus}}_{\mathcal{D}_{3}^{\oplus}}(s) \leftarrow
q_{\oplus}(\mathcal{D}_{3}^{\oplus})$ ;
\tcc{Compute the signed error of the demographic disparity
estimate}
$e=\left [ \hat{p}_{\mathcal{D}_{3}^{\ominus}}^{q_{\ominus}}(s) -
\hat{p}_{\mathcal{D}_{3}^{\oplus}}^{q_{\oplus}}(s) \right ] -
\left [ p_{\mathcal{D}_{3}^{\ominus}}(s) -
p_{\mathcal{D}_{3}^{\oplus}}(s) \right ]$ ;
$E \leftarrow E \cup \{e\}$ } } } }
$\mathrm{mae}\leftarrow\mathrm{MAE}(E)$ ;
$\mathrm{mse}\leftarrow\mathrm{MSE}(E)$ ;
\Return{$\mathrm{mae}$, $\mathrm{mse}$} \BlankLine
\caption{Protocol \texttt{sample-prev-$\mathcal{D}_2$}, shown for
variations of prevalence values in class $y=\ominus$.}
\label{pseudo:sample-prev-d2}
\end{footnotesize}
\end{algorithm}
\subsubsection{Results}
\begin{figure}[t
\centering
\begin{subfigure}{\textwidth}
\centering
\includegraphics[width=.99\linewidth]{./plots/adult_gender/protD2_vary_prev_d20.pdf}
\caption{Protocol
\texttt{sample-prev-$\mathcal{D}_{2}^{\ominus}$}}
\label{fig:sample_prev_d20}
\end{subfigure} \\
\begin{subfigure}{\textwidth}
\centering
\includegraphics[width=.99\linewidth]{./plots/adult_gender/protD2_vary_prev_d21.pdf}
\caption{Protocol \texttt{sample-prev-$\mathcal{D}_{2}^{\oplus}$}}
\label{fig:sample_prev_d21}
\end{subfigure}
\caption{Protocol \texttt{sample-prev-$\mathcal{D}_2$} on the Adult
dataset.
Distribution of the estimation error ($y$ axis) as $\breve{\mathcal{D}}_2$ is sampled with a given $\Pr(S=1|Y=\ominus)$ value, plot (a), or $\Pr(S=1|Y=\oplus)$ value, plot (b) ($x$ axis).
The green line indicates the value of $\Pr(S=1)$ as observed in $\mathcal{D}_{3}^{\ominus}$, plot (a), or $\mathcal{D}_{3}^{\oplus}$, plot (b).
}
\label{fig:sample_prev_d2}
\end{figure}
\noindent Figure~\ref{fig:sample_prev_d2} depicts the estimation error
on the $y$ axis, as we vary, on the $x$ axis, the sensitive attribute
prevalence in $\mathcal{D}_{2}^{\ominus}$
(Figure~\ref{fig:sample_prev_d20}) and $\mathcal{D}_{2}^{\oplus}$
(Figure~\ref{fig:sample_prev_d21}). CC, PCC, and HDy stand out as
fairly sensitive to shifts in their training set. In sub-protocol
\texttt{sample-prev-$\mathcal{D}_{2}^{\oplus}$}, summarized in
Figure~\ref{fig:sample_prev_d21}, we have that the prevalence of males
in the subset $\mathcal{D}_{2}^{\oplus}$, used to train one of the
quantifiers, is almost always lower than the prevalence in the
respective test subset $\mathcal{D}_{3}^{\oplus}$, reported with a vertical green line.\footnote{This is
true for every data point on the $x$ axis in
Figure~\ref{fig:sample_prev_d21}, except for the rightmost one, where
$p_{\mathcal{D}_{2}^{\oplus}}(s)=0.9>p_{\mathcal{D}_{3}^{\oplus}}(s)=0.85$.}
As a result, quantifiers trained on $\mathcal{D}_{2}^{\oplus}$ tend to
systematically underestimate the prevalence of males in
$\mathcal{D}_{3}^{\oplus}$ and overestimate the (signed) demographic
disparity of classifier $h$ as a result. Similar considerations hold
for sub-protocol \texttt{sample-prev-$\mathcal{D}_{2}^{\ominus}$},
with a sign flip due to $p_{\mathcal{D}_{3}^{\ominus}}(s)$ being the
first term in Equation \ref{eq:dd2}. Although less substantial, also
SLD displays similar trends.
The remaining methods, ACC and PACC, have a good median performance,
compensating this type of shift with the respective adjustments. On
the negative side, they display a large variance, due to a small
cardinality of the auxiliary set in this protocol, which makes
adjustments particularly unstable, as seen under protocol
\texttt{sample-size-$\mathcal{D}_2$} (Section
\ref{sec:sample_size_d2}). These effects are particularly evident at
the extrema of the $x$ axis, which correspond to settings where few
instances with either $S=0$ or $S=1$ are available for quantifier
training. In turn, the few positives (negatives) make it particularly
difficult to estimate the $\mathit{tpr}$ ($\mathit{tnr}$) of $k$ reliably, as required by Equations \eqref{eq:acc} and \eqref{eq:pacc}. For example, in
Figure~\ref{fig:sample_prev_d20} we see ACC reaching error rates that
range between $-0.7$ and 1.3. Given that the true demographic
disparity of the classifier $h$ is $\Delta(s)=-0.3$, these are the
worst possible errors, corresponding to extreme estimates
$\hat{\Delta}(s)=-1$ and $\hat{\Delta}(s)=1$, respectively.
\begin{table}[tb]
\small
\caption{Protocol \texttt{sample-prev-$\mathcal{D}_2$}.}
\label{tab:sample_prev_d2}
\resizebox{\textwidth}{!}{%
\input{tables/LR/tab_Protocols.VAR_D2_PREV.tex} }%
\end{table}
Similar trends also hold for COMPAS and CreditCard as summarized in
Table~\ref{tab:sample_prev_d2}. Overall, SLD seems to strike the best
balance between bias and variance. It is worth noting that (1) with
this protocol we tested extreme shifts in the prevalence of sensitive
attribute between the auxiliary set $\mathcal{D}_2$ and deployment set $\mathcal{D}_3$ and that (2) the summary in
Table~\ref{tab:sample_prev_d2} treats every prevalence as equally
likely, while in practice we expect that extreme shifts will be less
probable, helping to bound the estimation errors closer to zero. Indeed,
in Figure~\ref{fig:sample_prev_d2} every method performs better in a
proximity of the test prevalence.
\subsection{Protocol \texttt{sample-prev-$\mathcal{D}_3$}}
\label{sec:sample_prev_d3}
\subsubsection{Motivation and setup}
\noindent This is essentially the counterpart of protocol
\texttt{sample-prev-$\mathcal{D}_2$} (Section
\ref{sec:sample_prev_d2}), focusing on shifts in the test set
$\mathcal{D}_3$. Similarly, we consider two sub-protocols that model
changes in the prevalence of a sensitive variable $S$ in the test
subset of either positively or negatively predicted instances, called
$\mathcal{D}_{3}^{\ominus}$ and $\mathcal{D}_{3}^{\oplus}$. More in
detail, we let $\Pr(s|\ominus)$ (or its dual $\Pr(s|\oplus)$) in
$\breve{\mathcal{D}}_3$ take eleven evenly spaced values between 0 and
1. For example, under sub-protocol
\texttt{sample-prev-$\mathcal{D}_{3}^{\ominus}$}, we vary the
prevalence of sensitive attribute $S$ in
$\breve{\mathcal{D}}_{3}^{\ominus}$, so that
$\Pr(s|\ominus) \in \left \lbrace 0.0, 0.1 \dots, 0.9, 1.0 \right
\rbrace$, while keeping the prevalence in
$\breve{\mathcal{D}}_{3}^{\oplus}$ fixed. Contrary to protocol
\texttt{sample-prev-$\mathcal{D}_2$}, here we also allow for extreme
prevalence values of 0 and 1 for the sensitive attribute $S$, as this
does not invalidate the quantifiers' training. For both sub-protocols,
in each repetition we sample subsets of the test set $\mathcal{D}_3$
such that
$|\breve{\mathcal{D}}_{3}^{\ominus}|=|\breve{\mathcal{D}}_{3}^{\oplus}|=500$.
Pseudocode~\ref{pseudo:sample-prev-d3} describes the protocol when
acting on $\mathcal{D}_{3}^{\ominus}$; the case for
$\mathcal{D}_{3}^{\oplus}$ is analogous, and comes down to swapping
the roles of $\mathcal{D}_{3}^{\ominus}$ and
$\mathcal{D}_{3}^{\oplus}$ in Lines~\ref{line:randomsample:d30}
and~\ref{line:randomsample:d31}. Note that the pale red region
(delimiting the protocol-specific computations) comprises the
computation of the error (line~\ref{line:error:p4}) since, in this
case, the error is computed with respect to the samples
$\breve{\mathcal{D}}_{3}^{\ominus}$ and
$\breve{\mathcal{D}}_{3}^{\oplus}$, and not with respect to
$\mathcal{D}_{3}^{\ominus}$ and $\mathcal{D}_{3}^{\oplus}$.
This protocol accounts for the inevitable evolution of phenomena,
especially those related to human behaviour. Indeed, it is common in real-world
scenarios for data generation processes to be non-stationary and
change across training and test, due e.g., to seasonality or any sort
of unmodelled novelty and difference in populations
\citep{morenotorres2012:unifying,ditzler2015:learning,malinin2021shifts}. Given
most work on algorithmic fairness focuses on decisions or predictions
about people, and given the unavoidable role of change in human lives,
values, and behaviour, the above considerations about non-stationarity
seem particularly relevant in this context. For instance, data
available from one population is often repurposed to train algorithms
that will be deployed on a different population, requiring ad-hoc fair
learning approaches \citep{coston2019:fair} and evoking the
\emph{portability trap} of fair machine learning
\citep{selbst2019:fairness}. Moreover, agents may be responsive to
novel technology in their social context and adapt their behaviour
accordingly \citep{hu2019:disparate,tsirtsis2019optimal}, causing
\emph{ripple effects} \citep{selbst2019:fairness} and \emph{feedback
loops} \citep{mansoury2020:feedback}. Furthermore, as a concrete
(although spurious) example of a shift in a popular fairness dataset,
the repeated offense rate for black and white defendants in the COMPAS
dataset \citep{larson2016how} increases sharply between 2013 and 2014
\citep{barenstein2019propublica,biswas2021ensuring}. As a final example, personalized pricing constitutes an
increasingly possible practice with non-trivial fairness concerns
\citep{kallus2021:fairness} and inevitable shifts due to changing
habits and environments \citep{sindreu2021covid19}.
In the quantification literature, this is the most common evaluation
protocol. Similarly to \texttt{sample-prev-$\mathcal{D}_2$}, it
imposes shifts in the estimand between the training and testing
conditions of a quantifier, represented by the auxiliary set
$\mathcal{D}_2$ and the deployment set $\mathcal{D}_3$,
respectively. Through this protocol, we expect to find similar patterns
to those highlighted in Section~\ref{sec:sample_prev_d2}, with the
roles of the auxiliary set $\mathcal{D}_2$ and test set
$\mathcal{D}_3$ now switched. Under this protocol, $\mathcal{D}_3$ has
a smaller cardinality and variable prevalence (and is referred to as
$\breve{\mathcal{D}}_3$ for this reason), while $\mathcal{D}_2$ is
left to its original cardinality and prevalence of sensitive attribute
$S$.
\begin{algorithm}[t]
\LinesNumbered \SetNoFillComment
\begin{footnotesize}
\SetKwInOut{Input}{Input} \SetKwInOut{Output}{Output} \Input{
\textbullet\ Dataset $\mathcal{D}$ ; \\
\hspace{0.35em}\textbullet\ Classifier learner CLS; \\
\hspace{0.35em}\textbullet\ Quantification method Q; \\
} \Output{
\textbullet\ MAE of the demographic disparity estimates ; \\
\hspace{0.35em}\textbullet\ MSE of the demographic disparity
estimates ; }
\BlankLine
$E\leftarrow\emptyset$ ;
\For{5 random splits}{
$\mathcal{D}_A,\mathcal{D}_B,\mathcal{D}_C \leftarrow
\mathrm{split\_stratify}(\mathcal{D})$ ;
\For{$\mathcal{D}_1,\mathcal{D}_2,\mathcal{D}_3 \in
\mathrm{permutations}(\mathcal{D}_A,\mathcal{D}_B,\mathcal{D}_C)$}{
\tcc{Learn a classifier $h : X \rightarrow Y$} $h\leftarrow$
CLS.fit($\mathcal{D}_1$) ;
$\mathcal{D}_{2}^{\ominus}\leftarrow\{(\mathbf{x}_i,s_i)\in\mathcal{D}_2
\;|\; h(\mathbf{x}_i)=\ominus\}$ ;
$\mathcal{D}_{2}^{\oplus}\leftarrow\{(\mathbf{x}_i,s_i)\in\mathcal{D}_2
\;|\; h(\mathbf{x}_i)=\oplus\}$ ;
\tcc{Learn quantifiers $q_y : 2^\mathcal{X} \rightarrow [0,1]$}
$q_{\ominus} \leftarrow $ Q.fit($\mathcal{D}_{2}^{\ominus})$ ;
$q_{\oplus} \leftarrow $ Q.fit($\mathcal{D}_{2}^{\oplus})$ ;
\tcc{Split instances in $\mathcal{D}_3$ based on predicted labels
from $h$}
$\mathcal{D}_{3}^{\ominus}\leftarrow\{\mathbf{x}_i\in\mathcal{D}_3
\;|\; h(\mathbf{x}_i)=\ominus\}$ ;
$\mathcal{D}_{3}^{\oplus}\leftarrow\{\mathbf{x}_i\in\mathcal{D}_3
\;|\; h(\mathbf{x}_i)=\oplus\}$ ;
\For{10 repeats}{
\tikzmk{A} \For{$p \in \{0.1,0.2,\ldots,0.9\}$}{
\tcc{Generate samples from $\mathcal{D}_{3}^{\ominus}$ at desired
prevalence and size, and uniform samples from
$\mathcal{D}_{3}^{\oplus}$ at desired size}
$\breve{\mathcal{D}}_{3}^{\ominus}\sim\mathcal{D}_{3}^{\ominus}$
with $p_{\breve{\mathcal{D}}_{3}^{\ominus}}(s)=p$ and
$|\breve{\mathcal{D}}_{3}^{\ominus}|=500$ \label{line:randomsample:d30}
;
$\breve{\mathcal{D}}_{3}^{\oplus}\sim\mathcal{D}_{3}^{\oplus}$
with
$|\breve{\mathcal{D}}_{3}^{\oplus}|=500$ \label{line:randomsample:d31}
;
\tcc{Use quantifiers to estimate demographic prevalence}
$\hat{p}^{q_{\ominus}}_{\breve{\mathcal{D}}_{3}^{\ominus}}(s)
\leftarrow q_{\ominus}(\breve{\mathcal{D}}_{3}^{\ominus})$ ;
$\hat{p}^{q_{\oplus}}_{\breve{\mathcal{D}}_{3}^{\oplus}}(s)
\leftarrow q_{\oplus}(\breve{\mathcal{D}}_{3}^{\oplus})$ ;
\tcc{Compute the signed error of the demographic disparity
estimate}
$e=\left [
\hat{p}_{\breve{\mathcal{D}}_{3}^{\ominus}}^{q_{\ominus}}(s) -
\hat{p}_{\breve{\mathcal{D}}_{3}^{\oplus}}^{q_{\oplus}}(s)
\right ] - \left [ p_{\breve{\mathcal{D}}_{3}^{\ominus}}(s) -
p_{\breve{\mathcal{D}}_{3}^{\oplus}}(s) \right
]$ \label{line:error:p4};
\tikzmk{B} \boxit{pink} $E \leftarrow E \cup \{e\}$ } } } }
$\mathrm{mae}\leftarrow\mathrm{MAE}(E)$ ;
$\mathrm{mse}\leftarrow\mathrm{MSE}(E)$ ;
\Return{$\mathrm{mae}$, $\mathrm{mse}$} \BlankLine
\caption{Protocol \texttt{sample-prev-$\mathcal{D}_3$}, shown for
variations of prevalence values in class $y=\ominus$.}
\label{pseudo:sample-prev-d3}
\end{footnotesize}
\end{algorithm}
\subsubsection{Results}
\begin{figure}[t
\centering
\begin{subfigure}{\textwidth}
\centering
\includegraphics[width=.99\linewidth]{./plots/adult_gender/protD3_vary_prev_d30.pdf}
\caption{Protocol
\texttt{sample-prev-$\mathcal{D}_{3}^{\ominus}$}}
\label{fig:sample_prev_d30}
\end{subfigure} \\
\begin{subfigure}{\textwidth}
\centering
\includegraphics[width=.99\linewidth]{./plots/adult_gender/protD3_vary_prev_d31.pdf}
\caption{Protocol \texttt{sample-prev-$\mathcal{D}_{3}^{\oplus}$}}
\label{fig:sample_prev_d31}
\end{subfigure}
\caption{Protocol \texttt{sample-prev-$\mathcal{D}_3$} on the Adult
dataset.
Distribution of the estimation error ($y$ axis) as $\breve{\mathcal{D}}_3$ is sampled with a given $\Pr(S=1|Y=\ominus)$ value, plot (a), or $\Pr(S=1|Y=\oplus)$ value, plot (b) ($x$ axis).
The green line indicates the value of $\Pr(S=1)$ as observed in $\mathcal{D}_{2}^{\ominus}$, plot (a), or $\mathcal{D}_{2}^{\oplus}$, plot (b).
}
\label{fig:sample_prev_d3}
\end{figure}
\noindent The estimation error under this protocol is reported in
Figure~\ref{fig:sample_prev_d3}, on the $y$ axis, as we vary the
prevalence of protected groups in the test set, on the $x$
axis. Figure~\ref{fig:sample_prev_d30} concentrates on prevalence
variations in $\mathcal{D}_{3}^{\ominus}$, while Figure
\ref{fig:sample_prev_d31} considers variations of the prevalence of
protected groups in $\mathcal{D}_{3}^{\oplus}$. Similar trends emerge
under both sub-protocols. Similarly to
Section~\ref{sec:sample_prev_d2}, both CC and PCC display a clear
trend along the $x$ axis, vastly over- or under-estimating the
demographic disparity of $h$, and proving to be rather unreliable in
settings where the priors of their test set drift away from the priors
of their training set. In sub-protocol
\texttt{sample-prev-$\mathcal{D}_{3}^{\oplus}$}, symmetrically to
sub-protocol \texttt{sample-prev-$\mathcal{D}_{2}^{\oplus}$}, we have
that the prevalence of males in the subset
$\breve{\mathcal{D}}_{3}^{\oplus}$, used to test one of the
quantifiers, is almost always lower than the prevalence in the
respective training subset $\mathcal{D}_{2}^{\oplus}$. As a result, CC
tends to systematically overestimate the prevalence of males in
$\breve{\mathcal{D}}_{3}^{\oplus}$ and underestimate the (signed) demographic
disparity of classifier $h$ as a result.
\begin{table}[tb]
\small
\caption{Protocol \texttt{sample-prev-$\mathcal{D}_3$}.}
\label{tab:sample_prev_d3}
\resizebox{\textwidth}{!}{%
\input{tables/LR/tab_Protocols.VAR_D3_PREV.tex} }%
\end{table}
ACC, PACC, and HDy are three methods that require splitting the
training set to estimate auxiliary quantities. With respect to
protocol \texttt{sample-prev-$\mathcal{D}_{2}$}, where
$|\breve{\mathcal{D}}_2|$=1,000, in this experiment they all benefit
from a larger training set, reducing the bias of HDy and the variance
of ACC and PACC. Finally, SLD maintains a reliable
performance. Analogous results obtain on COMPAS and CreditCard, as
summarized in Table \ref{tab:sample_prev_d3}. Similarly to
Table~\ref{tab:sample_prev_d2}, we find that, under large shifts
between the auxiliary and deployment set, the estimation of demographic disparity is
more difficult on COMPAS and CreditCard than on the Adult dataset.
\subsection{Ablation study}
\label{sec:ablation}
\subsubsection{Motivation and setup}
\noindent In Sections
\ref{sec:sample_prev_d1}--\ref{sec:sample_prev_d3} we tested six
approaches to estimate demographic disparity. For each approach, we
exploited multiple quantifiers for the sensitive attribute $\mathcal{S}$, namely
one for each class in the codomain of classifier $h$. In the binary
setting adopted in this work, where
$\mathcal{Y}=\{\ominus,\oplus\}$, we trained two
quantifiers. One quantifier was trained on the set of
positively-classified instances of the auxiliary set
$\mathcal{D}_{2}^{\oplus}=\{ (\mathbf{x}_i,s_i) \in \mathcal{D}_2 \;|\;
h(\mathbf{x})=\oplus \}$ and deployed to quantify the prevalence of
sensitive instances (such that $S=s$) within the deployment subset
$\mathcal{D}_{3}^{\oplus}$. The remaining quantifier was trained on
$\mathcal{D}_{2}^{\ominus}$ and deployed on
$\mathcal{D}_{3}^{\ominus}$.
Training and maintaining multiple quantifiers is more expensive and
cumbersome than having a single one. Firstly, quantifiers that depend
on the classification outcome $\hat{y}=h(\mathbf{x})$ require
re-training every time $h$ is modified, e.g., due to a model update
being rolled out. Secondly, the cost of maintenance is multiplied by
the number of classes $|\mathcal{Y}|$ that are possible for the outcome variable. To ensure these downsides are compensated by performance
improvements, we perform an ablation study evaluating the performance
of different estimators of demographic disparity supported by a single
quantifier.
In this section, we concentrate on three estimation approaches, namely
CC, SLD and PACC. CC is chosen as the naïve baseline adopted by
practitioners unaware of ad-hoc approaches for prevalence
estimation. SLD and PACC are among the best performers in Sections
\ref{sec:sample_prev_d1}--\ref{sec:sample_prev_d3}, displaying low bias
or variance across all protocols. We compare their performance under
two settings. In the first setting, adopted thus far, two separate
quantifiers $q_{\ominus}$ and $q_{\oplus}$ are trained on
$\mathcal{D}_{2}^{\ominus}$, $\mathcal{D}_{2}^{\oplus}$ and deployed
on $\mathcal{D}_{3}^{\ominus}$, $\mathcal{D}_{3}^{\oplus}$,
respectively. In the second setting, we train a single quantifier $q$
on $\mathcal{D}_{2}$ and deploy it separately on
$\mathcal{D}_{3}^{\ominus}$ and $\mathcal{D}_{3}^{\oplus}$ to estimate
$\hat{\Delta}(s)$ via Equation~\ref{eq:dd_estim}, specialized so that
$q_{\ominus}$ and $q_{\oplus}$ are the same quantifier.
\subsubsection{Results}
\begin{figure}[t
\centering
\begin{subfigure}{\textwidth}
\centering
\includegraphics[width=.99\linewidth]{./plots/ablation/LR/protD1_vary_prev_d1_flip}
\caption{Protocol \texttt{flip-prev-$\mathcal{D}_{1}$}}
\label{fig:flip_prev_d1_ablation}
\end{subfigure} \\
\begin{subfigure}{\textwidth}
\centering
\includegraphics[width=.99\linewidth]{./plots/ablation/LR/protD2_vary_size.pdf}
\caption{Protocol \texttt{sample-size-$\mathcal{D}_{2}$}}
\label{fig:sample_size_d2_ablation}
\end{subfigure}
\caption{Ablation study on the Adult dataset. Distribution of the estimation error ($y$ axis) for CC, PACC, SLD, and their single-quantifier counterparts, as $\Delta(s)$, plot (a), and $|\breve{\mathcal{D}}_2|$, plot (b), are varied ($x$ axis).}
\label{fig:ablation}
\end{figure}
Figure~\ref{fig:ablation} summarizes results for the Adult dataset
under two protocols that are representative of the overall trends,
namely \texttt{flip-prev-$\mathcal{D}_{1}$} (Figure
\ref{fig:flip_prev_d1_ablation}) and
\texttt{sample-size-$\mathcal{D}_{2}$} (Figure
\ref{fig:sample_size_d2_ablation}).\footnote{In the interest of
brevity, the figures in this section refer to LR-based quantification on
the Adult dataset under two protocols. Results for SVM-based
quantifiers under every protocol are depicted in the Appendix (Figures
\ref{fig:sample_prev_d1_ablation_svm} -- \ref{fig:sample_prev_d3_ablation_svm}). Analogous results hold on CreditCard and
COMPAS.} The $y$ axis depicts the estimation error of CC, SLD, PACC,
and their single-quantifier counterparts, denoted with suffix
``nosD2'' to indicate that the auxiliary set $\mathcal{D}_2$ is
\underline{no}t \underline{s}plit into $\mathcal{D}_{2}^{\ominus}$,
$\mathcal{D}_{2}^{\oplus}$ during training. The $x$ axis depicts the
quantity of interest varied under each protocol.
Interestingly, CC appears to be rather insensitive to the ablation
study, so that the estimation errors of CC and CC-nosD2 are
well-aligned (although they both fare poorly). The opposite is true for both PACC and SLD. These
quantification approaches display a clear decay in performance in the
single-quantifier setting. Under protocol
\texttt{flip-prev-$\mathcal{D}_{1}$} (Figure
\ref{fig:flip_prev_d1_ablation}) both PACC-nosD2 and SLD-nosD2 have
large estimation errors, which vary along the $x$ axis, and are
consistently worse than CC. On the other hand, under protocol
\texttt{sample-size-$\mathcal{D}_{2}$} (Figure
\ref{fig:sample_size_d2_ablation}) PACC-nosD2 and SLD-nosD2 display a
more moderate yet sizeable performance decay, which is mostly constant
along the $x$ axis.
Under all protocols, the performance of SLD and PACC is compromised in
the absence of class-specific quantifiers $q_{\ominus}$ and
$q_{\oplus}$. If a single quantifier is trained on the full auxiliary
set $\mathcal{D}_2$, the corrections brought about by SLD and PACC end
up worsening, rather than improving, the prevalence estimates of
vanilla CC. For this reason, the ideal workflow requires partitioning
the auxiliary set into subsets $\mathcal{D}_{2}^{\ominus}$ and
$\mathcal{D}_{2}^{\oplus}$, as illustrated in Section~\ref{sec:adaptation}.
\subsection{Quantifying without classifying}
\label{sec:q_not_c}
\subsubsection{Motivation and setup}
\noindent The motivating use case for this work are internal audits of
group fairness, to characterize a model and its potential to harm
sensitive categories of users. Following \citet{aswasthi2021:ef}, we
envision this as an important first step to empower practitioners in
arguing for resources and, more broadly, advocate for deeper
understanding and careful evaluation of models. Unfortunately,
developing a tool to infer demographic information, even if motivated
by careful intentions and good faith, leaves open the possibility for
misuse, especially at an individual level. Once a predictive tool,
also capable of instance-level classification, is available, it will
be tempting for some actors to exploit it precisely for this purpose.
For example, the \textit{Bayesian Improved Surname Geocoding} (BISG)
method \citep{elliott2009:uc} is intended to estimate population-level
disparities in health care. However, it was also used to identify
individuals potentially eligible for settlements related to
discriminatory practices by auto lending companies
\citep{andriotis2015:US,koren2016:fu}. Automatic inference of
sensitive attributes of individuals is problematic for several
reasons. Such procedure exploits the co-occurrence of membership in a
group and display of a given trait, running the risk of learning,
encoding and reinforcing stereotypical associations. While also true
of group-level estimates, this practice is particularly troublesome at
an individual level, where it is likely to cause harms for people
who do not fit the norm, resulting, for instance, in misgendering and
the associated negative effects \citep{mclemore2015experiences}. Even
when ``accurate'', the mere act of externally assigning
sensitive labels can be problematic. For example, gender assignment
may be forceful and lead to psychological harm for individuals
\citep{keyes2018:misgendering}.
In this section, we aim to demonstrate that it is possible to decouple
the objective of (group-level) quantification of sensitive attributes
from that of (individual-level) classification. For protocols in
previous sections, we compute the accuracy and $F_1$ score (defined below) of the
sensitive attribute classifier $k$ underlying the tested quantifiers,
comparing it against their estimation error for class prevalence of
the sensitive attribute $S$ (Equation \ref{eq:estim_err1}).
Accuracy is the proportion of correctly classified instances over the total (Equation \ref{eq:accuracy})
while $F_1$ is the harmonic mean of precision and recall (Equation \ref{eq:F1}). Both measures can be computed from the counters of true positives (TP), true negatives (TN), false positives (FP), and false negatives (FN), as follows:
\begin{equation}
\label{eq:accuracy}
\mathrm{accuracy} =
\dfrac{\mathrm{TP}+\mathrm{TN}}{\mathrm{TP}+\mathrm{TN} + \mathrm{FP} + \mathrm{FN}}
\end{equation}
\begin{align}
\label{eq:F1}
F_{1} = & \ \left\{
\begin{array}{cl}
\dfrac{2\mathrm{TP}}{2\mathrm{TP} + \mathrm{FP} + \mathrm{FN}} & \mathrm{if} \ \mathrm{TP} + \mathrm{FP} + \mathrm{FN}>0 \rule[-3ex]{0mm}{7ex} \\
1 & \mathrm{if} \ \mathrm{TP}=\mathrm{FP}=\mathrm{FN}=0 \\
\end{array}
\right.
\end{align}
\subsubsection{Results}
\def .75\textwidth {.75\textwidth}
\begin{figure}[!t
\centering
\begin{subfigure}{.75\textwidth}
\centering
\includegraphics[width=.99\linewidth]{./plots/quant_without_class/LR/D2y0.pdf}
\caption{Protocol
\texttt{sample-prev-$\mathcal{D}_{2}^{\ominus}$}}
\label{fig:sample_prev_d20_q_wo_c}
\end{subfigure} \\
\begin{subfigure}{.75\textwidth}
\centering
\includegraphics[width=.99\linewidth]{./plots/quant_without_class/LR/D2y1.pdf}
\caption{Protocol
\texttt{sample-prev-$\mathcal{D}_{2}^{\oplus}$}}
\label{fig:sample_prev_d21_q_wo_c}
\end{subfigure} \\
\caption{Performance of CC, SLD and PACC on the Adult dataset when
used for quantification (MAE -- lower is better) and classification
($F_1$, accuracy -- higher is better) under protocol \texttt{sample-prev-$\mathcal{D}_2$}. The classification
performance of PACC is equivalent to that of CC (both equal to the performance of the underlying LR), and we thus omit it
for readability.
}
\label{fig:q_wo_c_d2}
\end{figure}
\begin{figure}[!t
\centering
\begin{subfigure}{.75\textwidth}
\centering
\includegraphics[width=.99\linewidth]{./plots/quant_without_class/LR/D3y0.pdf}
\caption{Protocol
\texttt{sample-prev-$\mathcal{D}_{3}^{\ominus}$}}
\label{fig:sample_prev_d30_q_wo_c}
\end{subfigure} \\
\begin{subfigure}{.75\textwidth}
\centering
\includegraphics[width=.99\linewidth]{./plots/quant_without_class/LR/D3y1.pdf}
\caption{Protocol
\texttt{sample-prev-$\mathcal{D}_{3}^{\oplus}$}}
\label{fig:sample_prev_d31_q_wo_c}
\end{subfigure}%
\caption{Performance of CC, SLD and PACC on the Adult dataset when
used for quantification (MAE -- lower is better) and classification
($F_1$, accuracy -- higher is better) under protocol \texttt{sample-prev-$\mathcal{D}_3$}. The classification
performance of PACC is equivalent to that of CC (both equal to the performance of the underlying LR), and we thus omit it
for readability.
}
\label{fig:q_wo_c_d3}
\end{figure}
Figures~\ref{fig:q_wo_c_d2} and \ref{fig:q_wo_c_d3} displays the quantification performance (MAE)
and classification performance ($F_1$, accuracy) of CC, SLD and PACC
on the Adult dataset under protocols
\texttt{sample-prev-$\mathcal{D}_{2}$} and
\texttt{sample-prev-$\mathcal{D}_{3}$}, respectively. As usual, we describe results
for LR-based learners and report their SVM-based duals in the Appendix
(Figures~\ref{fig:q_wo_c_svm_d2} and \ref{fig:q_wo_c_svm_d3}). To evaluate the quantification
performance of each approach, we simply report their MAE in estimating the prevalence
$p_{\mathcal{D}_{3}^{\ominus}}(S=1)$,
$p_{\mathcal{D}_{3}^{\oplus}}(S=1)$ in either test subset, depending
on the protocol at hand. To assess the performance of the sensitive
attribute classifier $k$ underlying each quantifier, we proceed as
follows. For CC and PACC, we simply run $k$ (LR) on either
$\mathcal{D}_{3}^{\ominus}$ or $\mathcal{D}_{3}^{\oplus}$, reporting
its accuracy and $F_1$ score in inferring the sensitive attribute of
individual instances. The classification performance of the
classifiers underlying CC and PACC are equivalent, so we omit the
latter from Figures~\ref{fig:q_wo_c_svm_d2} and \ref{fig:q_wo_c_svm_d3} for readability. For SLD, we
take the novel posteriors obtained by applying the EM algorithm to
either test subset, and use them for classification with a threshold of
0.5.
Clearly, SLD improves both the quantification and classification
performance of the classifier $k$. In terms of quantification, its MAE
is consistently below that of CC, and in terms of classification it
displays better $F_1$ and accuracy. However, under large prevalence
shifts across the auxiliary set $\mathcal{D}_2$ and the test set
$\mathcal{D}_3$, its classification performance becomes unreliable. In
particular, under protocol
\texttt{sample-prev-$\mathcal{D}_{3}^{\ominus}$}
(resp. \texttt{sample-prev-$\mathcal{D}_{3}^{\oplus}$}) in Figure
\ref{fig:sample_prev_d30_q_wo_c} (resp. Figure
\ref{fig:sample_prev_d31_q_wo_c}), for low values of the $x$ axis,
i.e., when the true prevalence values
$p_{\mathcal{D}_{3}^{\ominus}}(S=1)$
(resp. $p_{\mathcal{D}_{3}^{\oplus}}(S=1)$) becomes small, the SLD-based
classifier starts acting as a trivial rejector with low recall, hence
low $F_1$ score. On the other hand, the quantification performance of
SLD does not degrade in the same way, as its MAE is low and flat
across the entire $x$ axis in Figures~\ref{fig:sample_prev_d30_q_wo_c}
and \ref{fig:sample_prev_d31_q_wo_c}. This is a first hint to the fact
that classification and quantification performance may be decoupled.
PACC is another method which significantly outperforms CC in
estimating the prevalence of sensitive attributes in both test subsets
$\mathcal{D}_{3}^{\ominus}$, $\mathcal{D}_{3}^{\oplus}$. Indeed, its
MAE is well-aligned with that of SLD, displaying low quantification
error under every protocol (Figures
\ref{fig:q_wo_c_d2}--\ref{fig:q_wo_c_d3}). On the other hand, its classification performance is
aligned with the accuracy and $F_1$ score of CC, which is
unsatisfactory and can even become worse than random. This fact shows
that it is possible to build models which yield good prevalence
estimates for the sensitive attribute within a sample, without
providing reliable demographic estimates for single instances. Indeed, quantification methods of type \textit{aggregative} (i.e., based on the outcomes of a classifier -- like all methods we use in this study) are suited to repair the initial prevalence estimate (computed by classifying and counting) without
precise knowledge of which specific data items have been misclassified.
In the
context of models to measure fairness under unawareness of sensitive
attributes, we highlight this as a positive result, decoupling a
desirable ability to estimate group-level disparities from an
undesirable misuse at the individual level.
\section{Related work}
\label{sec:relatedwork}
\subsection{Fairness under unawareness of sensitive attributes}
\label{sec:fairnessunderunawareness}
\noindent Several fairness criteria have been proposed in the machine
learning literature, typically requiring equalization of some
conditional or marginal property of the joint distribution of the
sensitive variable $S$, ground truth $Y$, and classifier estimate
$\hat{Y}$ \citep{dwork2012:fairness,
hardt2016:equality,narayanan2018:21}. Unavailability of the sensitive
attribute poses a major challenge for internal and external fairness
audits under any of these criteria. When the sensitive attribute is
unknown, it is sometimes possible to seek expert advice for its
annotation \citep{buolamwini2018:gender}. Alternatively, disclosure
procedures have been proposed for subjects to provide their sensitive
attributes to a trusted third party \citep{veale2017:fm} or to share
them in encrypted form \citep{kilbertus2018:bj}. Another line of
research, closely related to our work, studies the problem of reliably
estimating measures of group fairness with no access to sensitive
attributes via proxy variables
\citep{chen2019:fu,kallus2020:aa,aswasthi2021:ef}.
\citet{chen2019:fu} study the problem of estimating the demographic
parity of a classifier, defined in terms of the distribution of $\hat{Y}$
conditional on $S$, exploiting non-sensitive variables $X$
as proxies to infer the sensitive variable $S$. They characterize the
limitations of a CC-based approach and propose a \emph{weighted
estimator} with better convergence properties, closely related to
PCC. The authors stress the tendency of CC to exaggerate disparities
as a key problem. In this work, we show extensive empirical evidence of
this phenomenon and adapt different approaches from the quantification
literature to overcome this limitation. \citet{kallus2020:aa} study
the identifiability of a classifier's demographic parity in a setting
with access to a primary dataset involving $(\hat{Y},Z)$ and an
auxiliary dataset involving $(S,Z)$, where $Z$ is a generic set of
proxy variables, potentially disjoint from $X$. They show that reliably estimating the demographic
parity of a classifier issuing predictions $\hat{Y}$ when $Z$ is not highly informative with respect to
either $\hat{Y}$ or $S$ is infeasible. Moreover, they provide upper
and lower bounds for the true value of the estimand in a setting where
the primary and auxiliary datasets are drawn from marginalizations of a
common joint distribution. In a similar setting,
\citet{aswasthi2021:ef} characterize the structure of the best
classifier for sensitive attributes when the final estimand is a classifier's
disparity in true positive rates across protected groups. They
show that the test accuracy of the attribute classifier and its
performance as an estimator of the true positive rate disparity is not necessarily
correlated.
Our work expands on this prior art, making realistic assumptions for
an internal audit of demographic parity. We study the problem of
estimating the demographic disparity of a classifier $h$ on production
data, allowing for different types of dataset shift between its
training set, its deployment set, and a small auxiliary set with information
on the sensitive attribute. We leverage techniques from
quantification learning, directly aimed at group-level estimates,
which are reliable even when the underlying sensitive attribute
classifier performs poorly. Moreover, we show that the quantification and classification objectives can be successfully decoupled.
\subsection{Quantification and fairness}
\label{sec:quantificationlearning}
The application of quantification approaches in algorithmic fairness research is not entirely new. \citet{biswas2021ensuring} study the problem of enforcing fair classification under prior probability shift, potentially affecting different demographic groups at different rates. They define a notion of fairness based on proportionality between the prevalence of positives in a protected group $S=s$ and the group-specific acceptance rate of a classifier issuing predictions $\hat{Y}$. This notion, called Proportional Equality, is defined by the quantity $\text{PE}= \left | \frac{\Pr(Y=\oplus|S=1)}{\Pr(Y=\oplus|S=0)} - \frac{\Pr(\hat{Y}=\oplus|S=1)}{\Pr(\hat{Y}=\oplus|S=0)} \right |$ computed on a test set $\mathcal{D}$, where low values of $\text{PE}$ correspond to fairer predictions $\hat{Y}$. In the presence of distribution drift between training and testing conditions, the true group-specific prevalences
$\Pr(Y=\oplus|S=1)$ and $\Pr(Y=\oplus|S=0)$
are unknown. The authors employ a PCC-based quantifier to estimate these prevalence values. PCC is embedded within a wider pipeline called CAPE, combining sampling, ensemble and quantification techniques to provide fair predictions.
In other words, prior work applying quantification to problems of algorithmic fairness concentrates on \emph{ensuring} fairness of classifiers under unawareness of \emph{target labels}. Our work, on the other hand, is aimed at \emph{measuring} fairness under unawareness of \emph{sensitive attributes}.
\section{Discussion and conclusion}
\label{sec:conclusion}
\noindent Measuring the differential impact of models on groups of
individuals is important to understand their effects in the real world
and their tendency to encode and reinforce divisions and privilege
across sensitive attributes. Unfortunately, in practice, demographic
attributes are often unavailable. In this work, we have taken the
perspective of responsible practitioners, interested in internal
fairness audits of production models. We have tackled the problem of
measuring group fairness under unawareness of sensitive attributes by
applying ad-hoc approaches from the quantification learning
literature. These methods are specifically designed for group-level
estimation rather than individual-level classification. Since
practitioners who try to measure fairness under unawareness are
precisely interested in group-level estimates, it is useful for the
fairness and quantification communities to exchange lessons.
We have studied the problem of estimating a classifier's demographic
disparity at deployment under unawareness of sensitive attributes,
with access to a disjoint auxiliary set of data for which demographic
information is available. Drawing from the algorithmic fairness
literature, we have identified five factors of import for this
problem, associating each of them with a formal evaluation
protocol. These factors mirror challenges in real-world applications,
including dataset shift and variable cardinality for auxiliary
datasets comprising demographic information. We have tested five
quantification methods under every protocol, comparing them against
the naïve Classify-and-Count (CC) method, which represents the default approach for practitioners unaware of quantification. Each quantification
approach was shown to outperform CC under most combinations of 5
protocols, 3 datasets, and 2 underlying learners. Moreover, we have
shown a simple approach to integrate quantification methods into
existing machine learning pipelines with little orchestration effort,
and demonstrated the importance of each component through an ablation
study.
Finally, we have considered the problem of model misuse to infer
demographic characteristics at an individual level, which represents a
concern when developing models to measure group fairness via proxy attributes. Through a dedicated
set of experiments, we have shown that it is possible to obtain
precise estimates of demographic disparity from methods that have poor
classification performance. This is a positive result for decoupling
these two objectives, which should help deter from the exploitation of
these models for individual-level inference.
Future work may require a deeper study of the relation between
classification and quantification performance, and the extent to which these two
objectives may be decoupled. It would be interesting to especially
target decoupling through learners aimed at maximizing quantification
performance subject to a low classification performance
constraint. Another important avenue for future work is the study of
confidence intervals for estimates of demographic disparity provided
by methods of quantification learning. An indication of confidence for
point estimates of group fairness may be invaluable for a practitioner
arguing for resources and attention to the disparate effects of a
machine learning system on different populations.
\section*{Acknowledgments}
\label{sec:Acknowledgments}
\noindent The work by Alessandro Fabris was supported by MIUR (Italian
Minister for Education) under the ``Departments of Excellence''
initiative (Law 232/2016). The work by Andrea Esuli, Alejandro Moreo,
and Fabrizio Sebastiani has been supported by the
\textsc{SoBigData++} project, funded by the European Commission (Grant
871042) under the H2020 Programme INFRAIA-2019-1, and by the
\textsc{AI4Media} project, funded by the European Commission (Grant
951911) under the H2020 Programme ICT-48-2020. The authors' opinions
do not necessarily reflect those of the European Commission.
\clearpage
\bibliographystyle{spbasic}
\section{Introduction}
\label{intro}
Your text comes here. Separate text sections with
\section{Section title}
\label{sec:1}
Text with citations \cite{RefB} and \cite{RefJ}.
\subsection{Subsection title}
\label{sec:2}
as required. Don't forget to give each section
and subsection a unique label (see Sect.~\ref{sec:1}).
\paragraph{Paragraph headings} Use paragraph headings as needed.
\begin{equation}
a^2+b^2=c^2
\end{equation}
\begin{figure}
\includegraphics{example.eps}
\caption{Please write your figure caption here}
\label{fig:1}
\end{figure}
\begin{figure*}
\includegraphics[width=0.75\textwidth]{example.eps}
\caption{Please write your figure caption here}
\label{fig:2}
\end{figure*}
\begin{table}
\caption{Please write your table caption here}
\label{tab:1}
\begin{tabular}{lll}
\hline\noalign{\smallskip}
first & second & third \\
\noalign{\smallskip}\hline\noalign{\smallskip}
number & number & number \\
number & number & number \\
\noalign{\smallskip}\hline
\end{tabular}
\end{table}
| {'timestamp': '2021-09-20T02:18:05', 'yymm': '2109', 'arxiv_id': '2109.08549', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08549'} | arxiv |
\section{Introduction}
\MathML{} has the ability to represent presentational and content information.
Several optional features and markup options make \MathML{} a highly versatile, but complex format.
\MathML's ability to mix presentation and content markup for an expression (hereafter called fully descreptive \MathML{}) makes \MathML{} increasingly important for mathematical digital libraries.
For example, Listing~\ref{lst.MathML} shows a simple example of a cross-referenced parallel markup \MathML{} document generated from the \LaTeX{} string \verb|\frac{a}{b}|.
\input{mmllst.tex}
Although \MathML{} is an official recommendation of the \href{https://www.w3.org/Math/}{World Wide Web Consortium} since 1998, has been an ISO standard (ISO/IEC 40314) since 2015, and is also part of HTML5, it is still a rarely used format.
For example, the prominent browser Microsoft Internet Explorer\footnote{The mention of specific products, trademarks, or brand names is for purposes of identification only. Such mention is not to be interpreted in any way as an endorsement or certification of such products or brands by the National Institute of Standards and Technology, nor does it imply that the products so identified are necessarily the best available for the purpose. All trademarks mentioned herein belong to their respective owners.} does not support \MathML.
Google Chrome supported \MathML{} only in version 24 and dropped it again in newer versions in favor of MathJax\footnote{\url{https://bugs.chromium.org/p/chromium/issues/detail?id=152430\#c43}}.
Furthermore, we were only able to identify few databases
that use fully descriptive \MathML{}.
Most databases use basic \MathML{} instead, such as the DLMF~\cite{DLMF} that only provides presentational \MathML{}.
Numerous tools that process math allow \MathML{} as an input or export format.
Most of these tools avoid \MathML{} as an internal data representation.
Instead, many systems create their own problem-specific data representation and implement custom tools to parse \MathML{} for internal processing.
This workaround causes problems in regard to reusability, restricts applicability, and decreases efficiency for processing mathematics.
During our research of a \MathML{} benchmark~\cite{Schubotz2018}, we realized that parsing \MathML{} data is an error-prone endeavor.
Even small changes, such as missing default namespaces, can cause the parsing process to fail.
With MathTools{}, we provide a collection of tools that overcomes the issues of complexity and simplifies the access to \MathML{} data.
MathTools{} also contains an open API for easy access to useful services that we used in several of our previous projects, such as for similarity calculations or for \LaTeX{} to \MathML{} conversion
tools~\cite{DBLP:conf/mkm/CohlSMSZMD15,
DBLP:conf/cikm/MeuschkeSHSG17,
Meuschke2018a,
disCicm14Mlp,
DBLP:phd/dnb/Schubotz17,
DBLP:conf/clef/SchubotzKMHG17,
Schubotz2018,
disSigir16,
vmext17}.
The tools we have developed are able to parse fully descriptive \MathML{} and to a certain degree, invalid \MathML{}.
Furthermore, we provide easy access to several useful features implemented in \MathML{} related projects.
These features include similarity metrics, distance calculations, and Java imports for state-of-the-art conversion tools.
\section{Related Work}\label{sec:rel-work}
Many digital libraries do not use \MathML{} but favor their custom internal formats to process mathematics.
The conversion tool \LaTeXML{}~\cite{LaTeXML} is able to generate presentation and content \MathML{} using \LaTeX{} input.
Instead of processing the input directly to \MathML, \LaTeXML{} uses a customized XML format, and creates \MathML{} in a post-processing step.
The Speech Rule Engine (SRE) implemented in MathJax~\cite{Cervone2016} is able to translate presentation \MathML{} expressions to speech.
Translations of the SRE ause a set of rules that are applied to a nonstandard tree representation of the original \MathML{} input.
Computer Algebra Systems (CAS) allow for complex computations of mathematical expressions.
These systems usually create their own internal data format, but typically allow for \MathML{} export.
For example, the CAS MAPLE
parses inputs to a directed acyclic graph (DAG) presentation~\cite[Chapter~2]{MAPLE:ProgrammingGuide}, whereas Mathematica uses a custom tree representation~\cite[Chapter~33]{Wolfram2017}.
{\sloppy
There are other tools that internally use \MathML{} in combination with customized implementations for parsing \MathML{}.
Examples of such tools include \MathML{\sc Can}~\cite{formanek2012}, a canonicalization tool for \MathML{} data;
the Visualization of Mathematical Expression Trees (VMEXT)~\cite{vmext17} for \MathML{} data;
and dependency graphs~\cite{DBLP:journals/ir/KristiantoTA17} for analyzing relationships between math expressions.}
\section{MathTools}
We provide MathTools, a collection of tools for convenient handling of \MathML{} data and an open Java API to access useful services related to \MathML{} data.
MathTools allows to parse, manipulate, and analyze fully descriptive \MathML{} data conveniently.
We haven chosen Java to realize MathTools, because the majority of related work is also implemented in Java. Java also is the most frequently used programming language.
The source of this project is publicly available on GitHub\footnote{\url{https://github.com/ag-gipp/MathMLTools}} and on maven-central under an Apache 2 license.
\begin{figure}[!b]
\center
\vspace*{-0.7cm}
\includegraphics[trim=5mm 10mm 5mm 15mm,clip,width=\textwidth]{images/MathMLT.pdf}
\vspace*{-0.7cm}
\caption{The pipeline schema of MathTools{} and the modules.
The orange arrow indicates the general workflow for processing a \MathML{} input to a valid \MathML{} output.
The converters also allow mathematical \LaTeX{} input, while the \MathML{} feature requires valid \MathML{} input.
The gold module provides valid \MathML{} without the core module.
Distances and similarities can be calculated using the similarity module.
Single elements or subtrees from valid \MathML{} can be accessed through the core module.}
\label{fig:mmlt}
\vspace*{-0.5cm}
\end{figure}
The project is organized in multiple modules, of which the \element{core} module provides the main functionality.
Figure~\ref{fig:mmlt} illustrates possible workflows for processing the input and shows the interaction of different modules.
The \element{core} module is designed for parsing, loading, storing, and manipulating presentation and content \MathML{} data.
The \element{core} also provides helper functions for easy access to specific information.
Examples of supported operations include splitting presentation and content trees; accessing original \TeX{} data if available; and extracting all of the identifiers, e.g., \verb|mi| or \verb|ci| elements from the data.
The \element{core} module also allows to `clean' \MathML{} of unwanted features.
Such features include cross-references or entire content subtrees.
This functionality is particularly helpful for obtaining simple \MathML{} for testing and learning purposes.
We equipped MathTools{} with several extra modules, which we consider useful for typical use cases related to processing \MathML{} data.
MathTools{} contains the following modules.\\[-0.43cm]
\moduleSec{Gold} is part of the \MathML{\sc Ben} project~\cite{Schubotz2018}, whose purpose is to provide a comfortable interface to \MathML{} gold standards within Java.
The module uses Plain Old Java Objects (POJOs) for representing entries of the gold standard.
The \element{gold} module can be used to implement benchmarks that use \MathML{}.
\moduleSec{Converters} is an outgrowth of the \MathML{\sc Ben} project and provides fast access to state-of-the-art conversion tools.
We implemented a Java interface for each supported tool and the \MathML{\sc Can}~\cite{formanek2012} that allows canocalization of the tool's outputs.
The module allows to:
(1) embed uniform \MathML{} data into translation workflows;
(2) conveniently change the translation engines;
(3) add new conversion tools to the API.
\moduleSec{Libraries} is a collection of reliable XPath and XQuery expressions for accessing elements in \MathML{} data.
Due to the XML structure of \MathML{} documents, MathTools{} uses data query languages to access specific elements.
The \element{library} module can be used to reliably query data from \MathML{} documents independently of programming languages.
\moduleSec{Similarity} implements several distance and similarity measures for \MathML{} documents.
Comparing \MathML{} data is a common task for many mathematical information retrieval systems, e.g., for mathematical search engines and for plagiarism detection systems that analyze mathematical expressions as well as for many evaluation and benchmark scenarios.
All measures included in the module, except the tree edit distance, produce histograms for \MathML{} elements using the names of the elements and their accumulated frequency of occurrence.
Frequency histograms of \MathML{} elements have been successfully applied as part of plagiarism detection methods to determine the similarity of mathematical expressions, see~\cite{DBLP:conf/cikm/MeuschkeSHSG17,Meuschke2018a} for a more detailed explanation.
We implemented the following similarity measures.
\vspace*{-0.7em}
\begin{itemize}[label={$\bullet$}]
\item \textbf{Histogram Distance:} calculates the absolute and relative differences of histograms formed from \MathML{} data.
A small histogram distance indicates semantic similarity between \MathML{} expressions.
\item \textbf{Tree Edit Distance:} calculates the number of changes that must be performed to transform one \MathML{} tree into another.
The user can control the weights for insertions, deletions, and renaming of elements.
We use an implementation of RTED~\cite{RTED} to perform these calculations. Tree edit distances are helpful
for detecting structural changes of \MathML{} trees.
\item \textbf{Earth Mover Distance (EMD):} is originally a distance measure for comparing probability distributions. The measure models a cost function for changing one distribution to another.
In our case, the probability distribution is the histogram of the \MathML{} data.
Our calculations are performed using a Java implementation of~\cite{DBLP:conf/iccv/PeleW09}.
EMD is widely used in multimedia information retrieval and for pattern recognition algorithms.
\item \textbf{Cosine Similarity:} is a distance measure between two non-zero vectors.
In our case, the vectors are represented by the histogram of the \MathML{} data.
\end{itemize}
\vspace*{-0.5em}
Note that EMD and Cosine similarity can be used for entire documents.
In this case, the histograms are an accumulation of all \MathML{} expressions in the document.
In this scenario, EMD and Cosine similarities provide a strong measure of how similar documents are in terms of their semantics.
\section{Conclusion and Future Work}
The MathTools{} project is a unified toolkit to facilitate working with \MathML{}.
By using MathTools{}, other researchers will no longer need to develop their own data representations, nor will they have to deal with the full complexity of XML.
The developed tools are actively being used in our own projects, such as \MathML{\sc Ben}~\cite{Schubotz2018}, VMEXT~\cite{vmext17}, the Mathematical Language Processing (MLP) Project~\cite{disCicm14Mlp}, and
HyPlag~\cite{DBLP:conf/iceis/GippMBPN14,Meuschke12,Meuschke2018a} for mathematical plagiarism detection.
Our hope is that the tools presented in this paper will help others to realize \MathML{} related projects in the future.
Our goal is to actively maintain and extend MathTools{}.
Plans for current and future work include enlarging the libraries of XPath and XQuery expressions and providing transformation tools for \MathML{} trees.
Furthermore, we are currently working on semantic enhancements of \MathML{} through the use of WikiData (as proposed in the \MathML{\sc Ben} project).
This semantic enhanced \MathML{} data can be used to calculate semantic distances through the calculation of distances between WikiData links.
Moreover, we will consider the development of convienient interfaces to other tools that deal with similar standars such as OpenMath. For instance Py-OpenMath\footnote{\url{https://github.com/OpenMath/py-openmath}} is a project written in Python that allows one to parse XML formats and provides for conversion between Python objects to OpenMath representations.
Additionaly, we are considering to take advantage of tools for processing semantics on the document level. In particular MMT~\cite{DBLP:conf/mkm/Rabe13}, which is a framework for creation of a new language for partially formal mathematical knowledge.
We plan to maintain the current API for the foreseeable future.
| {'timestamp': '2021-09-20T02:17:39', 'yymm': '2109', 'arxiv_id': '2109.08539', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08539'} | arxiv |
\section{Introduction}
\label{sec:intro}
Recent work has shown that training text encoders using data from multiple tasks helps to produce an encoder that can be used in numerous downstream tasks with minimal fine-tuning (e.g., T5~\cite{raffel2019exploring} and BART \cite{lewis2019bart}). However, in multitask learning for text summarization, it is still unclear what range of tasks can best support summarization, and most prior work has incorporated only one additional task during training ~\cite{isonuma2017extractive,chen2019multi,pasunuru2017towards,gehrmann2018bottom}. Also, to our knowledge, no prior work has tried to tackle multitask summarization in low-resource domains.
\label{rquestions}Our work attempts to address these gaps by answering the following research questions: \textit{Q1) Can abstractive summarization performance be boosted via multitask learning when training from a small dataset?} \textit{Q2) Are there some tasks that might be helpful and some that might be harmful for multitask abstractive summarization?} \textit{Q3) Will the same findings emerge if a very different learning model is used or if pretraining is performed?} \textit{Q4) Will the same findings emerge if a very different small training corpus is used?} To answer Q1, we use a pretrained BERT model \cite{devlin2018bert} within a multitask framework, and train all tasks using a small-sized corpus of student reflections (around 400 samples). To answer Q2, we explore the utility of training on four different tasks (both alone and in combination) in addition to abstractive summarization. To answer Q3, instead of fine-tuning with the BERT model, we perform experiments using the T5 transformer model \cite{raffel2019exploring}. To answer Q4, we replicate the student reflection experiments using two very different corpora (news and reviews). Our results show that abstractive summarization in low resource domains can be improved via multitask training. We also find that certain auxiliary tasks such as paraphrase detection consistently improve abstractive summarization performance across different models and datasets, while other auxilary tasks like language modeling more often degrade model performance.
\section{Related Work}
\textbf{Multitask learning.} Abstractive summarization has been enhanced in multitask learning frameworks
with one additional task, by integrating it with text entailment generation \cite{pasunuru2017towards}, extractive summarization
\cite{chen2019multi,hsu2018unified}, and sentiment classification \cite{unified2020,ma2018hierarchical}. While other research has combined multiple tasks,
\citet{lu2019multi} integrated only predictive tasks, while \citet{guo2018soft} used only generative tasks. Recently, \citet{dou2021gsum} proposed using different tasks as guiding signals. However,
the guiding signals can only be used one signal at a time with no easy way to combine them. In contrast, our work focuses on both generative and predictive tasks, explores task utility in isolation and in all combinations, and demonstrates generalization of findings across multiple models and corpora. Furthermore, aside from the two auxiliary tasks \textit{(language modeling} \cite{magooda2020attend} and \textit{extractive summarization} \cite{pasunuru2017towards}) that have been examined before in the context of multitask summarization, we introduce two new additional auxiliary tasks \textit{(paraphrase detection, concept detection)(Section \ref{sec:aux_tasks})}. Finally, while previous work relied on large training corpora (e.g. CNN/DailyMail~\cite{hermann2015teaching}), we target low resource domains and try to overcome data scarceness by using the same data to train multiple task modules.
\textbf{Low resource training data.}
While most abstractive summarization work takes advantage of large corpora such as CNN/DailyMail, New York Times, PubMed, etc. to train models from scratch \cite{hermann2015teaching,nallapati2016abstractive,cohan2018discourse}, recent work has also targeted low resource domains. Methods proposed to tackle little training data have included data synthesis
\cite{parida2019abstract,magooda2020abstractive}, few shot learning \cite{bravzinskas2020few}, and pretraining \cite{yu2021adaptsum}. Our approach is different in that we use the same data multiple times in a multitask setting to boost performance.
\section{Summarization Datasets}
\textbf{CourseMirror (CM)}\footnote{https://petal-cs-pitt.github.io/data.html}\label{data:cmirror}
is a student reflection dataset previously used to study both extractive \cite{luo2015summarizing} and abstractive \cite{magooda2020abstractive} summarization. The dataset consists of documents (i.e., a set of student responses to a reflective instructor prompt regarding a course lecture) and summaries from four course instantiations: CS, ENGR, S2015, and S2016.
\begin{table}[t]
\small
\begin{center}
\begin{tabular}{|l|c||c|c|c|}
\hline
\textbf{Data} & \textbf{\# Docs} & \textbf{Train} & \textbf{Val} & \textbf{Test}\\
\hline
CS & 138 & 209 & 23 & 138 \\
\hline
ENGR & 52 & 286 & 32 & 52 \\
\hline
S2015 & 88 & 254 & 28 & 88 \\
\hline
S2016 & 92 & 250 & 28 & 92 \\
\hline
CNN-5\% & 2500 & 1500 & 500 & 500 \\
\hline
Amazon/Yelp & 160 & 58 & 42 & 60\\
\hline
\end{tabular}
\end{center}
\caption{\label{dataset_summary} Dataset summary.}
\end{table}
\textbf{CNN/DailyMail (CNN-5\%)}\label{data:cnn}
is a widely used summarization dataset consisting of around 300k news-oriented documents \cite{hermann2015teaching}. Since the focus of our research is low resource data, we randomly select 5\% (500 documents) from the CNN/DailyMail test and validation sets. Then, to keep the CNN-5\% data distribution similar to CM (3 courses for training, 1 for testing), we randomly sample 1500 documents for the training set.
\textbf{Amazon/Yelp\footnote{https://github.com/abrazinskas/FewSum}}
is a dataset of opinions~\cite{bravzinskas2020few} that is both small as well as similar to CourseMirror in that documents consist of multiple human comments where order doesn't matter.
This dataset contains customer reviews from Amazon
and Yelp
of 160 products/businesses. For each of these, 8 reviews to be summarized are
selected from the full set of reviews.
Table \ref{dataset_summary} summarizes each dataset in terms of the number of documents
and their distribution into training, validation, and test sets. The PDF appendix contains examples from each dataset.
\section{Proposed Models}
This section describes the different tasks used for multitask learning with the intuition behind them, followed by the two summarization models used.
\subsection{Auxiliary Tasks}
\label{sec:aux_tasks}
\textbf{Extractive summarization (E)} aims to classify parts of a document (typically sentences) as either important (i.e. included in a summary) or not. It has been used as as an auxiliary abstractive summarization task~\cite{chen2019multi,hsu2018unified} as it can help the model focus on important sentences.
\textbf{Concept detection (C)} detects important concepts (keywords) within an input text. Humans can have a general understanding of a topic's main idea by looking through concepts or keywords (e.g., keywords integrated into early pages of research papers or books). Thus, we hypothesize that this task can help the model focus more on major keywords.
\label{task:para}\textbf{Paraphrase detection (P)} aims to classify a pair of sentences as to whether they are conveying the same ideas using different wordings. We hypothesize that the relation between input documents and summaries can be viewed as a potential paraphrasing. We use the MSRP paraphrase dataset \cite{dolan2005automatically}, in addition to summarization datasets, to train a paraphrase detection task.
\textbf{Language modeling (L)}, in general, can help improve generative tasks. Training with LMs aims to skew the vocabulary slightly into the training data distribution.
\subsection{BERT Multitask Integration\footnote{https://github.com/amagooda/MultiAbs.git}}
We use a pretrained BERT \cite{devlin2018bert} model as a shared sequence encoder followed by a set of different task-specific modules (Figure \ref{fig:model_fig}). In the {\bf single task} setting, only abstractive summarization is performed. In the {\bf multitask} setting (integrating one or more auxiliary tasks), encoder weights are also fine-tuned alongside the rest of the model.
\begin{figure}[htpb]
\centering
\includegraphics[width=.95\linewidth]{multi_model.png}
\caption{Proposed BERT-Multitask model.}
\label{fig:model_fig}
\end{figure}
\textbf{Abstractive summarization (A)}. While recent work often uses transformers to overcome issues of sequence length \cite{yan2020prophetnet}, LSTM based decoders consistently outperform transformer-based ones when trained from scratch on our small CM dataset. Thus, we use LSTMs for our abstractive summarization (primary) task.
\textbf{Extractive summarization (E)}: The model consists of a linear layer to classify a sentence as part of the summary or not. Document and input sentence are fed to BERT encoder in the format \textbf{[CLS] DW$_{1}$ DW$_{2}$...DW$_{n}$[SEP]SW$_{1}$ SW$_{2}$....SW$_{m}$}, where DW$_{i}$ is the i\textsuperscript{th} word of the input document, SW$_{i}$ is the i\textsuperscript{th} word of the sentence to classify, and ([CLS], [SEP]) are respectively the starting and separation tokens used by BERT.
\textbf{Concept detection (C)}: The module's objective is to classify each word within a sequence as either a part of a concept or not. The module consists of a fully connected layer following the BERT encoder. We prepare the data by extracting concepts using a TF-IDF ranking algorithm \cite{thaker2019student}.
\label{task:para_2}\textbf{Paraphrase detection (P)}: The module consists of a fully connected layer classifier. Similar to extractive summarization, the input is passed to BERT in the format \textbf{[CLS]Sent$_1$[SEP]Sent$_2$}. Sent$_1$ and Sent$_2$ are the two input sentences for the MSRP dataset, and the input document and human summary for the summarization datasets.
\textbf{Language modeling (L)}: The language modeling module consists of a masked language modeling (MLM) attention head, fine-tuned using the MLM objective. Following the original BERT training from \citet{devlin2018bert}, input tokens are masked with probability 15\%, where masked tokens are either replaced by a special token (80\%), random word (10\%) or left unchanged (10\%).
\textbf{Model training}:
We train the model by training sub-modules consecutively. Thus, for each of the training epochs, we first train one of the sub-modules (e.g. abstractive) using the corresponding data batches, then we move to another sub-module (e.g. extractive), and so on. Each submodule is trained with Maximum likelihood estimation (MLE). We perform training using multiple optimizers. The intuition is to tune different modules with different rates. We tune the whole model using 3 optimizers: one for the BERT encoder, another for the abstractive decoder, and the last for the other modules. All optimizers are Adam optimizers, with different initial learning rates 5e\textsuperscript{-4}, 5e\textsuperscript{-3}, and 5e\textsuperscript{-5} for BERT encoder, abstractive decoder, and other modules respectively. We also performed experiments using a single optimizer for the whole model. Multiple optimizers consistently outperform a single optimizer.
\subsection{T5 Multitask Integration}
\label{sec:t5}
We also make use of the T5 \cite{raffel2019exploring}, which stores a large amount of knowledge about language and tasks.
In the {\bf single task} setting, we fine-tune a pretrained T5 on the abstractive task ({\bf A}), using the low resource datasets.
In the {\bf multitask} settings, we adopt the T5 framework to train the mixture of tasks as text-to-text, which allows us to fine-tune in the same model simultaneously. Figure \ref{fig:fig} shows the settings used for training T5 model for both Single abstractive summarization task, and the multitask training with mixture of tasks. Since T5 is pretrained with CNN/DM, we don't perform experiments with CNN-5\% using T5. Also note that unlike BERT, T5 represents any task as language modeling. Thus,
we dropped the language modeling auxiliary task for T5, as it would be a form of redundancy.
\begin{figure}[htpb]
\centering
\begin{subfigure}{0.5\textwidth}
\centering
\includegraphics[width=.95\linewidth]{t5_abs.PNG}
\caption{Fine-tune T5 on Abstracive Summarization Dataset}
\label{fig:t5_abs}
\end{subfigure}\\
\begin{subfigure}{.5\textwidth}
\centering
\includegraphics[width=.95\linewidth]{t5_multitask2.PNG}
\caption{Fine-tune T5 on Mixture of tasks}
\label{fig:t5_multi}
\end{subfigure}
\caption{Different fine-tuning conditions for T5.
\textit{\textbf{(- -)} indicates optional additive data for Paraphrasing.}}
\label{fig:fig}
\end{figure}
\section{Experiments, Results and Discussion}
\begin{table}[!t]
\begin{center}
\small
\begin{tabular}{|l|c|c|c|
\hline
Tasks & R1 & R2 & RL\\% & Avg\\
\hline
Single task (A) & 26.82 & 4.71 & 21.5\\% & 17.68\\
\hline
A C & \cellcolor{DarkGray} 27.11 & \cellcolor{DarkGray} 4.75 & 21.1\\% & 17.66\\ \hline
\hline
A E & \cellcolor{DarkGray} 28.51 & \cellcolor{DarkGray} 4.91 & 21.41\\% & \cellcolor{DarkGray} 18.28\\
\hline
{A P} & \cellcolor{DarkGray} 27.83 & \cellcolor{DarkGray} 5.99 & \bf \cellcolor{DarkGray} 23.05\\% & \bf \cellcolor{DarkGray} 19.95\\
\hline
A L & \cellcolor{DarkGray} 27.22 & \cellcolor{DarkGray} 5.47 & 21.31\\% & \cellcolor{DarkGray} 18\\
\hline
{A E L} & \cellcolor{DarkGray} 28.36 & \cellcolor{DarkGray} 5.62 & \cellcolor{DarkGray} {21.6}\\% & \cellcolor{DarkGray}{18.53}\\
\hline
{A E P} & \cellcolor{DarkGray} 27.68 & \cellcolor{DarkGray} 5.24 & \cellcolor{DarkGray}{21.81}\\% & \cellcolor{DarkGray}{18.24}\\
\hline
{A E C} & \cellcolor{DarkGray}{27.41} & \cellcolor{DarkGray}{5.81} & \cellcolor{DarkGray}{22.13}\\% & \cellcolor{DarkGray}{18.45}\\
\hline
{A C P} & \bf \cellcolor{DarkGray}{29} & \bf \cellcolor{DarkGray}{6.43} & \cellcolor{DarkGray}{22.2}\\% & \cellcolor{DarkGray}{19.23}\\
\hline
A L P & \cellcolor{DarkGray} 27.71 & \cellcolor{DarkGray} 5.82 & 21.14\\% & \cellcolor{DarkGray} 18.22\\
\hline
A L C & \cellcolor{DarkGray} 27.39 & \cellcolor{DarkGray} 6.09 & 21.36\\% & \cellcolor{DarkGray} 18.28\\
\hline
ALL & \cellcolor{DarkGray} 27.72 & \cellcolor{DarkGray} 5.55 & 21.31\\% & \cellcolor{DarkGray} 18.73\\
\hline
\end{tabular}
\end{center}
\caption{\label{tab:BERTmodels_results} ROUGE results of {\it BERT} multitask on {\it CM}. Gray indicates multitask R is higher than single task score. \textbf{Boldface} indicates best R across tasks. {\it (Q1, Q2)}}
\end{table}
Our experiments evaluate performance using ROUGE \cite{lin2004rouge} on F1. For CM data we
report mean ROUGE using a leave-one-course-out validation\footnote{Individual course ROUGE scores are in the Appendix.}, while for CNN-5\% and Amazon-Yelp we report ROUGE using held-out test sets.
\hyperref[rquestions]{\textbf{Q1}}: The gray cells in Table \ref{tab:BERTmodels_results} show that BERT multitask
training for CM data can help improve single-task (A) training. For R1 and R2 we observe improvements across {\it all} task combinations. While some task combinations also improve RL ((A P), (A E L), (A E P), (A E C), (A C P)), others degrade performance, particularly when language modeling is involved (e.g., (A L), (A L P), (A L C), and (ALL)). Thus, while multitask training can be effective, we need to
further explore task choice.
{\textbf{Q2}}: Prior work showed the utility of extractive summarization \cite{hsu2018unified} and language models \cite{magooda2020attend} as auxiliary summarization tasks,
and we too observe similar behavior for R1 and R2 in Table~\ref{tab:BERTmodels_results}. For RL, however, (A E) and (A L) failed to improve the score.
Similarly, our new concept task (A C) improves R1 and R2 but not RL.
On the other hand, integrating our proposed paraphrasing task (A P) improves performance for all ROUGE scores. When we integrate two auxiliary tasks, (A E L), (A E P), (A E C), and (A C P)
improve all of R1, R2 and RL compared to single task performance. For RL, it seems that adding E with another auxiliary task rather than in isolation improves performance. Also, the (A C P) combination which uses our two proposed tasks (concept, paraphrasing) achieves the best R1, R2, RL in the 3-task setting.
\begin{table}[t]
\begin{center}
\small
\begin{tabular}{|l|c|c|c|
\hline
Tasks & R1 & R2 & RL\\% & Avg \\
\hline
Single Task (A) & 36.08 & 10.94 & 31.57\\% & 26.19 \\
\hline
A E & 29.99 & 8.80 & 24.80\\% & 21.20 \\
\hline
A C & 35.46 & 10.76 & 30.81\\% & 25.67 \\
\hline
{A P} & \bf \cellcolor{DarkGray}{36.75} & \bf \cellcolor{DarkGray}{12.13} & \bf \cellcolor{DarkGray}{32.30}\\% & \bf \cellcolor{DarkGray}{27.06} \\
\hline
A C P & \cellcolor{DarkGray} 36.28 & \cellcolor{DarkGray} 11.59 & \cellcolor{DarkGray} 31.58\\% & \cellcolor{DarkGray} 26.48 \\
\hline
A E C & 29.19 & 8.69 & 25.20\\% & 21.02 \\
\hline
ALL & 30.31 & 9.60 & 27.97\\% & 22.63 \\
\hline
\end{tabular}
\end{center}
\caption{\label{tab:T5models_results} ROUGE results of {\it T5} (No language modeling auxiliary task) fine-tuned on {\it CM}. \textit{(Q3)}
\end{table}
\hyperref[rquestions]{\textbf{Q3}}: Table \ref{tab:T5models_results} shows that some of the CM findings obtained using BERT multitask are similar when a different model such as T5 is used for CM. Similar to BERT, incorporating paraphrasing into T5 helps improve all ROUGE scores when used as a single auxiliary task (A P) and in combination with the concept task (A C P). On the other hand, the utility of (A E C) didn't transfer from BERT to T5.
\hyperref[rquestions]{\textbf{Q4}}: Shifting gears from changing the model to changing the data, Table \ref{tab:CNNBERTmodels_results} shows that when BERT multitask is applied to CNN-5\%,\footnote{Recall from Section~\ref{sec:t5} that T5 is not used for CNN-5\%.} there is now no task configuration that leads to improvement across all of R1, R2, and RL. However, the majority of combinations (6 of 11) improved two out of the three ROUGE scores, especially R2 and RL. Additionally, judging by ROUGE scores of certain combinations such as (A C) and (A P), we can see that the reduction in R1 (0.38, 0.47) is less than the improvements gained in R2 (0.39, 0.61) and far less than RL (2.05, 1.46) respectively. Thus, we can argue that paraphrasing auxiliary task tends to be very helpful either across different data or different models.
To further verify the utility of paraphrasing across datasets, we also evaluated the T5 model\footnote{We only examined T5 since for CM, the T5 ROUGE scores (Table~\ref{tab:T5models_results})
were higher than when using BERT (Table~\ref{tab:BERTmodels_results}).}
on the Amazon/Yelp dataset. However, due to the lack of extractive annotation for Amazon/Yelp, we only examine (A P), the best performing T5 combination for CM (Table~\ref{tab:T5models_results}). Table \ref{tab:T5models_results_2} shows that indeed paraphrasing is again helpful as an auxiliary task, as it improves all ROUGE scores for Amazon/Yelp.
\begin{table}[!t]
\begin{center}
\small
\begin{tabular}{|l|c|c|c|}
\hline
Tasks & R1 & R2 & RL \\%& Avg\\
\hline
Single Task (A) & 13.3 & 0.73 & 8.98\\% & 7.67 \\
\hline
A C & 12.92 & \cellcolor{DarkGray} 1.12 & \cellcolor{DarkGray} 11.03\\% & \bf \cellcolor{DarkGray} 8.36\\
\hline
A E & 12.9 & 0.33 & 8.76\\% & 7.33 \\
\hline
A P & 12.83 & \bf \cellcolor{DarkGray} 1.34 & \cellcolor{DarkGray} 10.44 \\%& \cellcolor{DarkGray} 8.2 \\
\hline
A L & \cellcolor{DarkGray} 13.43 & 0.65 & 8.36 \\%& 7.48\\
\hline
A E L & \bf \cellcolor{DarkGray} 14.18 & 0.36 & \cellcolor{DarkGray} 10.1 \\%& \cellcolor{DarkGray} 8.21\\
\hline
A E P & 12.82 & 0.64 & 8.53 \\%& 7.33\\
\hline
A E C & 11.52 & \cellcolor{DarkGray} 1.05 & \bf \cellcolor{DarkGray} 11.23 \\%& \cellcolor{DarkGray} 7.93\\
\hline
A C P & 11.08 & \cellcolor{DarkGray} 1.09 & \cellcolor{DarkGray} 10.95 \\%& \cellcolor{DarkGray} 7.71 \\
\hline
A L P & 12.79 & 0.53 & 8.94 \\%& 7.42\\
\hline
A L C & 10.35 & 0.09 & \cellcolor{DarkGray} 9.81 \\%& 6.75\\
\hline
ALL & 11.15 & \cellcolor{DarkGray} 1.26 & \cellcolor{DarkGray} 10.49 \\%& 7.63\\
\hline
\end{tabular}
\end{center}
\caption{\label{tab:CNNBERTmodels_results} ROUGE results of {\it BERT} on {\it CNN-5\%}. \textit{(Q4)}}
\end{table}
\begin{table}[!t]
\small
\begin{center}
\begin{tabular}{|l|c|c|c|}
\hline
Tasks & R1 & R2 & RL \\%& Avg\\
\hline
\citeauthor{bravzinskas2020few}& 36.25 & 9 & 22.36 \\%& 22.53\\
\hline
Single task (A) & 34 & 8.8 & 21.25 \\%& 21.3\\
\hline
{A P} & \bf \cellcolor{DarkGray} 34.1 & \cellcolor{DarkGray}{\textbf{9.1}} & \bf \cellcolor{DarkGray} 21.7 \\%& \bf \cellcolor{DarkGray} 21.6 \\
\hline
\end{tabular}
\caption{\label{tab:T5models_results_2} ROUGE results of {\it T5} fine-tuned with paraphrasing on {\it Amazon/Yelp}. \textit{(Q4)}}
\end{center}
\end{table}
Finally, while the objective of our work is to explore the utility of auxiliary tasks across models and data, rather than to outperform the prior SOTA, we briefly compare our results to prior work where possible. For CM, multiple task combinations outperform the data synthesis method (CM + synthetic) from \citet{magooda2020abstractive} on R2 and RL. For example, while (A C P) yielded 0.63 less R1, it had 0.98 and 1.52 higher R2 and RL, respectively.
For Amazon/Yelp, while our approach increases R2 by 0.1 compared to \citet{bravzinskas2020few}, the R1 and RL scores are lower by 2.15 and .66, respectively. These results show that there is still room for improvement, particularly for R1, and suggest a future combination of our approach with such alternative low-resource methods.
\section{Conclusion and Future Work}
We explored the utility of multitask training for abstractive summarization, using three low resource datasets (CM, CNN-5\%, Amazon/Yelp)
and two fundamentally different models (BERT, T5) with different preconditions (i.e. BERT not pretrained with summarization dataset versus T5 pretrained with CNN dataset) to verify any observed behavior. We also integrated four different auxiliary tasks, in isolation and together. We conducted several experiments to find if training a multitask model, in general, is helpful, or if some tasks might introduce degradation in model performance. We showed that indeed some tasks might help improve ROUGE scores and some might not help, at least when trained in a low resource setting.
We found that among all task combinations, \textbf{(Abstractive + Paraphrase detection)} improved almost all ROUGE scores across different datasets (CM , Amazon/Yelp, and CNN-5\%) and different
models (BERT, and T5),
with \textbf{(Abstractive + Concept detection + Paraphrase detection)} as another good candidate. We also found that paraphrasing and concept detection, which had not been previously examined as auxiliary abstractive summarization tasks, can be helpful for low resource data.
In the future, we plan to continue exploring the generality of our findings, by
include new types of low resource data (e.g. discussions, emails),
BART as one of the SOTA models, and new auxiliary tasks. We also plan to combine multitask learning with other low resource methods (e.g., data synthesis).
\section*{Acknowledgements}
The research reported here was supported, in whole or in
part, by the institute of Education Sciences, U.S. Department
of Education, through Grant R305A180477 to the University of Pittsburgh. The opinions expressed are those of the
authors and do not represent the views of the institute or the
U.S. Department of Education. We like to thank Khushboo Thaker for helping generating concepts, the Pitt PETAL group and the anonymous reviewers for advice in improving this paper.
| {'timestamp': '2021-09-20T02:18:36', 'yymm': '2109', 'arxiv_id': '2109.08565', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08565'} | arxiv |
\section*{Acknowledgment}
This work has been supported by ``Fondazione di Modena'' and by the ``European Training Network on PErsonalized Robotics as SErvice Oriented applications'' (PERSEO) MSCA-ITN-2020 project (Grant Agreement 955778).
\bibliographystyle{IEEEtran}
\section{Introduction}
\label{sec:introduction}
\IEEEPARstart{R}{obotic} exploration is the task of autonomously navigating an unknown environment with the goal of gathering sufficient information to represent it, often via a spatial map~\cite{stachniss2009robotic}. This ability is key to enable many downstream tasks such as planning~\cite{selin2019efficient} and goal-driven navigation~\cite{savva2019habitat,wijmans2019dd,morad2021embodied}.
Although a vast portion of existing literature tackles this problem~\cite{osswald2016speeding,chaplot2019learning,chen2019learning,ramakrishnan2020occupancy}, it is not yet completely solved, especially in complex indoor environments.
The recent introduction of large datasets of photorealistic indoor environments~\cite{chang2017matterport3d,xia2018gibson} has eased the development of robust exploration strategies, which can be validated safely and quickly thanks to powerful simulating platforms~\cite{deitke2020robothor,savva2019habitat}. Moreover, exploration algorithms developed on simulated environments can be deployed in the real world with little hyperparameter tuning~\cite{kadian2020sim2real,bigazzi2021out,truong2021bi}, if the simulation is sufficiently realistic.
Most of the recently devised exploration algorithms exploit deep reinforcement learning (DRL)~\cite{zhu2018deep}, as learning-based exploration and navigation algorithms are more flexible and robust to noise than geometric methods~\cite{chen2019learning,niroui2019deep,ramakrishnan2021exploration}.
Despite these advantages, one of the main challenges in training DRL-based exploration algorithms is designing appropriate rewards.
\begin{figure}[t!]
\centering
\includegraphics[width=.9\columnwidth]{images/overview_impact.pdf}
\caption{We propose an impact-based reward for robot exploration of continuous indoor spaces. The robot is encouraged to take actions that maximize the difference between two consecutive observations.}
\label{fig:overview}
\end{figure}
In this work, we propose a new reward function that employs the impact of the agent actions on the environment, measured as the difference between two consecutive observations~\cite{raileanu2020ride}, discounted with a pseudo-count~\cite{bellemare2016unifying} for previously-visited states (see Fig~\ref{fig:overview}).
So far, impact-based rewards~\cite{raileanu2020ride} have been used only as an additional intrinsic reward in procedurally-generated (grid-like mazes) or singleton (the test environment is the same employed for training) synthetic environments.
Instead, our reward can deal with photorealistic non-singleton environments. To the best of our knowledge, this is the first work to apply impact-based rewards to this setting.
Recent research on robotic exploration proposes the use of an extrinsic reward based on occupancy anticipation~\cite{ramakrishnan2020occupancy}.
This reward encourages the agent to navigate towards areas that can be easily mapped without errors. Unfortunately, this approach presents two major drawbacks. First, one would need the precise layout of the training environments in order to compute the reward signal. Second, this reward heavily depends on the mapping phase, rather than focusing on what has been already seen. In fact, moving towards new places that are difficult to map would produce a very low occupancy-based reward.
To overcome these issues, a different line of work focuses on the design of intrinsic reward functions, that can be computed by the agent by means of their current and past observations. Some examples of recently proposed intrinsic rewards for robot exploration are based on curiosity~\cite{bigazzi2020explore}, novelty~\cite{ramakrishnan2021exploration}, and coverage~\cite{chaplot2019learning}. All these rewards, however, tend to vanish with the length of the episode because the agent quickly learns to model the environment dynamics and appearance (for curiosity and novelty-based rewards) or tends to stay in previously-explored areas (for the coverage reward). Impact, instead, provides a stable reward signal throughout all the episode~\cite{raileanu2020ride}.
Since robotic exploration takes place in complex and realistic environments (Fig.~\ref{fig:overview}) that can present an infinite number of states, it is impossible to store a visitation count for every state. Furthermore, the vector of visitation counts would consist of a very sparse vector, and that would cause the agent to give the same impact score to nearly identical states. To overcome this issue, we introduce an additional module in our design to keep track of a pseudo-count for visited states. The pseudo-count is estimated by a density model trained end-to-end and together with the policy.
We integrate our newly-proposed reward in a modular embodied exploration and navigation system inspired by that proposed by Chaplot~\textit{et al}.~\cite{chaplot2019learning} and consider two commonly adopted collections of photorealistic simulated indoor environments, namely the Gibson~\cite{xia2018gibson} and Matterport 3D (MP3D)~\cite{chang2017matterport3d}. Furthermore, we also deploy the devised algorithm in the real world. The results in both simulated and real environments are promising: we outperform state-of-the-art baselines in simulated experiments and demonstrate the effectiveness of our approach in real-world experiments.
\section{Related Work}
\label{sec:related}
\subsection{Geometric Robot Exploration Methods}
Classical heuristic and geometric-based exploration methods rely on two main strategies: frontier-based exploration~\cite{yamauchi1997frontier} and next-best-view planning~\cite{gonzalez2002navigation}. The former entails iteratively navigating towards the closest point of the closest frontier, which is defined as the boundary between the explored free space and the unexplored space. The latter entails sequentially reaching cost-effective unexplored points, \textit{i}.\textit{e}.,~points from where the gain in the explored area is maximum, weighed by the cost to reach them. These methods have been largely used and improved~\cite{holz2010evaluating,bircher2016receding,niroui2019deep} or combined in a hierarchical exploration algorithm~\cite{zhu2018deep,selin2019efficient}. However, when applied with noisy odometry and localization sensors or in highly complex environments, geometric approaches tend to fail~\cite{chen2019learning,niroui2019deep,ramakrishnan2021exploration}. In light of this, increasing research effort has been dedicated to the development of learning-based approaches, which usually exploit DLR to learn robust and efficient exploration policies.
\subsection{Intrinsic Exploration Rewards} The lack of ground-truth in the exploration task forces the adoption of reinforcement learning (RL) for training exploration methods.
Even when applied to tasks different from robot exploration, RL methods have low sample efficiency. Thus, they require designing intrinsic reward functions that encourage visiting novel states or learning the environment dynamics. The use of intrinsic motivation is beneficial when external task-specific rewards are sparse or absent.
Among the intrinsic rewards that motivate the exploration of novel states, Bellemare~\textit{et al}.~\cite{bellemare2016unifying} introduced the notion of pseudo visitation count by using a Context-Tree Switching (CTS) density model to extract a pseudo-count from raw pixels and applied count-based algorithms. Similarly, Ostrovski~\textit{et al}.~\cite{ostrovski2017count} applied the autoregressive deep generative model PixelCNN~\cite{oord2016conditional} to estimate the pseudo-count of the visited state.
Rewards that encourage the learning of the environment dynamics comprehend Curiosity~\cite{pathak2017curiosity}, Random Network Distillation (RND)~\cite{burda2018exploration}, and Disagreement~\cite{pathak2019self}.
Curiosity forces the agent towards areas that maximize to prediction error for future states. RND exploits the prediction error of the state encodings made with a fixed random initialized network. Disagreement employs an ensemble of dynamics models and rewards the agent for visiting states where the disagreement of the ensemble is high.
Recently, Raileanu~\textit{et al}.~\cite{raileanu2020ride} proposed to jointly encourage both the visitation of novel states and the learning of the environment dynamics. However, their approach is developed for grid-like environments with a finite number of states, where the visitation count can be easily employed as a discount factor. In this work, we improve Impact, a paradigm that rewards the agent proportionally to the change in the state representation caused by its actions, and design a reward function that can deal with photorealistic scenes with non-countable states.
\subsection{Learning-based Robot Exploration Methods}
In the context of robotic exploration and navigation tasks, the introduction of photorealistic simulators has represented a breeding ground for the development of self-supervised DRL-based visual exploration methods. Ramakrishnan~\textit{et al}.~\cite{ramakrishnan2021exploration} identified four paradigms for visual exploration: novelty-based, curiosity-based (as defined above), reconstruction-based, and coverage-based. Each paradigm is characterized by a different reward function used as a self-supervision signal for optimizing the exploration policy. In particular, novelty discourages re-visiting the same areas as it is defined as the inverse visitation counts for each area; reconstruction favors reaching positions from which it is easier to predict unseen observations of the environment; and coverage maximizes the information gathered at each time-step, being it the number of objects or landmarks reached or area seen.
A coverage-based reward, considering the area seen, is also used in the successful modular approach to Active SLAM presented by Chaplot~\textit{et al}.~\cite{chaplot2019learning}, which combines a neural mapper module with a hierarchical navigation policy. To enhance exploration efficiency in complex environments, Ramakrishnan~\textit{et al}.~\cite{ramakrishnan2020occupancy} resorted to an extrinsic reward by introducing the occupancy anticipation reward, which aims to maximize the agent accuracy in predicting occluded unseen areas.
\begin{figure*}[t!]
\centering
\includegraphics[width=\textwidth]{images/fig2.pdf}
\caption{Our modular exploration architecture consists of a Mapper that iteratively builds a top-down occupancy map of the environment, a Pose Estimator that predicts the pose of the robot at every step, and a hierarchical self-supervised Navigation Module in charge of sequentially setting exploration goals and predicting actions to navigate towards it. We exploit the impact-based reward to guide the exploration and adapt it for continuous environments, using an Observation Encoder to extract observation features and depending on the method, a Density Model or a Grid to compute the pseudo-count.}
\label{fig:method}
\end{figure*}
\subsection{Deep Generative Models} Deep generative models are trained to approximate high-dimensional probability distributions by means of a large set of training samples. In recent years, literature on deep generative models followed three main approaches: latent variable models like VAE~\cite{kingma2013auto}, implicit generative models like GANs~\cite{goodfellow2014generative}, and exact likelihood models.
Exact likelihood models can be classified in non-autoregressive flow-based models, like RealNVP~\cite{dinh2016density} and Flow++~\cite{ho2019flow++}, and autoregressive models, like PixelCNN/RNN~\cite{oord2016conditional} and Image Transformer~\cite{parmar2018image}. Non-autoregressive flow-based models consist of a sequence of invertible transformation functions to compose a complex distribution modeling the training data. Autoregressive models decompose the joint distribution of images as a product of conditional probabilities of the single pixels. Usually, each pixel is computed using as input only the previous predicted ones, following a raster scan order. In this work, we employ PixelCNN/RNN~\cite{oord2016conditional} to learn a probability distribution over possible states and estimate a pseudo visitation count.
\section{Proposed Method}
\label{sec:method}
\subsection{Exploration Architecture}
Following the current state-of-the-art architectures for navigation for embodied agents, the proposed method comprises three main components: a CNN-based mapper, a pose estimator, and a hierarchical navigation policy. The navigation policy defines the actions of the agent, the mapper builds a top-down map of the environment to be used for navigation, and the pose estimator locates the position of the agent on the map. Our architecture is depicted in Fig.~\ref{fig:method} and described below.
\subsubsection{Mapper}
The mapper generates a map of the free and occupied regions of the environment discovered during the exploration. At each time step, the RGB observation $o^{rgb}_t$ and the depth observation $o^{d}_t$ are processed to output a two-channel $V\times V$ local map $l_t$ depicting the area in front of the agent, where each cell of the local map describes the state of a $5\times 5$ cm area of the environment, the channels measure the probability of a cell being occupied and being explored. The local maps are aggregated and registered to the $W\times W\times 2$ global map $M_t$ of the environment using the estimated pose $(x_t, y_t, \theta_t)$ from the pose estimator. The resulting global map is used by the navigation policy for action planning.
\subsubsection{Pose Estimator} The pose estimator is used to predict the displacement of the agent in consequence of an action. The considered atomic actions $a_t$ of the agent are: \textit{go forward 0.25m, turn left 10°, turn right 10°}. However, the noise in the actuation system and the possible physical interactions between the agent and the environment could produce unexpected outcomes causing positioning errors. The pose estimator reduces the effect of such errors by predicting the real displacement $(\Delta x_t, \Delta y_t, \Delta\theta_t)$. The input of this module consists of the RGB-D observations $(o^{rgb}_{t-1}, o^{rgb}_{t})$ and $(o^d_{t-1}, o^d_t)$ and the local maps $(l_{t-1}, l_t)$. Each modality $i = 0, 1, 2$ is encoded singularly to obtain three different estimates of the displacement:
\begin{equation}
g_i(e_{t-1}, e_t) = W_1 \text{max}(W_2(e_{t-1}, e_t) + b_2,0) + b_1,
\label{eq:g_i}
\end{equation}
where $e_t \in \{o^{rgb}_t, o^d_t, l_t\}$ and $W_{1,2}$ and $b_2$ are weights matrices and bias. Eventually, the displacement estimates are aggregated with a weighted sum:
\begin{align}
\alpha_i = \text{softmax}(\text{MLP}_i([\bar{o}^r_t, \bar{o}^d_t, \bar{l}_t])), \\
(\Delta x_t,\Delta y_t,\Delta \theta_t) = \sum_{i=0}^{2}{\alpha_i \cdot g_i},
\label{eq:displacement}
\end{align}
where MLP is a three-layered fully-connected network, ($\bar{o}^r_t$, $\bar{o}^d_t$, $\bar{l}_t$) are the inputs encoded by a CNN, and $[\cdot, \cdot, \cdot]$ denotes tensor concatenation. The estimated pose of the agent at time $t$ is given by:
\begin{equation}
(x_t, y_t, \theta_t) = (x_{t-1}, y_{t-1}, \theta_{t-1}) + (\Delta x_t,\Delta y_t,\Delta \theta_t).
\label{eq:pose}
\end{equation}
Note that, at the beginning of each exploration episode, the agent sets its position to the center of its environment representation, \textit{i}.\textit{e}.,
\begin{equation}
(x_0, y_0, \theta_0) = (0, 0, 0).
\label{eq:initial_pose}
\end{equation}
\subsubsection{Navigation Module}
The sampling of the atomic actions of the agent relies on the hierarchical navigation policy that is composed of the following modules: the global policy, the planner, and the local policy.
The global policy samples a point on an augmented global map of the environment, $M_t^+$, that represents the current global goal of the agent. The augmented global map $M_t^+$ is a $W\times W\times 4$ map obtained by stacking the two-channel global map $M_t$ from the Mapper with the one-hot representation of the agent position $(x_t, y_t)$ and the map of the visited positions, which collects the one-hot representations of all the positions assumed by the agent from the beginning of the exploration.
Moreover, $M_t^+$ is in parallel cropped with respect to the position of the agent and max-pooled to a spatial dimension $H\times H$ where $H<W$. These two versions of the augmented global map are concatenated to form the $H\times H\times 8$ input of the global policy that is used to sample a goal in the global action space $H\times H$. The global policy is trained with reinforcement learning with our proposed impact-based reward $r^{global}_t$, defined below, that encourages exploration.
The planner consists of an A* algorithm that uses the global map and the global goal to plan a path towards the global goal and samples a local goal within $1.25$m from the position of the agent.
The local policy outputs the atomic actions of the agent to reach the local goal and is trained to minimize the euclidean distance to the local goal, which is expressed via the following reward:
\begin{equation}
r^{local}_t = d_t - d_{t-1},
\label{eq:r_local}
\end{equation}
where $d_t$ is the euclidean distance to the local goal at time step $t$.
Note that the output actions in our setup are discrete. These platform-agnostic actions can be translated into signals for specific robots actuators, as we do in this work. Alternatively, based on the high-level predicted commands, continuous actions can be predicted, \textit{e}.\textit{g}.~in the form of linear and angular velocity commands to the robot, by using an additional, lower-level policy, as done in~\cite{irshad2021hierarchical}. The implementation of such policy is beyond the scope of our work.
Following the hierarchical structure, the global goal is reset every $\eta$ steps, and the local goal is reset if at least one of the following conditions verifies: a new global goal is sampled, the agent reaches the local goal, the local goal location is discovered to be in a occupied area.
\subsection{Impact-Driven Exploration}
The exploration ability of the agent relies on the design of an appropriate reward for the global policy. In this setting, the lack of external rewards from the environment requires the design of a dense intrinsic reward. To the best of our knowledge, our proposed method presents the first implementation of impact-driven exploration in photorealistic environments. The key idea of this concept is encouraging the agent to perform actions that have impact on the environment and the observations retrieved from it, where the impact at time step $t$ is measured as the $l_2$-norm of the encodings of two consecutive states $\phi(s_{t-1})$ and $\phi(s_{t})$, considering the RGB observation $o_t^{rgb}$ as the state $s_{t}$. The reward of the global policy for the proposed method is calculated as:
\begin{equation}
r^{global}_t(s_{t-1}, s_{t}) = \frac{\left\| \phi(s_{t}) - \phi(s_{t-1}) \right\|_2}{\sqrt{N(s_{t})}},
\label{eq:global_reward}
\end{equation}
where $N(s_{t})$ is the visitation count of the state at time step $t+1$, \textit{i}.\textit{e}.,~how many times the agent has observed $s_{t}$. The visitation count is used to drive the agent out of regions already seen in order to avoid trajectory cycles.
\subsubsection{Visitation Counts}
The concept of normalizing the reward using visitation count fails when the environment is continuous, since during exploration is unlikely to visit exactly the same state more than once. In fact, even microscopic changes in terms of translation or orientation of the agent cause shifts in the values of the RGB observation, thus resulting in new states.
Therefore, using a photorealistic continuous environment nullifies the scaling property of the denominator of the global reward in Eq.~\ref{eq:global_reward} because every state $s_t$ during the exploration episode is, most of the times, only encountered for the first time. To overcome this limitation, we implement two types of pseudo-visitation counts $\hat{N}(s_t)$ to be used in place of $N(s_t)$, which extend the properties of visitation counts to continuous environments: \textit{Grid} and \textit{Density Model Estimation}.
\vspace{.1cm}
\tinytextit{Grid} With this approach, we consider a virtual discretized grid of cells with fixed size in the environment. We then assign a visitation count to each cell of the grid. To this end, we take the global map of the environment and divide it into cells of size $G\times G$. The estimated pose of the agent, regardless of its orientation $\theta_t$, is used to select the cell that the agent occupies at time $t$.
In the \textit{Grid} formulation, the visitation count of the selected cell is used as $N(s_t)$ in Eq.~\ref{eq:global_reward} and is formalized as:
\begin{equation}
\hat{N}(s_t) = \hat{N}(g(x_t, y_t)),
\label{eq:pseudo_grid}
\end{equation}
where $g(\cdot)$ returns the block corresponding to the estimated position of the agent.
\tinytextit{Density Model Estimation (DME)}
Let $\rho$ be an autoregressive density model defined over the states $s \in S$, where $S$ is the set of all possible states.
We call $\rho_n(s)$ the probability assigned by $\rho$ to the state $s$ after being trained on a sequence of states $s_1, ..., s_n$, and $\rho'_n(s)$, or recoding probability, the probability assigned by $\rho$ to $s$ after being trained on $s_1, ..., s_n, s$.
The prediction gain $PG$ of $\rho$ describes how much the model has improved in the prediction of $s$ after being trained on $s$ itself, and is defined as
\begin{equation}
PG_n(s) = \log \rho'_n(s) - \log \rho_n(s).
\label{eq:prediction_gain}
\end{equation}
In this work, we employ a lightweight version of Gated PixelCNN~\cite{oord2016conditional} as density model. To compute the input of the PixelCNN model, we transform the RGB observation $o^r_t$ to grayscale and we crop and resize it to a lower size $P\times P$. The transformed observation is quantized to $B$ bins to form the final input to the model, $s_t$. The model is trained to predict the conditional probabilities of the pixels in the transformed input image, with each pixel depending only on the previous ones following a raster scan order. The output has shape $P\times P\times B$ and each of its elements represents the probability of a pixel belonging to each of the $B$ bins. The joint distribution of the input modeled by PixelCNN is:
\begin{equation}
p(s_t) = \prod_1^{P^2}p(\chi_i|\chi_1,...,\chi_{i-1}),
\label{eq:pixel_cnn}
\end{equation}
where $\chi_i$ is the $i^{\textit{th}}$ pixel of the image $s_t$. $\rho$ is trained to fit $p(s_t)$ by using the negative log-likelihood loss.
Let $\hat{n}$ be the pseudo-count total, \textit{i}.\textit{e}.,~the sum of all the visitation counts of all states during the episode. The probability and the recoding probability of $s$ can be defined as:
\begin{align}
\rho_n(s) &= \frac{\hat{N}_n(s)}{\hat{n}}, & \rho'_n(s) &= \frac{\hat{N}_n(s) + 1}{\hat{n} + 1}.
\label{eq:probabilities}
\end{align}
Note that, if $\rho$ is learning-positive, \textit{i}.\textit{e}.,~if $PG_n(s) > 0$ for all possible sequences $s_1,...,s_n$ and all $s \in S$, we can approximate $\hat{N}_n(s)$ as:
\begin{equation}
\hat{N}_n(s) = \frac{\rho_n(s)(1-\rho'_n(s))}{\rho'_n(s)-\rho_n(s)} \approx (e^{PG_n(s)} - 1)^{-1}.
\label{eq:pseudo_count}
\end{equation}
To use this approximation in Eq.~\ref{eq:global_reward}, we still need to address three problems: it does not scale with the length of the episode, the density model could be not learning-positive, and $\hat{N}_n(s)$ should be large enough to avoid the reward becoming too large regardless the goal selection. In this respect, to take into account the length of the episode, we introduce a normalizing factor $n^{-1/2}$, where $n$ is the number of steps done by the agent since the start of the episode. Moreover, to force $\rho$ to be learning-positive, we clip $PG_n(s)$ to 0 when it becomes negative.
Finally, to avoid small values at the denominator of $r^{global}_t$ (Eq.~\ref{eq:global_reward}), we introduce a lower bound of 1 to the pseudo visitation count.
The resulting definition of $\hat{N}_n(s)$ in the \textit{Density Model Estimation} formulation is:
\begin{align}
\widetilde{PG}_n &= c \cdot n^{-1/2} \cdot (PG_n(s))_+, \\
\hat{N}_n(s) &= \max \Big\{\Big(e^{\widetilde{PG}_n(s)}-1\Big)^{-1}, 1\Big\},
\label{eq:pseudo_count_final}
\end{align}
where $c$ is a term used to scale the prediction gain
\section{Experimental Setup}
\label{sec:experiments}
\subsection{Datasets} For comparison with state-of-the-art DRL-based methods for embodied exploration, we employ the photorealistic simulated 3D environments contained in the Gibson dataset~\cite{xia2018gibson} and the MP3D dataset~\cite{chang2017matterport3d}. Both these datasets consist of indoor environments where different exploration episodes take place. In each episode, the robot starts exploring from a different point in the environment.
Environments used during training do not appear in the validation/test split of these datasets.
Gibson contains $106$ scans of different indoor locations, for a total of around $5$M exploration episodes ($14$ locations are used in $994$ episodes for test in the so-called Gibson Val split).
MP3D consists of $90$ scans of large indoor environments ($11$ of those are used in $495$ episodes for the validation split and $18$ in $1008$ episodes for the test split).
\subsection{Evaluation Protocol} Following the well-established evaluation protocol for embodied exploration in Habitat~\cite{savva2019habitat,chaplot2019learning,ramakrishnan2020occupancy}, we train our models on the Gibson train split. Then, we perform model selection basing on the results obtained on Gibson Val. We then employ the MP3D validation and test splits to benchmark the generalization abilities of the agents.
To evaluate exploration agents, we employ the following metrics. \textbf{IoU} between the reconstructed map and the ground-truth map of the environment: here we consider two different classes for every pixel in the map (free or occupied). Similarly, the map accuracy (\textbf{Acc}, expressed in $m^2$) is the portion of the map that has been correctly mapped by the agent. The area seen (\textbf{AS}, in $m^2$) is the total area of the environment observed by the agent. For both the IoU and the area seen, we also present the results relative to the two different classes: free space and occupied space respectively (\textbf{FIoU}, \textbf{OIoU}, \textbf{FAS}, \textbf{OAS}). Finally, we report the mean positioning error achieved by the agent at the end of the episode. A larger translation error (\textbf{TE}, expressed in $m$) or angular error (\textbf{AE}, in degrees) indicates that the agent struggles to keep a correct estimate of its position throughout the episode. For all the metrics, we consider episodes of length $T=500$ and $T=1000$ steps.
\input{tables/ablation}
\input{tables/gibson_val_exp_2}
\input{tables/mp3d_val_exp_2}
\input{tables/mp3d_test_exp_2}
\subsection{Implementation Details} The experiments are performed using the Habitat Simulator~\cite{savva2019habitat} with observations of the agent set to be $128\times 128$ RGB-D images and episode length during training set to $T=500$. Each model is trained with the training split of the Gibson dataset~\cite{xia2018gibson} with $40$ environments in parallel for $\approx5$M frames.\\
\tinytextit{Navigation Module} The reinforcement learning algorithm used to train the global and local policies is PPO~\cite{schulman2017proximal} with Adam optimizer and a learning rate of $2.5\times 10^{-4}$. The global goal is reset every $\eta=25$ time steps and the global action space hyperparameter $H$ is $240$. The local policy is updated every $\eta$ steps and the global policy is updated every $20\eta$ steps.\\
\tinytextit{Mapper and Pose Estimator} These models are trained with a learning rate of $10^{-3}$ with Adam optimizer, the local map size is set with $V=101$ while the global map size is $W=961$ for episodes in the Gibson dataset and $W=2001$ in the MP3D dataset. Both models are updated every $4\eta$ time steps, where $\eta$ is the reset interval of the global policy.\\
\tinytextit{Density Model} The model used for density estimation is a lightweight version of Gated PixelCNN~\cite{oord2016conditional} consisting of a $7\times 7$ masked convolution followed by two residual blocks with $1\times 1$ masked convolutions with $16$ output channels, a $1\times 1$ masked convolutional layer with $16$ output channels, and a final $1\times 1$ masked convolution that returns the output logits with shape $P\times P\times B$, where $B$ is the number of bins used to quantize the model input. We set $P=42$ for the resolution of the input and the output of the density model.
\section{Experimental Results}
\subsection{Exploration Results}
As a first step, we perform model selection using the results on the Gibson Val split (Table~\ref{tab:ablation}). Our agents have different hyperparameters that depend on the implementation for the pseudo-counts. When our model employs grid-based pseudo-counts, it is important to determine the dimension of a single cell in this grid-based structure. In our experiments, we test the effects of using $G \times G$ squared cells, with $G \in \{ 2, 4, 5, 10 \}$. The best results are obtained with $G=5$, with small differences among the various setups.
When using pseudo-counts based on a density model, the most relevant hyperparameters depend on the particular model employed as density estimator. In our case, we need to determine the number of bins $B$ for PixelCNN, with $B\in\{64,128,256\}$. We find out that the best results are achieved with $B = 128$.
In Table~\ref{tab:gibsonvalexpT1000}, we compare the Impact (Grid) and Impact (DME) agents with
agents based on the curiosity, coverage, and anticipation rewards. It is worth noting that the anticipation agent uses a strong extrinsic reward that, different from our intrinsic impact-based reward, cannot be computed without strong information on the ground-truth map layout.
As it can be seen, results achieved by Impact are constantly better than those obtained by the competitors. In particular, the two proposed impact-based agents constantly achieve first and second position in terms of IoU, FIoU, OIoU, Acc, AS, FAS, and OAS, both for $T=500$ and $T=1000$. Overall, the proposed impact-based intrinsic reward provides a notable boost compared to the simple curiosity.
\begin{figure*}[t!]
\centering
\scriptsize
\setlength{\tabcolsep}{.3em}
\begin{tabular}{cc ccccc}
& & \textbf{Curiosity} &\textbf{Coverage} & \textbf{Anticipation} & \textbf{Impact (Grid)} & \textbf{Impact (DME)} \\
\addlinespace[0.12cm]
\rotatebox{90}{\parbox[t]{0.56in}{\hspace*{\fill}\textbf{Gibson Val}\hspace*{\fill}}} & &
\includegraphics[width=0.18\linewidth]{images/qualitatives/gibson_curiosity_499.jpg} &
\includegraphics[width=0.18\linewidth]{images/qualitatives/gibson_coverage_499.jpg} &
\includegraphics[width=0.18\linewidth]{images/qualitatives/gibson_anticipation_499.jpg} &
\includegraphics[width=0.18\linewidth]{images/qualitatives/gibson_impG_499.jpg} &
\includegraphics[width=0.18\linewidth]{images/qualitatives/gibson_impD_499.jpg} \\
\addlinespace[0.08cm]
\rotatebox{90}{\parbox[t]{1.05in}{\hspace*{\fill}\textbf{MP3D Val}\hspace*{\fill}}} & &
\includegraphics[width=0.18\linewidth]{images/qualitatives/mp3d_curiosity_499.jpg} &
\includegraphics[width=0.18\linewidth]{images/qualitatives/mp3d_coverage_499.jpg} &
\includegraphics[width=0.18\linewidth]{images/qualitatives/mp3d_anticipation_499.jpg} &
\includegraphics[width=0.18\linewidth]{images/qualitatives/mp3d_impG_499.jpg} &
\includegraphics[width=0.18\linewidth]{images/qualitatives/mp3d_impD_499.jpg} \\
\addlinespace[0.08cm]
\rotatebox{90}{\parbox[t]{0.65in}{\hspace*{\fill}\textbf{MP3D Test}\hspace*{\fill}}} & &
\includegraphics[width=0.18\linewidth]{images/qualitatives/mp3d_test_curiosity_499.jpg} &
\includegraphics[width=0.18\linewidth]{images/qualitatives/mp3d_test_coverage_499.jpg} &
\includegraphics[width=0.18\linewidth]{images/qualitatives/mp3d_test_anticipation_499.jpg} &
\includegraphics[width=0.18\linewidth]{images/qualitatives/mp3d_test_impG_499.jpg} &
\includegraphics[width=0.18\linewidth]{images/qualitatives/mp3d_test_impD_499.jpg} \\
\end{tabular}
\caption{Qualitative results. For each model, we report three exploration episodes on Gibson Val, MP3D Val, and MP3D Test for $T=500$.}
\label{fig:qualitatives}
\end{figure*}
Further, we test the exploration abilities of the different agents on the Matterport3D (MP3D) dataset.
These experiments are intended to test the generalization abilities of exploration agents, therefore we keep the hyperparameters selected in the previous experiments fixed.
Both on MP3D Val and MP3D Test (Tables~\ref{tab:mp3dvalexpT1000} and~\ref{tab:mp3dtestexpT1000} respectively), the proposed impact-based exploration agents surpass the competitors on all the metrics. The different implementations chosen for the pseudo-counts affect final performance, with Impact (DME) bringing the best results in terms of AS. For $T=1000$, the two impact-based agents are best and second best in terms of IoU, FIoU, and Acc.
\input{tables/pointnav}
In Fig.~\ref{fig:qualitatives}, we report some qualitative results displaying the trajectories and the area seen by different agents in the same episode. Also, from a qualitative point of view, the benefit given by the proposed reward in terms of exploration trajectories and explored areas is easy to identify.
\subsection{PointGoal Navigation}
One of the main advantages of training deep modular agents for embodied exploration is that they easily adapt to perform downstream tasks, such as PointGoal navigation~\cite{savva2019habitat}. Recent literature~\cite{chaplot2019learning,ramakrishnan2020occupancy} has discovered that hierarchical agents trained for exploration are competitive with state-of-the-art architecture tailored for PointGoal navigation and trained with strong supervision for $2.5$ billion frames~\cite{wijmans2019dd}. Additionally, the training time and data required to learn the policy is much more limited (2 to 3 orders of magnitude smaller). In Table~\ref{tab:pointnav}, we report the results obtained on the standard benchmark for PointGoal navigation in Habitat~\cite{savva2019habitat}.
We consider five main metrics: the average distance to the goal achieved by the agent, the mean number of atomic steps per episode, and three success-related metrics. The success rate (\textbf{SR}) is the fraction of episodes terminated within $0.2$ meters from the goal, while the \textbf{SPL} and \textbf{SoftSPL} weigh the distance from the goal with the length of the path taken by the agent in order to penalize inefficient navigation.
As it can be seen from Table~\ref{tab:pointnav}, the two proposed agents achieve first and second place when compared with the main competitors: OccAnt~\cite{ramakrishnan2020occupancy} and Active Neural Slam (ANS)~\cite{chaplot2019learning}, thus confirming the appropriateness of impact-based rewards also for PointGoal navigation.
For both the competitors, we report the results achieved by the RGB-D agents, as reported in the papers.
For completeness, we also compare with the results achieved by DD-PPO~\cite{wijmans2019dd}, a method trained with imitation learning for the PointGoal task on $2.5$ billion frames, $500$ times more than the frames used to train our agents.
\subsection{Real-world Deployment}
As agents trained in realistic indoor environments using the Habitat simulator are adaptable to real-world deployment~\cite{kadian2020sim2real,bigazzi2021out}, we also deploy the proposed approach on a LoCoBot robot~\cite{locobot}. We employ the PyRobot interface~\cite{murali2019pyrobot} to deploy code and trained models on the robot.
To enable the adaptation to the real-world environment, there are some aspects that must be taken into account during training. As a first step, we adjust the simulation in order to reproduce realistic actuation and sensor noise. To that end, we adopt the noise model proposed in~\cite{chaplot2019learning} based on Gaussian Mixture Models fitting real-world noise data acquired from a LoCoBot. Additionally, we modify the parameters of the RGB-D sensor used in simulation to match those of the RealSense camera mounted on the robot. Specifically, we change the camera resolution and field of view, the range of depth information, and the camera height. Finally, it is imperative to prevent the agent from learning simulation-specific shortcuts and tricks. For instance, the agent may learn to slide along the walls due to imperfect dynamics in simulation~\cite{kadian2020sim2real}. To prevent the learning of such dynamics, we employ the \textit{bump} sensor provided by Habitat and block the agent whenever it is in contact with an obstacle.
When deployed in the real world, our agent is able to explore the environment without getting stuck or bumping into obstacles.
\section{Conclusion}
\label{sec:conclusion}
In this work, we present an impact-driven approach for robotic exploration in indoor environments. Different from previous research that considered a setting with procedurally-generated environments with a finite number of possible states, we tackle a problem where the number of possible states is non-numerable. To deal with this scenario, we exploit a deep neural density model to compute a running pseudo-count of past states and use it to regularize the impact-based reward signal. The proposed agent stands out from the recent literature on embodied exploration in photorealistic environments and can also solve downstream tasks such as PointGoal navigation. Additionally, being trained on the Habitat simulator, we show that it is easy to deploy the trained models in the real world.
| {'timestamp': '2021-09-20T02:16:40', 'yymm': '2109', 'arxiv_id': '2109.08521', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08521'} | arxiv |
\section*{Appendix}
\section*{Multi-hop Prover Details}
Prolog is a logic programming language that consists of a set of predicates. A predicate has a name (functor) and a set of $N > 0$ arguments. For example, \prologTerm{get(i, work, on\_time)} is a predicate with functor \prologTerm{get} and 3 arguments. Predicates are defined by a set of logical rules or Horn clauses (\prologTerm{$\text{Head} \coloneq \text{Body}$}) and facts (\prologTerm{$\text{Head}$}), where \prologTerm{Head} is a predicate, \prologTerm{Body} is a conjunction of predicates, and \prologTerm{$\coloneq$} is logical implication. Prolog uses backward-chaining to logically reason about (prove) an input query, represented by a predicate. From a high level, a proof consists of a chain of logical facts and rules available in the background KB. Inspired by this prover, we extend this to free-form text proofs in this paper.
This chain-structured definition of a proof is inspired by a Prolog proof. A knowledge tuple here is analogous to a logical rule in Prolog (\prologTerm{Head $\coloneq$ Body}) where the \emph{subject} and \emph{object} correspond to either the \prologTerm{Body}, or the \prologTerm{Head} depending on the \emph{relation}. We categorize $\mathbb{COMET}$~\emph{relation}s into two classes, namely pre-conditions and post-effects. If the \emph{relation} is a post-effect, the \emph{object} is the \prologTerm{Head} and the \emph{subject} is the \prologTerm{Body}. If the \emph{relation} is a pre-condition, the reverse is true. For example, the relations ``Because I wanted'' and ``is used for'' in Fig~\ref{fig:comet} are post-effects, whereas the relations ``Before I needed'' and ``requires action'' are pre-conditions.
The \emph{subject} (\prologTerm{Body}) consists of a single predicate (instead of a conjunction of predicates in Prolog). Since there is no conjunction in the \prologTerm{Body} of the rules, the logical proof reduces to a chain (as opposed to a proof tree in Prolog). Moreover, the semantic closeness of $o_{i-1}$ and $s_i$ is inspired by the unification operation \cite{colmerauer1990introduction} in Prolog and is analogous to the soft unification operation of CORGI's neuro-symbolic theorem prover.
It is worth noting that this analogue falls short of Prolog's variable grounding and is an interesting avenue for our future work.
\section*{Dialogue System Details}
The control flow of \varmathbb{CLUE}'s dialog system in Figure \ref{fig:CLUE_diagram} is shown in detail in Figure \ref{fig:control_flow}. The dialog system uses the logic templates and the results returned by $\mathbb{COMET}${} to interact with the human user and ask questions.
\input{dialog_fig}
For example, consider proving the first implication of the blue template (\!\!\!\!\!\blueTemplate{$\neg$ {\fontfamily{lmtt}\selectfont goal\,} $\coloneq$ {\fontfamily{lmtt}\selectfont state\,}}) for the command ``If it snows tonight then wake me up early because I want to get to work on time''. \varmathbb{CLUE}~first tries to find the negation of the {\fontfamily{lmtt}\selectfont goal\,} (get to work on time) by querying $\mathbb{COMET}$$(r, \text{{\fontfamily{lmtt}\selectfont goal\,}})$ for relations ($r$) indicating negation (such as \emph{NotCapableOf} and \emph{NotIsA}). \varmathbb{CLUE}~then picks the highest ranking returned $\mathbb{COMET}$~statement (I am late) and asks the user ``is $\langle \neg$ {\fontfamily{lmtt}\selectfont goal\,} $\rangle$ the opposite of $\langle$ {\fontfamily{lmtt}\selectfont goal\,} $\rangle$?(y/n)'' (Is ``I am late'' the opposite of ``I get to work on time''?(y/n)). If the user responds `yes', then \varmathbb{CLUE}~asks ``what does $\langle$ {\fontfamily{lmtt}\selectfont state\,} $\rangle$ cause that leads to $\langle \neg$ {\fontfamily{lmtt}\selectfont goal\,} $\rangle$?'' (what does ``it snows tonight'' cause that leads to ``I am late''?) and expects an explanation from the user in response. If the user responds `no' to the first question, then \varmathbb{CLUE}~asks ``what does $\langle$ {\fontfamily{lmtt}\selectfont state\,} $\rangle$ cause that makes it difficult to achieve $\langle$ {\fontfamily{lmtt}\selectfont goal\,} $\rangle$?'' (What does ``it snows tonight'' cause that makes it difficult to achieve ``I get to work on time''?) and expects an explanation from the user in response. The reason for querying $\mathbb{COMET}$~for the negated {\fontfamily{lmtt}\selectfont goal\,}~is that negation in Prolog is implemented based on negation as failure. Therefore, to be consistent, \varmathbb{CLUE}~converts the {\fontfamily{lmtt}\selectfont goal\,} to its negated statement and proves that instead.
\section*{Extended Experiments}
\input{half_proofs_table}
Tables \ref{tab:half_proof_ex_p1} and \ref{tab:half_proof_ex_p2} show 32 examples of the 67 expert-verified half-proofs reported in Table \ref{tab:n_hop}. These half-proofs are obtained using bidirectional 2-hop beam search and logically prove the {\fontfamily{lmtt}\selectfont goal\,} $\coloneq$ {\fontfamily{lmtt}\selectfont action\,} implication. Recall that {\fontfamily{lmtt}\selectfont action\,} refers to the Then-portion of the command and {\fontfamily{lmtt}\selectfont goal\,} refers to the Because-portion of the command. The embeddings used to measure semantic closeness in the prover is GloVe. The second intermediate hop obtained by \varmathbb{CLUE}'s prover is shown in column 4 of the tables. Each row indicates a successfully half-proved if-then-because command along with its intermediate commonsense reasoning hop. Let us explain the proofs through an example. Consider the example on Row 5 of Table \ref{tab:half_proof_ex_p1}:
``if the temperature is going to be below 40 degrees in the evening but above 40 degrees in the morning then remind me to bring a jacket because i want to stay warm on my commute''. The relations (column 3) and $\mathbb{COMET}${} outputs (column 4) for this example indicate that the {\fontfamily{lmtt}\selectfont action\,} of reminding the user to bring a jacket \emph{causesDesire} for the user to \emph{wear the jacket} which is a \emph{Prerequisite} for the {\fontfamily{lmtt}\selectfont goal\,} of staying warm on the user's commute. In other words \varmathbb{CLUE}{} is able to understand why reminding someone to bring a jacket would allow them to stay warm (because they would be able to wear the jacket). This is a logical proof for the implication {\fontfamily{lmtt}\selectfont goal\,} $\coloneq$ {\fontfamily{lmtt}\selectfont action\,}~according to the proof definition of the prover proposed in this paper. For more examples, please refer to Tables \ref{tab:half_proof_ex_p1} and \ref{tab:half_proof_ex_p2}.
\section{Background and Notation}
\label{sec:background}
In this section, we briefly re-introduce the benchmark task, the logic templates, and \citeauthor{corgi}'s reasoning engine CORGI (COmmonsense ReasoninG By Instruction), along with an overview of $\mathbb{COMET}$~\cite{Bosselut2019COMETCT}.
\subsection{If-Then-Because Commands}
The benchmark dataset \citep{corgi} contains natural language commands given to conversational agents. These commands follow the template {\bf ``If-({\fontfamily{lmtt}\selectfont state\,}), Then-({\fontfamily{lmtt}\selectfont action\,}), Because-({\fontfamily{lmtt}\selectfont goal\,})''}.
The if-clause is referred to as the {\fontfamily{lmtt}\selectfont state\,}, the then-clause as the {\fontfamily{lmtt}\selectfont action\,}~and the because-clause as the {\fontfamily{lmtt}\selectfont goal\,}.
\paragraph{Logic Templates:}
The data is partitioned into 4 color-coded reasoning logic templates that indicate how the commanded {\fontfamily{lmtt}\selectfont action\,}~leads to the {\fontfamily{lmtt}\selectfont goal\,}~when the {\fontfamily{lmtt}\selectfont state\,}~holds. To be self-contained, we have included the table of logic templates from \citeauthor{corgi} in Figure \ref{fig:logic_template}. In the interest of space, we give one example of the blue logic template, \blueTemplate{$(\neg(\text{{\fontfamily{lmtt}\selectfont goal\,}}) \coloneq \text{{\fontfamily{lmtt}\selectfont state\,}}) \wedge (\text{{\fontfamily{lmtt}\selectfont goal\,}} \coloneq \text{{\fontfamily{lmtt}\selectfont action\,}}(\text{{\fontfamily{lmtt}\selectfont state\,}}))$}, where $\neg$ indicates negation, and $\wedge$ indicates logical AND. Under this template, the {\fontfamily{lmtt}\selectfont state\,}~implies the negation of the {\fontfamily{lmtt}\selectfont goal\,}~AND the {\fontfamily{lmtt}\selectfont action\,}~implies the {\fontfamily{lmtt}\selectfont goal\,}~when the {\fontfamily{lmtt}\selectfont state\,}~holds. An example if-then-because command that satisfies this template is, ``If it snows tonight then wake me up early because I want to get to work on time''. Here, the {\fontfamily{lmtt}\selectfont state\,}~of snowing (a lot) at night results in the negation of the {\fontfamily{lmtt}\selectfont goal\,}~and the user will not be able to get to work on time. AND if the {\fontfamily{lmtt}\selectfont action\,}~of waking the user up earlier is performed when the state of snowing (a lot) at night holds, the user will get to work on time. The other three follow different logic templates, but are of the same nature. We refer the reader to \citeauthor{corgi} for more details.
\input{logic_template_fig}
\subsection{CORGI}
COmmonsense ReasoninG By Instruction (CORGI; \citet{corgi}) is the SOTA commonsense reasoning engine designed for inferring commonsense presumptions of if-then-because commands. CORGI has a neuro-symbolic reasoning module (theorem prover) that generates multi-hop reasoning trees given if-then-because commands. The neuro-symbolic reasoning module is a soft logic programming system that reasons using backward chaining (a backtracking algorithm). CORGI does not use the logic templates to do reasoning.
One of the main limitations of CORGI is that it uses a small hand-crafted KB that is not diverse enough to reason about all the if-then-because commands in the benchmark dataset. CORGI was tested only on 10 commands in the released benchmark \citep{corgi}. Moreover, CORGI's KB is programmed in a syntax similar to Prolog \cite{colmerauer1990introduction}, but large-scale commonsense Prolog-like knowledge bases are not readily available. Therefore, in this paper we propose to use a large-scale SOTA neural commonsense KB which both extends that limited source of background knowledge and also enables the use of a new \emph{type} of knowledge source.
CORGI is equipped with a conversational interaction strategy to acquire knowledge from humans when that knowledge is missing from the KB. However, CORGI uses a static question generation strategy that often confuses the end-users. First, the parser often omits verb conjugation or subjects, resulting in grammatically incorrect questions. Second, the static question generation strategy does not always generate contextual queries. Therefore, in this paper we propose a dynamic question generation strategy that generates more relevant questions resulting in a higher quality knowledge extraction from humans. We also include a more robust parser to ensure the questions are grammatically correct.
\subsection{COMET}
COMmonsensE Transformer ($\mathbb{COMET}$\cometemoji; \citeauthor{Bosselut2019COMETCT}) is a generative transformer-based commonsense KB that learns to generate rich and diverse commonsense descriptions.
$\mathbb{COMET}$~constructs commonsense KBs by using existing tuples as a seed set of knowledge on which to train. In essence, a pre-trained language model learns to adapt its learned representations to knowledge generation, producing novel high-quality tuples.
Unlike other KBs, $\mathbb{COMET}$~represents knowledge implicitly in its neural network parameters and expresses knowledge through generated free-form open-text descriptions.
This makes it well-suited for the studied reasoning task, as the if-then-because commands are also expressed in free-form text descriptions. Therefore, we can directly query $\mathbb{COMET}$~for commonsense pre-conditions and post-effects of the {\fontfamily{lmtt}\selectfont state\,}, {\fontfamily{lmtt}\selectfont action\,} and {\fontfamily{lmtt}\selectfont goal\,}. For example, ``pouring coffee'' is a commonsense pre-condition for ``drinking coffee'' (Fig \ref{fig:atomic}).
Our system uses a $\mathbb{COMET}$~model trained on two knowledge graphs, ATOMIC \cite{sap2019atomic} and ConceptNet \cite{Speer2016ConceptNet5A}. Each of these knowledge graphs consists of a collection of tuples, $\{s, r, o\}$, where $s$ and $o$ are the \emph{subject} and \emph{object} phrase of the tuple, respectively and $r \in [r^{0},r^{1},\dots,r^{\ell-1}]$ is the \emph{relation} between $s$ and $o$, and $\ell$ is the number of relations in the KB. $\mathbb{COMET}$~is trained to generate $o$ given $s$ and $r$. E.g., Figure \ref{fig:comet} shows examples of the generated objects given an input subject, ``I drink coffee,'' and several relations from the ATOMIC-trained (Fig.~\ref{fig:atomic}) and ConceptNet-trained (Fig.~\ref{fig:conceptnet}) $\mathbb{COMET}${} models.
\section{Conclusions}
We introduce the ConversationaL mUlti-hop rEasoner (\varmathbb{CLUE}) for commonsense reasoning in conversational agents. \varmathbb{CLUE}~uses a neural commonsense KB and symbolic logic rules to perform multi-hop reasoning. It takes {\bf if-(state), then-(action), because(goal)} commands as input and returns a multi-hop chain of commonsense knowledge, indicating how the {\fontfamily{lmtt}\selectfont action\,} leads to the {\fontfamily{lmtt}\selectfont goal\,} when the {\fontfamily{lmtt}\selectfont state\,} holds. The symbolic logic rules help significantly reduce the multi-hop reasoning search space and improve the quality of the generated commonsense reasoning chains. We evaluate \varmathbb{CLUE}~with a user study with human users
\section*{Acknowledgments}
Tom Mitchell is supported in part by AFOSR under grant FA95501710218. Antoine Bosselut and Yejin Choi gratefully acknowledge the support of DARPA under No. N660011924033 (MCS), JD.com, and the Allen Institute for AI.
\section{Experiments and Results}
Here we discuss our experimental setup, evaluation method, baselines and results.
We work with 132 out of the 160 commands from the benchmark dataset \shortcite{corgi} that fall under three logic templates blue, orange and green (Figure \ref{fig:logic_template}). The red template contains commands for which there is no unifying logic template. Therefore, we cannot use it.
\paragraph{Evaluation:}
We do not use automated evaluation metrics and instead use human evaluations for two reasons. First,
there are currently no metrics in the literature that assess whether the returned reasoning chains are ``correct'' from a commonsense perspective.
Second, evaluating dialog systems is challenging. It is debated that metrics such as BLEU \cite{papineni2002bleu} and perplexity often fail to measure true response quality \cite{liu2016not,li2016deep}.
\paragraph{Experiments:}
In the first experiment, we evaluate our multi-hop prover in isolation and without conversational interactions. The human evaluators in this study are expert evaluators. In our second experiment, we test \varmathbb{CLUE}'s performance end-to-end with non-expert human users and investigate the efficacy of the conversational interactions.
In order to be comparable with \citet{corgi}'s study, we use the knowledge base of commonsense facts and rules, $\mathcal{K}$, released with the dataset. It contains 228 facts and rules.
Our $\mathbb{COMET}$~model is pre-trained on knowledge graphs ConceptNet
and ATOMIC.
We used $\mathbb{COMET}$'s open-source code\footnote{https://github.com/atcbosselut/comet-commonsense} for training with the hyper-parameters reported there \citep{Bosselut2019COMETCT}
\subsection{Multi-hop Prover Evaluation}
As shown in Figure \ref{fig:logic_template}, each logic template consists of a conjunction of two logical implication statements. We use the terminology \emph{end-to-end} proof to refer to proving both of the implications in the template and \emph{half-proof} to refer to proving one.
Table \ref{tab:n_hop}
presents the number of proved logical implications {\fontfamily{lmtt}\selectfont goal\,} $\coloneq$ {\fontfamily{lmtt}\selectfont action\,}, with respect to the number of hops
using unidirectional and bidirectional beam search. Expert-verified proofs refer to reasoning chains with similarity score of at least $0.8$ that are validated by a human evaluator.
The similarity threshold of $0.8$ was tuned offline on a small subset of the benchmark dataset
and picked from the following list $[0.7, 0.8, 0.85, 0.9]$. Automated proofs are the portion of the human evaluated proofs for which the highest scoring proof is the verified one. As shown, the number of automated proofs almost doubles when an expert human evaluator validates the proofs.
This indicates that the model benefits from \emph{human knowledge evaluators}. An instance of this scenario is shown in Figure \ref{fig:dialog} where the human user chooses the second ranking candidate as the correct proof. As expected, a portion of the commands cannot be proved using $\mathbb{COMET}$~alone even with human evaluators. This indicates that we are encountering missing knowledge. Therefore, there is need for \emph{humans as novel knowledge contributors}.
Moreover, Table \ref{tab:n_hop} shows that bidirectional beam search is more successful than unidirectional search for lower hops greater than $1$. This is because there is a higher chance of finding a good scoring match when the two directions meet due to an extended search space. For the same reason, the number of successful proofs drop when the number of hops is increased beyond a certain point. Please note, in bidirectional beam search $N=1$ is not applicable because the smallest number of hops extracted for bidirectional beam search is 2. Moreover, if a statement is proved with lower number of hops, we do not prove it with a higher $N$. Therefore, the number of hops needed for proving a certain statement is not predefined, and is rather chosen based on the best semantic closeness among all extracted hops at test time.
The automated half-proofs obtained from the prover are listed in Tables \ref{tab:half_proof_ex_p1} and \ref{tab:half_proof_ex_p2} in the Appendix.
\input{n_hop_table}
\input{rank_at_k_table}
In Table \ref{tab:rank_k}, we present the number of expert-verified half-proofs achieved with different number of hops ($N$) within the top $k$ ranked results. Note that we exclude successful half-proofs for higher degrees of $N$ if there exists a proof with fewer hops, and we include a proof as long as the verified result is within the top $k$ results. Table \ref{tab:rank_k} shows that the majority of successful half-proofs are achievable in $N\leq3$.
In Table \ref{tab:comet_auto_full_proofs}, we present the number of obtained full proofs for 2-hop bidirectional beam search (the best result from Table \ref{tab:n_hop}) using GloVe embeddings broken down by logic templates. Although $\mathbb{COMET}$~is successful at finding half proofs, the success rate decreases when two implications need to be proven in conjunction. As shown, $\mathbb{COMET}$~can (fully) prove $12.8\%$ of the if-then-because commands. This emphasizes the necessity of using human conversational interactions for obtaining full proofs. Therefore, if $\mathbb{COMET}$~succeeds at proving half of the template, there is a chance to prove the other half with the help of a human user. This is because most of the commands belong to the long tail of tasks for which there is too little knowledge available in any commonsense KB.
Table \ref{tab:half_proofs} compares the number of successful proofs obtained using GloVe, BERT and commonsense embeddings.
As shown, GloVe embeddings perform better than the others since commonsense and BERT embeddings perform poorly when there is little surrounding context for the words.
The returned \emph{objects} by $\mathbb{COMET}$~tend to have a few number of tokens, (around 1-2). Therefore, the similarity scores assigned by BERT and commonsense embeddings either result in more false positives or in pruning out good candidates. For example, BERT and commonsense embeddings both tend to assign a lower similarity score to ``I sleep'' and ``sleep'' than single token words like ``ski'' and ``spoil''. But this is not an issue with GloVe embeddings. Therefore, in all the other experiments we have used GloVe embeddings. The effect of the embeddings is amplified as the number of hops increases. For example in Table \ref{tab:n_hop}, The number of expert-verified 2-hops proofs drops from 21 to 5 if we use BERT embeddings.
\begin{table}[t]
\centering
\caption{Number of End-to-End Proofs per Logic Template for 2-hop bidirectional beam search.}
\label{tab:comet_auto_full_proofs}
\resizebox{\columnwidth}{!}{%
\begin{tabular}{llccc}
\toprule
& Logic Template & Successful & False Positive & Total Count \\ \midrule
\multirow{ 3}{*}{\thead{Automated \\proof}} & orange & 1 & 0 & 50 \\
&blue & 6 & 1 & 65 \\
&green & 6 & 2 & 17 \\
\midrule
\multirow{ 3}{*}{\thead{Expert\\evaluated \\proof}} & orange & 1 & N/A & 50 \\
&blue & 7 & N/A & 65 \\
&green & 9 & N/A & 17 \\
\bottomrule
\end{tabular}
}
\end{table}
\begin{table}[t]
\centering
\caption{Number of half-proofs using bidirectional beam search: evaluated by expert human evaluators.}
\label{tab:half_proofs}
\resizebox{0.9\columnwidth}{!}{%
\begin{tabular}{lcc}
\toprule
Embedding Space & {\fontfamily{lmtt}\selectfont goal\,} $\coloneq$ {\fontfamily{lmtt}\selectfont action\,} & $\neg$ {\fontfamily{lmtt}\selectfont goal\,} $\coloneq$ {\fontfamily{lmtt}\selectfont state\,} \\
\midrule
GloVe & 67 & 17 \\
BERT & 52 & 14 \\
Commonsense &59 & 12 \\
\bottomrule
\end{tabular}
}
\end{table}
\subsection{User Study}
To assess \varmathbb{CLUE}'s end-to-end performance, we ran a user study in which human users engaged in a conversational interaction with \varmathbb{CLUE}~and answered its prompts. We collected a total of 700 dialogues from this study and report the percentage of the if-then-because commands that were successfully proved (end-to-end) as a result of the conversational interactions in Table \ref{tab:userstudybreakdown}. Our users worked on a total of 288 if-then-because commands that fit the blue, orange, and green logic templates. We had 129 unique commands and 29 participants in the study with at least 2 users per command. The 129 commands used in this study are a subset of the 132 commands (half-proofs) in Table \ref{tab:n_hop}. The remaining 3 statements were excluded because either the statements were longer than COMET's maximum input token size (for the full-proof) or they did not trigger a CORGI/CLUE interaction so it does not make sense to include them in the user-study. Each participant worked on 9-10 statements taking approximately 30-40 minutes to complete them all. The participants were undergraduate, graduate or recently graduated students with a background in computer science or engineering. Please note that no skills beyond reading is required for interacting with \varmathbb{CLUE}; no particular domain expertise is needed either because most humans possess common sense regarding day-to-day activities.
The users contributed a total number of 70 novel knowledge tuples to our background knowledge base and validated 64.86\% of the proofs extracted using our multi-hop prover.
\textbf{}\varmathbb{CLUE}~is built on top of CORGI,\footnote{https://github.com/ForoughA/CORGI} and is triggered only if CORGI fails. Therefore, the 19 and 4 commands proved by \varmathbb{CLUE}~are not provable by CORGI; the commands proved by CORGI in each row is indicated in the parentheses. Therefore, \varmathbb{CLUE}~successfully increases the reasoning success rate by 35\%. Please note that the absolute gain in terms of success percentage compared with CORGI is 8\%
We did not experience any inconsistencies between user responses in the study because users received the same goal for a given command. It is difficult to generate contradictory proofs when the context is the same. However, proofs among different users do not have to be identical. As long as the proof fulfills the criteria and is ``correct'' from a commonsense perspective, it holds. Every user has different preferences, linguistic tendencies, and living habits, which can affect the generated proof. Consequently, proofs are tailored to users. Also, showing the five multiple choice options helps users understand what kind of knowledge \varmathbb{CLUE}~is looking for, improving their responses.
\begin{table}[t]
\centering
\caption{User-study results. Commands not provable by CORGI trigger a \varmathbb{CLUE}~dialog, so commands proved by \varmathbb{CLUE}~are in addition to CORGI's. The numbers in the parentheses in proved column is the number of statements that CORGI proved.}
\label{tab:userstudybreakdown}
\resizebox{0.9\columnwidth}{!}{%
\begin{tabular}{cccc}
\toprule
Dialog Phase & \thead{Proved} & \thead{Tried} & \thead{Proved/Tried} \\% & \thead{\% Proved/ Total} \\
\midrule
CORGI & 65 & 288 & 0.2256 \\% & 0.2265\\
\varmathbb{CLUE}[orange]
& 17(+27) & 126 & 0.1349 \\
\varmathbb{CLUE}[green] & 2(+0) & 17 & 0.1176 \\
\varmathbb{CLUE} [blue
& 4(+38) & 145 & 0.0276 \\% & 0.0533 \\
\bottomrule
\end{tabular}
}
\end{table}
\section{Introduction}
Conversational agents are becoming prominent in our daily lives thanks to advances in speech recognition, natural language processing and machine learning.
However, most conversational agents still lack commonsense reasoning, preventing them from engaging in rich conversations with humans.
Recently, \citet{corgi} proposed a commonsense reasoning benchmark task for conversational agents that contains natural language commands given to an agent by humans.
These commands follow a general template of: {\bf ``If ({\fontfamily{lmtt}\selectfont state\,}~holds), Then (perform {\fontfamily{lmtt}\selectfont action\,}), Because (I want to achieve {\fontfamily{lmtt}\selectfont goal\,})''}.
We refer to commands satisfying this template as if-then-because commands. As stated in \citet{corgi}, humans often under-specify conditions on the if-portion (\,{\fontfamily{lmtt}\selectfont state\,}) and/or then-portion (\,{\fontfamily{lmtt}\selectfont action\,}) of their commands. These under-specified conditions are referred to as \emph{commonsense presumptions}. For example, consider the command, ``If it's going to rain in the afternoon \textcolor{purple}{$(\,\cdot\,)$}~Then remind me to bring an umbrella \textcolor{purple}{$(\,\cdot\,)$}~Because I want to remain dry'', where \textcolor{purple}{$(\,\cdot\,)$}~indicates the position of the unstated commonsense presumptions. The presumptions for this command are \textcolor{purple}{(}and I am outside\textcolor{purple}{)} and \textcolor{purple}{(}before I leave the house\textcolor{purple}{)}, respectively. The goal in this task is to infer such commonsense presumptions given if-then-because commands
\input{clue_dialog_fig}
\input{CLUE_diagram}
In this paper, we propose the ConversationaL mUlti-hop rEasoner (\varmathbb{CLUE})
for this task which performs zero-shot reasoning. \varmathbb{CLUE}~extracts a multi-hop reasoning chain that indicates how the {\fontfamily{lmtt}\selectfont action\,}~leads to the {\fontfamily{lmtt}\selectfont goal\,}~when the {\fontfamily{lmtt}\selectfont state\,}~holds. For example, the simplified reasoning chain for the previous example is, ``if I am reminded to bring an umbrella before I leave the house, then I have an umbrella'', ``if I have an umbrella and it rains when I am outside, then I can use the umbrella to block the rain'', ``if I block the rain, then I remain dry''. Additional commonsense knowledge provided by the reasoning chain is considered a commonsense presumption of the input command. In order to construct the multi-hop reasoning chain, we develop a novel reasoning system that uses a few symbolic logic templates
to prune the exponential reasoning search space, resulting in significantly improved generated commonsense knowledge.
Our multi-hop reasoner uses a state-of-the-art (SOTA) transformer-based commonsense knowledge model called COMmonsEnse Transformers ($\mathbb{COMET}$\cometemoji) \cite{Bosselut2019COMETCT} as its source of background knowledge and is the first time reasoning task is tackled using a large scale KB. Knowledge models can be used in place of KBs, but they are more flexible in terms of information access, so we use this term interchangeably with KB.
Despite being a SOTA KB, $\mathbb{COMET}${} still misses requisite knowledge for reasoning about if-then-because commands. In fact, many if-then-because commands often fall under the long tail of tasks for which there is too little knowledge available in any commonsense KBs. For example, one of the commands in the dataset is: ``If I get an email with subject the gas kiln fired, then send me a list of all the pots I put on the glaze shelf between the last firing and now, because I want to pick up the pots from the studio.''
It is unlikely for any knowledge source to contain a fact that is contextually relevant to this command. More importantly, it is also unlikely that a command requiring the same type of reasoning will occur again in the future, making it cost-ineffective to manually annotate.
To overcome this, we propose conversationally eliciting missing knowledge from human users.
Conversation with users is readily available since \varmathbb{CLUE}~is developed for conversational agents. We develop a novel question generation strategy that uses $\mathbb{COMET}$~to generate questions in the context of the input if-then-because commands, allowing \varmathbb{CLUE}~to acquire contextual feedback from humans. We evaluate our reasoner by conducting a user study with humans.
\paragraph{Summary of Results and Contributions:}
The contributions of this paper are two-fold. First, we propose a novel conversational commonsense reasoning approach called ConversationaL mUlti-hop rEasoner (\varmathbb{CLUE}) that incorporates Commonsense Transformers ($\mathbb{COMET}$), a large scale neural commonsense KB, as its main source of background knowledge.
We propose a multi-hop knowledge query mechanism that extracts reasoning chains by iteratively querying $\mathbb{COMET}$. This mechanism uses, for the first time, a few symbolic logic templates to prune the reasoning search space, significantly improving the quality of the generated commonsense knowledge.
Second, we propose a conversational knowledge acquisition strategy that uses the knowledge extracted from $\mathbb{COMET}$~to dynamically ask contextual questions to humans whenever there is missing knowledge.
We ran a user study and evaluated our proposed approach using real human users. Our results show that \varmathbb{CLUE}~achieves
a 35\% higher success rate compared to a baseline, which uses a less sophisticated conversational interface and a smaller background knowledge on the benchmark dataset. We also extensively evaluate the performance of the reasoner in an isolated non-conversational setting and empirically re-iterate the need for conversational interactions. \varmathbb{CLUE}'s components were not trained on the benchmark dataset.
Therefore, our results assess the performance of \varmathbb{CLUE}'s zero-shot reasoning.
\section{\varmathbb{CLUE}: Conversational Multi-Hop Reasoner}
\varmathbb{CLUE}~(ConversationaL mUlti-hop rEasoner) is a commonsense reasoning engine that inputs if-then-because commands and outputs a reasoning chain (proof) containing if-then logical statements that indicates how the {\fontfamily{lmtt}\selectfont action\,} achieves the user's {\fontfamily{lmtt}\selectfont goal\,} when the {\fontfamily{lmtt}\selectfont state\,} holds. \varmathbb{CLUE}~is built on top of CORGI and is triggered when CORGI fails. It consists of three components: (1) the parser, (2) the multi-hop prover (reasoner), and (3) the dialog system (Figure \ref{fig:CLUE_diagram}). The Parser takes in the command and extracts the {\fontfamily{lmtt}\selectfont state\,}, {\fontfamily{lmtt}\selectfont action\,} and {\fontfamily{lmtt}\selectfont goal\,} from it. At the second step, the prover attempts to find reasoning chains that connect the {\fontfamily{lmtt}\selectfont action\,} to the {\fontfamily{lmtt}\selectfont goal\,} when the {\fontfamily{lmtt}\selectfont state\,} holds. The extracted reasoning chains go through the dialog system that generates and presents contextualized questions to a human user who either validates a returned reasoning chain or contributes novel knowledge to \varmathbb{CLUE}~if none of the reasoning chains are correct.
All three components interact with \varmathbb{CLUE}'s two sources of background knowledge: (I) A small handcrafted knowledge base containing logic facts and rules, $\mathcal{K}$, programmed in a logic programming language and (II) A large scale neural knowledge base, $\mathbb{COMET}$, containing free-form text. During the user-interaction sessions, the system's background knowledge base $\mathcal{K}$ grows in size as new knowledge is added to it. This new knowledge is either novel information added by the user during conversational interactions, or knowledge queried from $\mathbb{COMET}$~and confirmed by the user. This new knowledge will be added to $\mathcal{K}$ for future similar reasoning tasks. In what follows, we explain the three components of \varmathbb{CLUE}~in detail.
\subsection{Parser}
Our parser extracts the {\fontfamily{lmtt}\selectfont state\,}, {\fontfamily{lmtt}\selectfont action\,}, and {\fontfamily{lmtt}\selectfont goal\,}~as independent clauses from the input if-then-because command. We use Spacy's \cite{honnibal2017spacy} NLP tools such as POS tagging and coreference resolution to make the clauses self-contained and contextual.
\subsection{Multi-Hop Prover}
\label{sec:prover}
Inspired by how Prolog generates proofs containing chains of logical rules and facts using a KB, our prover (reasoner) generates chains of natural language commonsense facts and rules to reason about an input command by iteratively querying $\mathbb{COMET}$~ (details on the analogue between Prolog and our prover are in the appendix). We denote a $\mathbb{COMET}$~query by $\mathbb{COMET}$$(r, s)$ where $r$ is a relation and $s$ is a subject or an input natural language clause. $\mathbb{COMET}$~uses beam search at decoding time and $\mathbb{COMET}$$(r, s)$ outputs a list of candidate objects $O = [o^{0},o^{1},\dots,o^{b-1}]$ ordered by confidence, where $b$ indicates $\mathbb{COMET}$'s beam size. We categorize $\mathbb{COMET}$~\emph{relation}s into two classes, namely pre-conditions and post-effects. For example, the relations ``Because I wanted'' and ``is used for'' in Fig~\ref{fig:comet} are post-effects, whereas the relations ``Before I needed'' and ``requires action'' are pre-conditions.
\input{one_hop_inference.tex}
Let us now formally define a reasoning chain or proof extracted from our neural knowledge base. A proof consists of a chain of knowledge tuples $\{s_i, r_i, o_i\}$, where $i \in [1,N]$ and $N$ indicates the number of hops in the proof chain such that $o_{i-1}$ is \emph{semantically close} to $s_i$. (We discuss the notion of semantic closeness in the next subsection.) The search space for finding a proof chain from $\mathbb{COMET}$~grows exponentially with $N$ if implemented naively. In the next subsections we explain how we prune the search space using the logic templates released with the benchmark dataset.
The goal of our prover is to scale up CORGI's small hand-crafted knowledge base, which is programmed in a Prolog-like language. Since a large-scale commonsense KB in Prolog is not readily available, \varmathbb{CLUE}~proposes an alternative prover that enables using SOTA large-scale commonsense KBs. Moreover, \varmathbb{CLUE}'s prover is consistent with CORGI's neuro-symbolic logic theorem prover (refer to the appendix for details),
allowing us to seamlessly extend CORGI's background knowledge without requiring a large scale commonsense KB programmed in Prolog. Lastly, \varmathbb{CLUE}~ performs reasoning in a zero-shot manner since the pre-trained $\mathbb{COMET}$~is not trained on the benchmark dataset used for evaluation in this paper.
\paragraph{Semantic Closeness:}
In order to measure semantic closeness of the \emph{object} and \emph{subject} phrases,
we embed the sequence of tokens that make up the object of the previous tuple ($o_{i-1}$) and the sequence of tokens that make up the subject of the next tuple ($s_i$) in the proof trace. Semantic closeness, used for ranking the returned proofs, is defined as a vector cosine similarity of larger than a threshold, $\tau$.
We investigate several embedding methods to find one that best suites our multi-hop prover.
We used GloVe embeddings \cite{pennington2014glove}, BERT pre-trained embeddings \cite{devlin2019bert} and fine-tuned embeddings in $\mathbb{COMET}$, which we call \emph{commonsense embeddings}. For GloVe and BERT embeddings, we compute the phrase embedding by averaging the embeddings of the tokens. For commonsense embeddings, we use the phrase embeddings returned by $\mathbb{COMET}$. In the results section, we compare the outcome of these choices.
\input{two_hop_inference_fig}
\paragraph{Pruning the Proof Search Space}
In order to form a reasoning chain (proof) for an if-then-because command using $\mathbb{COMET}$, we leverage the logic templates discussed in Sec. \ref{sec:background}. All the templates consist of a conjunction of two logical implications. For each implication (\prologTerm{Head $\coloneq$ Body}), the \prologTerm{Head} and \prologTerm{Body} are given in the if-then-because command. For example, the {\fontfamily{lmtt}\selectfont goal\,}~and {\fontfamily{lmtt}\selectfont state\,}~in the first implication of the purple template (\!\!\purpleTemplate{$\text{{\fontfamily{lmtt}\selectfont goal\,}} \coloneq \text{{\fontfamily{lmtt}\selectfont state\,}}$}) are extracted from the input command. Therefore, in order to prove the first implication, we need to find a chain of reasoning that leads from the {\fontfamily{lmtt}\selectfont state\,}~to the {\fontfamily{lmtt}\selectfont goal\,} in a series of $N$ hops. In order to do that, we either perform unidirectional or bidirectional beam search as explained below.
\paragraph{\emph{Unidirectional Beam Search:}} Here, for a given number of hops $N$, we first construct all beam results $O_1=$$\mathbb{COMET}$$(r_{e}, s_1)$ where $s_1$ is the natural language clause that corresponds to the \prologTerm{Body} of the implication in the logic template, and for all $r_e$ that are post-effect $\mathbb{COMET}$~relations.
We continue to query $\mathbb{COMET}$($r_e, o_n^j$)~recursively in a breadth-first manner for $\forall~o_n^j \in O_n$ where $n \in [1,\dots,N]$ is the hop index. In each hop, we only continue the query for the top $K$ results ranked by the semantic closeness of the returned beam result $o_n^j$ and the implication's \prologTerm{Head}, where $K$ is the search's beam size. At the $N^{\text{th}}$ hop, the prover returns proof chains for which $o_N$ is semantically close to the implication's \prologTerm{Head}, which corresponds to the {\fontfamily{lmtt}\selectfont goal\,}.
\paragraph{\emph{Bidirectional Beam Search:}} Here, we construct all possible beam results of $\mathbb{COMET}$$(r_e, s_1)$, where $s_1$ is the natural language clause that corresponds to the implication's \prologTerm{Body}, for all $r_e$ that are post-effect relations as well as $\mathbb{COMET}$$(r_c, o_N)$, where $o_N$ is the natural language clause corresponding to the \prologTerm{Head} of the implication in the logic template, for all $r_c$ that are pre-condition relations.
The proof succeeds when two intermediate beam results are semantically close in the beam search path from either direction (Fig \ref{fig:blue_template}).
\subsection{Dialog System}
The reasoning chains obtained by the prover are passed to the Dialog System, which has two main goals. The first is to confirm the prover obtained valid reasoning chains by asking the user if they think the automatically recovered proofs are ``correct'' from a commonsense stand point (Fig \ref{fig:dialog}). The necessity of this was also confirmed in \citet{Bosselut2019COMETCT}'s human evaluation studies. The second is to overcome the problem of missing knowledge when the user rejects all the proofs returned by the prover. We introduce the dialog generators responsible for fulfilling each of the above
goals in what follows.
\paragraph{Humans as Knowledge Evaluators}
The dialog generator
confirms the returned $\mathbb{COMET}$~proofs with humans before adding it as background knowledge to $\mathcal{K}$. In order to do this, it chooses the top 5 proofs with the highest similarity scores and presents them as candidates to the human user to choose from. Our study shows that these multiple choices not only help confirm $\mathbb{COMET}$~results but they also provide guidance to users as to what information the system is looking for.
As shown in Figure \ref{fig:dialog}, five explanations for the question are returned by \varmathbb{CLUE}. The user chooses one and provides an explanation as to why he/she chose that option. The explanation is in open-domain text, formatted as a series of if-then statements. This is because if-then formatted explanations can be easily
parsed using our parser.
In this step, the question asked from users is contingent on which logic template the if-then-because command follows. The dialog system's flowchart as well as an example dialog are in the appendix.
\paragraph{Humans as Novel Knowledge Contributors}
We also use human interaction to acquire novel knowledge that does not exist in the background knowledge bases, $\mathcal{K}$ and $\mathbb{COMET}$.
When faced with missing knowledge in $\mathcal{K}$, \varmathbb{CLUE}~uses the same technique from \citet{corgi} with a rephrased, more comprehensive question, ``what ensures $\langle$ {\fontfamily{lmtt}\selectfont goal\,}$\rangle$?'' resulting in higher quality feedback.
If the user's response to the multiple-choice question is ``None of the above'', it indicates that $\mathbb{COMET}$~has missing knowledge. \varmathbb{CLUE}~then asks the user for an explanation and adds the new knowledge to $\mathcal{K}$ and runs CORGI's reasoning module to construct a proof.
It is worth noting that since $\mathcal{K}$ is orders of magnitudes smaller than SOTA knowledge bases, growing it with novel knowledge does not introduce any scalability issues.
\section{Related Work}
Efforts in developing commonsense reasoning started as early as the foundation of the field of artificial intelligence \cite{grice1975logic,winograd1972understanding,davis2015commonsense, minskyframework}.
Commonsense reasoning is becoming more prominent as computers increase their interactions with us in our daily lives. For example, conversational agents such as Alexa, Siri, Google Home and others have very recently entered our daily lives. However, they cannot currently engage in natural sounding conversations with their human users mainly due to lack of commonsense reasoning. Moreover, they operate mostly on a pre-programmed set of tasks. On the other hand, instructable agents \cite{azaria2016instructable,labutov2018lia,li2018appinite,li2017programming,li2017sugilite,guo2018dialog,mohan2014learning,mininger2018interactively,mohan2012acquiring}, can be taught new tasks through natural language instructions/demonstrations. One of the challenges these bots face is correctly grounding their natural language instructions into executable commands.
Our approach addresses a new reasoning task proposed by \citet{corgi} that contains commands given to an instructable agent satisfying a general template.
In contrast to this challenging task and TimeTravel \cite{qin2019counterfactual}, most commonsense reasoning benchmarks have traditionally been designed in a multiple choice manner. Moreover, they are not typically targeted at conversational agents.
Refer to \citet{storks2019commonsense} and \citet{corgi} for a comprehensive list of commonsense reasoning benchmarks.
Our commonsense reasoning engine uses a SOTA neural knowledge model, $\mathbb{COMET}$~\cite{Bosselut2019COMETCT}, as an underlying source of commonsense knowledge. $\mathbb{COMET}$~is a framework for constructing knowledge bases from transformer-based language models. In contrast to previous automatic knowledge base construction methods that rely on semi-structured \cite{suchanek2007yago,hoffart2013yago2,auer2007dbpedia} and unstructured \cite{dong2014knowledge,carlson2010toward,mitchell2018never,nakashole2012patty} text extraction, $\mathbb{COMET}$~uses transfer learning to adapt language models to generate knowledge graph tuples by learning on examples of structured knowledge from a seed KB.
$\mathbb{COMET}$~was recently used for persona-grounded dialog for chatbots \cite{majumder2020like}.
| {'timestamp': '2021-09-20T02:17:55', 'yymm': '2109', 'arxiv_id': '2109.08544', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08544'} | arxiv |
\section{Introduction}
Answer set programming (ASP) \cite{GL2,MT5,EFPL12} is a popular nonmonotonic-logic based paradigm for knowledge representation and solving combinatorial problems. Computing the answer set of an ASP program is NP-hard in general, and researchers have been investing significant effort to speed it up. Most ASP solvers employ SAT solver-like technology to find these answer sets. As a result, justification for why a literal is in the answer set is hard to produce. There are dependency graph (DG) based approaches to find answer sets, but due to the representational limitations of dependency graphs, such approaches are limited. In this paper we propose a novel dependency graph-based approach for finding answer sets in which conjunction of goals is explicitly represented as a node which allows arbitrary answer set programs to be uniformly represented. Our representation preserves causal relationships allowing for justification for each literal in the answer set to be elegantly found.
Compared to SAT solver based implementations, graph-based implementations of ASP have not been well studied. Very few researchers have investigated graph-based techniques. NoMoRe system \cite{anger2001nomore} represents ASP programs with a \textit{block graph} (a labeled graph) with meta-information, then computes the A-coloring (non-standard graph coloring with two colors) of that graph to obtain answer sets. Another approach \cite{konczak2005graphs} uses \textit{rule dependency graph} (nodes for rules, edges for rule dependencies) to represent ASP programs, then performs graph coloring algorithm to determine which rule should be chosen to generate answer sets. Another group \cite{linke2005suitable} proposed an hybrid approach which combines different kinds of graph representations that are suitable for ASP. The hybrid graph uses both rules and literals as nodes, while edges represent dependencies. It also uses the A-coloring technique to find answer sets.
All of the above approaches were well designed, but their graph representations are complex as they all rely on extra information to map the ASP elements to nodes and edges of a graph. In contrast, our approach uses a much simpler graph representation, where nodes represent literals and an edge represent the relationship between the nodes it connects. Since this representation faithfully reflects the causal relationships, it is capable of producing causal justification for goals entailed by the program.
In the rest of the paper, we assume that the reader is familiar with ASP. Details can be found elsewhere \cite{baral,gelfond2014knowledge}.
\iffalse
\section{General Background} \label{sec:background}
\subsection{Answer Set Programming} \label{sec:asp}
Answer Set Programming (ASP) is a declarative paradigm that extends logic programming with negation-as-failure. ASP is a highly expressive paradigm that can elegantly express complex reasoning methods, including those used by humans, such as default reasoning, deductive and abductive reasoning, counterfactual reasoning, constraint satisfaction~\cite{baral,gelfond2014knowledge}.
ASP supports better semantics for negation ({\it negation as failure}) than does standard logic programming and Prolog. An ASP program consists of rules that look like Prolog rules. The semantics of an ASP program {$\Pi$} is given in terms of the answer sets of the program \texttt{ground($\Pi$)}, where \texttt{ground($\Pi$)} is the program obtained from the substitution of elements of the \textit{Herbrand universe} for variables in $\Pi$~\cite{baral}.
Rules in an ASP program are of the form:
\begin{equation}
\resizebox{.6\linewidth}{!}{$
\texttt{p :- q$_1$, ..., q$_m$, not r$_1$, ..., not r$_n$.}
$}
\label{rule1}
\end{equation}
\noindent where $m \geq 0$ and $n \geq 0$. Each of \texttt{p} and \texttt{q$_i$} ($\forall i \leq m$) is a literal, and each \texttt{not r$_j$} ($\forall j \leq n$) is a \textit{naf-literal} (\texttt{not} is a logical connective called \textit{negation-as-failure} or \textit{default negation}). The literal \texttt{not r$_j$} is true if proof of {\tt r$_j$} \textit{fails}. Negation as failure allows us to take actions that are predicated on failure of a proof.
Thus, the rule {\tt r :- not s.} states that {\tt r} can be inferred if we fail to prove {\tt s}.
Note that in Rule \ref{rule1}, {\tt p} is optional. Such a headless rule is called a constraint, which states that conjunction of {\tt q$_i$}'s and \texttt{not r$_j$}'s should yield \textit{false}. Thus, the constraint {\tt :- u, v.} states that {\tt u} and {\tt v} cannot be both true simultaneously in any model of the program (called an answer set).
The declarative semantics of an Answer Set Program \texttt{P} is given via the Gelfond-Lifschitz transform~\cite{baral,gelfond2014knowledge} in terms of the answer sets of the program \texttt{ground($\Pi$)}.
More details on ASP can be found elsewhere~\cite{baral,gelfond2014knowledge}.
\fi
\section{Dependency Graph}\label{sec:dg}
A dependency graph \cite{linke2005suitable} uses nodes and directed edges to represent dependency relationships of an ASP rule.
\begin{definition}
The dependency graph of a program is defined on its literals s.t. there is a positive (resp. negative) edge from $p$ to $q$ if $p$ appears positively (resp. negatively) in the body of a rule with head $q$.
\label{def1}
\end{definition}
Conventional dependency graphs are not able to represent ASP programs uniquely. This is due to the inability of dependency graphs to distinguish between non-determinism (multiple rules defining a proposition) and conjunctions (multiple conjunctive sub-goals in the body of a rule) in logic programs. For example, the following two programs have identical dependency graphs (Figure \ref{fig:fig1}).\\
\noindent\begin{minipage}{.45\textwidth}
\begin{lstlisting}[language=prolog,basicstyle=\small]
p :- q, not r, not p.
\end{lstlisting}
\end{minipage}
\begin{minipage}{.45\textwidth}
\begin{lstlisting}[language=prolog,basicstyle=\small]
p :- q, not p. p :- not r.
\end{lstlisting}
\end{minipage}
To make conjunctive relationships representable by dependency graphs, we first transform it slightly to come up with a novel representation method. This new representation method, called conjunction node representation (CNR) graph, uses an artificial node to represent conjunction of sub-goals in the body of a rule. This conjunctive node has a directed edge that points to the rule head (Figure \ref{fig:fig2}).
\begin{figure}[tb]
\centering
\begin{minipage}{.5\textwidth}
\centering
\includegraphics[scale=0.3]{images/figure_1.png}
\caption{Dep. Graph for Programs 1 \& 2}
\label{fig:fig1}
\end{minipage}%
\begin{minipage}{.5\textwidth}
\centering
\begin{subfigure}[b]{0.5\linewidth}
\centering
\includegraphics[scale=0.3]{images/figure_2a.png}
\caption{CNR for Program 1}
\end{subfigure}\hfill
\begin{subfigure}[b]{0.5\linewidth}
\centering
\includegraphics[scale=0.3]{images/figure_2b.png}
\caption{CNR for Program 2}
\end{subfigure}
\caption{CNRs for Program 1 \& 2}
\label{fig:fig2}
\end{minipage}
\end{figure}
The conjunction node, which is colored black, refers to the conjunctive relation between the in-coming edges from nodes representing subogals in the body of a rule. Note that a CNR graph is not a conventional dependency graph.
\medskip\noindent\textbf{Converting CNR Graph to Dependency Graph} \label{sec:cnrtodg}
Since CNR graph does not follow the dependency graph convention, we need to convert it to a proper dependency graph in order to perform dependency graph-based reasoning. We use a simple technique to convert a CNR graph to an equivalent conventional dependency graph. We negate all in-edges and out-edges of the conjunction node. This process essentially converts a conjunction into a disjunction. Once we do that we can treat the conjunction node as a normal node in a dependency graph. As an example, Figure \ref{fig:fig3} shows the CNR graph to dependency graph transformation for program {\tt p :- q, not r.} This transformation is a simple application of De Morgan's law. The rule in this program represents {\tt p :- C. and C :- q, not r.} The transformation produces the equivalent rules {\tt p :- not C., C :- not q. and C :- r.}
\noindent Since conjunction nodes are just helper nodes which allow us to perform dependency graph reasoning, we don't report them in the final answer set.
\medskip\noindent\textbf{Constraint Representation} \label{sec:constraintnode}
ASP also allows for special types of rules called constraints. There are two ways to encode constraints: (i) headed constraint where negated head is called directly or indirectly in the body (e.g., Program 3), and (ii) headless constraints (e.g., Program 4). \\
\noindent\begin{minipage}{.45\textwidth}
\begin{lstlisting}[language=prolog,basicstyle=\small]
p :- not q, not r, not p.
\end{lstlisting}
\end{minipage}
\begin{minipage}{.45\textwidth}
\begin{lstlisting}[language=prolog,basicstyle=\small]
:- not q, not r.
\end{lstlisting}
\end{minipage}
Our algorithm models these constraint types separately. For the former one, we just need to apply the CNR-DG transformation directly. Note that the head node connects to the conjunction node both with an in-coming edge and an out-going edge (Figure \ref{fig:fig4a}). For the headless constraint, we create a head node with truth value as \textit{False}.
\begin{figure}[tb]
\centering
\begin{minipage}{.5\textwidth}
\centering
\includegraphics[width=.6\linewidth]{images/figure_3.png}
\caption{CNR-DG Transformation}
\label{fig:fig3}
\end{minipage}%
\begin{minipage}{.5\textwidth}
\centering
\begin{subfigure}[b]{0.5\linewidth}
\centering
\includegraphics[scale=0.3]{images/figure_4a.png}
\caption{Program 3}
\label{fig:fig4a}
\end{subfigure}\hfill
\begin{subfigure}[b]{0.5\linewidth}
\centering
\includegraphics[scale=0.3]{images/figure_4b.png}
\caption{Program 4}
\label{fig:fig4b}
\end{subfigure}
\caption{Constraint DG}
\label{fig:fig4}
\end{minipage}
\end{figure}
The reason why we don't treat a headless constraint the same way as a headed constraint is because in the latter case, if head node ({\tt p} in Program 3) is provable through another rule, then the headed constraint is inapplicable. Therefore, we cannot simply assign a false value to its head.
\section{grASP: A Bottom-up Approach}
We have developed the grASP graph-based algorithm for finding answer sets. The philosophy of grASP is to translate an ASP program into a dependency graph (via CNR conversion), then propagate truth values from nodes whose values are known to other connected nodes, obeying the sign on the edge, until the values of all the nodes are fixed. However, due to possible existence of a large number of cycles, the propagation process is not straightforward. In grASP, we define a collection of rules for propagating values among nodes involved in cycles. These assignment rules take non-monotonicity of answer set program and the causal relationship among nodes in the dependency graph into account.
Unlike other SAT-solver based approaches, our graph based approach enables stratification of ASP programs on the basis of dependence. The Splitting Theorem \cite{lifschitz1994splitting} can thus be used to link the various levels, permitting values to be propagated among nodes more efficiently. Also, the existence of sub-structures (sub-graphs) makes an efficient recursive implementation algorithm possible.
\subsection{Cycles in Program} \label{sec:cycle}
In an ASP program, cycles among literals may exist. There are three kinds of cycles that can be found in the program: even cycles, odd cycles, and positive cycles. Even cycles and odd cycles refer to cycles that have even or odd number of negative edges in the corresponding dependency graph. Positive cycles are cycles with no negative edge. It is well known that even cycles generate multiple worlds, while odd cycles kill worlds. For example, in program {\tt p :- not q. q :- not p.}, $p$ and $q$ forms an even cycle, which generates two mutually exclusive worlds: \{p/True, q/False\} and \{q/True, p/False\}. For program {\tt p :- not q. q :- not r. r :- not p.}, nodes $p$, $q$ and $r$ form an odd cycle, which makes the program unsatisfiable.
\subsection{The grASP Algorithm} \label{sec:graspalgorithm}
The grASP algorithm is recursive in nature. Since a dependency graph represents the causal relationships among nodes, the reasoning should follow a topological order. We don't need to do topological sorting to obtain the order, instead, for each iteration, we just pick those nodes which have no in-coming edges. We call this kind of node a \textbf{root node}. After picking the root nodes, the algorithm checks their values. If a root node's value has not been fixed (no value yet), we assign \textit{False} to it. Otherwise, the root node will keep its value as is. Once all root nodes' values are fixed, we will propagate the values along their out-going edges in accordance with the sign on each edge (the propagation rules will be discussed in Section \ref{sec:propagate}). At the end of this iteration, we remove all root nodes from the graph, then pass the rest of the graph to the recursive call for the next iteration.
The input graph may contain cycles, and, of course, there will be no root nodes in a cycle. Therefore, this recursive process will leave a cycle unchanged. To cope with this issue, we proposed a novel solution, which wraps all nodes in the same cycles together, and treat the wrapped nodes as a single \textit{virtual} node. All the in-coming and out-going edges connecting the wrapped nodes to other nodes will be incident on or emanate from the virtual node. Thus, the graph is rendered acyclic and ready for the root-finding procedure.
For each iteration of the recursive procedure, we have to treat regular root nodes and virtual root nodes differently. If the node is a regular node, we do the value assignment, but if it is a virtual node, we will have to \textit{break the cycles}. Cycle breaking means that we will remove the appropriate cycle edges by assigning truth values to the nodes involved (\textit{cycle breaking} will be discussed in this section later). After cycle breaking, we will pass the nodes and edges in this virtual node to another recursive call, because the virtual node can be seen as a substructure of the program. The returned value of the recursive call will be the answer set of the program constituting the virtual node. When all regular and virtual root nodes are processed, we will have to merge the values for propagation.
The value propagation in each iteration makes use of the \textbf{splitting theorem} \cite{lifschitz1994splitting} (details omitted due to lack of space). After removing root nodes, rest of the graph acts as the \textit{top} strata and all of the predecessors constitute the \textit{bottom} strata, using the terminology of \cite{lifschitz1994splitting}. Thus, when we reach the last node in the topological order, we will get the whole answer set.
The cycle breaking procedure may return multiple results, because a negative even cycle generates two worlds (as discussed in Section \ref{sec:cycle}). Therefore, the merging of solution for the root nodes may possibly result in exponential number of solutions. For example, if the root nodes consists of one regular node and two virtual nodes, each virtual node generates two worlds \& the merging process will return four worlds. Of course, this exponential behavior is inherent to ASP.
\medskip\noindent\textbf{Propagation Rules} \label{sec:propagate}
In an ASP rule, the head term only can be assigned as \textit{True} if all its body term(s) are true. For example, in rule {\tt p :- not q.}, only when {\tt q} is unknown or known as \textit{False}, {\tt p} will be \textit{True}. For another example {\tt p :- q.}, {\tt p} will be \textit{True}, only when {\tt q} is known as \textit{True}. In both examples, {\tt p} will not be assigned as \textit{False}, until the reasoning of the whole program fails to make it \textit{True}. Therefore, mapping this to our graph representation, we obtain two propagation rules: (i) when a node $N$ has a \textit{True} value, assign \textit{True} to all the nodes connected to $N$ via positive out-going edges of $N$; (ii) when a $N$ node has a \textit{False} value, assign \textit{True} to all the nodes connected to $N$ via negative out-going edges of $N$.
\medskip\noindent\textbf{Cycle Wrapping}
As previously mentioned (Section \ref{sec:graspalgorithm}), those nodes which are involved in the same cycles need to be wrapped into a virtual node. The reason being that we want the tangled nodes to act like a single node, in order to be found as a root. This requires the dependency of the wrapped nodes to be properly handled. The virtual node should inherit the dependencies of all the node it contains. These dependency relations include both incoming and outgoing edges.
Since cycles may be overlapped or nested with each other, we can make use of the strongly connected component concept in graph theory. Thus, each strongly connected component will be a virtual node.
\medskip\noindent\textbf{Cycle Breaking} \label{sec:cyclebreaking}
We can state the following corollary:
\begin{corollary}
In the dependency graph of an answer set program, if a node's value is True, all of its in-coming edges and negative out-going edges can be removed. If a node's value is False, then all its positive out-edges can be removed.
\label{corol}
\end{corollary}
\begin{proof}
According to the propagation rules (discussed in Section \ref{sec:propagate}), a node can only be assigned \textit{True} through in-coming edges. When a node has already been known as \textit{True}, it no longer needs any assignment, then all in-coming edges become meaningless. Also, a negative edge won't be able to propagate the \textit{True} value to the other side. If a node has been known as \textit{False}, we still have to keep its in-coming edges to detect inconsistency (if some of its predecessors attempt to assign it as \textit{True}, the program is inconsistent). Note that a node labeled \textit{False} cannot make any node \textit{True} through an outgoing positive edge.
\end{proof}
\noindent We will use Corollary \ref{corol} to remove edges while breaking cycles. The most important thing for cycle breaking is that we need to follow a specific order with respect to types of cycles. As we discussed in Section \ref{sec:cycle}, an even cycle can divide a world into two, while an odd cycle will make one or more worlds unsatisfiable and thus disappear (this happens if no node in the odd cycle has the value \textit{True}). Therefore, when breaking a virtual node that has hybrid cycles, we need to first check those odd cycles to make sure that these cycles are satisfiable. An odd cycle will make the world satisfiable if and only if it has \textit{True} nodes. In a virtual node, the only way for an odd cycle to have \textit{True} node would be by overlapping with an even cycle. The overlapping node is assigned \textit{True} which means that the even cycle admits only possible world, that is the one with the overlapped node as \textit{True}.
When there is an odd cycle which does not overlaps with any even cycle, no assignment is possible. If there is neither even cycle, nor odd cycle, the only possible situation is that all nodes that are connected by positive edges. Since we are in the virtual node which has no predecessors, there is no way to make these nodes \textit{True}; so we assign \textit{False} to every node, and delete all edges.
\medskip\noindent\textbf{Performance} \label{sec:implementation}
The grASP system has been written in python and uses the $DiGraph$ data structure and \textit{simple\_cycles} function from NetworkX ~\cite{SciPyProceedings_11}. The performance testing for grASP was done on two types of programs: (i) established benchmarks such as N-queens; (ii) randomly generated answer set programs. Clingo \cite{DBLP:journals/corr/GebserKKS14} was chosen as the system to compare with. For the first phase, we chose four classic NP problems (map coloring problem, Hamiltonian cycle problem, etc.). The results are shown in Table \ref{tb1}. For the second phase, we used a novel propositional ASP program generator that we have developed for this purpose to generate random programs. The testing performed five rounds with 100 programs each (Table \ref{tb2}). The performance comparison shows that for programs with simpler cycle conditions, grASP achieved similar speed to Clingo, but when solving programs with large number of cycles, grASP is slowed down by the cycle breaking process.
More details about grASP can be found at arXiv \cite{grASP2021fang}.
\begin{table}
\parbox{.5\linewidth}{
\centering
\scalebox{0.9}{
\begin{tabular}{lrr}
\toprule
Problem & Clingo & grASP \\
\midrule
Coloring-10 nodes & 0.004 & 0.693\\
Coloring-4 nodes & 0.001 & 0.068\\
Ham Cycle-4 nodes(no cross edges) & 0.001 & 0.052\\
Ham Cycle-4 nodes(fully connected) & 0.002 & 0.089\\
Birds & 0.001 & 0.001\\
Stream Reasoning & 0.001 & 0.001\\
\bottomrule
\end{tabular}
}
\caption{Performance Comparison on Classic Problems}
\label{tb1}
}
\parbox{.5\linewidth}{
\centering
\scalebox{0.9}{
\begin{tabular}{lrrrrr}
\toprule
Round & \#Rules & \#EC & \#OC & Clingo & grASP \\
\midrule
1 & 3231 & 61813 & 61781 & 0.032 & 0.351\\
2 & 3078 & 28593 & 29040 & 0.027 & 0.276\\
3 & 3307 & 39346 & 39433 & 0.028 & 0.087\\
4 & 3069 & 14581 & 14868 & 0.022 & 0.405\\
5 & 3074 & 23017 & 22984 & 0.024 & 0.801\\
\bottomrule
\end{tabular}
}
\caption{Performance on Random Problems (time in seconds, EC: even cycles, OC: odd cycles)}
\label{tb2}
}
\end{table}
\section{igASP: A Top-down Approach}
Our top-down approach is called igASP, which stands for incremental graph-based ASP solver. The philosophy of igASP is to translate an ASP program into a CNR dependency graph, which is always constrained by some constraint rules, then try to satisfy the constraints by assigning presumed truth values to the related nodes, until all constraints have been satisfied. At the same time, igASP will propagate truth values of the nodes whose truth value has already been determined.
Our graph-based approach performs reasoning in an incremental manner. It starts from the constraints in the answer set program and traces along causal nodes until it find support through facts (well-founded case) or it detects a cycle through negation (cyclic case). Our algorithm can be thought of as a more general form of the Galliwasp algorithm for query-driven execution of answer set programs \cite{galliwasp2}. The igASP approach is constraint-driven and thus significantly reduces the search space by avoiding exploration of worlds that are inconsistent with the constraints. Furthermore, the incremental reasoning from constraints allows igASP to perform query-driven execution.
\subsection{The igASP Algorithm} \label{sec:igASPalgorithm}
The igASP algorithm is a recursive algorithm. Since a CNR dependency graph represents the causal relationships among nodes, a topological order would indicate the truth values flow along edges from one node to another starting from the leaves. By their nature, the constraint nodes (labeled \textit{False}, discussed in Section \ref{sec:dg}) will be at the end of such flows in the CNR dependency graph. Therefore, we can incrementally establish the satisfiability relationships across all the nodes starting from the constraint nodes. This incremental establishment of satisfiability starting from the constraint nodes amounts to developing a proof tree. An example (Program 5) is shown in Figure \ref{fig:incre-graph} where the graph is to the left and proof tree to the right. To falsify the constraint node, i.e., to ensure it is \textit{False}, node $m$ must be \textit{True} and $n$ must be \textit{False}. For node $m$ to be \textit{True}, at least one of the three must hold: $p$ is \textit{True}, $q$ is \textit{False}, or $r$ is \textit{True}. When every node's presumed truth value has been found to be consistent with all the dependencies, the algorithm will return the answers.
\begin{figure}[tb]
\centering
\includegraphics[scale=0.3]{images/incre-graph.png}
\caption{Satisfiability Example}
\label{fig:incre-graph}
\end{figure}
\begin{lstlisting}[language=prolog,basicstyle=\small]
m :- p. m :- not q. m :- r. :- not m. :- n.
\end{lstlisting}
\medskip\noindent\textbf{Effective Edge:}
An effective edge in a CNR dependency graph refers to any edge that propagates \textit{True} value to the node it is incident on. There are two type of \textit{effective} edges: (i) positive edge emanating from a \textit{True} node; (ii) negative edge emanating from a \textit{False} node. An effective edge only points to a \textit{True} node.
\medskip\noindent\textbf{Satisfying Conjunction vs. Disjunction:}
There are two kinds of dependencies that may arise for a node in the CNR dependency graph: conjunctive and disjunctive. A conjunctive dependency refers to the situation where a node is presumed to be \textit{False}. In this case, none of the edges incident into the node should be effective edges. A disjunctive dependency indicates that when a node is presumed to be \textit{True}, at least one of the in-coming edges should be effective. Since igASP works in a reverse manner (from constraints to facts), we may get multiple partial models before we can validate the \textit{True}/\textit{False} label of the current node. For both conjunction and disjunction, these partial models need to be merged for the sake of integrity as well as efficiency. The merging process is discussed later.
\medskip\noindent\textbf{Proof Branch:}
In the igASP algorithm, we start from the constraints that have to be shown to be false, and incrementally construct a proof tree obeying the constraints imposed by the CNR dependency graph. In this incremental reasoning process, we will pursue various paths in the CNR dependency graph. Our proof will have multiple branches, corresponding to various paths in the CNR dependency graph. Traversal of a branch stops when we reach a fact node whose value has already been given by the ASP program (i.e., known to be a true due to being a fact or known to be false because the atom does not have a rule with that atom as head), or sense that the branch contains a \textbf{cycle}.
\medskip\noindent\textbf{Cycle Handling:}
For positive cycles, we need to ensure that any models computed are consistent with ASP semantics. Suppose we have a program {\tt p :- q. q :- p.}, under ASP semantics, it will have only one answer set: \{p/False, q/False\}. The other model (\{p/True, q/True\}) has to be rejected, as it is not well-founded per ASP semantics. Thus, positive cycles have to be handled properly so that only correct answer sets are reported.
To detect a cycle, igASP keeps track of the presumed nodes along the branch, when the current node has been seen previously, we will check whether there exist any \textit{False} node between these two nodes. If so, it is an even cycle, otherwise, it is a positive cycle and only the falsifying assignment should be computed.
\medskip\noindent\textbf{Model Merging}
As mentioned previously, for each presumed node $n$ (i.e., a node assigned a truth value), its dependencies will be either conjunctive (if $n$ is presumed \textit{False})
or disjunctive.
(if $n$ is presumed \textit{True}).
For both conditions, we need to merge the partial models that have been computed so far while assigning a truth value to the dependent nodes.
For the conjunctive condition, the merging process only takes successfully merged models, each of which are the union of two non-conflicting sub-models.
For example, consider a node $n$ that is presumed to be \textit{False}. Suppose it has two predecessors $p$ and $q$, both $p$ and $q$ connect to $n$ via negative edges. So that $n$ will only be \textit{False} when both $p$ and $q$ will be \textit{True}. We need a conjunctive merge here. Suppose we have sub-models \{p1:\{a/True, d/True, b/False\}, p2:\{a/False, b/True\}\} that hold for $p$ to be \textit{True}, and sub-models \{q1:\{a/True, c/True, b/False\}\} for $q$ to be \textit{True}. The conjunction merging of sub-models between $p$ and $q$ will only accept the union of $p1$ and $q1$, because $p2$ conflicts with $q1$. Therefore, there will only be one model to satisfy for $n$ being \textit{False}, that is \{a/True, c/True, d/True, b/False\}.
For a disjunctive merging, we will keep the conflicted sub-models along with successfully merged ones. Let's modify the above example a little bit by presuming the value of node $n$ to be \textit{True}, and keep everything else unchanged. Now the merging condition became disjunctive, because one of $p$ or $q$ being \textit{False} will still make $n$ \textit{True}. Since $p1$ and $q1$ can be merged without conflict, we replace them by their union \{a/True, c/True, d/True, b/False\}. But this time we don't discard $p2$, because $p2$ is also a valid model that makes $n$ \textit{True}. Therefore, after this merging, we will have two sub-models for $n$ being \textit{True}: \{\{a/True, c/True, d/True, b/False\}, \{a/False, b/True\}\}.
\medskip\noindent\textbf{Forward Propagation:}
Since nodes are assigned values is in a backward chaining manner, where we compute the truth assignment of the predecessors before that of the current node, the sub-models needs to cover as much information as possible. If some nodes' value can be inferred from the proven nodes, they must also be added into the sub-model. For example, suppose we have a sub-model \{a/True, b/False\} for making node $n$ \textit{True}. Suppose there are two additional rules related to node $a$ and $b$: {\tt (i) c :- a. (ii) d :- not b.} In this case, we know that $c$ and $d$ must also be \textit{True}.
igASP propagates truth values every time a presumed node value has been established, by using a causal map which covers all of the causal relationships for each node/value. When a presumed node/value is established, igASP will check whether there is any other node whose value can be inferred from current node assignments. If there are any, the inferred value is assigned to that node and propagation continues until the model does not change.
\medskip\noindent\textbf{Query Handling:}
A query w.r.t. an ASP program amounts to checking whether a literal is in one of the models of the program. For instance, ASP program {\tt p :- not q. q :- not p. :- p, q.} has two models \{\{p/True, q/False\}, \{p/False, q/True\}\}. If we query $p$, we should get the model $\{p\}$.
For query handling, igASP negates the query literal and append it to the ASP program as an additional constraint. So for the above example, the query $p/True$ will be converted to a constraint rule {\tt :- not p.} and added to the original program. So the program will now be {\tt p :- not q. q :- not p. :- p, q. :- not p.}
\medskip\noindent\textbf{Non-constrained (Non-headless-rules) Program Handling:}
igASP begins its reasoning from a constraint node (typically, the query represented as a constraint), then searches for a partial answer set to satisfy the constraint.
This may raise a concern: How about an ASP program that has no global constraints (headless rules) at all? To solve this problem, igASP performs a conversion on the original dependency graph.
Since all original facts in an ASP program should never be \textit{False}. It means that we can take all negated facts as global constraints. Therefore, for any ASP program has default facts, we will generate global constraints accordingly. What if there is no fact in the program? In this case, igASP picks one node, and links it to the ``Constraint" node with both positive and negative edges (via a conjunction node). The reason is simple, a node will either be \textit{True} or \textit{False}. For a program whose dependency graph is disconnected, igASP picks one node from each separated sub-graph, and links them to the ``Constraint" node with both positive and negative edges. For picking which node to connect with the ``Constraint" node, we use a heuristic which chooses the node with most in-coming edges. Since in-coming edges represent dependencies, and each sub-graph is connected, the heuristic is admissible.
\subsection{A Partial Implementation}
Currently, igASP is still under implementation, we are exploring to apply CDCL (Conflict driven clause learning) to improve the performance. Meanwhile, we have developed an application based on a partial implementation of igASP, which only finds partial answer sets. In some application scenarios, finding the whole answer sets may be an overkill or even inapplicable. Especially for commonsense reasoning, where the knowledgebases may be large and guaranteeing consistency may be hard as parts of the knowledgebase were constructed separately. If a subset of the knoweldgebase that contains the answer we are seeking is consistent, we may not care about other inconsistent part of the knowledgebase. In this case, a partial answer set solver will be preferred. This application system (DiscASP) will be presented at the Technical Communications of ICLP 2021.
\section{Causal Justification} \label{sec:causaljustification}
A major advantage of our graph approaches is that they provides justification as to why a literal is in an answer set for free. Providing justification is a major problem for implementations of ASP that are based on SAT solvers. In contrast to SAT-based ASP solvers, our graph representation maintains the information about structure of an ASP program while computing stable models. Indeed, the resulting graph itself is a justification tree. Since the truth values of all vertices are propagated along edges, we are able to find a justification by looking at the effective out-going edges and their ending nodes. Here the effective out-going edge refer to an edge that actually propagated \textit{True} value to its ending node. According to propagation rules that are discussed in Section \ref{sec:propagate}, there are only two type of \textit{effective} out-going edges: (i) positive edge coming from a \textit{True} node; (ii) negative edge coming from a \textit{False} node. Every effective out-going edge should point to a \textit{True} node. Therefore, the justification first picks effective out-going edges, then check each edge's ending node. If all those ending nodes are \textit{True}, the answer set is justified.
\section{Current Status and Future Works}
We proposed two dependency graph based approaches to compute the answer sets of an answer set program. We use a novel transformation to ensure that each program has a unique dependency graph, as otherwise multiple programs can have the same dependency graph. A major advantage of our algorithm is that it can produce a justification for any proposition that is entailed by a program.
Currently, grASP has been finished as the first working version, while igASP is still under implementation. Meanwhile, we have implemented an application of the partial version of igASP, which compute the atoms of an answer set that are related to a query atom within a fixed ``causal distance". This application system will be published at the Technical Communication of ICLP 2021.
For now, both approaches only work for propositional answer set programs. Our goal is to extend it so that answer sets of datalog programs (i.e., answer set programs with predicates whose arguments are limited to variables and constants) can also be computed without having to ground them first. This will be achieved by dynamically propagating bindings along the edges connecting the nodes in our algorithm's propagation phase.
Even though the speed of execution on grASP is slower compared to Clingo, it still finds solutions to NP-hard problems in a reasonable time. We expect that igASP will be much more efficient due to its constraint-driven nature. We plan to investigate optimizing techniques such as conflict driven clause learning \cite{silva2003grasp,gebser22} to speed up execution. Our graph approaches are more than just ASP solvers: their visualization feature makes it suitable for educational purpose and for debugging. Moreover, graph-based approaches bring new possibilities for applying optimization.
\bibliographystyle{eptcs}
| {'timestamp': '2021-09-21T02:00:09', 'yymm': '2109', 'arxiv_id': '2109.08681', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08681'} | arxiv |
\section{Introduction}
Quality Estimation (QE) \cite{specia-etal-2020-findings-wmt} is the task of predicting the quality of an automatically translated sentence at test time, without the need to rely on reference translations.
Formally, given a source sentence, $s$ and a translated sentence, $t$, the goal of QE is to learn a regression model, $m$ such that $m(s,t)$ returns a score that represents the quality of the translated sentence.
There are many important applications of quality estimation, for example, translation companies use QE systems to identify mistranslated sentences, which would reduce post-editing costs and efforts, while online platforms use QE systems as filters to hide poorly translated sentences from end-users. Additionally, with the proliferation of mined parallel data obtained from web-crawls as a source of NMT training data~\cite{el2020searching,el2020massive}, QE has become an important tool in performing quality control on translations from models trained on noisy training data.
The performance of a QE system is usually measured by the correlation
between predicted QE and human-annotated QE scores.
However, the predictions of QE models are primarily used to make binary decisions \cite{zhou2020practical}:
only translations above a certain QE threshold would be given to a human for post-edition in a translation company, or shown to the user in an online platform.
Therefore, Pearson correlation might not be the best metric to evaluate the actual performance of the QE models in real-world use cases.
In recent iterations of the QE shared task at the Conference on Machine Translation (WMT) \cite{fonseca2019findings, specia-etal-2020-findings-wmt}, the top-performing QE systems have been built on large multilingual contextualized language models that were pre-trained on huge amounts of multilingual text data.
Further, these QE models are multilingual and work well in zero-shot scenarios \cite{sun-etal-2020-exploratory}.
This characteristic makes them very appealing for real-life scenarios because it removes the need to train one bilingual model for every pair of languages.
However, these neural QE models contain millions of parameters and as such their memory and disk footprints are very large. Moreover,
at inference time they are often
more computationally
expensive than the upstream neural machine translation (NMT) models, making them unsuitable for deployment in applications with low inference latency requirements or on devices with disk or memory constraints.
In this paper we explore applying compression techniques to these large QE models to yield more practical, lower-latency, models while retaining state-of-the-art (SoTA) performance.
Our {\bf main contributions and findings} are:
\begin{enumerate}
\item We conduct a thorough study on the efficiency of SoTA neural QE models.
\item We shed light on the performance of recent compression techniques on a multilingual regression task and show that these techniques are inadequate for regression.
\item We empirically show that regression has a lower level of compression effectiveness than classification, on publicly available multilingual QE datasets.
\item We argue that the level of expressiveness of a regression model in a continuous range is unnecessary given the downstream applications of QE, and evaluating QE models using classification metrics would better reflect their actual performance in real-world applications.
\todo{modify this claim}
\item We find that multilingual QE models are not as effective as bilingual QE models on both regression and binary classification, for models with higher degrees of compression.
\end{enumerate}
\section{Related Work}
Early work on QE built models on manually crafted features extracted from the source and translated sentences, or confidence features directly from machine translation (MT) systems \cite{specia2009estimating}.
In contrast, SoTA models are usually trained in an end-to-end manner using neural networks \cite{specia2018findings, fonseca2019findings, specia-etal-2020-findings-wmt, tuan2021quality}, without the additional step of feature extraction.
The proliferation of many-to-many NMT~\cite{fan2021beyond,ko2021adapting} has motivated similar multilingual QE models. These multilingual QE models have exploited large pre-trained contextualized multilingual language models to achieve a previously-unseen level of correlation with human judgments in recent iterations of the WMT QE shared task.
For example, the top-performing QE model at WMT 2019 \cite{kepler2019unbabels} is a neural predictor-estimator model based on multilingual BERT \cite{devlin-etal-2019-bert}, while
the best QE models at WMT 2020 \cite{transquest:2020,fomicheva-etal-2020-bergamot} are regression models built on XLM-R \cite{conneau2019unsupervised}.
\citet{sun-etal-2020-exploratory} find that these models generalize well across languages and training a single multilingual QE model is more effective than training a bilingual model for every language direction.
Unfortunately, these models are computationally infeasible for real-world applications.
Several approaches have been proposed to address the latency issues of these large contextualized language models.
Most of these work are based on \textbf{knowledge distillation} \cite{sanh2019distilbert, jiao2019tinybert, aguilar2020knowledge, tang2019distilling, sun2019patient} where large contextualized language models (teacher) are used to supervise the training of smaller student models \cite{hinton2015distilling}, or \textbf{pruning}, which discards redundant model components.
Some examples are model weights \cite{gordon2020compressing}, tokens \cite{goyal2020power}, encoder layers \cite{sajjad2020poor} and attention heads \cite{michel2019sixteen}.
Existing work has looked at model compression for other multilingual tasks:
\citet{tsai-etal-2019-small} obtained 27x speedup on multilingual sequence labeling without any significant performance degradation, while \citet{mukherjee2020xtremedistil} obtain 51x speedups on NER tasks while retaining 95\% performance.
In our experiments with QE we do not observe the same levels of compression effectiveness, suggesting that the QE is a much harder task for model compression.
A call to reframe QE as a classification problem was made by \citet{zhou2020practical}, based on the perspective that classification is more suitable for real-world use cases and binary classes are easier to interpret than the predicted QE scores.
Our work suggests the same direction, but now from the perspective of modeling, where we empirically find that the level of expressiveness of a regression-based QE model is unnecessary and evaluating QE models using classification metrics would better reflect their actual performance in real-world applications.
\section{Preamble: The efficiency of neural QE models}
\section{Background and hypothesis}
Current
state of the art QE systems
\cite{fomicheva-etal-2020-bergamot, transquest:2020, sun-etal-2020-exploratory}.
are built on XLM-R \cite{conneau2019unsupervised}, a contextualized language model pre-trained on more than 2 terabytes of filtered CommonCrawl data \cite{wenzek2020ccnet}.
As seen in Figure \ref{fig:xlmr}, the model concatenates a pair of source and translated sentences with a separator token in between and appends a special \textbf{CLS} token to the beginning of the concatenated string.
\begin{figure}[ht!]
\includegraphics[width=0.9\linewidth]{images/xlmr-qe}
\centering
\caption{XLM-R based neural QE model. The base version of XLM-R has 12 encoder layers while the large version of XLM-R has 24 encoder layers.}
\label{fig:xlmr}
\end{figure}
It then converts the pre-processed string into a sequence of embedding vectors using a pre-trained embedding lookup table.
The embedding vectors are then encoded using the multi-head self-attention mechanism as described in \citet{vaswani2017attention}.
This step is repeated 12 times for the \emph{base}{} version of XLM-R and 24 times for the \emph{large}{} version of XLM-R.
Finally, the neural QE model converts the final encoding of the \textbf{CLS} token into a QE score via a multilayer perceptron (MLP) layer.\\
In this work, we follow the neural architecture in \citet{sun-etal-2020-exploratory}, and experiment with both \textbf{bilingual models (BL)}, where each model is trained on data from only one language direction, and \textbf{multilingual models (ML)} that are trained on the concatenated data from all language pairs available in the dataset.
We choose mean squared error and binary cross-entropy as the objective functions for the regression and binary classification tasks respectively.
We use AdamW \cite{loshchilov2017decoupled} for parameter tuning and use a common learning rate of $1e^{-6}$ for all experiments.
\subsection{Efficiency of neural QE models}
\addtolength{\tabcolsep}{-1pt}
\begin{table}[h]
\centering
\begin{tabular}{ccccc}
\toprule
&\multicolumn{2}{c}{\textbf{\emph{base}{}}}&\multicolumn{2}{c}{\textbf{\emph{large}{}}}\\
\textbf{Module}&\textbf{\#P}&\textbf{L(ms)}&\textbf{\#P}&\textbf{L(ms)}\\
\midrule
Embedding & 192M & 0.7 & 257M & 0.9 \\
Encoder & 7.1M & 10.0 & 12.6M & 15.3 \\
MLP & 2.4M & 0.6 & 4.2M & 0.8 \\
\midrule
Total & 280M & 122 & 563M & 370 \\
\bottomrule
\end{tabular}
\caption{
Number of parameters (\#P) and latency measured in milliseconds (L) for different components of the base and large version of XLM-R.
For the encoder, we show the average statistics for each layer.
Note that the \emph{base}{} version has 12 encoder layers, while the large version has 24.
}
\label{benchmark}
\end{table}
To gain insights on the practicality of deploying the aforementioned baseline QE models in real-world situations, we gathered benchmark results on a server with 40 physical cores and 512GB of RAM.
We measure the average time required to compute DA score for every sentence pair in the test sets across all seven language directions.
We use a batch size of 1 and run the QE models on CPU.
We highlight some of the findings in Table \ref{benchmark}.
\paragraph{Memory}
XLM-R \emph{base}{} has around 280 million parameters, and 69\% of the parameters are in the embedding layer.
XLM-R \emph{large}{} has around 563 million parameters, which is more than 2 times the number of parameters in XLM-R \emph{base}{}, and 54\% of the parameters are in the encoder layers.
Given that these models take up around 1-2 GB of memories on disk, they might be unsuitable for devices with small RAM capacity.
\paragraph{Latency}
Most of the computations take place in the encoder layers, where the latency of each encoder layer is 15.3 milliseconds for XLM-R \emph{large}{} and 10 milliseconds for XLM-R \emph{base}{}.
Although the embedding layer contains a significant number of parameters, it requires much fewer computations than the encoder layers since its embedding matrices are only used as lookup tables.
Given the benchmark results in Table \ref{benchmark}, it is clear that recent QE models based on XLM-R \emph{large}{} are computationally expensive and memory intensive.
At an average inference time of 370 milliseconds per sentence pair, these QE models can be even slower than the upstream MT systems, making them infeasible in real-world applications that require real-time response.
As more than 98\% of inference time is spent in the encoder layers of the neural QE models, we will explore model compression techniques that could reduce the number of parameters and computations in those layers.
\section{Model compression techniques}
Given the vast amount of work in the field of model compression, we explore three broad techniques and examine whether they could be successfully applied to compressing QE models.
\subsection{Pruning}
Pruning techniques are inspired by observations that large pre-trained contextualized language models might be over-parameterized for downstream tasks and most model parameters can be removed without significantly hurting model performance \cite{kovaleva2019revealing}.
\paragraph{Layer pruning} \citet{sajjad2020poor} demonstrated that it is possible to drop encoder layers from pre-trained contextualized language models while maintaining up to 98\% of their original performance.
We apply the \emph{top-layer strategy} to XLM-R by dropping the top N encoders layers and then fine-tune the reduced neural architecture on QE datasets.
We experiment with different values for N from \{3, 6, 9, 12, 15, 18, 21, 23\}.
\paragraph{Token pruning}
\citet{pmlr-v119-goyal20a} observed that token vectors start carrying similar information as they pass through the encoder layers of contextualized language models.
The authors propose a method that progressively removes redundant word vectors by only keeping the top K vectors at each encoder layer based on an attention scoring mechanism.
To determine the optimal value of K for each encoder layer, they add a soft extraction layer with learnable parameters in the range [0, 1] that represents the degree of usefulness for every token vector.
L1 regularizers are used to optimize the weights of the parameters in the soft extraction layer.
Following the original implementation, we tune a hyper-parameter that controls the trade-off between the loss of the original tasks and the regularizers.
\subsection{Knowledge distillation}
Recent knowledge distillation (KD) methods \cite{jiao2019tinybert, mao2020ladabert, sanh2019distilbert} use larger BERT models (teacher) to supervise the training of smaller BERT models (student), typically with the help of the same raw text data that was used by the teacher models.
Given that XLM-R was trained on more than 2 terabytes of multilingual text data, it would be computationally difficult to adapt the KD techniques to XLM-R.
Instead, we experiment with a simplified KD setup inspired by \citet{xu2020bert}.
\paragraph{Module replacement}
\begin{figure}[ht!]
\begin{center}
\includegraphics[width=0.7\linewidth]{images/kd.png}
\end{center}
\caption{
Module replacement: replacing N encoder layers with a single encoder layer.
}
\label{kd}
\end{figure}
We explore whether it is effective to compress N encoder layers into a single encoder layer.
As seen in Figure \ref{kd}, we use the top N layers of a fine-tuned QE model to supervise the training of one encoder layer in a smaller QE model.
For the student QE model, we randomly initialize the target encoder layer and copy all other parameters from the teacher QE model.
During training, we freeze all parameters except for the ones in the target encoder layer.
The loss function is defined as the sum of 1) the mean squared error between the output of the final teacher encoder and the output of the target student encoder, and 2) the original objective function.
We use sentence pairs in the MLQE dataset to train the student model and experiment with the following values for N: \{2, 6, 12, 18, 23, 24\}.
\section{Experimental settings}
We report results on the MLQE-PE dataset using Pearson correlation for regression and F1 for classification.
\subsection{QE dataset}\label{sec:dataset}
MLQE-PE is the publicly released multilingual QE dataset used for the WMT 2020 shared task on QE \cite{fomicheva2020mlqepe}.
This dataset was built using source sentences extracted from Wikipedia and Reddit, translated to and from English with SoTA bilingual NMT systems that were trained on publicly available parallel corpora.
It contains seven language pairs:
the high-resource English-German (En-De), English-Chinese (En-Zh), and Russian-English (Ru-En);
the medium-resource Romanian–English (Ro-En) and Estonian–English (Et-En);
and the low-resource Sinhala–English (Si-En) and Nepali–English (Ne-En).
Each pair of sentences was manually annotated for quality using a 0--100 direct assessment (DA) scheme as shown in table \ref{annotation}. A z-normalized version of these scores is used directly for {\bf regression}.
\begin{table}[h]
\centering
\begin{tabular}{p{0.2\linewidth}p{0.7\linewidth}}
\toprule
\textbf{DA score}&\textbf{Meaning}\\
\midrule
0-10&incorrect translation\\
\midrule
11-29&translation with few correct keywords, but the overall meaning is different from the source\\
\midrule
30-50&a translation with major mistakes\\
\midrule
51-69&a translation which is understandable and conveys the overall meaning of the source but contains typos or grammatical errors\\
\midrule
70-90&a translation that closely preserves the semantics of the source sentence\\
\midrule
90-100&a perfect translation\\
\bottomrule
\end{tabular}
\caption{
Annotation scheme used to build the MLQE-PE dataset
}
\label{annotation}
\end{table}
As previously mentioned, since the most common use case of the QE is to make binary decisions based on predicted QE scores \cite{zhou2020practical}, i.e, to determine whether a translated sentence is adequate based on a certain threshold on QE score, we also experiment with models that are directly optimized for {\bf binary classification}.
To that end, we modify the MLQE-PE dataset to predict the \emph{acceptability} of a translation by assigning the label \emph{not acceptable} to sentence pairs with DA scores less than some threshold values and the label \emph{acceptable} for the remainder of the translations.
The notion of acceptability is thus based on the guidelines provided for the MLQE-PE annotations in Table~ \ref{annotation}.
Here, we require that a translation is understandable but not necessarily perfect, and experiment with two thresholds of $\ge51$ and $\ge70$ to signify acceptability.\footnote{We acknowledge that this threshold may be application-dependent. In other cases, where a higher level of quality is desired (e.g. for \emph{knowledge dissemination}), a $\ge90$ threshold might be more appropriate.}
\subsection{Evaluation metrics}
Following the standard practice used by the QE research community, we measure the performance of a QE model by calculating the \emph{Pearson Correlation coefficient} of its predicted DA scores and the actual human-annotated DA scores on a test set.
Formally, let $x_i=m(s_i, t_i)$ be the DA score for a sentence pair $(s_i, t_i)$ predicted by a QE model, m, and $y_i$ be the actual human-annotated DA score.
Then the performance of m on a test set $T=\{(s_1, t_1, y_1), (s_2, t_2, y_2), \dots (s_N, t_N, y_N)\}$ is defined as:
\begin{equation}
r=\dfrac{\sum\limits_{i=1}^N (x_i - \bar{x})(y_i - \bar{y})}{\sqrt{\sum\limits_{i=1}^N (x_i - \bar{x})^2 \sum\limits_{i=1}^N (y_i - \bar{y})^2}}
\end{equation}
r is in the range $[-1, 1]$ and a better model would have a r closer to 1.
For binary classification, we use the F1 score defined as:
\begin{equation}
F1 = \dfrac{2 \times (P \times R)}{(P + R)}
\end{equation}
where P is the precision and R is the recall.
For head-to-head comparison, we also evaluate regression models using F1 by converting the predicted QE scores into binary classes using the same threshold described in previous subsection.
\section{Results}
The baseline results on the MLQE dataset\footnote{\url{https://github.com/sheffieldnlp/mlqe-pe}} used at WMT 2020 are shown in Table \ref{baseline}.
We keep the same train-dev-test splits as the WMT 2020 shared task\footnote{\url{http://www.statmt.org/wmt20/quality-estimation-task.html}} for all experiments.
The results of our regression models are comparable to the results reported in recent work \cite{fomicheva-etal-2020-bergamot, ranasinghe2020transquest}.
In general, QE models based on XLM-R \emph{large}{} outperform models based on XLM-R \emph{base}{}, showing that a higher number of parameters benefits the QE task.
This is especially true for the regression tasks, where on average, the large models outperform the base models by 11\% and 56.8\% for bilingual and multilingual models respectively.
However, the same levels of performance degradation are not observed on the classification tasks: On average, the large QE models only perform 3.7\%/5.6\% and 1.2\%/7.1\% better than the base QE models for bilingual and multilingual settings respectively at different thresholds.
This shows that classification performance depends less on the number of model parameters and therefore we could potentially observe better compression results and more accurate model performance in real-world application if we evaluate QE with classification metrics.
\todo{modify this claim}
In the remaining of this section we explore different compression techniques on both regression and classification to test this hypothesis.
\addtolength{\tabcolsep}{-3pt}
\begin{table}[ht!]
\small
\centering
\begin{tabular}{cccccc}
\toprule
\multirow{2}{*}{\textbf{Model}} & \multirow{2}{*}{\textbf{Type}} & \multicolumn{2}{c}{\begin{tabular}{c}\textbf{Regression}\\ corr. ($\rho$)\end{tabular}}& \multicolumn{2}{c}{\begin{tabular}{c}\textbf{Classification}\\ F1 ($\geq51$ / $\geq70$)\end{tabular}} \\
\cmidrule(r){3-4}
\cmidrule(l){5-6}
& & \textbf{Base} & \textbf{Large} & \textbf{Base} & \textbf{Large} \\
\midrule
BERGAMOT&BL&-&0.67&-&-\\
-LATTE&ML&-&0.69&-&-\\
\midrule
\multirow{2}{*}{TransQuest}&BL&-&0.69&-&-\\
&ML&-&0.67&-&-\\
\midrule
\multirow{2}{*}{This work}&BL&0.63&0.70&0.82/0.72&0.85/0.76\\
&ML&0.44&0.69&0.83/0.70&0.84/0.75\\
\bottomrule
\end{tabular}
\caption{
Baseline results of bilingual (BL) and multilingual (ML) models on the MLQE-PE dataset for both regression and binary classification at different thresholds.
Results are averaged over 5 different runs and 7 language directions.
Our results are comparable to the results of BERGAMOT-LATTE \cite{fomicheva-etal-2020-bergamot} and TransQuest \cite{ranasinghe2020transquest}, the top-performing systems at WMT 2020 QE shared task.
}
\label{baseline}
\end{table}
\subsection{Compression techniques results}
We apply each compression technique to bilingual QE models using XLM-R \emph{large}{}, and average the results over 5 different runs for every language direction.
We then compute the average speedup of every compressed model to its original model.
The performance drop against speedup plots\footnote{averaged over 7 language directions} of regression models and classification models are shown in Figure \ref{reg_speedup} and Figure \ref{cls_speedup} respectively.
\begin{figure}[ht!]
\centering
\includegraphics[width=0.95\linewidth]{images/reg_speedup.png}
\caption{
\% degradation ($\rho$) vs. speedup for regression models.
}
\label{reg_speedup}
\end{figure}
\begin{figure}[ht!]
\centering
\includegraphics[width=0.95\linewidth]{images/cls_speedup.png}
\caption{
\% degradation ($F1$) vs. speedup for classification models ($\geq$ 51).
}
\label{cls_speedup}
\end{figure}
Based on the results of our experiments, we find that layer pruning outperforms module replacement, especially at higher speedup.
For example, at around 24x speedup, layer pruning outperforms module replacement by 31.8\% and 2.9\% for regression and classification respectively.
For token pruning, we find that it does not offer any significant benefit over the other 2 compression techniques.
Further, the token-pruned models that we tuned to the best of our efforts are conservative and prefer model accuracy over speedup:
14.4\% and 26.4\% faster than the original QE models with $<$ 1\% performance degradation for regression and classification respectively.
In the remainder of this paper, we will focus on running model compression experiments with the layer pruning strategy.
\subsection{Compression techniques are inadequate when evaluating QE as a regression task}
As seen in Figure \ref{reg_speedup}, the compressed regression-based QE models have a performance degradation of more than 9\% at just 2x speedup.
The performance degradation worsens to 23\% at 4x speedup and 34\% at 24x speedup.
These results are significantly worse than the numbers reported on other NLP tasks: \citet{jiao2019tinybert} reported a 9.4x speedup with 96.8\% performance retention on GLUE benchmark \cite{wang2018glue} , \citet{mukherjee2020xtremedistil} reported 51x speedup with 95\% performance retention on a multilingual NER task with 41 languages and \cite{wang2020minilm} reported 2x speedup with more than 99\% performance retention on SQUAD 2.0 \cite{rajpurkar2018know}.
Our results suggest that QE datasets might not suffer from the same degree of \emph{overparameterization problem} \citet{kovaleva2019revealing} observed in other NLP datasets.
We hypothesize that the performance of QE \emph{depends heavily on the large number of parameters in XLM-R}.
This is further supported by the results in Table \ref{baseline}, where the XLM-R \emph{large}{} models, with around twice the number of parameters in XLM-R base models, outperform the latter by more than 11\%.
\subsection{Better compression results when evaluating QE with classification metric}
\todo{new subsection title}
\begin{table}[ht!]
\small
\centering
\begin{tabular}{ccccc}
\toprule
&\textbf{En-De}&\textbf{En-Zh}&\textbf{Ru-En}&\textbf{Ro-En}\\
\midrule
Regr. & -8.0\%&-13.7\%&-8.8\%&-4.5\%\\
Class. ($\geq51$) & 0.0\%&0.0\%&-1.1\%&-1.1\%\\
Class. ($\geq70$)& 0.0\%&0.0\%&-2.8\%&-3.9\%\\
\midrule
& \textbf{Et-En}&\textbf{Si-En}&\textbf{Ne-En}&\textbf{Average}\\
\midrule
Regr. & -14.1\%&-9.2\%&-10.3\%&-9.8\%\\
Class. ($\geq51$)& -6.0\%&-1.4\%&-12.7\%&-3.2\%\\
Class. ($\geq70$)& -12.1\%&-0.1\%&-9.1\%&-4.0\%\\
\bottomrule
\end{tabular}
\caption{
Performance drops of \emph{base}{} QE models with respect to \emph{large}{} QE models for regression (top) and binary classification at different thresholds.
}
\label{gain}
\end{table}
In Table \ref{gain}, we compute the relative percentage of performance drops when using XLM-R \emph{base}{} instead of XLM-R \emph{large}{}.
We observe that the base QE models perform significantly worse than the large QE models on regression tasks, with an average performance drop of 9.8\% over 7 language directions.
In contrast, the average performance drops of 3.2\% and 4.0\% for binary classification at different thresholds are significantly lower, with less than 1.5\% drop on majority of 7 language directions.
Figure \ref{cls_speedup} also shows that it is possible to retain 94.6\% performance with 8x speedup and 88.8\% with 24x speedup.
Comparing these to the results in the previous subsection, we observe significantly less model degradation when evaluating the QE models with classification metric instead of regression metric.
\todo{tweak this claim}
\subsection{Regression or binary classification?}
\begin{figure}[ht!]
\centering
\includegraphics[width=0.98\linewidth]{images/reg_or_cls.png}
\caption{
Comparison between regression models (REG) and classification models (CLS) for different layer pruning configurations.
All models are based on XLM-R \emph{large}{}.
Top shows the results for bilingual models and bottom shows the results for multilingual models.
}
\label{reg_or_cls}
\end{figure}
In practice, the predicted QE scores from regression models are primarily used to make binary decisions based on predetermined thresholds.
To test whether it would be better to directly optimize QE models for binary classification, we convert the predicted DA scores from regression models into binary classes using the same threshold as the one in Section \ref{sec:dataset} and then compute F1 scores.
As shown in Figure \ref{reg_or_cls}, the F1 performances of regression models are comparable to the classification models at lower compression settings.
However, the regression models start to outperform the classification models when we further compress the models by dropping more encoder layers.
Our results show that in our case of using thresholds of $\geq51$ and $\geq70$ with layer pruning as our model compression strategy, optimizing QE as a regression task and then converting the predicted DA scores into binary classification labels seems better than directly optimizing QE as a binary classification task.
\subsection{Pearson correlation is misleading}
\begin{figure}[ht!]
\centering
\includegraphics[width=0.95\linewidth]{images/pc_points.png}
\caption{
Predicted DA scores from a pruned and an original QE model, as well as the gold labels for 10 random samples from Sinhala-English test set.
Pearson correlation is 0.47 and 0.64, and F1 is 0.72 and 0.73 for the pruned and original models respectively.
The red dashed line is the decision boundary.
}
\label{pc_points}
\end{figure}
Looking at the results in Figures \ref{reg_speedup}, \ref{cls_speedup} and \ref{reg_or_cls}, it is apparent that the drastic drops in Pearson correlation at higher compression settings do not translate to equivalent degrees of performance degradation in terms of F1.
For example, at approximately 24x speedup, the bilingual regression models suffer an average performance degradation of 33.9\% in Pearson correlation, which is significantly higher than the 7.5\% performance degradation observed in binary classification.
The explanation lies in the fact that Pearson correlation penalizes predictions that do not follow the same linear trend as the gold DA scores.
However, getting the linear trend right is not useful for binary classification, i.e., a predicted DA score is correct as long as it falls on the right side of the decision boundary, regardless of the degree of closeness to the gold DA score.
This phenomenon is illustrated in Figure \ref{pc_points} where the predicted scores of a QE model based on XLM-R \emph{large}{} are generally closer to the gold DA scores than the predicted scores of a layer pruned QE model, which explains their 36.2\% difference in Pearson correlation.
However, the two models obtain comparable F1 scores because their predicted DA scores generally fall on the same sides of the decision boundary.
Our results suggest that larger QE models are required to make more accurate QE score predictions that have a higher Pearson correlation with human-annotated QE scores.
However, the higher accuracy and more optimal ordering of the predicted QE scores do not necessarily contribute to higher accuracy when making binary judgments.
We believe that Pearson correlation is a misleading evaluation metric that deviates from the use cases in real-world settings.
Chasing higher Pearson correlation could lead us down the path of building larger models that are computationally infeasible, yet having better exact DA predictions is not necessarily useful for better binary classification.
Based on these results, we recommend that \emph{classification metrics are used to evaluate the effectiveness of compressed QE models.}
\subsection{Does model compression affect the performance of multilingual QE?}
\begin{figure}[h]
\centering
\includegraphics[width=0.95\linewidth]{images/multilingual_power.png}
\caption{Comparison of multilingual models (ML) against bilingual models (BL) for different layer pruning configurations. }
\label{multilingual_power}
\end{figure}
We plot the averaged results of bilingual and multilingual models for different configurations of layer pruning in Figure \ref{multilingual_power}.
We observe that at lower compression settings with less than or equals to 12 dropped layers, the results of the multilingual models are generally comparable to the results of the bilingual models and this corroborates the finding that multilingual QE model generalize well across languages \cite{sun-etal-2020-exploratory}.
However, at higher compression settings with more than 12 dropped layers, the multilingual models start to lose their effectiveness, underperforming the bilingual models significantly.
We hypothesize that the multilingual neural models no longer have enough model capacities for 7 different language directions beyond a certain degree of model compression.
\section{Conclusions}
This paper presents a thorough study on the efficiency of SoTA neural QE models and explores whether recent compression techniques can be successfully applied to reduce the size and improve the latency of these models.
Our experimental results show that recent compression techniques are inadequate for regression as we observe significant performance degradation on the QE task with little improvement in model efficiency.
We argue that the level of expressiveness of a QE model in a continuous range is unnecessary since the outputs of the QE model are usually used to make binary decisions.
Our results show that it is more appropriate to reframe the QE task as a classification problem, and evaluating QE models using classification metrics would better reflect their actual performance in real-world applications.
This enables us to achieve SoTA performance with tiny and efficient models.
Our experimental results suggest that compressing large neural QE models for the QE regression task remains a challenging problem, especially in the case of multilingual models, where they start showing higher degrees of performance degradation than their bilingual counterparts.
| {'timestamp': '2021-09-20T02:20:29', 'yymm': '2109', 'arxiv_id': '2109.08627', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08627'} | arxiv |
\section{Cognitive Digital Twin}
\label{sec:cognitive-digital-twin}
The definition of \textit{cognitive digital twin} is inspired by major advances in cognitive science, machine learning, and artificial intelligence.
Neisser’s classic definition of cognition~\cite{solso2005cognitive} includes “\textit{all the processes by which the sensory input is transformed, reduced, elaborated, stored, recovered and used ...}”.
Fundamental aspects of cognition include attention (selective focus), perception (forming useful precepts from raw sensory data), memory (encoding and retrieval of knowledge), reasoning (drawing inferences from observations, beliefs, and models), learning (from experiences, observations, and teachers), problem-solving (achieving goals), knowledge representation, etc.
\begin{figure}
\centering
\includegraphics[width=1.\linewidth]{figures/diff.pdf}
\caption{Standard digital twin and cognitive digital twin \cite{alf2021cognitive}.}
\label{fig:digitaltwin}
\end{figure}
The standard view of the digital twin and the conceptual framework of the cognitive digital twin proposed in \cite{alf2021cognitive} are depicted in Fig. \ref{fig:digitaltwin}. The digital twin on the left of Fig. \ref{fig:digitaltwin} is the standard digital twin, which has a digital part, a corresponding physical part, and a connection between them. This version of the digital twin has the ability to learn. The digital twin we propose is shown on the right of Fig. \ref{fig:digitaltwin}, which in addition to having the ability to learn, is endowed with the other elements of cognition such as perception, attention, memory, reasoning, problem-solving, etc. In the following, we describe these capabilities in the context of a digital twin.
\subsection{Cognitive Capabilities}
\label{sec:cognitive-digital-twin-capabilities}
\subsubsection{Perception} in cognitive psychology could be defined as {\it the organization, identification, and interpretation of sensation to form a mental representation} \cite{schacter2011psychology}. We extend this definition to define perception in cognitive digital twin as {\it the process of forming useful representations of data related to the physical twin and its physical environment for further processing}. It is well established that machine learning techniques are less effective in learning representations of high dimensional and large data volume \cite{lecun2015deep}. Since CPPS (and IoT) generate multi-modal, high-dimensional, large volumes of data, we posit that perception is a key cognitive capability to form useful {\it precepts} upon which further cognitive processing can occur in a digital twin. Perception in a digital twin will enable visibility in manufacturing systems.
\subsubsection{Attention} can be viewed as the allocation of limited resources or a selection mechanism \cite{posner2011cognitive}.
We adopt the latter view and define attention in a cognitive digital twin as {\it the process of focusing selectively on a task or a goal or certain sensory information either by intent or driven by environmental signals and circumstances}. Attention can be perceptual or non-perceptual and controlled or otherwise (see \cite{oberauer2019working} for a detailed taxonomy of attention). Attention enables focus on the essential information from the raw sensor data and memory. So, it can simplify and improve the process of perception and decision making in a cognitive digital twin. Attention will help monitor or select a task to focus on, paving the way for autonomy in manufacturing systems.
\subsubsection{Memory} we define memory in a cognitive digital twin adopting the view of memory provided in \cite{mcdermott2018memory}: {\it is a single process that reflects a number of different abilities: holding information briefly while working with it (working memory), remembering episodes of the physical twin’s life (episodic memory), and knowledge of facts of the environment and its interaction with the physical twin (semantic memory), where remembering includes the steps: encoding information (learning it, by perceiving it and relating it to past knowledge), storing it (maintaining it over time), and then retrieving it (accessing the information when needed)}. Thus, memory (both working memory and the remembered episodes and knowledge), are an essential ingredient for the algorithms complementing the digital twin to autonomously control the physical processes related to the various stages of a physical twin because memory allows the algorithm to remember the context and additionally allows the digital twin to leverage past knowledge.
\subsubsection{Reasoning} in cognitive psychology can be broadly defined as the ``process of drawing meaningful conclusions for informing problem-solving or decision making'' \cite{sternberg2004nature}. Reasoning can be broadly classified under deduction, induction, and probabilistic reasoning \cite{st1993cognitive}. {\it Thinking} and {\it reasoning} are cornerstones of human intelligence and so have been extensively studied in cognitive psychology \cite{baron2000thinking,sternberg2004nature}.
We define reasoning in cognitive digital twins adopting the definition proposed in \cite{johnson2010mental}: {\it drawing conclusions consistent with a starting point — a perception of the physical twin and its environment, a set of assertions, a memory, or some mixture of them}. Thus, reasoning directly impacts understanding (transparency) and is central to decision making (autonomy).
\subsubsection{Problem-solving} we define problem-solving in cognitive digital twin as {\it the process of finding a solution for a given problem or achieving a given goal from a starting point}. Thus, problem-solving is central to decision making and autonomy.
\subsubsection{Learning} we define learning in cognitive digital twin as {\it the process of transforming experience of the physical twin into reusable knowledge for a new experience}.
Hence, learning is essential for adaptability (or autonomy) and responsiveness of the physical system that the digital twin represents and becomes a key ingredient for intelligence in digital twins.
\section{Digital Twins and Manufacturing}
\label{sec:digital-twin}
The term \textit{Digital Twin} was first used in 2002 by John Vickers of the National Aeronautics and Space Administration (NASA). During a later 2010 report, Vickers also gave the first formal definition of the digital twin, specified for air vehicles, as \textit{an integrated multi-physics, multi-scale, probabilistic simulation of an as-built vehicle or system that uses the best available physical models, sensor updates, fleet history, etc., to mirror the life of its corresponding flying twin} \cite{negri2017review}.
The most basic and concise definition of a digital twin can be stated as in \cite{hultgren2020concept}: ``\textit{A digital twin has a digital or a virtual part, a physical part and a connection between them.}''
Since its inception, the digital twin concept has evolved and expanded to various products, processes, and domains. Digital twins have been proposed for many applications or use cases such as predicting real-time behavior, monitoring, decision support, planning, production optimization, and control \cite{kritzinger2018digital, tao2018digital}.
\green{ The concept of digital twins in cyber-physical production systems is studied in \cite{uhlemann2017digital}, however strictly for data acquisition. In \cite{ding2019defining}, a digital twin-based cyber-physical production system is examined, placing specific emphasis on the interconnection between the physical and cyber-shop floors. Our focus encompasses these works in a larger view of cyber-physical manufacturing (see Fig. \ref{fig:DT-I4}) while providing a flexible framework for enabling cognitive functions throughout the system’s life cycle.}
Fig. \ref{fig:DT-I4} illustrates the digital twin in the context of a cyber-physical production systems (CPPS) and the overarching use cases (or functions). The top part of the figure illustrates the digital twin ecosystem: (i) major building blocks and constituents of digital twins (data, models, and algorithms); (ii) capabilities digital twins can enable (visibility, transparency, predictive capacity, and adaptability); and (iii) the various use cases ranging from design to autonomy and cooperation. The bottom part of the figure shows the key enabling technologies of this ecosystem. The top-right side of the figure depicts the physical manufacturing system. CPPS related data (e.g., operational data and maintenance data) are collected in real-time and provided to the digital twins. Digital twins in response provide real-time feedback (e.g., decision and control) to the physical manufacturing system. This provides real-time two-way seamless communication between the physical manufacturing system and the corresponding digital twin.
The use cases of digital twins span the entire life cycle of a product: product design and optimization, testing, production system design and operation, supply chain management and control, prognostics, maintenance, aftermarket services, cyber-security (Fig. \ref{fig:DT-I4}). For example, the digital twin of a component or a product can be used to simplify and streamline the design process by enabling virtual testing of the specifications to ensure that the product meets the standards (verify) and the performance requirements (validate) \cite{tao2018digital}. The digital twin of a product can be used to detect the early onset of faults (predictive maintenance), help diagnose the fault, and provide customized solutions for performance optimization, maintenance, and compliance \cite{tao2018digital}. A manufacturing company can offer new services based on digital twins for optimizing the performance of the product during operation. Thus, computing through digital twins provides organizations with opportunities for offering new products and services. The digital twin of a production system can be used to optimize the system for throughput (performance), reduce waste (efficiency), improve quality \cite{tao2018digital}. Digital twins can also enable processes involved in CPPS to be adaptable and responsive to disruptive events \cite{lim2019state}.
\begin{figure}[ht]
\centering
\includegraphics[width=1.0\linewidth]{figures/pathindustry.pdf}
\caption{Pathway to Industry 4.0 \cite{alf2021cognitive}.}
\label{fig:pathway-I4}
\end{figure}
In our previous paper we envisioned that cognitive digital twins are the key for the various stages of the Industry 4.0 development path (proposed in \cite{ignatov2019global}): visibility (what is happening), transparency (why is it happening), predictive capacity (what will happen), and adaptability (how can an autonomous response be achieved) (see Fig. \ref{fig:pathway-I4}, which is an adaptation of Fig. 3 in \cite{ignatov2019global}). Visibility is vital for assessing the shop floor changes and operating conditions for the overall system's adaptability and responsiveness. This will impact decisions in the production pipeline, allowing the system to adapt quickly and effectively, therefore reducing downtime and costs. Transparency and predictive capacity are essential for understanding and inferring how to respond, and thus directly affect manufacturing performance under changing circumstances. Finally, adaptability enables the system to respond to a changing situation by itself with self-corrections based on feedback, instead of a human-in-the-loop making the decisions. When this happens across interacting physical processes, the system can achieve seamless cooperation in how it responds and operates.
There are many different algorithms and implementations that may be used to realize these discussed capabilities in digital twins (\green{e.g., Neural Networks, Dynamic Bayesian Networks, Hidden Markov Models, Finite Element Analysis, and Deep Learning \cite{lim2019state}}). Graph learning, another example, can enhance visibility by learning relationships between systems and subsystems --- creating a higher-level abstracted vision of an entire system. Graph representations can also provide more explainable decisions than traditional machine learning algorithms as relations between components of a system can be mapped and visually interpreted. Also, graph learning can help in prediction tasks --- for example, if a tool in a manufacturing plant breaks down or requires repair, the graph structure can enable informed predictions on other tools that may need preventative repairs or reinforcements. Large scale graphs can enable higher levels of autonomy in digital twins by allowing abstraction through a holistic view of a system, much like how humans perceive their environment. {\it We posit that graph learning, further detailed in Section \ref{sec:graphlearning}, provides a pathway for cognition in digital twins}.
\section{Future of Manufacturing}
\label{sec:fut-of-manufacturing}
The evolution of manufacturing can be presently defined by four major transformations: (i) the industrial revolution during the 18th and 19th centuries; (ii) mass production in the first half of the 20th century; (iii) information technology-based automation of production in the second half of the 20th century; and (iv) the ongoing fourth industrial revolution. This fourth industrial revolution has many monikers, namely, Industry 4.0, Smart Manufacturing, connected industries --- as part of Society 5.0 in Japan, Made in China 2025, etc. This wave of future visions of manufacturing is often hinged on harnessing the power of computing in manufacturing systems. Most of these visions aspire to bring together wireless (and wired) communications, smart sensors, cyber-physical systems, internet-of-things (IoT) \cite{jazdi2014cyber}, advanced robotics~\cite{Bahrin2016INDUSTRY4A}, additive manufacturing, simulation and high-performance computing, advanced data analytics, machine learning and artificial intelligence, cloud computing, and cybersecurity \cite{industry4-alfaruque}. The goal of the fourth industrial revolution is to achieve personalized, affordable, efficient, resilient, adaptive, and sustainable products and production across distributed factories and supply chains.
Digital twins are one of the many technologies that will help shape the future of manufacturing. Digital twins integrate the cyber and physical worlds --- allowing for seamless communication between digital models and real, in-operation systems. Digital twins have been shown to provide distinct advantages in manufacturing \cite{alfaruqudigitaltwin}.
Digital twins leverage many auxiliary technologies and systems such as modeling and simulation, IoT sensors, standards and interoperability among digital technologies, computing, and data from different stages of the product lifecycle. These enabling technologies that constitute increasingly sophisticated and powerful digital twins are illustrated in Fig.~\ref{fig:DT-I4}.
\begin{figure*}[!ht]
\centering
\includegraphics[width=0.93\linewidth]{figures/ena.pdf}
\caption{Digital Twin in the context of cyber-physical production systems \cite{alf2021cognitive}.}
\label{fig:DT-I4}
\end{figure*}
The deployment of digital twins in manufacturing can have an impact throughout the entire product life cycle --- including, but not limited to, product design and optimization, testing, production system design and operation, supply chain management and control, prognostics, maintenance, aftermarket services, and cybersecurity. As with many modern research fields in computing, the applications of digital twins in manufacturing continues to rapidly progress and increase. Gartner has listed the digital twin as one of the top ten technology trends for 2019 and the years to come \cite{gartner2019}. Furthermore, according to recent reports, the digital twins' market size is projected to grow from US\$3.1 billion in 2020 to US\$48.2 billion in value by 2026 \cite{marketsandmarkets2020}. Historically, the aerospace and automotive industries have been dominant users of digital twin technologies; however, other manufacturing sectors are also beginning to leverage the many advantages that digital twins can offer \cite{marketsandmarkets2020}.
Concurrently, digital twins have given rise to many exciting and challenging research questions.
In this paper, we extend upon the cognitive digital twin framework introduced in \cite{alf2021cognitive}. Specifically, we propose graph learning frameworks and algorithms as a potential pathway for cognitive digital twins. Graph learning is a subset of machine learning that focuses on algorithms and methods involving data that can be structured as graphs. Graph learning techniques, which have gained increasing interest in recent years \cite{wu2020comprehensive}, have many benefits in modeling non-Euclidean data that has inherent graph structures. The pervasive nature of graphs in manufacturing systems can be observed at all scales and stages --- from process and fabrication flow graphs to high-level organization supply chains. Hence, graph learning can be leveraged in future Industry 4.0 systems. Furthermore, these methods can be used to realize the vision of cognition in digital twins. We make the important clarification that graph learning is not the only solution to enabling cognition in digital twins, nor does it completely enable all levels of cognition across a system. It is simply just yet another computational method that takes advantage of data-driven modelling that can be used in systems moving towards further autonomy.
The main contribution of this work is a novel, graph learning framework for enabling cognition in digital twins. The framework we propose is a query-based framework that can potentially answer any type of query. The framework involves three main steps namely, (i) the {\it Graph Formation} step, which can aggregate data from diverse data types and from diverse products in a graph representation that can be used for reasoning or solving a specific problem, (ii) {\it Graph Operations} that process the graph further to select the key features, and (iii) the {\it Learning Objective} that specifies the problem to be solved to answer the query. This framework can leverage both physical and virtual data simultaneously, improve the core operations of manufacturing systems, and address some of the open research gaps in the field.
The remainder of this paper is structured as follows: Section \ref{sec:digital-twin} introduces digital twins and their importance in Industry 4.0; in Section \ref{sec:cognitive-digital-twin}, the concept of cognitive digital twins is detailed; Section \ref{sec:graphlearning} describes concepts of graph learning and its application in manufacturing along with a general graph learning framework for digital twins with illustration for the product design stage; and Section \ref{sec:conclusion} gives concluding remarks.
\section{Graph Learning for Cognitive Digital Twins}
\label{sec:graphlearning}
Data driven models based on artificial intelligence and machine learning have become increasingly popular for enabling some cognitive capabilities in digital twins at various levels of manufacturing systems \cite{abburu2020cognitwin}. In this section, we present graph learning as just one of many solutions that can be used to enable cognition in digital twins.
In the subsequent subsections, we briefly provide preliminaries on graph learning along with motivation for the use of graphs in manufacturing systems. In Section \ref{sec:mandesign2}, we present specialized graph learning frameworks and discuss how they can enable cognitive capabilities in digital twins and offer potential solutions for important research challenges within the field of manufacturing systems.
\begin{figure}[h!]
\centering
\includegraphics[scale = 0.35]{figures2/Graph_Icons_V4.png}
\caption{A generic undirected graph formed in the context of product design.}
\label{fig:Graph_Pre}
\end{figure}
\begin{figure}[h!]
\centering
\includegraphics[scale = 0.30]{figures2/Neighbors_V4.png}
\caption{Neighborhood node aggregation of node $E$.}
\label{fig:Neighbors}
\end{figure}
\begin{table*}[t]
\centering
\caption{Related Works of Graphs Learning in Manufacturing}
\label{table:graph}
\begin{tabular}{|c|c|c|}
\hline
\multicolumn{1}{|c|}{\textbf{Manufacturing Stage}} &
\multicolumn{1}{|c|}{\textbf{Graph Function}} &
\multicolumn{1}{|c|}{\textbf{References}} \\ \hline
\multirow{3}{*}{Design} & perform automation engineering tasks using functional lifting & \cite{wan2018future}\\ \cline{2-3}
& design of distributed circuits & \cite{zhang2019circuit}\\ \cline{2-3}
& unsupervised 3D shape retrieval & \cite{nie2020multi} \\ \hline
\multirow{2}{*}{Optimization} & optimize scheduling performance of flexible manufacturing systems & \cite{hu2020petri} \\ \cline{2-3}
& find the optimum scheduling policy for job-shop problems & \cite{park2021learning} \\ \hline
\multirow{4}{*}{Monitoring} & detect and isolate faulty components in industrial systems & \cite{khorasgani2019fault} \\ \cline{2-3}
& improve product failure prediction & \cite{kang2020product} \\ \cline{2-3}
& share multi-level manufacturing knowledge within a system & \cite{he2019manufacturing} \\ \cline{2-3}
& predict the remaining useful life estimation of industrial equipment & \cite{narwariya2020graph} \\ \hline
\end{tabular}
\end{table*}
\subsection{Preliminaries on Graph Learning}
\label{ssec:prelims}
We define a graph with $n$ nodes as, $\mathcal{G} = \{\bar{V},\bar{A}\}$, where $\bar{V}= [v_1, v_2, ... v_n]$ is the matrix of the node embedding in the graph, $v_i$ is the node embedding for node $i$. The edges of a graph are represented by the adjacency matrix, $\bar{A}$, where each value $a_{ij}$ corresponds to the relation between nodes $i$ and $j$. The feature matrix of the graph, $\bar{X}$ is composed of each nodes feature vectors, $x_i$, which can hold unique data pertaining to each node. Fig. \ref{fig:Graph_Pre} shows a basic graph of six nodes with various connections. This example is set in a manufacturing design setting where each node is a product, and the edges are possible connections between products. Additionally, some examples of features of product $C$ are also shown.
Graphs can be classified as (i) {\it directed} or {\it undirected} and (ii) {\it weighted} or {\it unweighted}. Directed graphs are graphs where the edges represent relations that are uni directional. The opposite is the undirected graph where the edge is a bi-directional relation. Weighted graphs are graphs where the edges have an associated weight that specifies the relative importance of the relation. The concepts we present later hold for graphs of any type.
Graph learning broadly includes two steps: the formation of the graph and finding a lower dimensional representation of the graph. Graph neural networks are a widely popular and successful deep learning technique for generating lower dimensional representation of graph structure data. The first \textit{Graph Neural Network} (GNN) model was developed in \cite{scarselli2008graph}, and since then, numerous graph approaches have been proposed such as \textit{Recurrent Graph Neural Networks} (RecGNNs), \textit{Convolutional Graph Neural Networks} (ConvGNNs), \textit{Graph Autoencoders} (GAEs) and \textit{Spatio-temporal Graph Neural Networks} (STGNNs)~\cite{wu2020comprehensive}.
One of the key techniques contributing to graph learning's rise in popularity is notably the Graph Convolutional Network (GCN), developed by \cite{kipf2016semi} in 2016.
Graph neural networks typically include the following two operations: (i) message passing and (ii) node embedding. Message passing is the function that aggregates features from a node's neighbors. This operation updates the features of nodes with the information from their respective neighbors and its current feature values. Multiple message passing operations will then result in a final node feature that is a function of information from nodes across the graph.
Figure \ref{fig:Neighbors} shows one such instance of message passing for the graph in Fig. \ref{fig:Graph_Pre}. The node embedding operation encodes the final feature vector as a lower dimensional representation. These two operations form the key parts of most general graph neural network approach.
\subsection{Graph Learning in Manufacturing}
Graph learning has some fundamental advantages, specifically: (i) modeling of non-Euclidean data; (ii) expressing data in an insightful manner to understand relationships between entities of a system; (iii) abstracting data for higher-level reasoning tasks; (iv) capturing dependencies between the different model instances of a system. Since graphs are prevalent in manufacturing systems (see Section \ref{sec:digital-twin}), it follows that graph learning can provide significant advantages in manufacturing. In Table \ref{table:graph}, works that illustrate the use of graph learning in various phases of manufacturing systems are listed. In \cite{wan2018future,zhang2019circuit,nie2020multi}, it is shown that graphs of similar or related products can be used to leverage information sharing and save time and money for verification, validation, and testing in the design stage. In \cite{hu2020petri,park2021learning}, it is shown that graph learning can be used to optimize scheduling performance during operation. In monitoring systems, graph learning has been shown to improve detection and prediction of failures in both products and equipment \cite{khorasgani2019fault,kang2020product,narwariya2020graph}. While these demonstrations highlight the opportunities that lie for graph learning in manufacturing systems, the graph learning systems that these works develop are restricted to specific applications. In the following sections, we present a novel and general graph learning framework for any digital twin application. We focus on the design stage of manufacturing to illustrate our ideas.
\section{Conclusion}
\label{sec:conclusion}
This paper presented a comprehensive vision of future cognitive digital twins that can enable advancements in Industry 4.0. The benefits of using digital twins in manufacturing were detailed. Six core cognitive capabilities, \textit{perception, attention, memory, reasoning, problem-solving}, and \textit{learning}, were described along with their ability to influence complex manufacturing decisions and future autonomy. A novel, query-based graph learning framework for enabling cognition in digital twins was presented to fill existing research gaps in the field. We believe that to realize the full potential of cognitive digital twins, collaboration across different research communities is essential. Domain expertise in many areas will be necessary in the development of the future of manufacturing.
\section*{Acknowledgment}
This research was supported by NSF awards CMMI-1739503 and ECCS-1839429. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect views of our funding agencies.
\bibliographystyle{IEEEtran}
\subsection{Product Design}
\label{sec:mandesign}
\green{Benefits of cognition can be realized throughout manufacturing, like shown in \cite{zaeh2010holistic}. They propose a cognitive production planning and control system that it is able to react and autonomously adapt its production planning process to increase manufacturing efficiency. They employ cognitive functions of perception, knowledge, and planning within their architecture. Cognitive IoT is another application that can be used in manufacturing systems as sensors themselves can exercise cognitive capabilities \cite{ploennigs2017materializing}.} While cognition can impact various stages of Industry 4.0 and related technologies, here we focus on the product design stage to illustrate our key ideas.
The potential impact of this focus is far-reaching --- advancements in product design can lead to more robust designs, cost efficient research and development, and overall more streamlined designs. The product design stage of manufacturing can be defined as steps starting from the idea generation of a product to the physical testing, verification, and validation of the product before manufacturing. Current practices in this domain often target their efforts in two separate streams, one that focuses on physical data and the other that focuses on virtual data. Thus both do not take advantage of the benefits a digital twin can offer \cite{tao2018digital2}.
In the following subsections, we discuss the application of graph learning to the {\it search} operation of the design phase. We discuss the benefits that arise and comment on the limitations and future research directions.
\subsection{The Search Operation}
The \textit{search} operations in the product design stage can be defined as processes that involve transferring useful knowledge and information from other products or systems that can aid in the design of the product under development.
Currently, researchers and engineers spend a large amount of time building a new product, process, or system without leveraging the knowledge that already exists for a similar or somewhat closer product, process, or system.
For example, there are resources such as GrabCad \cite{grabcad}, which contains computer-aided design (CAD) models of many engineering systems, that can be used as a base design for creating new models. These CAD models are part of the digital twin of the product that goes through the manufacturing process to be converted into the physical twin. Various methods have been proposed for exploring 3D models (a partial digital twin model defining the physical twin geometry and manufacturing information). For example, authors in \cite{3Dmodelsearch} created a 3D search engine that utilizes the spherical harmonics descriptor for acquiring the signature vector and use the Euclidean distance among these vectors to find a similar polygon model. Authors in \cite{VESPER} utilized the shape similarity metric on 3D models to enable the discovery of parts and assemblies existing in the company's database. Authors in \cite{3DPDF} utilized a similarity measure based on various attributes (such as name, description, etc.) to calculate a score for discovering CAD models in repositories. While these research efforts focused on searching and discovering similar 3D models based on geometry information, the digital twin models comprise more than just geometry information of the physical twins and thus can be used for searching and responding to more diverse search queries. {\it We posit that graph learning techniques by virtue of their capability to learn general relationships are critical to building a general purpose product search engine.}
\subsection{Graph Learning Framework}
\label{sec:mandesign2}
In Fig. \ref{fig:graph-cogdt}, we portray the graph learning framework for enabling cognition in digital twins. Cognitive functions allow humans to transfer their knowledge and experiences from one domain to a completely different domain. While this is a big challenge for current machine learning methodologies, graph learning is a potential machine learning technique that can bridge this gap.
In Fig. \ref{fig:graph-cogdt}, the functional steps of the graph learning framework are shown on the left and the cognitive functions it enables are shown on the right.
The framework we propose is a query-based framework. The query can be either any user generated query or an automated query from the digital twin. The query can potentially cover a range of tasks or problems like finding functionally similar products or generating configuration for a new set of product specifications, or even generating novel insights for new products. Thus, the scope of this framework is very broad. The graph learning framework will allow the digital twin to answer such higher level queries by identifying complex product to product or product to sub-component relationships and solving problems by processing this information. In the \textbf{Graph Formation} step, data of products and their properties are mined and organized as a graph based on the query, allowing them to be processed further. The constructed graph captures the essential relations and provides a powerful abstraction or representation that can enable reasoning or problem solving using graph operations to answer the query. The \textbf{Graph Operations} step, can model very general and complex mathematical functions. Graph operations can further aggregate information and form condensed representations as shown in the figure, which is useful for generating the final decision or insight to answer the query. Graph neural networks, in principle, can model any mathematical function, and so are a potential approach for this step. Lastly, the \textbf{Learning Objective} specifies the problem to be solved for answering the query and the general metrics and specifications to optimize and fine-tune the model for solving this problem. Specifying the correct metrics for training and verifiability are critical to ensure the digital twin can effectively and reliably optimize the model for the given problem (e.g. classification, prediction). Accurate problem specification is also critical for generating the best response to the query. This step's output and subsequent feedback can also be used to iteratively refine and improve the model.
By leveraging this framework, digital twins can learn to organize information from diverse domains by their complex relations based on the query (which can be a search query).
While physical testing is not completely substitutable, this method can make the design process more efficient by allowing the designer to leverage prior knowledge. For example, a designer targeting a specific design objective can initiate their query, and the framework can enable aggregation of knowledge from various domains to generate new insights for the design of the product. This will also enable digital twins to leverage physical and virtual data simultaneously, and find improved solutions for the specific queries, addressing a key gap that we alluded to in Section \ref{sec:mandesign}. We also envision that future cognitive digital twins will be able to make these queries autonomously. We note that full cognition in manufacturing will leverage a combination of other methods, as indicated in the top right of Fig. \ref{fig:graph-cogdt}, and that graph learning is one of the key methodologies. \green{In the next section, we showcase a real-world application that illustrates some functionalities of the proposed framework.}
\green{
\section{Use Case}
\label{sec:app}
In this section, we review experiments and results of an application to illustrate the proposed methodology. In a previous work, our group presented a specialized graph learning framework that uses the concept of functional lifting for future automation engineering in the product design space \cite{wan2018future}. Automation engineering in this context can be defined as automation of the \textit{design, creation, development and management of production systems in factories, process plants, and supply chains that realize the production of products}. Automated functional lifting refers to the strategy of inferring functions of products based on abstractions of common engineering data.
In these experiments, the goal is to produce accurate classification labels for different product types using engineering data artifacts. This classification enables more efficient search operation within and across different products with similar functionalities. To realize these operations, a graph learning framework with a structural graph convolutional neural network (SGCNN) is proposed.
The dataset was generated by scraping GrabCAD \cite{grabcad} for six different categories of 3D CAD models with related functions: \textit{Car, Engine, Robotic Arm, Airplane, Gear, and Wheel}. Functional information such as model’s name, author, description of the model, name of parts in the model, tags, likes, timestamps, and comments on the models was also extracted. The total number of models per category was 2,271 for \textit{Car}, 1,597 for \textit{Engine}, 2,013 for \textit{Robotic Arm}, 2,114 for \textit{Airplane}, 1,732 for \textit{Gear}, and 2,404 for \textit{Wheel}. These were later broken down into a testing-training split that is detailed in Section \ref{ssec:cogs}.
\subsection{Graph Learning Framework}
The graph learning framework proposed in \cite{wan2018future} is depicted in Fig. \ref{fig:sgcnn}. Their framework can be viewed as an application of our cognitive digital twin framework. To illustrate this, we present their proposed framework as it aligns with the different stages of our cognitive digital twin framework: Graph Formation, Graph Operations, Learning Objective. We detail these stages in their framework below.
\begin{figure*}[ht!]
\centering
\includegraphics[width=0.9\textwidth]{figures2/architecture1.pdf}
\caption{SGCNN Architecture \cite{wan2018future}.}
\label{fig:sgcnn}
\end{figure*}
\textbf{Graph Formation}
In this stage, the input dataset is processed into graph structures based on a search query which is dependent on the target design application. Specifically, the Sample Generator generates subgraphs, $\mathcal{G}_n$, based on the queried schema of interest, which in this setting is the information from the extracted 3D CAD models. This schema is designed to extract functional information from each sample. The embedding of sample information into the feature vectors is done by the well-known \texttt{word2vec}, and the induced subgraphs are composed of the functional information for each sample. These subgraphs are aimed at capturing the meaning of the engineering design and enable functional lifting.
\textbf{Graph Operations}
In this stage, both graph pooling and graph convolutions are performed over the subgraphs. This involves aggregating information from neighbor nodes within a subgraph, appending this information to the original subgraphs, and then processing the subgraphs through convolutional layers. The output after these subsequent convolutions is processed through a nonlinear activation function in order to perform the classification. The final output is the probability of the various classes. The processing done during this stage enables functional lifting by abstracting the common engineering data across subgraphs in a way that they can mathematically utilized.
The Neighborhood Node Aggregation Layer performs convolutions and pooling to aggregate information from each node's neighbors into the created subgraphs. Here, the common method \texttt{node2vec} that combines a breadth/depth first search over graphs is utilized. The feature vector for each node, $x_n$, is calculated as follows:
\begin{equation}
x_n = \sigma(f_{pool}(\bar{W} \circledast \bar{N}) + b) ,
\end{equation}
where $\sigma(\mathord{\cdot})$ is the activation function; $f_{pool}$ is a pooling function; $\bar{W}$ is a $1$ by $d$ trainable weight matrix with $d$ as a defined search depth; $\circledast$ represents the convolution operation; $\bar{N}$ is $n$ by $d$ matrix of the neighbor node's features (as illustrated roughly in Fig. \ref{fig:Neighbors}); and $b$ is a bias variable.
The aggregated subgraphs are then fed into the SGCNN layers which consist of subsequent convolutions, graph pooling, and non-linear activations. In order to perform the 2D convolutions over the subgraphs, an attribute matrix, $\bar{R}$, is calculated as:
\begin{equation}
\bar{R} = \bar{X} \circ (\bar{A}+\bar{I}),
\end{equation}
where $\bar{X}$ is the feature matrix for the subgraph (as described in Section \ref{ssec:prelims}); $\circ$ denotes the Hadamard Product of two matrices; $\bar{A}$ the adjacency matrix of the subgraph (as described in Section \ref{ssec:prelims}); and $\bar{I}$ denotes thee identity matrix.
Before the convolutions are applied, a special graph pooling algorithm is used to down sample $\bar{R}$ to a $k$ by $k$ matrix, $\bar{R}^k$, where $k$ is the size of the convolutional kernel. The trainable $k$ by $k$ kernel matrix, $\bar{W}^k$, is passed over the subgraph as defined in the following equation:
\begin{equation}
x^k = \phi(\bar{W}^k \circledast \bar{R}^k + b) ,
\end{equation}
where $\phi(\mathord{\cdot})$ is the non-linear activation function. This graph convolution operation is able to effectively aggregate local features for each node, in a similar manner that traditional convolutions over images are applied. The new subgraph, adjacency, and attribute matrix are then calculated using the previous subgraph and passed to the next SGCNN layer accordingly.
\textbf{Learning Objective}
The overall graph learning objective for classification is specified by the cross-entropy loss function, $H$, over the output of the final SGCNN layer:
\begin{equation}
\max H, ~ H = \sum_{i \in \text{classes}} y_i log_e(\hat{y}_i) ,
\end{equation}
where $y_i$ is the indicator of the ground truth validity of the label $i$ and $\hat{y}_i$ is the inferred probability of the label $i$. It is clear that when the learning objective is maximized, the predicted probabilities will closely match the ground truth labels. During training of the model, the weights of the graph pooling and convolution operations at each layer are updated. As in traditional supervised learning training approaches, the model has access to the ground truth labels to compute the loss function. During testing of the model, the performance is then evaluated against subgraphs is has not previously been trained on.
For training and evaluation of the SGCNN architecture a train-test split of 11,304 to 2,827 samples was used. Through extensive experiments, the best SGCNN model was identified to be four layers. It was also observed that as both the number of hidden layer features and output kernel size were increased the model achieved better classification scores. It was shown that the model was able to correctly classify roughly 91\% of the subgraphs based on their functionality. We refer readers to \cite{wan2018future} for further information regarding the model structure and tuning of hyperparameters and ablation studies.
\subsection{Cognitive Capabilities}
\label{ssec:cogs}
The cognitive capabilities are utilized throughout the framework's core operations. \textit{Perception} is utilized in the representation of the data on subgraphs, and the subsequent embedding of features that are abstracted to a level for the model to perform further computations. \textit{Memory} and \textit{learning} are utilized continuously in the update and the optimization of the model parameters during the training process. In the graph operations, \textit{attention} and \textit{reasoning} are effectively employed to reuse knowledge across different samples while selectively focusing on the most relevant functional attributes. Thus, the framework implements several key cognitive functions.
\subsection{Further Extensions}
An additional output that the graph framework could produce is the clustering of the nearest-neighbor subgraphs that serve similar design functions. This could allow the digital twin to learn from similar designs at a functional level when tasked with searching for similar products, as opposed to searching for only similar products of the same basic design. This would require a multi-task learning approach because with this additional objective the model must be trained for accurate classification and clustering. Even further, this framework can be extended for higher level cognitive functions like reasoning, decision making and problem solving by enabling a feedback loop that self-generates queries. This can potentially enable complete autonomy and fully realize the capabilities of cognitive digital twins.
\section{Discussion}
In this section we discuss current challenges and limitations, extensions to other areas of manufacturing, and an outlook on future research directions in the field.
\textit{Challenges:}
There are some specific challenges with regards to the proposed framework. Formation of graphs, problem and metric specification, and hyper-parameter tuning of graph operations can require expert knowledge. \green{In the use case in Section \ref{sec:app}, extensive studies on the optimal model and hyperparameters, such as various activation functions, number of hidden features per layer, kernel size, and number of total layers were needed.} Techniques for formation of graphs are still relatively under-explored and therefore may be burdensome in some applications. \green{Additionally, there are some scenarios where the data is not easy to represent as a graph. Further abstraction of systems and/or processes may be necessary to arrive at a graph-level representation. Nonetheless, applications of graph learning approaches to these situations are still under explored.} All of these are open research challenges.
Another notable challenge is the availability of data. Due to constraints in the sharing of propriety information, some companies may be prohibited from collaboration with others. Additionally, financial and competitive motivations may also limit progress along this direction. However, as Industry 4.0 continues to develop, the amount of available data will continue to increase as well. This will enable digital twins using data-driven approaches to become more robust and efficient over time.
\textit{Other Applications in Manufacturing:}
The framework we presented can be extended to the entire life cycle of a product. During actual manufacturing, information about operations, products, logistics, and diagnostics are exchanged between various systems. This data can be modeled on graphs and graph learning can be leveraged to create new solutions to key manufacturing problems. Likewise, high-level organizational supply chains and consumer-provider supply and demands can be modelled on graphs and optimized towards specific performance objectives. Another powerful extension stems from a cognitive digital twin's ability to draw on its own past experiences (or experiences from other digital twins) to learn and adapt over time. Graph learning can incorporate temporal features, features that vary over time, which can allow a digital twin to learn from past data and observe specific time-dependent trends. This can enable iterative learning over design cycles and more intelligent design tools. Likewise, the growing areas of reconfigurable/flexible manufacturing can benefit from similar methods.
\textit{Future Research Directions:}
The research community has immense opportunities to contribute in the areas of mathematical representations, algorithms, tools, and methodologies for developing and using cognitive digital twins. In this context, we formulate and pose a few research questions.
- What are the appropriate mathematical representations of digital twins that can enable the incorporation of cognitive capabilities? Examples here include differential equations, discrete-event dynamic systems, logic-based models, graph models, connectionist network models, etc. How can such models be used for simulations, state estimation, and control and decision making?
- How can high-performance computing and numerical simulation tools be leveraged to enable cognitive capabilities in digital twins? For example, can numerical simulations (along with experimental data) create large memory banks that can be used for interpreting and acting on real-time streaming data from IoT sensors? Can they be used for real-time response to changes in the manufacturing system environment?
- How can we enable public searchability of the digital twin models? More specifically, how to embed metadata in complex digital twin models (parts, processes, and systems) so that they can easily be searched over the internet during the design phase?
- How do we make the knowledge sharing scalable in digital twin models? Scaling may fall under the scope of generalizing knowledge sharing across multiple domains. Scalability is non-trivial and is a challenge due to the complexity of cross-domain knowledge sharing. However, the digital twin models may be capable of sharing knowledge across non-overlapping domains (for example, across manufacturing systems utilizing different technologies, between the aging model and quality prediction model, etc.).
\green{Among these future research directions, we believe that there is not one sequential path that takes precedence over others in the future development of cognitive digital twins. Different applications and studies will call for varying degrees of focus on these directions and may involve pursuing multiple directions simultaneously. Having said that, prioritizing development of strong theoretical and mathematical methods will be necessary to address many of these directions. Public searchability and scalability could be developed in tandem as they can work synergistically together to enable a proliferation of cognitive digital twin usage and prevalence.}
| {'timestamp': '2021-09-20T02:20:46', 'yymm': '2109', 'arxiv_id': '2109.08632', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08632'} | arxiv |
\section{Introduction}
Means for quality control in crowdsourcing include organizational approaches, such as task design, decomposition, golden tasks preparation, yet reliably automated, and computational approaches that employ relationships and statistical properties of workers, tasks, and labels. Many crowdsourcing studies of complex crowdsourcing pipelines aim to reduce their tasks to multi-classification or combine multi-classification with post-acceptance, e.g., in a seminal paper by \citet{Bernstein:10}. At the same time, researchers from such fields as natural language processing, computer vision, and others develop discipline-specific methods. To be conveniently employed, these methods need to be integrated with popular data science libraries and frameworks. However, such toolkits as SQUARE \citep{Sheshadri:13}, CEKA \citep{Zhang:15}, Truth Inference \citep{Zheng:17}, spark-crowd \citep{Rodrigo:19}, require additional effort to be embedded in applications. We believe in addressing this issue by developing \textbf{Crowd-Kit}, an open-source production-ready Python toolkit for computational quality control in crowdsourcing. It implements popular quality control methods, providing a common ground for reliable experimentation and application. We perform an extensive evaluation of the Crowd-Kit library to provide the common ground for comparisons. \textit{In all the experiments in this paper, we used our implementations of the corresponding methods.}
\section{Crowd-Kit Design and Maintenance}
Our fundamental design principle of Crowd-Kit is to bridge the gap between crowd science and vivid data science ecosystem of NumPy, SciPy, Pandas, and scikit-learn \citep{Pedregosa:11}. We implemented Crowd-Kit in Python and employ the highly optimized data structures and algorithms available in these libraries, ensuring compatibility with the application programming interface (API) of scikit-learn and data frames of Pandas.
We implemented all the methods in Crowd-Kit from scratch in Python. Although unlike spark-crowd \citep{Rodrigo:19} our library does not provide means for running on a distributed computational cluster, it leverages efficient implementations of numerical algorithms in underlying libraries widely used in the research community. Besides aggregation methods, Crowd-Kit offers annotation quality characteristics, such as uncertainty \citep{Malinin:19} and agreement with aggregate \citep{Wawa}.
Crowd-Kit is platform-agnostic, allowing analyzing data from any crowdsourcing marketplace (as soon as one can download the data). Crowd-Kit is an open-source library available under Apache license both on GitHub and PyPI: \url{https://github.com/Toloka/crowd-kit} and \url{https://pypi.org/project/crowd-kit/}, correspondingly.
\section{Categorical Aggregation}
Crowd-Kit includes aggregation methods for categorical data, in which latent label assumption is met. We implement most traditional methods for categorical answer aggregation, including such models as \textit{Dawid-Skene} (DS, \citeyear{Dawid:79}), GLAD \citep{Whitehill:09}, and M-MSR \citep{Ma:20}. We also offer an implementation of \textit{Majority Vote} (MV) as well as its such weighted variations as \textit{Worker Agreement with Aggregate} (Wawa) as described in \citet{Wawa}.
\begin{table}[htbp]
\centering
\resizebox{\columnwidth}{!}{\begin{tabular}{l*{6}{c}}
\textbf{Method} & \textbf{D\_Product} & \textbf{D\_PosSent} & \textbf{S\_Rel} & \textbf{S\_Adult} & \textbf{binary1} & \textbf{binary2} \\
MV & $0.897$ & $0.932$ & $0.536$ & $0.763$ & $0.931$ & $0.936$ \\
Wawa & $0.897$ & $0.951$ & $0.557$ & $0.766$ & $0.981$ & $0.983$ \\
DS & $0.940$ & $0.960$ & $0.615$ & $0.748$ & $0.994$ & $0.994$ \\
GLAD & $0.928$ & $0.948$ & $0.511$ & $0.760$ & $0.994$ & $0.994$ \\
M-MSR & --- & $0.937$ & $0.425$ & $0.751$ & $0.994$ & $0.994$ \\
\end{tabular}}
\caption{\label{tab:categorical}Comparison of the implemented categorical aggregation methods (accuracy is used).}
\end{table}
\paragraph{Evaluation.} To ensure the correctness of our implementations, we compared the observed aggregation quality with the already available implementations by \citet{Zheng:17} and \citet{Rodrigo:19} on the same datasets. Table~\ref{tab:categorical} shows evaluation results, indicating a similar level of quality as them.
\section{Pairwise Aggregation}
Pairwise comparisons are essential for such tasks as information retrieval evaluation and subjective opinion gathering, where the latent label assumption is not met. We implemented the \textit{Bradley-Terry} probabilistic transitivity model (BT, \citeyear{Bradley:52}) for pairwise comparisons.
\paragraph{Evaluation.} Table~\ref{tab:pairwise} shows the comparison of the \textit{Bradley-Terry} method implemented in Crowd-Kit to the random baseline on the graded readability dataset by \citet{Chen:13}. Since it contains only 491 items, we additionally annotated on Toloka a sample of 2,497 images from the IMDB-WIKI dataset \citep{Rothe:18}. This dataset contains images of people with reliable ground-truth age assigned to every image. The annotation allowed us to obtain 84,543 comparisons by 2,085 workers.
\begin{table}[htbp]
\centering
\begin{tabular}{lcc}
\textbf{Method} & \textbf{\citet{Chen:13}} & \textbf{IMDB-WIKI} \\
Bradley-Terry & $0.543$ & $0.885$ \\
Random & $0.360$ & $0.504$ \\
\end{tabular}
\caption{\label{tab:pairwise}Comparison of implemented pairwise aggregation methods (NDCG@10 is used for \citet{Chen:13} and NDCG@100 is used for IMDB-WIKI).}
\end{table}
\section{Sequence Aggregation}
Crowd-Kit implements the \textit{Recognizer Output Voting Error Reduction} (ROVER) dynamic programming algorithm by \citet{Fiscus:97}, known for its successful application in crowdsourced sequence aggregation \citep{Marge:10}. We also offer implementations of \textit{Reliability Aware Sequence Aggregation} (RASA and HRRASA) algorithms by \citet{Li:19} and \citet{Li:20} that encode responses using Transformer-based representations and then iteratively estimate the aggregated response embedding.
\paragraph{Evaluation.} We used two datasets, CrowdWSA \citep{Li:19} and CrowdSpeech \citep{VoxDIY}. As the typical application for sequence aggregation in crowdsourcing is audio transcription, we used the word error rate as the quality criterion \citep{Fiscus:97} in Table~\ref{tab:sequence}.
\begin{table}[htbp]
\centering
\resizebox{\columnwidth}{!}{\begin{tabular}{lcccc}
\textbf{Dataset} & \textbf{Version} & \textbf{ROVER} & \textbf{RASA} & \textbf{HRRASA} \\
\multirow{3}{*}{CrowdWSA} & J1 & $0.612$ & $0.659$ & $0.676$ \\
& T1 & $0.514$ & $0.483$ & $0.500$ \\
& T2 & $0.524$ & $0.498$ & $0.520$ \\
\multirow{4}{*}{CrowdSpeech} & dev-clean & $0.676$ & $0.750$ & $0.745$ \\
& dev-other & $0.132$ & $0.142$ & $0.142$ \\
& test-clean & $0.729$ & $0.860$ & $0.859$ \\
& test-other & $0.134$ & $0.157$ & $0.157$ \\
\end{tabular}}
\caption{\label{tab:sequence}Comparison of implemented sequence aggregation methods (average word error rate is used).}
\end{table}
\section{Image Aggregation}
Crowd-Kit offers three image segmentation aggregation methods. First, it provides a trivial pixel-wise MV. Second, it implements a method similar to the one described in \citet{JungLinLee:18}, performing an EM algorithm for counting the probability of a correct answer as the proportion of correctly classified pixels to the number of all pixels that at least one worker chose. Third, we implement a variation of RASA that scores Jaccard distances between segments and weights them proportionally to these distances.
\paragraph{Evaluation.} We annotated on Toloka a sample of 2,000 images from the MS~COCO \citep{Lin:14} dataset consisting of four object labels. For each image, nine workers submitted segmentations. In total, we received 18,000 responses. Table~\ref{tab:segmentation} shows the comparison of the methods on the above-described dataset using the \textit{intersection over union} (IoU) criterion.
\begin{table}[htpb]
\centering
\begin{tabular}{lccc}
\textbf{Dataset} & \textbf{MV} & \textbf{EM} & \textbf{RASA} \\
MS~COCO & $0.839$ & $0.861$ & $0.849$ \\
\end{tabular}
\caption{\label{tab:segmentation}Comparison of implemented image aggregation algorithms (IoU is used).}
\end{table}
\section{Conclusion}
Our experience in running Crowd-Kit for processing crowdsourced data shows that it successfully handles industry-scale datasets without the need for a large computational cluster. We currently focus on providing a consistent API for benchmarking existing methods and implementing additional domain-specific aggregation techniques like sequence labels aggregation \citep{Nguyen:17} and continuous answer aggregation. We believe that the availability of computational quality control techniques in a standardized way would open new venues for reliable improvement of the crowdsourcing quality beyond the traditional well-known methods and pipelines.
| {'timestamp': '2021-10-11T02:24:22', 'yymm': '2109', 'arxiv_id': '2109.08584', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08584'} | arxiv |
\section{Introduction}
In Information Extraction (IE) we are interested in extracting structured knowledge from unstructured text. This structured knowledge takes most usually the form of binary relations between entities, in other words triples of the form \textit{head - relation - tail}, which can then be used to populate a Knowledge Base or a Knowledge Graph with factual information.
The standard approach to perform IE relies on a series of Natural Language Processing (NLP) tasks\footnote{Here we are implicitly assuming that all the tasks are solved with Machine Learning techniques and not rule based alternatives that are sometimes employed in open IE.}. First, Named Entity Recognition (NER) is employed to find and extract entities of interest, subsequently Entity Linking (EL) to link the extracted entities to Knowledge Base identifiers and finally Relation Extraction (RE) to identify existing relations between entities.
These tasks have attracted a great deal of attention in recent years with both methods and datasets fuelling further research \cite{verga2018simultaneously, zeng2014relation, zeng2015distant, lin2016neural}, since IE is largely regarded as a main facilitator of structured data reasoning, such as Knowledge Base Completion.
\subsection{Standard Information Extraction vs Slot Filling}
A major bottleneck in the above approach is that all modules (NER, EL, RE) need training data that is specific to the entity or relation types that we are interested in extracting, in other words a NER model recognizing diseases needs training data annotated with the entity type $disease$ and so forth. The biomedical domain is particularly affected by these limitations, in the sense that there might exist multiple entity and relation types and sourcing training data for each of these is expensive and challenging, requiring subject matter experts. For reference, the UMLS ontology contains 125 semantic types, i.e., entity types and 54 relation types.
An alternative approach to standard IE is slot filling. Slot filling's modelling of the task of IE is highly reminiscent of open domain question answering (QA): for a given head-relation pair, a retriever returns a set of relevant passages which are then fed to a reader model that processes them to answer with a tail entity. This approach is particularly attractive for biomedical IE, since it inherently allows for zero-shot settings thereby waiving the need for expensive training data. Importantly, this approach allows also to extend to relation types that were unseen during training, effectively reducing the need for re-training and re-deployment of a model deployed into production.
One further point in favour of a slot filling approach relates to the computational cost of inference. Standard IE requires processing of every single sentence of the given corpus through its different modules (NER, EL, RE). In contrast, slot filling requires to perform retrieval and reading comprehension on far less queries to extract relations. As an example, Hetionet \cite{himmelstein2017systematic} contains around 2.25M relations, but they can be formulated in around 46k distinct queries, of the form \textit{head-relation}\footnote{In other words, if we were trying to build a KB from biomedical text that would contain these 2.25M relations, we would require to perform around 46k queries on our index to retrieve relevant documents.}.
As a final point we summarize below how the two approaches would materialize in a production setting, to make their differences more apparent. We note that standard IE might involve additional tasks, such as coreference resolution, which we don't describe here for simplicity. Below, we assume that our biomedical corpus has already been split into sentences:
\begin{minipage}[t]{.5\textwidth}
Standard IE:
\begin{itemize}
\item Recognize entities with NER model in every sentence.
\item Link every previously recognized entity to an entity identifier from a Knowledge Base.
\item For each sentence that contains more than one recognized entity, extract relations between the entities with a RE model.
\item Aggregate relations per sentence, resolving potential conflicts.
\end{itemize}
\end{minipage
\begin{minipage}[t]{.5\textwidth}
Slot filling:
\begin{itemize}
\item For each entity in the Knowledge Base and each possible relation type, consider all possible head - relation pairs and construct the relevant queries, in a form \textit{head - relation}.
\item For each query, retrieve the top k relevant documents with a retriever model.
\item For each query-retrieved document pair, perform reading comprehension, extracting zero, one or multiple answers, i.e., tails.
\end{itemize}
\end{minipage}
\subsection{Slot Filling: General vs Biomedical Domain}
\label{sec:gen_vs_biomedical_domain}
Although similar in most aspects, slot filling in the general domain against slot filling in the biomedical and more broadly the scientific domain present a few key differences between them. The first lies in the link between relations and entities. In the general domain, a specific relation type will often imply a specific entity type as well, whereas this rarely holds in biomedical literature. Consider for example a relation \textit{spouse-of} in the general domain, where we expect both head and tail of the relation to be entities of type \textit{person}, as opposed to a relation \textit{(up)regulate} in biomedicine where the head and tail entities might be \textit{gene} or \textit{drug} equivalently. This seemingly minor detail poses nuances in the language used for e.g., a gene down-regulating a gene or a drug down-regulating a gene and renders the task of slot filling more challenging in biomedicine.
Another, perhaps more critical aspect relates to retrieval and more specifically how we build and evaluate on a retrieval dataset. In the general domain, a slot filling query, or more broadly a question if dealing with QA, will have most often a unique answer\footnote{We are implicitly referring only to factoid queries here which is the case for most open domain QA datasets; queries of list type would have multiple answers in any case.}, whereas this rarely holds when mining the biomedical literature. For instance, consider the examples illustrated in Table \ref{tbl:general_vs_biomedical_domain_sf} coming from two well established general domain benchmarks, Natural Questions \cite{kwiatkowski2019natural} and zsRE \cite{levy2017zero} against two datasets from the biomedical domain, BioASQ \cite{tsatsaronis2015overview} and our slot filling dataset (BioSF).
\begin{table}
\centering
\begin{tabular}{ccc}
Dataset&Query&Answer(s)\\
\hline
\hline
NQ&when is the next deadpool movie being released&May 18, 2018\\
NQ&what was the first capital city of australia&Melbourne\\
zsRE&Elmer George [SEP] spouse&Mari Hulman George\\
zsRE&Boone River [SEP] mouth of the watercourse&Des Moines River\\
\hline
BioASQ&What are the main indications of lacosamide?&'epilepsy', 'analgesic'\\
BioASQ&Which metabolite activates AtxA?&'CO2', 'bicarbonate'\\
BioSF&sildenafil [SEP] regulator&'L765A', 'F786A', 'F820A'\\
BioSF&Amprenavir [SEP] interacts with&'rifabutin', 'ritonavir'\\
\hline
\hline
\end{tabular}
\caption{\label{tbl:general_vs_biomedical_domain_sf} Examples of queries for general domain benchmarks (NQ, zsRE) vs biomedical domain benchmarks (BioASQ, BioSF). Queries in the biomedical domain usually involve multiple valid answers, as opposed to the general domain. }
\end{table}
This difference has a number of implications both for training and evaluation. With respect to training, one of the major successes of neural-based retrieval methods has been attributed to being able to present the model with hard negatives, i.e., examples were a previous version of the retriever (or a simpler statistical retriever) have failed. When for example we have a query-answer pair that mentions that Barack's Obama wife is Michelle Obama, and the model returns a passage that doesn't include the string "Michelle Obama", we can relatively safely consider this a false positive and use that passage as a hard negative. This helps the algorithm correct mistakes and improve. On the opposite, in biomedicine if we have an example where sildenafil regulates a mutation L765A, we can't automatically mark as a negative an example without this string, as it may contain other valid regulated mutations which don't exist in our Knowledge Base. This compromises our ability to build gold standard training data and we are presented with a situation similar to the one encountered in distant supervision, where unlabeled examples are considered as negatives but might be positives in some cases. Practically, this leads to a noisy training set which will compromise model accuracy.
During evaluation of a biomedical retriever, we encounter the same problem, in the sense that we might obtain misleading low performance since unknown correct passages might rank higher than the known correct ones. This leads to an imperfect, i.e., "silver" quality, evaluation regime making it hard to compare approaches and models.
In this work we aim to address the challenges mentioned in the two previous subsections. Specifically,
\begin{itemize}
\item We provide a short review of the relevant work in Section \ref{sec:related_work}.
\item We contribute a novel formulation of biomedical IE as a slot filling task, to address few-shot or zero-shot settings in Section \ref{sec:biomedical_slot_filling}.
\item We release a new benchmark for biomedical slot filling, dubbed \textit{BioSF} which we describe in Section \ref{sec:biosf}.
\item We train a biomedical dense passage retriever along with a biomedical reading comprehension model for slot filling, using BioSF. We provide the models publicly. We evaluate our approach over several baselines on BioSF, outperforming them by a large margin, in Section \ref{sec:experiments}.
\end{itemize}
\section{Related Work}
\label{sec:related_work}
Recent years have witnessed a series of significant advances in the field of QA, primarily owing to the Transformer architecture \cite{vaswani2017attention} and the BERT language model paradigm \cite{devlin2018bert}. These advances, both in terms of methods \cite{chen2017reading, lin2019bert, guu2020realm, lewis2020retrieval} and datasets \cite{kwiatkowski2019natural, yang2018hotpotqa}, motivated researchers to formulate a series of different NLP tasks as open domain QA, such as entity linking or relation extraction \cite{levy2017zero, petroni2021kilt}. In this work we follow this paradigm by formulating biomedical IE as a slot-filling task.
In open domain QA, given a query, a retrieval module retrieves relevant documents from the knowledge source (such as Wikipedia) and a reading comprehension module is then used to extract a span from the relevant documents, the answer. The retrieval step was, up to very recently, dominated by statistical-based approaches, namely BM25 or tf-idf \cite{chen2017reading}. ORQA \cite{lee2019latent} and REALM \cite{guu2020realm} have been the first neural based methods to clearly outperform statistical based retrieval, although they required expensive language model pre-training. Dense Passage Retrieval (DPR) \cite{karpukhin2020dense} has improved upon these methods by considering a dual BERT-based encoder, one for the queries and one for passages and training it to recognize relevant vs irrelevant passages. This approach has proved superior to other neural based approaches and has quickly become the preferred method for open domain QA in subsequent work \cite{lewis2020retrieval, izacard2021leveraging, maillard2021multi}.
Among the subsequent works, Retrieval Augmented Generation \cite{lewis2020retrieval} employs an architecture based on DPR and BART \cite{lewis2020bart} that is optimized end to end during finetuning, to retrieve relevant documents and generate answers to queries. Also, Fusion-in-decoder \cite{izacard2021leveraging} employs DPR or BM25 as retrievers coupled with a T5 language model, to generate answers by attending at multiple passages simultaneously. For simplicity, we are not considering these approaches in this work, leaving their implementation for the biomedical domain for future work.
In an effort to fuel further research on this field, Petroni et al. \cite{petroni2021kilt} introduced KILT, a new benchmark of knowledge intensive tasks, which contains among others two slot filling datasets, zero-shot RE which was first presented in \cite{levy2017zero} and T-REx introduced in \cite{elsahar-etal-2018-rex}. In building our biomedical slot filling dataset we largely follow the conventions and format of KILT, with the intention to ease experimentation.
Finally, Glass et al. \cite{glass2021robust} have presented a RAG model specifically finetuned for slot filling on the above datasets, showing significant improvement over the generic alternatives, which were finetuned on Natural Questions (NQ).
\section{Biomedical Slot Filling}
\label{sec:biomedical_slot_filling}
Formally, let us first define the task of IE. We assume a knowledge source $K$, consisting of passages $p_i$. Furthermore, we assume there exists a Knowledge Base that contains a number of entities $e_i$. Our goal is to extract from $K$ all possible relations from a set R of relation types $r_i$ that connect entities in a $e_a - r_i - e_b$ form. For each $e_i$ we assume that it has a specific entity type $e_t$ and that each $e_t$ can be involved in a specific subset of R.
Slot filling further formulates the above task as follows: we first employ a retrieval model $M_r$ that encodes all passages $p_i$ from $K$. Subsequently, the encoded passages are indexed. At inference, for each $e_i$ of type $e_t$, we consider all possible relations from R and construct the relevant queries $q_i: e_i - r_i$. Each query is then encoded and the resulting vector is used to query the index, returning the n most similar $p_i$ in terms of the maximum inner product:
\begin{equation}
sim(q_i, p_i) = E_Q(q_i)^TE_P(p_i)
\end{equation}
where $E_Q$ is the query encoder and $E_P$ is the passage encoder. Subsequently a reader model $M_{qa}$ takes as input the above query and each of the retrieved passages and extracts zero, one or more spans, i.e., answers. Valid answers are considered as those representing an entity $e_i$.
Here we adopt as $M_r$ a neural, dense bi-encoder, namely DPR, which uses a different encoder for passages and queries, but any type of retriever can be used such as BM25, where $E_Q=E_P$. Here, we initialize DPR's encoders with the ones presented in \cite{karpukhin2020dense} which were finetuned on the NQ benchmark. We subsequently train DPR on the dataset presented in Section \ref{sec:biosf}, with the following loss function:
\begin{equation}
L(q_i, p_i^+, p_i^-) = -log\frac{e^{sim(q_i, p_i^+)}}{e^{sim(q_i, p_i^+)}+e^{sim(q_i, p_i^-)}}
\end{equation}
Here, unlike \cite{karpukhin2020dense}, we assume that each training instance is a $(q_i, p_i^+, p_i^-)$ tuple where $p_i^+$ is a positive, i.e., relevant passage and $p_i^-$ is a negative passage.
Regarding the reader component of our approach, we employ a standard Transformer-based language model and more specifically BioBERT \cite{lee2019biobert}, finetuned on the dataset of Section \ref{sec:biosf}.
\begin{table}
\centering
\begin{tabular}{cccc}
\hline
Dataset&relation&relation types&size\\
\hline
\hline
BioCreative V CDR \cite{li2016biocreative}&compound-disease&1&15,796\\
BioCrative VI ChemProt \cite{krallinger2017overview}&compound-protein&9&15,568\\
DDIExtraction 2013 \cite{segura2013semeval}&drug-drug&1&32,018\\
\hline
\hline
\end{tabular}
\caption{\label{tbl:bio_dataset_for_biosf} Public datasets used to build our biomedical slot filling dataset, BioSF. The relation types for the drug-drug interactions dataset have been merged into one relation dubbed \textit{interacts with}.}
\end{table}
\section{Biomedical Slot Filling Dataset}
\label{sec:biosf}
In order to build a slot filling dataset for biomedicine, we resort to a number of publicly available biomedical NER and RE datasets, summarized in Table \ref{tbl:bio_dataset_for_biosf}. Each instance in these datasets contains the relation triple as well as the text where it was found, thus we can easily transform them in a question answering-like format for slot filling. In total, we build two datasets, one to train and evaluate the retriever and one for the reader model respectively.
Specifically for the retriever training, we use negative, i.e., null relation instances, as negatives. Additionally, we have used BM25 to add hard negatives to our dataset, exactly as \cite{karpukhin2020dense, glass2021robust} have done previously. Both datasets with their training, development and testing splits are released with our code. In the following, we refer to our dataset as \textit{BioSF}.
\begin{table}
\centering
\begin{tabular}{ccccc}
\hline
Retriever&hits@1&hits@10&hits@100&index size(Gb)\\
\hline
\hline
BM25&21.4&36.1&60.6&\textbf{1.1}\\
DPR-NQ \cite{karpukhin2020dense}&5.5&17.2&37.6&2.9\\
DPR-multitask \cite{maillard2021multi}&4.2&14.3&33.8&2.9\\
DPR-zsRE \cite{glass2021robust}&7.6&19.6&37.2&2.9\\
Bio-DPR(ours)&\textbf{31.0}&\textbf{55.1}&\textbf{72.5}&2.9\\
\hline
\hline
\end{tabular}
\caption{\label{tbl:retrieval_on_1m} Evaluation results for retrieval experiments on the BioSF development set using as content one million passages from PubMed. }
\end{table}
\section{Experiments}
\label{sec:experiments}
In this Section we present the experiments that we conducted, along with the relevant results, followed by a discussion on their implications. We first evaluate our biomedical DPR retriever, subsequently our biomedical slot filling reader and eventually report end to end evaluation results, both in a standard as well as in a zero-shot setting where we evaluate our approach on a subset of Hetionet \cite{himmelstein2017systematic} triples.
As a knowledge source, we use a PubMed dump from April 2020, filtering instances that have an abstract and splitting abstracts to roughly 100-token length passages. For the retrieval experiments, we also use a smaller subset of one million passages, in order to be able to search for optimal hyper-parameters and allow easy replication of results. In that subset, we randomly sample passages and add the gold passages of the slot filling dataset that we previously built so as to make sure that a perfect retrieval algorithm would be able to retrieve all correct passages and find the answer. We highlight that this is an easier version of the real-world task, where the retriever needs to search among around 29 million passages.
\begin{table}
\centering
\begin{tabular}{ccccc}
\hline
Retriever&hits@1&hits@10&hits@100&index size \\
\hline
\hline
BM25&11.0&30.3&56.1&\textbf{29.4}\\
DPR-NQ&5.2&17.9&38.9&90.0\\
DPR-zsRE&2.3&10.2&26.4&90.0\\
Bio-DPR(ours)&\textbf{11.5}&\textbf{33.2}&\textbf{59.1}&90.0\\
\hline
\hline
\end{tabular}
\caption{\label{tbl:retrieval} Evaluation results for retrieval experiments on the BioSF development set on full PubMed. }
\end{table}
\subsection{Retrieval}
\label{sec-exp-retrieval}
First, we are interested to understand the performance of our approach against different baselines. To that end, we employ BM25 as well as three already finetuned DPR retrievers from \cite{karpukhin2020dense, glass2021robust, maillard2021multi}.
For BM25, we employ the anserini package \cite{10.1145/3077136.3080721}, and build a Lucene index on the pre-processed passages, whereas we used the off the shelf Huggingface models for the general domain DPR retrievers.
For our retriever, we train DPR on the BioSF dataset, for 40 epochs keeping the best model in terms of the validation loss. We use a learning rate of $3e-5$, an Adam optimizer with default options and a training batch size of 32 examples. Subsequently, we encode the passages with the trained passage encoder. Encoding the full 29 million passages takes around 12 hours in a server with 8 GPUs V100. We then build a flat FAISS \cite{johnson2019billion} index for the encoded passages.
Initially, we conduct experiments on the smaller dataset that we described above of one million passages. As we noted in Section \ref{sec:gen_vs_biomedical_domain} evaluating retrieval for slot filling or more broadly for QA in the biomedical domain is significantly different than in the general domain since in biomedicine a query has in most cases multiple answers as opposed to the general domain. Table \ref{tbl:retrieval_on_1m} illustrates the results for this first series of experiments.
As we can see the DPR models that have been finetuned on the general domain perform rather poorly compared to the much lighter and computationally efficient BM25. Nevertheless, our model Bio-DPR, is substantially better than BM25 in all cases, achieving up to 19 points of improvement in hits@10. These results, are aligned to the results previously presented for the general domain where BM25 has been outperformed by DPR. Nevertheless, in-domain training data seems critical for DPR to perform well for slot filling, a finding also shared in \cite{maillard2021multi}.
The same findings apply for the full PubMed knowledge source, as illustrated in Table \ref{tbl:retrieval}, although the improvement of our model over BM25 is much smaller but still significant.
\subsection{Slot Filling Reader}
\label{sec-exp-reader}
We now focus on evaluating the reader component of our slot filling approach. We finetune a BioBERT-base and a BioBERT-large model on the BioSF training set. We further include two baselines, one trained on the BioASQ 8 QA dataset and one trained in the zero-shot RE (zsRE) dataset from \cite{levy2017zero}. We employ these two baselines to test whether in-domain data from a different task (BioASQ) or general domain data for the same task (zsRE) can be helpful in learning an accurate model.
For all models, we train up to ten epochs, keeping the best model on the development set, using a learning rate of $3e-5$, a batch size of $32$ and the Adam optimizer with $1e-8$. Table \ref{tbl:reader_on_slot} presents the results. We observe that the baselines perform rather poorly compared to the models trained with in-domain slot filling data a finding that highlights the importance of building an in-domain dataset for slot-filling.
\begin{table}
\centering
\begin{tabular}{cccc}
\hline
Model&Data&Exact Match(dev/test)&F1(dev/test) \\
\hline
\hline
BioBERT-base&BioASQ&13.10/13.44&17.95/18.64\\
"&zsRE&16.59/15.77&22.51/22.98\\
"&BioSF&52.30/54.67&58.82/59.98\\
\hline
BioBERT-large&BioSF&\textbf{54.80/55.65}&\textbf{60.92/61.55}\\
\hline
\end{tabular}
\caption{\label{tbl:reader_on_slot} Evaluation results for the reader experiments on the BioSF development and testing sets. }
\end{table}
\subsection{End to End Evaluation}
\label{sec:e2e_eval}
Having evaluated both components of our approach, we now turn our attention to the end to end setting, which simulates better a real world scenario. In this setting, we are given a head entity and a relation and we want to correctly extract the tail entity. To evaluate our approach in such a setting, we first employ the triples included in the BioSF test set. This data set contains 3,171 queries with 2.35 answers, i.e. tails, per query on average.
Additionally, we would like to understand how our approach performs in the zero-shot setting, i.e., for entities and relations that our models haven't seen during training. To this end, we employ Hetionet \cite{himmelstein2017systematic}, a network of biomedical knowledge assembled from 29 biomedical Knowledge Bases, containing 24 distinct relation types. We keep nine relation types that our models haven't previously seen, e.g., "expresses", "localizes", "treats" and sample randomly 500 queries, with 9.3 answers, i.e. tails, per query on average. We note that this dataset differs substantially to the previous one, in the sense that a query might have far more numerous valid answers. For example, some queries have more than 100 valid answers.
\begin{table}
\centering
\begin{tabular}{cc|cc}
\hline
Setting&Dataset&end-to-end micro-recall\\
\hline
\hline
Standard&BioSF test set&24.38\\
Zero-shot&Hetionet&18.66\\
\hline
\end{tabular}
\caption{\label{tbl:e2e_results} End to end evaluation of our approach on a standard as well as a zero-shot setting. }
\end{table}
In both cases, we first retrieve the top-100 passages for each query with our bio-DPR model and subsequently we pass all query-passage pairs through our reader model. We evaluate with micro-recall since, as we discussed previously, there might be multiple valid answers not contained in our KB and we aim to examine what percentage of the KB triples we can extract from text. We note again that this is not a perfect evaluation as, besides the issue mentioned above, there might also be triples in Hetionet that don't appear in any sentence in the literature. Table \ref{tbl:e2e_results} illustrates our results. The recall is substantially low, a finding that is somewhat expected due to the imperfect nature of our evaluation setting, as well the challenging nature of the task, especially in the zero-shot setting. Nevertheless, we consider that these two additional datasets, will enable further research and improved approaches.
Overall, the above experiments should be regarded as a stepping stone towards a novel paradigm for biomedical IE, overcoming the shortcomings of the current standard approach.
\section{Conclusions and Future Work}
\label{sec:conclusions}
In this work we formulated the task of biomedical Information Extraction as a slot filling problem. This approach aims to forgo the need for entity and relation type specific training data, which is scarce and costly to annotate in the biomedical domain. Additionally, this formulation allows to deal with the addition of new relation types, without needing to re-train the relevant models.
Additionally, we have introduced a new biomedical slot filling benchmark and used it to train a biomedical DPR model, a dual BERT-based encoder for retrieval, as well as a biomedical slot filling reader based on BioBERT. In a series of experiments our approach outperforms significantly a number of general domain baselines as well as the simpler BM25 retriever. Furthermore, our results illustrate the importance of in-domain, task-specific training data, in line with findings from recent works \cite{glass2021robust, maillard2021multi}.
In future work, we aim to focus on sequence to sequence variants of this work such as the work in \cite{izacard2021leveraging}, as well as to conduct a through comparison of a standard biomedical IE system against our slot filling approach.
\bibliographystyle{acl_natbib}
| {'timestamp': '2021-09-20T02:18:24', 'yymm': '2109', 'arxiv_id': '2109.08564', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08564'} | arxiv |
\section{Introduction}
The majority of human-computer interactions are mediated by Graphical User Interfaces (GUIs) within desktop and mobile environments.
GUIs provide the interaction backbone in which end-users compose and repurpose atomic functional elements embedded within existing applications.
Recently, there is an emerging effort to build models to support the automation of long-tail processes within a multi-application Desktop/GUI environment~\cite{ferreira2020evaluation}.
This effort encompasses the interfacing of Human-Desktop Interaction (HDI) with natural language, both for HDI understanding (the creation of natural language descriptions that describe HDIs) and HDI semantic parsing (the execution of HDI actions from commands expressed in natural language).
One fundamental skill required for designing such models is being able to \emph{ground} UI element mentions in natural language instructions, in the style of a mapping task.
A natural language command in most cases will contain an action verb.
Often, this verb has as an argument an object that refers to an interface element.
A model geared towards understanding this instruction should be aware of the mapping between words and interface elements' concrete realisation.
This mapping is named \textit{interface element grounding task}~\cite{pasupat2018mapping} or UI grounding.
Consider the instruction ``Click on the cancel button.'': in order to ground this instruction, one is expected to find the cancel button in a screen. Applications of a UI grounding model ranges from intelligent process automation to the creation of accessibility tools.
Transformer-based models have achieved excellent performance in tasks requiring semantic inference, with state of the art results in various NLP tasks. However, such models' expertise in reasoning with elements positioned in a 2-dimensional space has limited research, especially in the interface element grounding domain.
This work focuses on testing and probing the grounding abilities of three different transformer-based models, namely BERT~\cite{devlin-etal-2019-bert}, RoBERTa~\cite{liu2019roberta}, and LayoutLM \cite{xu2020layoutlm}.
This process is performed in two parts: first, evaluating the accuracy for UI grounding for different reasoning types, and second, probing the generated representations using spatial auxiliary tasks.
The contributions of this work can be summarised as follows:
\begin{itemize}
\item We provide a first systematic study of the spatial reasoning capabilities of transformer-based models in the UI grounding setting.
\item We compare different pre-trained transformer-based architectures and present a probing-based analysis of their spatial reasoning capabilities.
\item We empirically demonstrate that the semantic representation of textual and layout information from scanned documents can also be successfully transferred to represent user interfaces.
\item We propose a novel application domain for transformer-based models.
\item We demonstrate the need for more complex spatial reasoning datasets and models capable of relative spatial reasoning.
\end{itemize}
\section{Problem Formulation: Grounding Interface Elements}
Given a command (noun phrase) $c$ contained in a natural language command and an user interface composed of a set $U = \{ u_1, u_2, \ldots, u_2\}$ of \emph{interface elements}, where each element $i$ is composed of a given text content $u_{i_T}$ and a bounding box $u_{i_{BB}}=[u_{i_{x_0}},u_{i_{x_1}},u_{i_{y_0}}, u_{i_{y_1}}]$, the \textit{grounding task} aims to select the correct element $u_i \in U$ which is referred in phrase $c$, assuming that this phrase only refers to a unique element.
\noindent Given $U$ and $c$, the following condition distribution over the elements is defined:
\begin{equation}
p(u_i|p) \propto exp[s(f(c), g(u_i))]
\end{equation}
\noindent where $g(\cdot)$ and $f(\cdot)$ are embedding functions for the UI elements and phrase, respectively, and $s(\cdot, \cdot)$ is a scoring function between command and UI element. To obtain the correct interface element, one needs to maximise the log-likelihood for the correct interface element.
To solve the grounding task, a model needs mainly to focus on three types of reasoning~\cite{li2020mapping, pasupat2018mapping}, subject to what is required by the command $c$. The types of reasoning are \emph{extractive}, \emph{absolute spatial} and \emph{relative spatial}.
Extractive reasoning is required in the most trivial cases, where one needs only to match the textual content $u_{i_T}$ of the interface element with the text in $c$. This scenario includes cases where there is an exact keyword matching and also where some paraphrasing is required. As shown in example (a) from Figure~\ref{fig:example_rico}, for this type of reasoning, a model does not require any spatial information about the interface element.
When spatial reasoning is needed, the task increases in complexity. Absolute spatial reasoning requires a model to understand the positional information contained in the command and to be able to locate the interface element inside a screen. Figure~\ref{fig:example_rico}(b) presents an example of this case, where it is not possible to identify the element without having the values of its bounding box. However, it does not require the representation of surrounding interface elements, unlike relative spatial reasoning.
Relative spatial reasoning is the most challenging type considering a model is expected to interpret a relative spatial command, demanding an understanding of the screen as a whole. In this type of command, an interface element is referred to in relation to another element. As shown in Figure~\ref{fig:example_rico}(c), this type of instruction can be easily mistaken with an extractive reasoning command in circumstances where a model is not knowledgeable of the spatial nature of the task given then extra noise with textual information from a different element.
\begin{figure}[h]
\centering
\includegraphics[width=0.85\linewidth]{diagram_rico.pdf}
\caption{Example of three different commands, requiring different types of reasoning, and matching interface elements in a mobile screen. The screen presented here is part of the Rico dataset~\cite{Deka:2017:Rico}.}
\label{fig:example_rico}
\end{figure}
\section{Related Work}
\subsection{UI Grounding}
Past research on grounding interface elements has mainly focused on applications to mobile screens and web elements.
\citet{li2020mapping} proposes Seq2Act, a two-stage Transformer model for grounding UI elements in an Android environment.
In our work, we compare pre-trained models with the Seq2Act model.
\citet{pasupat2018mapping} proposes an embedding based model for grounding instructions based on web elements.
They are able to represent not only positional information but also properties of UI elements.
There is still limited research in the task of interface element grounding. However, a considerable amount of literature has been published on semantic parsing for task execution.
\citet{goldwasser2011learning} and \citet{volkova2013lightly} focus on using natural language instructions to learn the concepts and rules of an environment, where these elements can be used to execute and verify tasks.
Similarly, the work by \citet{branavan2012learning} use text from manuals to learn the rules of the game Civilization II.
For goal-oriented tasks, the parsing can be modelled around a reward/punishment function.
\citet{branavan2010reading} explicitly models an environment where a reward function is used to evaluate how well a command sequence achieves a described task.
\citet{macglashan2014training} propose a learning algorithm for generating high-level task definitions from instruction, derived from online human-delivered reward and punishment.
\subsection{Probing}
There is often interest in the \emph{intermediate} features or information captured by neural models.
There are two broad categories of approaches to determining the extent to which certain features or
phenomena are captured: either \emph{behavioural} analysis or \emph{structural}
analysis.
The common practise of evaluating a model's accuracy
on a targeted challenge dataset (designed to be representative of the feature or phenomenon
in question) is
a form of \emph{behavioural} analysis.
On the other hand, \emph{structural} analysis concerns the structural properties of the
representation space, such as emergent feature clusters or geometric regularities.
A recently popular style of structural analysis is methodical diagnostic classification or
\emph{probing\footnote{The term \emph{probing} is sometimes also used for studies featuring
only behavioural analyses, but we refer specifically to the methodology surrounding
auxiliary classification on top of intermediate model representations, as in \citet{alainbengio, hewitt-manning-2019-structural} and \citet{pimentel-etal-2020-information}}}.
First introduced in \citet{alainbengio} as \emph{diagnostic classification}, probing
has been popular in the study of natural language processing models, where it has shown
the prevalence of rich syntactic features (for example in \citet{hewitt-manning-2019-structural}) and
semantic features \cite{vulic-etal-2020-probing}.
Given that the aim of probing studies is very different from the usual machine learning goal of
achieving the maximum possible accuracy on test sets, there has been much discussion
on the suggested best practices and possible pitfalls when carrying out probing studies
\cite{zhangbowman, hewitt-liang, voita-titov-2020-information, pimentel-etal-2020-information, pimentel-etal-2020-pareto}.
We attempt to take on most of the suggestions in our methodology, especially the control tasks and
selectivity measure in \citet{hewitt-liang} and the complexity ranges in \citet{hewitt-manning-2019-structural,
pareto}.
\section{Experimental Setup}
The experiments in this work are separated into two parts. The first part evaluates the accuracy of distinct models on the task of grounding UI elements for mobile devices, while the second part assesses the spatial reasoning capabilities of the models trained during the first stage. All the datasets generated, trained models and code used in this work are made available in \url{http://github.com/debymf/ipa_probing}.
The stages of the experiments are described in the following subsections.
\subsection{Interface Element Grounding}
\subsubsection{Datasets}
For this work, we focused on datasets containing commands for grounding mobile UI elements.
This choice was due to the more extensive availability of datasets, unlike desktop applications.
However, the concepts and experiments presented here can easily be transported to different interface environments, given their similar structure.
The datasets used for our experiments are PixelHelp and RicoSCA~\cite{li2020mapping}.
RicoSCA is a dataset containing commands with its respective matching interface element, composed of textual content and bounding box.
The dataset contains a total of 329,411 instructions\footnote{The number of instructions is different from the reported value in the original paper since only the generation script is provided, and that does not ensure that the same dataset is generated. In order to ensure reproducibility, we will make available our version of the dataset with respective splits.} which we split between train/dev/set as shown in Table~\ref{tab:datasets}.
RicoSCA contains three types of commands, Name-Type, Absolute-Location and Relative-Location, which we map to extractive, spatial absolute and spatial relative reasoning, respectively.
PixelHelp contains 187 multi-step instructions, where 88 are general tasks, such as configuring accounts, 38 are e-mail tasks, 31 are browser tasks, and 30 photos related tasks.
PixelHelp is only used for testing, given its smaller size.
In this work, we focus only on single-step commands; therefore, PixelHelp cannot be used in its original format. To obtain single-step commands from the multi-step ones found in PixelHelp, we used the \textit{action phrase extraction model} proposed by \citet{li2020mapping}. We obtained a total of 780 single step commands.
This dataset does not contain annotations on the type of reasoning required for each command. To generate such data, two expert human annotators enriched the dataset with the correct types, obtaining a .78 Kappa score, providing strong reliability. The details of this dataset are also shown in Table~\ref{tab:datasets}.
\begin{table}[!h]
\centering
\resizebox{\linewidth}{!}{%
\begin{tabular}{@{}lrrrr@{}}
\toprule
\multicolumn{1}{c}{\multirow{2}{*}{\textbf{Dataset}}} &
\multicolumn{4}{c}{\textbf{Number of Instructions}} \\
\multicolumn{1}{c}{} &
\multicolumn{1}{c}{\textbf{Extractive}} &
\multicolumn{1}{c}{\textbf{Absolute}} &
\multicolumn{1}{c}{\textbf{Relative}} &
\multicolumn{1}{c}{\textbf{Total}} \\ \midrule
\textbf{RicoSCA - Train} & 100,921 & 6,531 & 57,222 & 164,674 \\
\textbf{RicoSCA - Dev} & 40,504 & 2,529 & 22,577 & 65,610 \\
\textbf{RicoSCA - Test} & 60,922 & 3,897 & 34,308 & 99,127 \\
\textbf{PixelHelp} & 673 & 100 & 7 & 780 \\ \bottomrule
\end{tabular}%
}
\caption{Number of instructions for each dataset, indicating the type of reasoning required for grounding. }
\label{tab:datasets}
\end{table}
\subsubsection{Models}
For the grounding of mobile UI elements, we compare the performance of four different models: BERT (base), RoBERTa (base), LayoutLM (base) and Seq2Act.
\emph{BERT}~\cite{devlin-etal-2019-bert} and \emph{RoBERTa}~\cite{liu2019roberta} are known to obtain excellent results in tasks where direct semantic similarity is required.
However, there is still no conclusive evidence that this model can reason spatially, especially for the task of grounding UI elements.
\emph{LayoutLM}~\cite{xu2020layoutlm} is a ''Language" Model for the combination of text and document layout, geared towards document image understanding tasks.
This model takes as input a bounding box that denotes the relative position of a token within a document.
This positional embedding can capture the relationship among tokens within a document.
LayoutLM was initially proposed as a pre-trained model for physical documents, making this work a novel application for such a model.
This model can also take as input images representing a layout structure; however, we only consider the interface elements' positional features as input in this work.
In order to apply such pre-trained models, we reformulate the interface element grounding problem as a pairwise relevance classification problem. Given a natural language command $c$ and interface elements $U=\{u_1,\ldots,u_n\}$, a function $f(c,u_i)$ is defined, where $f(c,u_i)=1$ if $u_i$ is the target element in $c$ and $f(c,u_i) = 0$ otherwise.
BERT and RoBERTa take as input the command $c$ and the text $u_{i_T}$ from the interface element being tested in the format $ [ c || u_{i_T} ] $. These models cannot receive the element's position as input since they cannot interpret such a structure.
On the other hand, LayoutLM also takes as input the bounding box $u_{i_{BB}}$ of the interface element, hence, it uses two different inputs: the textual information $ [ c || u_{i_T} ]$, in the same manner as BERT, and the positional information $[u_{i_{BB}}]$.
These models are trained using the RicoSCA training and development set and tested for the PixelHelp and RicoSCA testing sets.
The supporting pipelines for inferring the correct interface element using these models are illustrated in Figure~\ref{fig:inference_process}.
\begin{figure*}[!h]
\centering
\includegraphics[width=0.9\linewidth]{training_process.pdf}
\caption{Inference pipeline for LayoutLM, BERT and RoBERTa. Both models generate representations based on the instruction and interface elements. The predicted interface element is inferred from the output probabilities for the pair classification setting. Best seen in colour.}
\label{fig:inference_process}
\end{figure*}
Both models are trained\footnote{The models are trained with a learning rate of $1e$-$5$, batch size of $16$, a maximum sequence length of $256$ and $5$ epochs. Using $4$ Tesla V100s, both models take around $21$ hours to complete training.} with the objective to minimise Cross Entropy loss for the pair
classification task, so that the classifier is trained on the
conditional likelihood $p(u_i \mid c)$ and select the UI element
$\argmax_{u_i \in U} ~p(u_i \mid c)$
The last compared model is \emph{Seq2Act}~\cite{li2020mapping}, composed of two different parts, an action phrase-extraction step and a grounding step. The first stage is a Transformer architecture which maps multi-step instructions to single-step ones. The grounding step matches these single-step commands to UI objects using another Transformer that contextually represents UI objects, and grounds object descriptions. Given the focus of this work, we are only interested in the results from the grounding stage. Seq2Act is trained using the full RicoSCA dataset; therefore, it was necessary to retrain the model using only the training split for RicoSCA. Given that the model was trained on a smaller split of the RicoSCA dataset, the obtained results differed slightly from the original paper.
\subsection{Probing Methodology}
Following recent works on the developing best practices in probing studies \cite{hewitt-liang, hewitt-manning, pimentel-etal-2020-information, pimentel-etal-2020-pareto, voita-etal-2019-analyzing}, we have followed three key
principles:
\begin{enumerate}
\item Prioritising probe families with \emph{simple structure},
\item Using a range of probing model complexities with in a family of probing models, and
\item Using randomised control tasks \cite{hewitt-liang} in order to ensure \emph{maximum selectivity}
for reported accuracies.
\end{enumerate}
\subsubsection{Probe Complexity Control}
For each auxilliary task, an MLP probe architectures, training 50 probes of varying complexities using the Probe-Ably framework of
\cite{ferreira-etal-2021-representation}\footnote{\url{https://github.com/ai-systems/Probe-Ably} } with the default configurations for the MLP model.
We use the number of parameters as a naive
approximation of model complexity.
\subsection{Control Task and Selectivity Measure}
For the a given set of probe hyperparameters, we train the
probes on a $30-20-50$ train-dev-test split of the auxiliary
task data.
For each fully trained probe, we report both the test accuracy
and the \emph{selectivity} measure \cite{hewitt-liang} in its
``entropic form": namely, the difference between the cross-entropy loss
of the auxiliary task test set and the cross-entropy loss
of the randomised \emph{control task} training set.
We use a simple control task where input representation vectors
have been assigned fixed random labels from among the auxiliary
task target classes.
Tracking the selectivity ensures that we are not using a probe that is
complex enough to be \emph{overly expressive} to the point of
having the capacity to overfit the
randomised control training set.
\subsubsection{Auxiliary tasks}
Towards probing the representation generated by LayoutLM, BERT and RoBERTa, we define four different auxiliary tasks, two for each spatial reasoning type:
\begin{itemize}
\item \textbf{Absolute spatial reasoning probing} (Figure~\ref{fig:aux_task1}): Given the representation of a command and an interface element, the first task is determining if the element is located at the bottom or top of the screen (\textbf{AT1}) while the second task focus on determining if the element is at the left or the right of the screen (\textbf{AT2}).
\item \textbf{Relative spatial reasoning probing} (Figure~\ref{fig:aux_task2}): Given the representation of a command and an interface element, the third task requires positioning the interface element at the top or bottom of the element targeted by the command (\textbf{AT3}). Similarly, the last task indicates if the element is at the target's left or right (\textbf{AT4}).
\end{itemize}
\begin{figure}[ht!]
\centering
\subfloat[Determining the absolute position.]
{ \includegraphics[width=0.40\linewidth]{auxiliary_task1.pdf} \label{fig:aux_task1}}
\qquad
\subfloat[Determining the relative position.]
{\includegraphics[width=0.40\linewidth]{auxiliary_task2.pdf} \label{fig:aux_task2}}
\caption{Illustration of the two types of auxiliary tasks, which requires determining the relative position from the obtained representation.}
\end{figure}
\section{Results and Discussion}
This section presents the results for both parts of this work, the interface element grounding and the spatial reasoning probing.
\subsection{UI Grounding Performance}
Table~\ref{tab:results_grounding} presents the accuracy of all models for the task of interface element grounding. The results for the RicoSCA dataset are separated by the type of reasoning required: extractive reasoning (Ext), absolute spatial reasoning (Abs) and relative spatial reasoning (Rel).
We choose not to present the same for PixelHelp, given the small representativity of instructions demanding spatial reasoning in this dataset.
\begin{table*}[!ht]
\centering
\begin{tabular}{@{}llllllllll@{}}
\toprule
\multicolumn{1}{c}{\multirow{3}{*}{\textbf{Model}}} &
\multicolumn{9}{c}{\textbf{Datasets}} \\
\multicolumn{1}{c}{} &
\multicolumn{1}{c}{\multirow{2}{*}{\textbf{PixelHelp}}} &
\multicolumn{4}{c}{\textbf{RicoSCA Dev}} &
\multicolumn{4}{c}{\textbf{RicoSCA Test}} \\
\multicolumn{1}{c}{} &
\multicolumn{1}{c}{} &
\multicolumn{1}{c}{\textbf{Ext}} &
\multicolumn{1}{c}{\textbf{Abs}} &
\multicolumn{1}{c}{\textbf{Rel}} &
\multicolumn{1}{c}{\textbf{All}} &
\multicolumn{1}{c}{\textbf{Ext}} &
\multicolumn{1}{c}{\textbf{Abs}} &
\multicolumn{1}{c}{\textbf{Rel}} &
\multicolumn{1}{c}{\textbf{All}} \\ \midrule
\textbf{BERT-Base} &
86.28 &
\textbf{99.61} &
67.12 &
54.75 &
78.07 &
\textbf{99.54} &
67.07 &
55.69 &
77.92
\\
\textbf{RoBERTa-Base} &
\textbf{87.17} &
99.60 &
67.03 &
56.31 &
\textbf{78.12} &
99.53 &
68.03 &
56.47&
\textbf{77.98}
\\
\textbf{LayoutLM} &
71.41 &
98.51 &
\textbf{86.75} &
\textbf{61.40} &
77.62 &
98.40 &
\textbf{90.80} &
\textbf{60.53} &
77.51
\\
\textbf{Seq2Act } &
75.86 &
96.64 &
67.14 &
33.23 &
73.95 &
96.75 &
65.89 &
31.75 &
73.78\\
\bottomrule
\end{tabular}
\caption{Accuracy for the compared models. For the RicoSCA dataset, we compare the performance for different types of required reasoning for grounding. The Seq2Act results presented here are obtained from partial matching, since we are considering single-step commands.}
\label{tab:results_grounding}
\end{table*}
As expected, BERT and RoBERTa obtains outstanding performance for instructions requiring lexical overlap and semantic similarity. It easily outperforms the state-of-the-art model, Seq2Act, raising the importance of pre-trained model baselines in such studies: often, the basic similarity features captured by out-of-the-box language models are sufficient for complex tasks without needing to introduce new architectures.
Even though such models do not have access to the interface elements' position, they seems to manage (partially) the commands requiring spatial reasoning.
Similarly, LayoutLM achieves almost perfect accuracy for extractive reasoning commands while also having a superior performance for absolute reasoning.
This performance is likely due to the fact that LayoutLM is integrated with BERT, with the added capability of representing positional information.
This result confers evidence that the structure learned from documents layout can also be transported to interface elements. LayoutLM achieves a lower performance on the relative spatial reasoning but still outperforms BERT for this task type. We hypothesise that such results could be improved by modifying the pair classification task to a selection across elements task. In this case, the model would be aware of all the screen elements when inferring a decision. However, such models are still very computationally demanding, and given that a screen can easily have up to $300$ UI elements, there is a need for more scalable approaches.
Even though Seq2Act is designed with the understanding of spatial reasoning in mind, we can notice that the model is outperformed in almost all aspects by transformers that encode only text.
The overall obtained results highlight the need for more robust datasets for testing UI element grounding. Future work proposing new datasets and approaches capable of encoding positional information should initially ensure that the dataset evaluates such properties.
The training protocol present in this work can be employed to remove trivial examples from the dataset. Instances of the dataset that can be predicted with high certainty by models that do not encode positions should be removed for testing specific spatial reasoning.
\subsection{Probing Results}
In Figures \ref{fig:all_plots} (a-d) we present the
\emph{auxiliary task test accuracy} and the \emph{selectivity} of
50 trained MLP probes with varying complexity.
\footnote{Seq2Act does not generate a representation; hence, it was not included in the probing stage.}
Regions of maximum selectivity indicate that the accuracy scores are more trustworthy: low selectivity indicates little difference between the control task scores and the auxiliary task scores.
It is important to ensure that the selectivity doesn't drop off (indicating an overly expressive probe), which is why the selectivity plots are included.
\begin{figure*}[!htbp]
\centering
\subfloat[AT1 probing.]
{ \includegraphics[width=0.90\textwidth]{images/at1.pdf}
\label{fig:plots_1_a}}
\subfloat[AT2 probing.]
{ \includegraphics[ width=0.90\textwidth]{images/at2.pdf}
\label{fig:plots_1_b}}
\subfloat[AT3 probing.]
{\includegraphics[ width=0.90\textwidth]{images/at3.pdf}
\label{fig:plots_2_a}}
\subfloat[AT4 probing.]
{
\includegraphics[width=0.90\textwidth]{images/at4.pdf} \label{fig:plots_2_b}}
\caption{Probing results for the both spatial reasoning task for MLP probes with varying complexity (approximated here by the number of parameters).}
\label{fig:all_plots}
\end{figure*}
As we can see from the MLP probes, LayoutLM outperform BERT and RoBERTa in the auxiliary spatial reasoning tasks, which shows that the generated representations are better able to discriminate between spatial labels.
This suggests its promising application for grounding UI elements and tasks with similar requirements, not limited to the domain of scanned documents.
Overall, we can see that the Task \textbf{AT2} was the easiest one for all models. In this task, the model was required to decide if an element is to the right or the left of the screen (considering a point in the middle). There is likely a bias in the dataset that makes it easier to distinguish between elements on the right or left of the screen.
Again, such bias can influence the interpretation of the results, given the false interpretation that such models can understand positions such as left or right. However, such a conclusion for BERT and RoBERTa is impracticable, given that they are unable to encode positions. The probing framework provided here can be applied to verify the quality of datasets used for grounding UI elements.
\section{Conclusion}
This paper presents an analysis of the UI grounding capabilities of three pre-trained models: LayoutLM, BERT and RoBERTa.
This analysis is performed in two parts: the first is a traditional analysis of the task accuracy, while in the second part, we perform a more profound analysis of the spatial reasoning performed by such models using probing techniques.
The results presented in this work highlights the need for datasets that go beyond lexical matching, focusing more on challenging spatial reasoning.
Even though RicoSCA contains a substantial amount of spatially focused commands, it is still a synthetic dataset with limited demonstration of the kinds of complex descriptions that would occur in natural language instructions.
There is a need for human-generated datasets of this kind, but such datasets are still challenging to obtain, especially those of a more natural variety
(which is critical for future applications such as accessibility tools).
Overall, We conclude that the greatest challenge in this area is the interpretation of instructions which require relative spatial reasoning that complicates the grounding task, binding it more tightly to a visual screen state.
While there is insufficient data to create strong models specifically for UI grounding of natural language instructions that include spatial descriptors, we have shown that document-based models such as LayoutLM learn a reasonable amount of spatially-relevant features (supported by the probing findings) that make them transferable to the UI grounding task.
| {'timestamp': '2021-09-20T02:20:48', 'yymm': '2109', 'arxiv_id': '2109.08634', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08634'} | arxiv |
\section{Introduction}\label{sec:intro}
\IEEEPARstart{T}{HE} Golay complementary pairs (GCPs) were first introduced by Golay \cite{gol1961}. The aperiodic auto-correlation sum (AACS) of a GCP diminishes to zero for all time shifts not equal to zero. The sequences in a GCP are known as Golay sequences. Tseng and Liu extended the concept of GCP to complementary set (CS), which is a set of $M (\geq 2)$ sequences of equal length $N$ such that their AACS sum is zero for all non zero time shift \cite{cliu}. They also proposed the idea of mutually orthogonal complementary set (MOCS), which can be viewed as collection of $K$ CSs of size $M$ and sequence length $N$ such that any two distinct CSs are orthogonal to each other i.e., their aperiodic cross-correlation sum (ACCS) is zero for all shifts. A MOCS consisting of $K$ CSs, each containing $M$ sequences of length $N$ is denoted by $(K,M,N)$-MOCS. For a MOCS the set size $K$ is bounded above by number of constituent sequences $M$, i.e., $K\leq M$ \cite{hwa}. For the special case, when the set size of MOCS achieves its upper bound, i.e, MOCS with $K=M$ are known as a set of complete complementary codes (CCCs) and is denoted by ($K,K,N$)-CCC \cite{hatori}. Due to the ideal correlation properties and optimal set size CCCs have found its application in next generation multi carrier code division multiple access (MC-CDMA) \cite{bell,jun,wiley,parampalli,guan}. Apart form this CCCs are used in optimal channel estimation in multiple-input
and multiple-output (MIMO) frequency-selective channels
\cite{wang}, MIMO radar \cite{shufeng} , \cite{tang}, cell search in orthogonal frequency division multiplexing (OFDM) systems \cite{min}, and data hiding \cite{kojima}, et al.\\
A primary approach to construct CCCs based on generalised Boolean functions (GBFs). This was started by Davis and Jedwab in year 1999, who have proposed a GBFs based construction of $2^h\left(h\in \mathbb{N}\right)$ GCPs of length $2^m\left(m\in \mathbb{N}\right)$\cite{Davis}. Paterson extended the idea of $2^h$-ary
GCPs to $q$-ary (for even $q$) CSs with constituent sequences having power of two lengths \cite{pater2000}. Paterson’s idea
was further extended by Rathinakumar and Chaturvedi \cite{arthina} to construct $(K,K,2^m)$-CCC. All these construction based on GBFs generates sequence of length $2^m$ only. In the recent development GBFs based construction of CSs with more flexible lengths have been proposed \cite{chen1,chen2,chen3,majhi,linyu}. CSs with flexible
lengths are of interest to practical orthogonal frequency division multiplexing (OFDM) systems with varying
numbers of subcarriers. Several GBFs based construction of Z-complementary code set (ZCCS) of non power of two length are proposed in literature\cite{roy,sahin}. MOCS constructions based
on a series of sequence operations (e.g., reversals, negations, interleaving, and concatenations) have been proposed in \cite{cliu}. Das \textit{et al.} presented methods by using paraunitary (PU) matrices to construct MOCSs and CCCs
with various lengths\cite{das1,das2,das3}. However, the sequence generated through these indirect methods may not be friendly for hardware generation due to their large space and time requirements.
In \cite{shing,liying} construction of MOCSs with non power of two lengths based on GBFs have been proposed, where the set size is upper bounded by half of the number of constituent sequences in a CS, i.e., $K\leq M/2$. Recently, Palash \textit{et al.} has proposed the construction of CCCs using multivariable functions \cite{sarkar}. This direct construction can generates $q$-ary CCCs of all possible length. However, in case of $q=2$, only binary CCC of length in the form $2^m$ ($m\in \mathbb{Z}$) can be constructed \cite{sarkar}.
So, direct construction of binary CCCs of non power of two length is still an open problem.\\
{In this paper a GBFs based construction of binary CCCs of length $2^{m-1}+2^{m-3}$ ($m\geq5$) is proposed. Using GBFs and truncating the tail of the sequence, $2^{m-1}+2^{m-3}$ ($m\geq5$) length GCPs are constructed in \textit{Theorem} \ref{thm1}. We have used the idea of graphs corresponding to the quadratic part of the GBFs, with the property that deleting some vertices of the graph results in a path. In \textit{Theorem} \ref{thm2} the idea has been further extended to generate CSs. Finally in \textit{Theorem} \ref{thm3} binary CCC of non power of two length has been constructed using CSs of \textit{Theorem} \ref{thm2} and its mate.} \\
The remaining letter is organized as follows. Basic notations and definitions are provided in Section II. In Section III, the proposed construction of $q$-ary even length ZCPs is discussed. Finally, concluding remarks are provided in Section IV.
\section{Notations and Definitions}
In this section we will discuss the preliminaries, notations and basic results that will be required in our proposed construction.
\begin{definition}\label{def1} Let $\mathbf{d}$ $=[d_{0},d_{1}, \ldots, d_{N-1}]$ and $\mathbf{e}$ $=[e_0,e_1, \ldots, e_{N-1}]$ be two $N$ length complex valued sequence. The
ACCF at a shift $\tau$ ($\tau \in \mathbb{Z}$) is defined by
\begin{equation*}
C\left(\mathbf{d}, \mathbf{e}\right)(\tau)=\begin{cases}
\sum_{k=0}^{N-1-\tau} d_{k}\cdot e^*_{k+\tau}, & 0 \leq \tau \leq N-1, \\
\sum_{k=0}^{N-1-\tau} d_{k+\tau}\cdot e^*_{k}, & -N+1 \leq \tau \leq-1,\\
0, & |\tau| \geq N.
\end{cases}.
\end{equation*}
\end{definition}
Where $e^*$ is the complex conjugate of $e$. When $\mathbf{d}$ and $\mathbf{e}$ are equal, it is known as
AACS of $e$ and is denoted by $A(\mathbf{\mathbf{e})}(\tau).$\\
We can also define the ACCF and AACF of $\mathbb{Z}_q$ valued sequences by defining a one-one correspondence between $\mathbb{Z}_q$ valued sequence $\mathbf{e}$=$[e_0,e_1, \ldots, e_{N-1}]$ and the complex valued sequence $\mathbf{e'}$=$[e'_0,e'_1, \ldots, e'_{N-1}]$, where $e'_i=\omega^{e_i}$ and $\omega=\exp\left(2\pi \sqrt{-1}/q\right)$. So if $\mathbf{d}$ and $\mathbf{e}$ are $\mathbb{Z}_q$ valued sequence then we define their ACCF $C(\mathbf{d,e})(\tau)$ and AACF $A(\mathbf{e})(\tau)$ respectively as ACCF and AACF of the corresponding complex value sequence $\mathbf{d'}$ and $\mathbf{e'}$.
\begin{definition}\label{def2} A set of $n$ sequences $\mathbf{e}^{0}, \mathbf{e}^{1}, \ldots, \mathbf{e}^{n-1}$, each of equal length $N$, is said to be a complementary set (CS) if
$$
\begin{gathered}
A\left(\mathbf{e}^{0}\right)(\tau)+A\left(\mathbf{e}^{1}\right)(\tau)+\ldots+A\left(\mathbf{e}^{n-1}\right)(\tau) \\
= \begin{cases}n N, & \tau=0, \\
0, & \text { otherwise .}\end{cases}
\end{gathered}
$$
A size two CS is called a
GCP.
\end{definition}
\begin{definition}\label{def3}
Consider a set containing $K$ sequences sets $\mathcal{E}=\left\{E^{0}, E^{1}, \cdots, E^{K-1}\right\}$, where each set $E^{p}$ consists of $M$ sequences $E^{p}=\left\{\mathbf{e}_{0}^{p}, \mathbf{e}_{1}^{p}, \cdots, \mathbf{e}_{M-1}^{p}\right\}$ and each sequence has
length $N, 0 \leq p \leq K-1$. The set $\mathcal{E}$ is called an MOCS, denoted by $(K,M,N)-\mathrm{MOCS}$, if the aperiodic correlation function of $E^{p}$ and $E^{p^{\prime}}$ satisfies
$$
C\left(E^{p}, E^{p^{\prime}}\right)(\tau)=\sum_{n=0}^{M-1} C\left(\mathbf{e}_{n}^{p}, \mathbf{e}_{n}^{p^{\prime}}\right)(\tau)
$$
\begin{equation}\label{eqn1}
= \begin{cases}MN, & \tau=0, p=p^{\prime} \\ 0, & \text { otherwise }\end{cases}
\end{equation}
where $0 \leq p, p^{\prime} \leq K-1, K$ is the set size, $M$ is the flock size, and $N$ is the sequence length.
For an $(K, M, N)$ -MOCS, the upper bound on the set size is given by $K \leq M$. If $K=M$, the MOCS is called a CCC of order $K$ and length $N$, and denoted by $(K,K,N)$-CCC.
\end{definition}
\subsection{Generalised Boolean Function}
A GBF $f$ in $m$ binary variables $x_0,x_1,\hdots,x_{m-1}$ is a function from $\{0,1\}^m$ to $\mathbb{Z}_q$ (where throughout the paper $q\geq 2$ is an even integer ). A monomial of degree $r$ is defined as the product of any $r$ variables among $x_0,x_1,\hdots,x_{m-1}$. So there are $\sum_{r=0}^{m}{m\choose r}$ = $2^m$ monomials, namely $1,x_0,x_1$, $\hdots,x_{m-1},x_0x_1,x_0x_2,\hdots,x_{m-2}x_{m-1},\hdots,x_0x_1\cdots x_{m-1}$. With the linear combination of these $2^m$ monomials by taking coefficient from $\mathbb{Z}_q$, a GBF can be expressed uniquely. In the expression of a GBF of order $r$, there exist at least one highest-degree monomial of order $r$ with non-zero coefficient. Corresponding to a GBF $f$ of $m$ variables $x_0,x_1,\hdots,x_{m-1}$, length-$2^m$ $\mathbb{Z}_q$-valued vector is expressed as
\begin{equation}\label{eqn2}
\mathbf{f}=\left[\omega^{f_0}, \omega^{f_1}, \hdots, \omega^{f_{2^m-1}}\right],
\end{equation}
where $f_i=f(i_0,i_1,\hdots,i_{m-1})$
and $[i_0,i_1,\hdots,i_{m-1}]$ is the
binary vector representation of $i$.
A complex-valued vector $\mathbf{f'}$ is associated with every $\mathbf{f}$, where $f'_i=\omega^{f_i}$ and $\omega=\exp\left(2\pi\sqrt{-1}/q\right)$.
When it is clear from the context, we
will just use $f$ to refer to all three.
Corresponding to a GBF $f$ with $m$ variables the sequence $\mathbf{f}$ is of length $2^{m} .$ In this paper, we focus on sequences of length $\neq 2^{m} .$ Hence, we define the truncated sequence $\mathbf{f}^{(L)}$ and $\mathbf{f}_{(L)}$ corresponding to the GBF $f$ by respectively deleting the first $L$ and last $L$ elements of the sequence $\mathbf{f}$. For the sake of simplicity, we ignore the superscript of $\mathbf{f}^{(L)}$ and subscript of $\mathbf{f}_{(L)}$ when the sequence length is known from the context. Also for a set $A$ containing sequences of equal length, $\Psi^L(A)$ and $\Psi_L(A)$ represents a set by respectively deleting first $L$ and last $L$ elements of each sequence of the set $A$.
\subsection{Graph of a Generalised Boolean Function}
Let $Q:\{0,1\}^{m} \rightarrow \mathbb{Z}_{q}$ be the generalized Boolean function defined by
$$
Q\left(x_{0}, \cdots, x_{m-1}\right)=\sum_{0 \leq i<j<m} q_{i j} x_{i} x_{j}
$$
where $q_{i j} \in \mathbb{Z}_{q}$, so that $Q$ is a quadratic form in $m$ variables over $\mathbb{Z}_{q}$. We associate a labeled graph $G(Q)$ on $m$ vertices with $Q$ as follows. We label the vertices of $G(Q)$ by $0,1, \cdots, m-1$ and join vertices $i$ and $j$ by an edge labeled $q_{i j}$ if $q_{i j} \neq 0$. In the case $q=2$, every edge is labeled 1 and by convention we will omit edge labels in this case. Of course, from any graph $G$ of this type we can recover a quadratic form $Q .$ If $f:\{0,1\}^{m} \rightarrow$ $\mathbb{Z}_{q}$ is a GBF of order $r$, then we define $G(f)$ to be the graph $G(Q)$ where $Q$ is the quadratic part of $f$. We say that a graph $G$ of the type defined above is a path if either
\begin{itemize}
\item $m=1$ (in which case the graph contains a single vertex and no edges), or
\item $m \geq 2$ and $G$ has exactly $m-1$ edges, all labeled $q / 2$ which form a Hamiltonian path in $G$.
\end{itemize}
For $m \geq 2$, a path on $m$ vertices corresponds to a quadratic form of the type
$$
\frac{q}{2} \cdot \sum_{\alpha=0}^{m-1} x_{\pi(\alpha)} x_{\pi(\alpha+1)},
$$
where $\pi$ is a permutation of $\{0,1, \cdots, m-1\}$.
\subsection{Restricted Boolean Function}
Let $f:\{0,1\}^{m} \rightarrow \mathbb{Z}_{q}$ be a generalized Boolean function in variables $x_{0}, x_{1}, \cdots, x_{m-1}$. Let $0 \leq j_{0}<j_{1}<\cdots<j_{k-1}<m$
be a list of $k$ indices and write $\mathbf{x}=\left[x_{j_{0}} x_{j_{1}} \cdots x_{j_{k-1}}\right]$. Let $\mathbf{c}=$ $\left[c_{0} c_{1} \cdots c_{k-1}\right]$ be a binary word of length $k$. Then we define the vector $f|_{x=c}$ to be the complex-valued vector with component $i=\sum_{j=0}^{m-1} i_{j} 2^{j}$ equal to $\omega^{f\left(i_{0}, i_{1}, \cdots, i_{m-1}\right)}$ if $i_{j_{\alpha}}=c_{\alpha}$ for each
$0 \leq \alpha<k$, and equal to 0 otherwise. Here $\omega$ is a complex $q$th root of unity. By convention, in the special case where $\mathbf{x}$ and $\mathbf{c}$ are null (i.e., of length zero), we define $f|_{x=c}$ to be the complex-valued vector associated with $f$.
A simple consequence of the definition is the following vector identity: for any $\mathbf{x}$ defined as above
$$f=\sum_{c} f|_{x=c}.$$
The vector $f|_{x=c}$ can also be thought of as being constructed from the GBF $f$ by substituting $x_{i_{\alpha}}=$ $c_{\alpha}$ in the algebraic normal form for $f$ for each $0 \leq \alpha<k$, simplifying to obtain a GBF in $m-k$ variables (which we also denote by $\left.\left.f\right|_{x=c}\right)$, then calculating $\omega^{\left.f\right|_{x=c}}$ over the domain of this new function and finally inserting zeros at appropriate locations in the resulting vector.
\begin{lemma}[\cite{arthina}]\label{lem1}
Let $f, g:\{0,1\}^{m} \rightarrow \mathbb{Z}_{q}$ be GBFs in variables $x_{0}, x_{1}, \ldots, x_{m-1} .$ Let $0 \leq j_{0}<j_{1}<\cdots<$ $j_{k-1}<m$ be a list of $k$ indices and let $\mathbf{c}=\left[c_{0} c_{1} \cdots c_{k-1}\right]$ and $\mathbf{d}=\left[d_{0} d_{1} \cdots d_{k-1}\right]$ be binary-valued vectors. Write $\mathbf{x}=\left[x_{j_{0}} x_{j_{1}} \cdots x_{j_{k-1}}\right]$ and suppose $0 \leq i_{1}<i_{2}<\cdots<$ $i_{l-1}<m$ is a set of indices not in $\left\{j_{0}, j_{1}, \ldots, j_{k-1}\right\} .$ Denote $\mathbf{y}=\left[x_{i_{0}} x_{i_{1}} \cdots x_{i_{l-1}}\right]$, then
\begin{equation}
\mathbf{C}\left(\left.f\right|_{\mathbf{x}=\mathbf{c}},\left.g\right|_{\mathbf{x}=\mathbf{d}}\right)(\tau)=\sum_{\mathbf{c}_{1}, \mathbf{c}_{2}} \mathbf{C}\left(\left.f\right|_{\mathbf{x y}=\mathbf{c c}_{1}},\left.g\right|_{\mathbf{x y}=\mathrm{d} \mathbf{c}_{2}}\right)(\tau)
\end{equation}
\end{lemma}
\begin{lemma}[\cite{pater2000}]\label{lem2}
Let $f:\{0,1\}^{m} \rightarrow \mathbb{Z}_{q}$ be a generalized Boolean function in variables $x_{0}, x_{1}, \cdots, x_{m-1}$. Let
$$
0 \leq j_{0}<j_{1}<\cdots<j_{k-1}<m
$$
be a list of $k$ indices. Write $\boldsymbol{x}=\left[x_{j_{0}} x_{j_{1}} \cdots x_{j_{k-1}}\right]$. Then
\begin{equation}
A(f)(\ell)=\sum_{c} A\left(\left.f\right|_{x=c}\right)(\ell)+\sum_{c_{1} \neq c_{2}} C\left(\left.f\right|_{x=c_{1}},\left.f\right|_{x=c_{2}}\right)(\ell)
\end{equation}
\end{lemma}
\section{Proposed Construction}
In this section, we first provide a direct GBFs based construction of GCPs of non power of two length. The result is further extended to generate CSs and its mate. Finally with union of two MOCSs non power of two length binary CCC is constructed using GBFs. In this section always $m\geq 5.$\\
Suppose $Q:\mathbb{Z}_2^{m-4} \rightarrow \mathbb{Z}_q$ is the quadratic form in variables $x_0,x_1,\hdots,x_{m-5}$, i.e.,
\begin{equation}\label{eqn5}
Q\left(x_0,x_1,\hdots,x_{m-5}\right)=\frac{q}{2}\sum_{0\leq i < j < m-4} q_{ij}x_ix_j.
\end{equation}
For any $c,c_i \in \mathbb{Z}_q$,define
\begin{equation}\label{eqn6}
f1=Q+\sum_{i=0}^{m-5}c_ix_i+c,~\text{where $Q$ is defined in (\ref{eqn5}).}
\end{equation}
Using $f1$ of (\ref{eqn6}), define the GBF $f:\mathbb{Z}_2^m \rightarrow \mathbb{Z}_2$ as
\begin{equation}\label{eqn7}
\begin{aligned}
f=&f1+\frac{q}{2}\bar x_{m-1}\left(\bar x_{m-4}\left(x_{m-3}+x_{m-2}\right)+x_{m-2}x_{m-3}\right)\\&
+\frac{q}{2}x_{\beta_1}\left(\bar x_{m-1}\left(x_{m-2}\bar x_{m-3}\bar x_{m-4}+x_{m-2}x_{m-3}\right)\right.\\& \left.+x_{m-1}\bar x_{m-2}\bar x_{m-3} \right).
\end{aligned}
\end{equation}
Let $0\leq j_0<j_1<\cdots<j_{k-1}<m-4$, be a list of k indices, where $0\leq k \leq m-5$ and write $\mathbf{x}=[x_{j_0},x_{j_1},\hdots,x_{j_{k-1}}]$.
Let the remaining $m-4-k$ indices between 0 to $m-5$ are $0\leq i_0<i_1<\cdots<i_{m-k-5}<m-4$.\\
Let $\mathbf{c}=[c_0c_1\cdots c_{k-1}]$ is a $k$ length binary vector.
\subsection{Construction of GCPs of Non Power of Two length}
\begin{theorem}\label{thm1}
Suppose that the function $f|_\mathbf{x=c}$ (obtained by substituting $x_{j_\alpha}=c_\alpha, 0\leq \alpha \leq k \leq m-5$, in (\ref{eqn7})) is such that the
$G\left(\left.f\right|_\mathbf{x=c}\right)$ is a path. Then the complex-valued vector $f|_\mathbf{x=c}$ is Golay sequence of length $2^{m-1}+2^{m-3}$ and forms a GCP with each vector of the form
\begin{equation*}
\left(f+\frac{q}{2}x_{\beta_2}+c'\right)|_\mathbf{x=c},
\end{equation*}
where $c\in \mathbb{Z}_q$ and $\beta_1$ and $\beta_2$ be the label of end vertices of the path
$G\left(\left.f\right|_\mathbf{x=c}\right)$ when $0\leq k < m-5$. In case of $k=m-5$, $G\left(\left.f\right|_\mathbf{x=c}\right)$ has only a single vertex labeled $\beta=\beta_1=\beta_2$.
\end{theorem}
\begin{IEEEproof}
We will prove the theorem by induction on $k$, where the statement of the theorem is taken as an inductive hypothesis.\\
\textit{Base Case:} For $k=m-5$, in this case $Q$ the quadratic part of $f|_\mathbf{x=c}$ is identically zero and $G\left(\left.f\right|_\mathbf{x=c}\right)$ has a single vertex labeled $\beta$, and $\mathbf{x}$ omits exactly the variable $x_\beta$ among \{$x_0,x_1,\hdots,x_{m-5}$\}. Since the higher order terms of the function remains unaffected by $\mathbf{x=c}$, so the function $f|_\mathbf{x=c}$ takes non-zero values in exactly 20 components numbered
\begin{equation}\label{eqn8}
k2^{m-4}+\sum_{j\neq \beta}c_j2^j ~\text{and}~~ 2^\beta+k2^{m-4}+\sum_{j\neq \beta}c_j2^j ~\text{for}~0\leq k \leq 9.
\end{equation}
and these non zero terms in increasing order of their positions are
\begin{equation*}
\begin{aligned}
&\left\{\omega^{f_0},\omega^{f_1},\omega^{f_0},\omega^{f_1},-\omega^{f_0},-\omega^{f_1},\omega^{f_0},\omega^{f_1},-\omega^{f_0},\omega^{f_1}\right. \\& \left. ,\omega^{f_0},\omega^{f_1},-\omega^{f_0} ,\omega^{f_1},-\omega^{f_0},\omega^{f_1},\omega^{f_0},-\omega^{f_1},\omega^{f_0},-\omega^{f_1}\right\},
\end{aligned}
\end{equation*}
where $f_0,f_1$ are the values taken by the function $f1|_\mathbf{x=c}$ at $\sum_{j\neq \beta}c_j2^j$ and $2^\beta+\sum_{j\neq \beta}c_j2^j$ respectively. \\
The function $\left(f1+\frac{q}{2}x_\beta+c'\right)|_\mathbf{x=c}$
will takes values $f_0+c'$ and $f_1+\frac{q}{2}+c'$ at positions $\sum_{j\neq \beta}c_j2^j$ and $2^\beta+\sum_{j\neq \beta}c_j2^j$ respectively. So the 20 non-zero components of the function $\left(f+\frac{q}{2}x_{\beta}+c'\right)|_\mathbf{x=c}$ at positions mentioned in (\ref{eqn8}) are
\begin{equation*}
\begin{aligned}
&\left\{\omega^{f_0+c'},-\omega^{f_1+c'},\omega^{f_0+c'},-\omega^{f_1+c'},-\omega^{f_0+c'},\omega^{f_1+c'},\omega^{f_0+c'}\right. \\& \left.,-\omega^{f_1+c'},-\omega^{f_0+c'},-\omega^{f_1+c'} ,\omega^{f_0+c'},-\omega^{f_1+c'},-\omega^{f_0+c'}\right.\\& \left.,-\omega^{f_1+c'},-\omega^{f_0+c'},-\omega^{f_1+c'},\omega^{f_0+c'},\omega^{f_1+c'},\omega^{f_0+c'},\omega^{f_1+c'}\right\},
\end{aligned}
\end{equation*}
{The non zero value of the AACF of the vectors corresponding to $f|_\mathbf{x=c}$ and $\left(f+\frac{q}{2}x_{\beta}+c'\right)|_\mathbf{x=c}$ occurs only at shifts $\tau=k2^{m-4}+2^\beta$, $0\leq k \leq 9$ and $\tau=k2^{m-4}-2^\beta$, $1\leq k \leq 9$.\\
For $\tau=k2^{m-4}+2^\beta$, $0\leq k \leq 9$.
\begin{equation*}
A\left(f|_\mathbf{x=c}\right)\left(\tau\right)= \mathrm{s}_k\omega^{f_0}\left(\omega^{f_1}\right)^*= \mathrm{s}_k\omega^{f_0-f_1}
\end{equation*}
and
\begin{equation*}
A\left(\left(f+\frac{q}{2}x_{\beta}+c'\right)|_\mathbf{x=c}\right)\left(\tau\right)\!=\! \mathrm{s}_k\omega^{f_0+c'}\!\left(-\omega^{f_1+c'}\right)^*\!=\!-\mathrm{s}_k\omega^{f_0-f_1}
\end{equation*}
where $\mathrm{s}_k$ is some constant.\\
Similarly for $\tau=k2^{m-4}-2^\beta$, $1\leq k \leq 9$.
\begin{equation*}
A\left(f|_\mathbf{x=c}\right)\left(\tau\right)= \mathrm{t}_k\omega^{f_1}\left(\omega^{f_0}\right)^*= \mathrm{t}_k\omega^{f_1-f_0}
\end{equation*}
and
\begin{equation*}
\begin{aligned}
&A\left(\left(f+\frac{q}{2}x_{\beta}+c'\right)|_\mathbf{x=c}\right)\left(\tau\right)= \mathrm{t}_k(-\omega^{f_1+c'})\left(-\omega^{f_0+c'}\right)^*\\&=-\mathrm{t}_k\omega^{f_1-f_0},~
\text {where $\mathrm{t}_k$ is some constant.}
\end{aligned}
\end{equation*}
So the AACS is zero for all $\tau \neq 0$, and hence the statement is true for $k=m-5$.}\\
Now, suppose that the theorem is true in the case where $\mathbf{x}$ contains $k+1$ variables, where $0\leq k< m-5$. The non-zero components of the function $f|_\mathbf{x=c}$ are determined by the values of the function $f|_\mathbf{x=c}$ in variables $\left(x_{i_0},x_{i_1},\hdots,x_{i_{m-k-5}},x_{m-4},x_{m-3},x_{m-2},x_{m-1}\right)$, where $G\left(\left.Q\right|_\mathbf{x=c}\right)$ is a path. So for some permutation $\pi$ of $\{0,1,\hdots,m-k-5\}$ and $c_0,c_1,\hdots,c_{m-k-5},c \in \mathbb{Z}_2$
\begin{equation}\label{eqn9}
\begin{aligned}
&f|_\mathbf{x=c}\left(x_{i_0},x_{i_1},\hdots,x_{i_{m-k-5}},x_{m-4},x_{m-3},x_{m-2},x_{m-1}\right)\\&= \frac{q}{2}\sum_{\alpha=0}^{m-k-6}x_{i_{\pi(\alpha)}}x_{i_{\pi(\alpha+1)}}+\sum_{\alpha=0}^{m-k-5}c_{\alpha}x_{i_{\pi(\alpha)}}+c\\&
\!+\!\frac{q}{2}x_{i_{\pi(m-k-5)}}\!\left(\bar x_{m-1}\!\left(x_{m-2}\bar x_{m-3}\bar x_{m-4}\!+\!x_{m-2}x_{m-3}\right)\!+\!x_{m-1} \right. \\& \left.\bar x_{m-2}\bar x_{m-3} \right)\!+\! \frac{q}{2}\bar x_{m-1}\left(\bar x_{m-4}\left(x_{m-3}\!+\!x_{m-2}\right)\!+\!x_{m-2}x_{m-3}\right)
\end{aligned}
\end{equation}
The higher order terms in (\ref{eqn9}) will be used frequently, so for the sake of simplicity let
\begin{equation}\label{eqn10}
\begin{aligned}
&R\!=\!\frac{q}{2}x_{i_{\pi(m-k-5)}}\!\left(\bar x_{m-\!1}\!\left(x_{m-\!2}\bar x_{m-\!3}\bar x_{m-\!4}\!+\!x_{m-\!2}x_{m-\!3}\right)\!+\!x_{m-\!1} \right. \\& \left.\bar x_{m-2}\bar x_{m-3} \right)\!+\! \frac{q}{2}\bar x_{m-1}\left(\bar x_{m-4}\left(x_{m-3}\!+\!x_{m-2}\right)\!+\!x_{m-2}x_{m-3}\right)
\end{aligned}
\end{equation}
Now, we will show that $f|_\mathbf{x=c}$ and $\left(f+\frac{q}{2}x_{i_{\pi(0)}}+c'\right)|_\mathbf{x=c}$, where $c'\in \mathbb{Z}_q$ is arbitrary, forms a $2^{m-1}+2^{m-3}$ length GCP.
Let $\tau \neq 0 $ is chosen arbitrarily and consider
\begin{equation}\label{eqn11}
\begin{aligned}
& A\left(f|_\mathbf{x=c}\right)\left(\tau\right)+ A\left(\left(f+\frac{q}{2}x_{i_{\pi(0)}}+c\right)|_\mathbf{x=c}\right)\left(\tau\right)\\&=A(g1)(\tau)+A(g2)(\tau)+C(g1,g2)(\tau)+C(g2,g1)(\tau)\\&+A(g3)(\tau)+A(g4)(\tau)+C(g3,g4)(\tau)+C(g4,g3)(\tau),
\end{aligned}
\end{equation}
where, $g1\!=\!f|_{\mathbf{x}x_{i_{\pi(0)}}=\mathbf{c}0}$,
$g3=\left(f+\frac{q}{2}x_{i_{\pi(0)}}+c'\right)|_{\mathbf{x}x_{i_{\pi(0)}}=\mathbf{c}0}$,\\
$~~~~~~~~~~g2=f|_{\mathbf{x}x_{i_{\pi(0)}}=\mathbf{c}1}$
$g4=\left(f+\frac{q}{2}x_{i_{\pi(0)}}+c'\right)|_{\mathbf{x}x_{i_{\pi(0)}}=\mathbf{c}1}$\\
The non-zero components of the vector $g1$ come from a function $h1$ obtained by substituting $x_{i_{\pi(0)}}=0$ in the function $f|_\mathbf{x=c}$ in (\ref{eqn9}). For $0 \leq k \leq m-7$
\begin{equation*}
\begin{aligned}
& h1|_\mathbf{x=c}\left(\!x_{i_{\pi(0)}},\!x_{i_{\pi(1)}},\!\hdots,\!x_{i_{\pi(m-k-5)}},\!x_{m-4},\!x_{m-3},\!x_{m-2},\!x_{m-1}\!\right)\\&= \frac{q}{2}\sum_{\alpha=1}^{m-k-6}x_{i_{\pi(\alpha)}}x_{i_{\pi(\alpha+1)}}+\sum_{\alpha=1}^{m-k-5}c_{\alpha}x_{i_{\pi(\alpha)}}+c+R.
\end{aligned}
\end{equation*}
While for $k=m-6$
\begin{equation*}
\begin{aligned}
&h1\left(x_{i_{\pi(0)}},x_{i_{\pi(1)}},\hdots,x_{i_{\pi(m-k-5)}},x_{m-4},x_{m-3},x_{m-2},x_{m-1}\right)\\&=c_1x_{i_{\pi(1)}}+c+R,
\end{aligned}
\end{equation*}
where $R$ is defined in (\ref{eqn10}).\\
Similarly, the non zero components of the vector $g2$ come from a function $h2$ obtained by substituting $x_{i_{\pi(0)}}=1$ in the function $f|_\mathbf{x=c}$. We have
\begin{equation*}
\begin{aligned}
&h2\left(x_{i_{\pi(0)}},x_{i_{\pi(1)}},\hdots,x_{i_{\pi(m-k-5)}},x_{m-4},x_{m-3},x_{m-2},x_{m-1}\right)\\&= h1+x_{i_{\pi(1)}}+c_0.
\end{aligned}
\end{equation*}
Next consider the vector
\begin{equation*}
g2'=\left(f+\frac{q}{2}x_{i_{\pi(1)}}+c_0\right)|_{\mathbf{x}x_{i_{\pi(0)}}=\mathbf{c}0}.
\end{equation*}
Substituting $\mathbf{x=c}$ and then $x_{i_{\pi(0)}}=0$ in the expression for $f+\frac{q}{2}x_{i_{\pi(1)}}+c_0$, we obtain the function $h1+\frac{q}{2}x_{i_{\pi(1)}}+c_0$ identical to $h2$. It follows that the value of vector $g2$ in component $i$ is equal to that of the vector $g2'$ in position $i-2^{x_{i_{\pi(0)}}}$ (i.e. in the non-zero positions, g2 is just a shift of $g2'$). So, the vectors $g2$ and $g2'$ have identical AACF.
Now consider the pair
\begin{equation*}
g1=f|_{\mathbf{x}x_{i_{\pi(0)}}=\mathbf{c}0}.
\end{equation*}
and
\begin{equation*}
g2'=\left(f+\frac{q}{2}x_{i_{\pi(1)}}+c_0\right)|_{\mathbf{x}x_{i_{\pi(0)}}=\mathbf{c}0}.
\end{equation*}
We have seen above that $h1$, the generalized Boolean function to which $g1$ corresponds, is quadratic and has a graph that is a path on $m-k-5$ vertices. Moreover, either $i_{\pi(1)}$ is an end vertex of this path, or $k=m-6$ and it is the only vertex in the graph. By the inductive hypothesis, $g1$ and $g2'$ is a Golay complementary pair, hence for $\tau \neq 0$
$$
A(g1)(\tau)+A(g2')(\tau)=0
$$
Since $A(g2)(\tau)=A(g2')(\tau)$ for every $\tau$, we also have
\begin{equation}\label{eqn12}
A(g1)(\tau)+A(g2)(\tau)=0.
\end{equation}
From the definitions, we have $g3=\omega^{c'} g1$ and $g4=-\omega^{c'}g2 .$ It follows that $A(g3)(\tau)=A(g1)(\tau)$ and $A(g4)(\tau)=A(g2)(\tau)$, so from (\ref{eqn11})
\begin{equation}\label{eqn13}
A(g3)(\tau)+A(g4)(\tau)=0.
\end{equation}
Also,
\begin{align*}
C(g3,g4)(\tau)&=C(\omega^{c'}g1,-\omega^{c'}g2)(\tau)\\& =-C(g1,g2)(\tau),
\end{align*}
and so
\begin{equation}\label{eqn14}
\begin{aligned}
C(g1,g2)(\tau)&+C(g3,g4)(\tau)\\& =C(g2,g1)(\tau)+C(g4,g3)(\tau)=0.
\end{aligned}
\end{equation}
So, from (\ref{eqn12})-(\ref{eqn14}), the sum in (\ref{eqn10}) is zero. Since $\tau\neq0$ was chosen arbitrary, it follows that $f|_\mathbf{x=c}$ and $\left(f+\frac{q}{2}x_{\beta_2}+c'\right)|_\mathbf{x=c}$ forms a GCP of length $2^{m-1}+2^{m-3}$.
\end{IEEEproof}
\begin{example}
For $m=8$ and $q=2$, consider the $5^{th}$ order GBF $f$ defined as,
\begin{equation*}
\begin{aligned}
f&=x_0x_1+x_1x_2+x_2x_3+x_3x_0+x_0x_2+x_1x_3+x_0+x_1\\&+x_2+x_3+\bar x_7\left(\bar x_4\left(x_5+x_6\right)+x_6x_5\right)+x_2\left(\bar x_7\left(x_6\bar x_5\bar x_4 \right. \right.\\& \left. \left.+x_6x_5\right)+x_7\bar x_6\bar x_5\right)
\end{aligned}
\end{equation*}
\begin{figure}
\centering
\includegraphics{graph.png}
\caption{The graph of quadratic form of $f$}
\label{fig:my_label}
\end{figure}
The graph $G(f)$ of $f$ (quadratic part of $f$) is given in Fig.\ref{fig:my_label}. By substituting $x_0x_3=00$ ( deleting vertices $x_0,x_3$) we get $G\left(f|_{x_0x_3=00}\right)$ is a path. So by \textit{Theorem} \ref{thm1}, $f|_{x_0x_3=00}$ and $\left(f+x_1+1\right)|_{x_0x_3=00}$ forms a GCP of length 160.
\end{example}
\subsection{Construction of Mutually Orthogonal Complementary Sets}
Suppose $Q$ and $f$ are defined in (\ref{eqn5}) and (\ref{eqn7}) respectively ($q=2$), with the notation that $G(f)$ is $G(Q)$. For $0\leq t <2^k$, ($0\leq k\leq m-5$) define the ordered set $S_t$ (with the natural order induced by the binary vector $[d_0d_1\cdots d_{k-1}]$) as
\begin{equation}\label{eqn15}
\left\{f+\sum_{\alpha=0}^{k-1} d_{\alpha} x_{j_{\alpha}}+\sum_{\alpha=0}^{k-1} b_{\alpha} x_{j_{\alpha}}+d x_{\beta_2}: d,d_\alpha \in \{0,1\}\right\},
\end{equation}
where $t=\sum_{\alpha=0}^{k-1} b_{\alpha} 2^{\alpha}$.
\begin{theorem}\label{thm2}
Suppose that $G(Q)$ contains a set of $k \leq m-5$ distinct vertices labeled $j_0,j_1,\hdots,j_{k-1}$ with the property that deleting those $k$ vertices and all their edges results in a path. Let $\beta_1$ and $\beta_2$ be the label of end vertices of the path. In case of single vertex let $\beta_1=\beta_2=\beta$. Then for any choice of $c, c_{i} \in \mathbb{Z}_{q}$, the set $\Psi_L(S_{t})$ (for $L=2^{m-2}+2^{m-3}$) is a CS for each $0 \leq t<2^{k}$. Further, for $t' \neq t,~S_{t'}$ and $S_{t}$ are MOCSs.
\end{theorem}
\begin{IEEEproof}
Since each $S_t$ for $1\leq t <2^k$ is a permutation of $S_0$, so proving $S_0$ is a complementary set is sufficient to show that for any $0\leq t <2^k$, the set $S_t$ is a complementary set.\\
Let $\mathbf{x}=x_{j_0}x_{j_1}\hdots x_{j_{k-1}}$ and $\mathbf{d}=d_{0}d_{1}\hdots d_{k-1}$. So $\mathbf{d\cdot x}=\sum_{\alpha=0}^{k-1}d_\alpha x_{j_\alpha}$. Now form \textit{Lemma} \ref{lem2} we have for $\tau \neq 0$
\begin{equation*}
\sum_{\mathbf{d}, d} A\left(f+\mathbf{d \cdot x}+d x_{a}\right)(\tau)=L_{1}+L_{2},
\end{equation*}
where
\begin{equation}\label{eqn16}
L_{1}=\sum_{\mathbf{d}, d} \sum_{c} A\left(\left(f+\mathbf{d \cdot x}+d x_{\beta_{2}}\right)|_{\mathbf{x}=c}\right)(\tau),
\end{equation}
and
\begin{equation}\label{eqn17}
\begin{aligned}
L_{2}=\sum_{c_{1} \neq c_{2}}\sum_{d} \sum_{\mathbf{d}} &C\left(\left(f+\mathbf{d \cdot x}+d x_{\beta_{2}}\right)|_{\mathbf{x}=\mathbf{c}_{1}},\right.\\& \left.
\left(f+\mathbf{d \cdot x}+d x_{\beta_{2}}\right)|_{\mathbf{x=c_2}}\right)(\tau).
\end{aligned}
\end{equation}
For every choice of $\mathbf{c}$ and $\mathbf{d}$ the graph of the function $\left(f+\mathbf{d \cdot x}\right)|\mathbf{x=c}$ is a path. So from \textit{Theorem} \ref{thm1} for every $\mathbf{c}$ and $\mathbf{d}$ the vectors $\left(f+\mathbf{d \cdot x}\right)|\mathbf{x=c}$ and $\left(f+\mathbf{d \cdot x}+x_{\beta_{2}}\right)|\mathbf{x=c}$ forms a GCP. Hence the sum $L_1$ in (\ref{eqn15}) is zero.
For fixed values of $\mathbf{c_1,c_2}$ and $d$, consider the inner sum of $L_2$ of (\ref{eqn16}) ,i.e.,
\begin{equation}\label{eqn18}
\sum_{\mathbf{d}} C\left(\left(f+\mathbf{d \cdot x}+d x_{\beta_{2}}\right)|_{\mathbf{x}=\mathbf{c}_{1}},
\left(f+\mathbf{d \cdot x}+d x_{\beta_{2}}\right)|_{\mathbf{x=c_2}}\right)(\tau).
\end{equation}
Now, the vector $\mathbf{x}$ contains all the terms of $\mathbf{d \cdot x}$. So for fixed $\mathbf{c_1,c_2}$ and $d$ we have,
\begin{equation*}
\begin{aligned}
\left(f \right.& \left.+\mathbf{d \cdot x}+d x_{\beta_{2}}\right)|_{\mathbf{x}=\mathbf{c}_j}\\&=
\begin{cases}
\mathbf{a_j}= \left(f+dx_{\beta_{2}}\right)|\mathbf{x=c_j},&\text {when}~\mathbf{d.c_j}=0 \Mod2,\\
-\mathbf{a_j},&\text {when}~\mathbf{d.c_j}=1 \Mod2.
\end{cases}
\end{aligned}
\end{equation*}
So, there are two types of correlations in the inner sum of $L_2$ (\ref{eqn18}) type-I and type-II, where type-I contains C($\mathbf{a_1,a_2}$) or C($\mathbf{-a_1,-a_2}$) and type-II contains C($\mathbf{-a_1,a_2}$) or C($\mathbf{a_1,-a_2}$).
Notice that type-I correlation arises either when $\mathbf{d \cdot c_1=d \cdot c_2}=0\Mod2$ or $\mathbf{d \cdot c_1=d \cdot c_2}=1\Mod2$ i.e, when $\mathbf{d \cdot c_1=d \cdot c_2}\Mod2$. Similarly type-II correlation arises when $\mathbf{d \cdot c_1}\neq \mathbf{d \cdot c_2}\Mod2$. Since $\mathbf{c_1}\neq \mathbf{c_2}$ implies that $\mathbf{c_1}+\mathbf{c_2}\neq 0 \Mod2$
and so the linear
functional $\mathbf{d} \cdot \left(\mathbf{c}_{1}+\mathbf{c}_{2}\right) \Mod 2$ (regarded as a function of $\mathbf{d}$) is not
equal to the zero functional. Hence it is balanced, i.e., takes on the values 0 and 1 equally often as $\mathbf{d}$ varies. Thus $\mathbf{d \cdot c_1}$ and $\mathbf{d \cdot c_2}$ agree modulo 2 for half the values of $\mathbf{d}$ and disagree modulo 2 for the other half. Hence there are equal numbers of type-I and type-II correlations.\\
Now since there are equal numbers of type-I and type-II correlations and they are equal in magnitude but have opposite signs. So, the inner sum of $L_2$ is zero and so is $L_2$. Hence it is proved that $S_t$ is a complementary set of size $2^k$. \\
Let $\mathbf{b}=\left[b_{0} b_{1} \cdots b_{k-1}\right]$ and
$t=\sum_{\alpha=0}^{k-1} b_{\alpha} 2^{\alpha}, t'=\sum_{\alpha=0}^{k-1} b'_{\alpha} 2^{\alpha}$ and $t \neq t'$ . To prove that $S_t$ and
$S_{t'}$ are mutually orthogonal, by \textit{Lemma} \ref{lem1} we have,
\begin{equation*}
\begin{aligned}
\sum_{\mathbf{d}, d} &C\left(f+ \left(\mathbf{d}+\mathbf{b}\right) \cdot \mathbf{x}+d x_{\beta_{2}},\right.\\& \left.
f+\left(\mathbf{d}+\mathbf{b}^{\prime}\right) \cdot \mathbf{x}+d x_{\beta_{2}}\right)(\tau)=M_1+M_2,
\end{aligned}
\end{equation*}
where
\begin{equation}\label{eqn19}
\begin{aligned}
M_{1}=\sum_{\mathbf{d}, d} \sum_{\mathbf{c}_{1} \neq \mathbf{c}_{2}} &C\left(\left(f+\left(\mathbf{d}+\mathbf{b}\right) \cdot \mathbf{x}+d x_{\beta_{2}}\right)|_{\mathbf{x}=\mathbf{c}_{1}} \right. \\& \left.
\left(f+\left(\mathbf{d}+\mathbf{b}^{\prime}\right) \cdot \mathbf{x}+d x_{\beta_{2}}\right)|_{\mathbf{x}=\mathbf{c}_{2}}\right)(\tau),
\end{aligned}
\end{equation}
and
\begin{equation} \label{eqn20}
\begin{aligned}
M_{2}=\sum_{\mathbf{d}, d} \sum_{\mathbf{c}} &C\left(\left(f+\left(\mathbf{d}+\mathbf{b}\right) \cdot \mathbf{x}+d x_{\beta_{2}}\right)|_{\mathbf{x}=\mathbf{c}} \right. \\& \left.
\left(f+\left(\mathbf{d}+\mathbf{b}^{\prime}\right) \cdot \mathbf{x}+d x_{\beta_{2}}\right)|_{\mathbf{x}=\mathbf{c}}\right)(\tau).
\end{aligned}
\end{equation}
For the fixed $\mathbf{c_1,c_2}$ and $d$, consider the sum $M_1$
\begin{equation*}
\begin{aligned}
\sum_{\mathbf{d}} &C\left(\left( f+\left(\mathbf{d}+\mathbf{b}\right) \cdot \mathbf{x}+d x_{\beta_{2}}\right)|_{\mathbf{x}=\mathbf{c}_{1}}, \right. \\& \left.
\left(f+\left(\mathbf{d}+\mathbf{b}^{\prime}\right) \cdot \mathbf{x}+d x_{\beta_{2}}\right)|_{\mathbf{x}=\mathbf{c}_{2}}\right)(\tau)
\end{aligned}
\end{equation*}
\begin{equation*}
\begin{aligned}
~~~~=&\sum_{\mathbf{d}} C\left(\left(f+\left(\mathbf{d}+\mathbf{b}\right) \cdot \mathbf{c_1}+d x_{\beta_{2}}\right)|_{\mathbf{x}=\mathbf{c}_{1}},\right. \\& \left.
\left(f+\left(\mathbf{d}+\mathbf{b}^{\prime}\right) \cdot \mathbf{c_2}+d x_{\beta_{2}}\right)|_{\mathbf{x}=\mathbf{c}_{2}}\right)(\tau)
\end{aligned}
\end{equation*}
\begin{equation*}
\begin{aligned}
~~~~~~~~~~~~=&\sum_{\mathbf{d}}(-1)^{\mathbf{d \cdot(c_1\oplus c_2)}} C\left(\left(f+\mathbf{b} \cdot \mathbf{x}+d x_{\beta_{2}}\right)|_{\mathbf{x}=\mathbf{c}_{1}}, \right. \\& \left.
\left(f+\mathbf{b}^{\prime} \cdot \mathbf{x}+d x_{\beta_{2}}\right)|_{\mathbf{x}=\mathbf{c}_{2}}\right)(\tau)
\end{aligned}
\end{equation*}
\begin{equation}\label{eqn21}
\begin{aligned}
~~~~~~~~~~~~=& C\left(\left(f+\mathbf{b} \cdot \mathbf{x}+d x_{\beta_{2}}\right)|_{\mathbf{x}=\mathbf{c}_{1}}, \right. \\& \left.
\left(f+\mathbf{b}^{\prime} \cdot \mathbf{x}+d x_{\beta_{2}}\right)|_{\mathbf{x}=\mathbf{c}_{2}}\right)(\tau)\sum_{\mathbf{d}}(-1)^{\mathbf{d \cdot (c_1\oplus c_2)}}.
\end{aligned}
\end{equation}
Since in the terms of $M_1$, $\mathbf{c_1}\neq \mathbf{c_2}$, so the function $\mathbf{d \cdot(c_1\oplus c_2)}$ take values $0$ and $1$ equal number of times and hence (\ref{eqn21}) vanishes for all $\tau$.\\
Now for the fixed $\mathbf{c_1,d}$ consider the following sum in $M_2$.
\begin{equation*}
\begin{aligned}
\sum_{{d}} &C\left(\left(f+\left(\mathbf{d}+\mathbf{b}\right) \cdot \mathbf{x}+d x_{\beta_{2}}\right)|_{\mathbf{x}=\mathbf{c}} \right. \\& \left.
\left(f+\left(\mathbf{d}+\mathbf{b}^{\prime}\right) \cdot \mathbf{x}+d x_{\beta_{2}}\right)|_{\mathbf{x}=\mathbf{c}}\right)(\tau).
\end{aligned}
\end{equation*}
\begin{equation*}
\begin{aligned}
~~~~=&\sum_{{d}} C\left(\left(f+\left(\mathbf{d}+\mathbf{b}\right) \cdot \mathbf{c}+d x_{\beta_{2}}\right)|_{\mathbf{x}=\mathbf{c}},\right. \\& \left.
\left(f+\left(\mathbf{d}+\mathbf{b}^{\prime}\right) \cdot \mathbf{c}+d x_{\beta_{2}}\right)|_{\mathbf{x}=\mathbf{c}}\right)(\tau)
\end{aligned}
\end{equation*}
\begin{equation*}
\begin{aligned}
~~~~=&\sum_{{d}} C\left(\left(f+\left(\mathbf{b}+\mathbf{b'}\right) \cdot \mathbf{c}+d x_{\beta_{2}}\right)|_{\mathbf{x}=\mathbf{c}},\right. \\& \left.
\left(f+d x_{\beta_{2}}\right)|_{\mathbf{x}=\mathbf{c}}\right)(\tau)
\end{aligned}
\end{equation*}
\begin{equation*}
=(-1)^{\mathbf{(b\oplus b')}\cdot c}\sum_{{d}} C\left(\left(f+d x_{\beta_{2}}\right)|_{\mathbf{x}=\mathbf{c}}
\left(f+d x_{\beta_{2}}\right)|_{\mathbf{x}=\mathbf{c}}\right)(\tau)
\end{equation*}
\begin{equation}\label{eqn22}
=(-1)^{\mathbf{(b\oplus b')}\cdot c}A\left(f|_\mathbf{x=c}\right)(\tau
+A\left(\left(f+ x_{\beta_{2}}\right)|_{\mathbf{x}=\mathbf{c}}\right) (\tau).
\end{equation}
From \textit{Theorem 1} the above sum in (\ref{eqn22}) is zero for all $\tau \neq 0$. For $\tau=0$, we get
\begin{equation}\label{eqn23}
A\left(f|_\mathbf{x=c}\right)(\tau)=A\left(\left(f+ x_{\beta_{2}}\right)|_{\mathbf{x}=\mathbf{c}}\right) (\tau)=2^{m-k-4}
\end{equation}
for $\mathbf{c} \in \mathbb{Z}_2^k$, substituting this back in (\ref{eqn22}), we get
\begin{equation}\label{eqn24}
\begin{aligned}
&\sum_{{d}} C\left(\left(f+\left(\mathbf{b}+\mathbf{b'}\right) \cdot \mathbf{c}+d x_{\beta_{2}}\right)|_{\mathbf{x}=\mathbf{c}},\right. \\& \left.
\left(f+d x_{\beta_{2}}\right)|_{\mathbf{x}=\mathbf{c}}\right)(0)=(-1)^{\mathbf{(b\oplus b')}\cdot c}\cdot 2^{m-k-3}.
\end{aligned}
\end{equation}
Since we are considering the case $t\neq t'$, so $\mathbf{b} \neq \mathbf{b}^{\prime}$, and hence $\mathbf{b} \oplus \mathbf{b}^{\prime} \neq (0)$, and so the linear functional $\left(\mathbf{b} \oplus \mathbf{b}^{\prime}\right) \cdot \mathbf{c}$ (regarded as a function of $\left.\mathbf{c}\right)$ is not equal to the zero functional. Hence it is balanced, i.e., takes on the values 0 and 1 equally often as $\mathbf{c}$ varies. Hence the sum
\begin{equation*}
\sum_{\mathbf{c}}(-1)^{\left(\mathbf{b} \oplus \mathbf{b}^{\prime}\right) \cdot \mathbf{c}} \cdot 2^{m-k+1}=0.
\end{equation*}
\end{IEEEproof}
For a given GBF in $m$ variables $\bar f(x_0,x_1,\hdots,x_{m-1})=f(\bar x_0,\bar x_1,\hdots,\bar x_{m=1})$, where $\bar x_i=1-x_i.$
\begin{lemma}\label{lem3}
Suppose that $G(Q)$ contains a set of $k \leq m-5$ distinct vertices labeled with the property that deleting those $k$ vertices and all their edges results in a path. Let $\beta_1$ and $\beta_2$ be the label of end vertices of the path. In case of $k=m-5$ let the single vertex of the graph is $\beta_1=\beta_2=\beta$. Then for each $0\leq t <2^k$, the ordered set $\Psi^L(\bar S_t$) (for $L=2^{m-2}+2^{m-3}$) given by
\begin{equation}\label{eqn25}
\left\{\bar f+\sum_{\alpha=0}^{k-1} d_{\alpha} \bar x_{j_{\alpha}}+\sum_{\alpha=0}^{k-1} b_{\alpha} \bar x_{j_{\alpha}}+\bar d x_{\beta_{2}}: d,d_\alpha \in \{0,1\}\right\},
\end{equation}
is a complementary set of size $2^{k+1}$, where $f$ (using $q=2$) is defined in (\ref{eqn7}) and $t=\sum_{\alpha=0}^{k-1} b_{\alpha} 2^{\alpha}$.
Further, for $t'\neq t$, $\bar S_{t'}$ and $\bar S_{t}$ are mutually orthogonal complementary sets.
\end{lemma}
The next theorem gives $2^{k+1}$ mutually orthogonal binary complementary set of size $2^{k+1}$
\begin{theorem}\label{thm3}
Let the sets $S_t$ and $\bar S_t$ are defined in \textit{Theorem} \ref{thm2} and \textit{Lemma} \ref{lem3} respectively, then for $L=2^{m-2}+2^{m-3}$
\begin{equation}\label{eqn26}
\left\{\Psi_L(S_t): 0\leq t<2^k\right\}
\cup\left\{\Psi^L(\bar S_t): 0\leq t<2^k\right\}
\end{equation}
forms a $\left(2^{k+1},2^{k+1},2^{m-1}+2^{m-3}\right)$-CCC.
\end{theorem}
\begin{IEEEproof}
We will show that any complementary set $S_{t_{1}}$ is mutually orthogonal to any other complementary set $\bar S_{t_{2}}$. Let
\begin{equation}\label{eqn27}
\begin{aligned}
\sum_{\mathbf{d}} &C\left( f+\left(\mathbf{d}+\mathbf{b}\right) \cdot \mathbf{x}+ x_{\beta_{2}},
\bar f+\left(\mathbf{d}+\mathbf{b}^{\prime}\right) \cdot \mathbf{\bar x}\right)(\tau) \\& +C\left( f+\left(\mathbf{d}+\mathbf{b}\right) \cdot \mathbf{x}\right),
\left(\bar f+\left(\mathbf{d}+\mathbf{b}^{\prime}\right) \cdot \mathbf{\bar x}+x_{\beta_{2}}\right)(\tau)\\&
=\sum_{\mathbf{d}}\sum_{\mathbf{c_1,c_2}} C\left(\left( f+\left(\mathbf{d}+\mathbf{b}\right) \cdot \mathbf{x}+ x_{\beta_{2}}\right)|_\mathbf{x=c_1},\right. \\& \left.
\hspace{2.7cm}\left(\bar f+\left(\mathbf{d}+\mathbf{b}^{\prime}\right) \cdot \mathbf{\bar x}\right)|_\mathbf{x=c_2} \right)(\tau) \\& +C\left(\left( f+\left(\mathbf{d}+\mathbf{b}\right) \cdot \mathbf{x}\right)|_\mathbf{x=c_1},\right.\\& \left.
\hspace{1cm}\left(\bar f+\left(\mathbf{d}+\mathbf{b}^{\prime}\right) \cdot \mathbf{\bar x}+x_{\beta_{2}}\right)|_\mathbf{x=c_2}\right)(\tau) = M(say)
\end{aligned}
\end{equation}
For a given $\mathbf{c_1}$ and $\mathbf{c_2}$, consider the following sum of the first correlation term in (\ref{eqn27})
\begin{equation}\label{eqn28}
\begin{aligned}
\sum_{\mathbf{d}} &C\left(\left( f+\left(\mathbf{d}+\mathbf{b}\right) \cdot \mathbf{x}+ x_{\beta_{2}}\right)|_\mathbf{x=c_1},\right. \\&~~ \left.
\left(\bar f+\left(\mathbf{d}+\mathbf{b}^{\prime}\right) \cdot \mathbf{\bar x}\right)|_\mathbf{x=c_2} \right)(\tau) \\&
=\sum_{\mathbf{d}} C\left(\left( f+\left(\mathbf{d}+\mathbf{b}\right) \cdot \mathbf{x}+ x_{\beta_{2}}\right)|_\mathbf{x=c_1},\right. \\& \left.
~~\left(\bar f+\left(\mathbf{d}+\mathbf{b}^{\prime}\right) \cdot \mathbf{(1-x)}\right)|_\mathbf{x=c_2} \right)(\tau)\\&
= C\left(\left( f+ x_{\beta_{2}}\right)|_\mathbf{x=c_1},
(\bar f|_\mathbf{x=c_2} \right)(\tau)\\&
\cdot \sum_{\mathbf{d}}\left((-1)^{\mathbf{b} \cdot \mathbf{c}_{1} \oplus \mathbf{b}^{\prime} \cdot \mathbf{c}_{2}} \cdot(-1)^{\left(\mathbf{d} \oplus \mathbf{b}^{\prime}\right) \cdot \mathbf{1}} \cdot(-1)^{\mathbf{d} \cdot\left(\mathbf{c}_{1} \oplus \mathbf{c}_{2}\right)}\right)\\&
= C\left(\left( f+ x_{\beta_{2}}\right)|_\mathbf{x=c_1},
(\bar f|_\mathbf{x=c_2} \right)(\tau)\\&
~~\cdot (-1)^{\mathbf{b} \cdot \mathbf{c}_{1} \oplus \mathbf{b}^{\prime} \cdot \mathbf{c}_{2} \oplus \mathbf{b'}\cdot \mathbf{1}}\sum_{\mathbf{d}}(-1)^{\mathbf{d} \cdot\left(\mathbf{c}_{1} \oplus \mathbf{c}_{2} \oplus \mathbf{1}\right)}
\end{aligned}
\end{equation}
The above sum in (\ref{eqn28}) vanishes whenever $\left(\mathbf{c}_{1} \oplus \mathbf{c}_{2}\right) \neq \mathbf{1}$. So when $\left(\mathbf{c_1} = \mathbf{c_2}\right)$, the first correlation term in (\ref{eqn27}) is zero. Thus, summing (\ref{eqn28}) over all $\mathbf{c_1} \neq \mathbf{c_2}$, we get
\begin{equation}\label{eqn29}
\begin{aligned}
&\sum_{\mathbf{c_1}\neq \mathbf{c_2}\atop \mathbf{c_1+c_2=1}}C\left(\left( f+ x_{\beta_{2}}\right)|_\mathbf{x=c_1},
(\bar f|_\mathbf{x=c_2} \right)(\tau)\\&
\hspace{1.5cm}
\cdot (-1)^{\mathbf{b} \cdot \mathbf{c}_{1} \oplus \mathbf{b}^{\prime} \cdot \mathbf{c}_{2} \oplus \mathbf{b'}\cdot \mathbf{1}}2^k \\&
=\sum_{\mathbf{c}}C\left(\left( f+ x_{\beta_{2}}\right)|_\mathbf{x=c},
(\bar f|_{\mathbf{x=(c\oplus1})} \right)(\tau)\\&
\hspace{1.5cm}
\cdot(-1)^{\mathbf{b'}\cdot \mathbf{1}}2^k \cdot (-1)^{\mathbf{b} \cdot \mathbf{c} \oplus \mathbf{b}^{\prime} \cdot (1\oplus\mathbf{c})} \\&
=\sum_{\mathbf{c}}C\left(\left( f+ x_{\beta_{2}}\right)|_\mathbf{x=c},
(\bar f|_{\mathbf{x=(c\oplus1})} \right)(\tau)
2^k \cdot (-1)^{\left(\mathbf{b} \oplus \mathbf{b}^{\prime}\right) \cdot \mathbf{c}}
\end{aligned}
\end{equation}
Similarly, the second term of the correlation in (\ref{eqn27}) becomes
\begin{equation}\label{eqn30}
\begin{aligned}
&\sum_{\mathbf{d}} C\left(\left( f+\left(\mathbf{d}+\mathbf{b}\right) \cdot \mathbf{x}\right)|_\mathbf{x=c_1},\right. \\& \left.
\hspace{1cm}\left(\bar f+\left(\mathbf{d}+\mathbf{b}^{\prime}\right) \cdot \mathbf{\bar x}+x_{\beta_{2}}\right)|_\mathbf{x=c_2} \right)(\tau) \\&
=\sum_{\mathbf{c}}C\left( f|_\mathbf{x=c},
\left(\bar f+x_{\beta_{2}}\right)|_{\mathbf{x=(c\oplus1})} \right)(\tau)\cdot
2^k \cdot (-1)^{\left(\mathbf{b} \oplus \mathbf{b}^{\prime}\right) \cdot \mathbf{c}}
\end{aligned}
\end{equation}
Substituting back (\ref{eqn29}) and (\ref{eqn30}) in (\ref{eqn27}) we get,
\begin{equation}\label{eqn31}
\begin{aligned}
&M=\sum_{\mathbf{c}}\left(C\left(\left( f+ x_{\beta_{2}}\right)|_\mathbf{x=c},
(\bar f|_{\mathbf{x=(c\oplus1})} \right)(\tau)\right.\\& \left.+C\left( f|_\mathbf{x=c},
\left(\bar f+x_{\beta_{2}}\right)|_{\mathbf{x=(c\oplus1})} \right)(\tau) \right)\cdot
2^k \cdot (-1)^{\left(\mathbf{b} \oplus \mathbf{b}^{\prime}\right) \cdot \mathbf{c}}
\end{aligned}
\end{equation}
From \textit{Lemma} \ref{lem1}
\begin{equation}\label{eqn32}
\begin{aligned}
&C\left(\left( f+ x_{\beta_{2}}\right)|_\mathbf{x=c},
\bar f|_{\mathbf{x=(c\oplus1})} \right)(\tau)\\&
= C\left(\left( f+ x_{\beta_{2}}\right)|_{\mathbf{x}x_{\beta_{2}}=\mathbf{c}0},
\bar f|_{\mathbf{x}x_{\beta_{2}}=(c\oplus1)0} \right)(\tau)\\&
~~+ C\left(\left( f+ x_{\beta_{2}}\right)|_{\mathbf{x}x_{\beta_{2}}=\mathbf{c}0},
\bar f|_{\mathbf{x}x_{\beta_{2}}=(c\oplus1)1} \right)(\tau)\\&
~~+ C\left(\left( f+ x_{\beta_{2}}\right)|_{\mathbf{x}x_{\beta_{2}}=\mathbf{c}1},
\bar f|_{\mathbf{x}x_{\beta_{2}}=(c\oplus1)0} \right)(\tau)\\&
~~+ C\left(\left( f+ x_{\beta_{2}}\right)|_{\mathbf{x}x_{\beta_{2}}=\mathbf{c}1},
\bar f|_{\mathbf{x}x_{\beta_{2}}=(c\oplus1)1} \right)(\tau)\\&
=C\left( f|_{\mathbf{x}x_{\beta_{2}}=\mathbf{c}0},
\bar f|_{\mathbf{x}x_{\beta_{2}}=(c\oplus1)0} \right)(\tau)\\&
~~+C\left( f|_{\mathbf{x}x_{\beta_{2}}=\mathbf{c}0},
\bar f|_{\mathbf{x}x_{\beta_{2}}=(c\oplus1)1} \right)(\tau)\\&
~~-C\left( f|_{\mathbf{x}x_{\beta_{2}}=\mathbf{c}1},
\bar f|_{\mathbf{x}x_{\beta_{2}}=(c\oplus1)0} \right)(\tau)\\&
~~-C\left( f|_{\mathbf{x}x_{\beta_{2}}=\mathbf{c}1},
\bar f|_{\mathbf{x}x_{\beta_{2}}=(c\oplus1)1} \right)(\tau)
\end{aligned}
\end{equation}
Similarly,
\begin{equation}\label{eqn33}
\begin{aligned}
&C\left( f|_\mathbf{x=c},
\left(\bar f+x_{\beta_{2}}\right)|_{\mathbf{x=(c\oplus1})} \right)(\tau) \\&
=C\left( f|_{\mathbf{x}x_{\beta_{2}}=\mathbf{c}0},
\bar f|_{\mathbf{x}x_{\beta_{2}}=(c\oplus1)0} \right)(\tau)\\&
-C\left( f|_{\mathbf{x}x_{\beta_{2}}=\mathbf{c}0},
\bar f|_{\mathbf{x}x_{\beta_{2}}=(c\oplus1)1} \right)(\tau)\\&
+C\left( f|_{\mathbf{x}x_{\beta_{2}}=\mathbf{c}1},
\bar f|_{\mathbf{x}x_{\beta_{2}}=(c\oplus1)0} \right)(\tau)\\&
-C\left( f|_{\mathbf{x}x_{\beta_{2}}=\mathbf{c}1},
\bar f|_{\mathbf{x}x_{\beta_{2}}=(c\oplus1)1} \right)(\tau)
\end{aligned}
\end{equation}
Substituting (\ref{eqn32}) and (\ref{eqn33}) in (\ref{eqn31}), we get
\begin{equation}
\begin{aligned}\label{eqn34}
&M=2\sum_{\mathbf{c}}\left(C\left( f|_{\mathbf{x}x_{\beta_{2}}=\mathbf{c}0},
\bar f|_{\mathbf{x}x_{\beta_{2}}=(c\oplus1)0} \right)(\tau)\right.\\& \left.
-C\left( f|_{\mathbf{x}x_{\beta_{2}}=\mathbf{c}1},
\bar f|_{\mathbf{x}x_{\beta_{2}}=(c\oplus1)1} \right)(\tau)\right)\cdot
2^k \cdot (-1)^{\left(\mathbf{b} \oplus \mathbf{b}^{\prime}\right) \cdot \mathbf{c}}
\end{aligned}
\end{equation}
Since $G(Q|_\mathbf{x=c})$ is a path, so for some permutation $\pi$ of $\{0,1,\hdots,m-k-5\}$ and $g_i,g'\in \mathbb{Z}_q$ the function obtained by substituting $\mathbf{x=c}$ in $f$ should be of the form
\begin{equation}\label{eqn35}
\begin{aligned}
&f|_\mathbf{x=c}= \sum_{\alpha=0}^{m-k-6}x_{\pi(\alpha)}x_{\pi(\alpha+1)}+\sum_{\alpha=0}^{m-k-5}c_{\alpha}x_{\pi(\alpha)}+c\\&
+x_{\pi(m-k-5)}\left(\bar x_{m-1}\left(x_{m-2}\bar x_{m-3}\bar x_{m-4}+x_{m-2}x_{m-3}\right)+x_{m-1} \right. \\& \left.\bar x_{m-2}\bar x_{m-3} \right)+ \bar x_{m-1}\left(\bar x_{m-4}\left(x_{m-3}+x_{m-2}\right)+x_{m-2}x_{m-3}\right)
\end{aligned}
\end{equation}
Let $h{1}$ denote the function obtained from $f$ by substituting $\mathbf{x}=\mathbf{c}$ and $x_{\beta_{2}}=0$ for some binary vector $\mathbf{c}$ and let $h{2}$ be the corresponding function when $\mathbf{x}=\mathbf{c}$ and $x_{\beta_{2}}=1 .$ Further without loss of generality let $\beta_2=\pi(0)$ . Then
\begin{equation}\label{eqn36}
h1=\sum_{\alpha=1}^{m-k-6}x_{\pi(\alpha)}x_{\pi(\alpha+1)}+\sum_{{\alpha=0}\atop \pi(\alpha)\neq 0}^{m-k-5}c_{\alpha}x_{\pi(\alpha)}+c+R
\end{equation}
\begin{equation}\label{eqn37}
h2=h1+x_{\pi(1)}+c_0
\end{equation}
The nonzero components of the complex vectors $\mathbf{a}=f|_{\mathbf{x} x_{\beta_{2}}=\mathbf{c} 0}$ and $\mathbf{b}=f|_{\mathbf{x} x_{\beta_{2}}=\mathbf{c} 1}$ are given by the functions $h{1}$ and $h{2}$ respectively. Similarly, the nonzero components of the vector $\bar{f}|_{\mathbf{x} x_{\beta_{2}}=(\mathbf{c} \oplus \mathbf{1}) 0}$ and $\bar{f}|_{\mathbf{x} x_{\beta_{2}}=(\mathbf{c} \oplus \mathbf{1}) 1}$ are given by the function $\bar{h2}$ and $\bar{h1}$ respectively. Using the identity
\begin{equation*}
C\left(a,\bar{b}\right)(\tau)= C\left(b,\bar{a}\right)(\tau)
\end{equation*}
We get,
\begin{equation}\label{eqn38}
\begin{aligned}
&C\left( f|_{\mathbf{x}x_{\beta_{2}}=\mathbf{c}0},
\bar f|_{\mathbf{x}x_{\beta_{2}}=(c\oplus1)0} \right)(\tau)\\&
=C\left( f|_{\mathbf{x}x_{\beta_{2}}=\mathbf{c}1},
\bar f|_{\mathbf{x}x_{\beta_{2}}=(c\oplus1)1} \right)(\tau)
\end{aligned}
\end{equation}
which shows that $M$ in (\ref{eqn34}) is zero, and hence the result follows from (\ref{eqn27}).
\end{IEEEproof}
\section{Conclusion}
In this paper, we proposed a direct and generalized construction of binary CCC of non-power of two length by using higher order GBFs
The resultant CCCs can be obtained directly from GBFs without using other tedious sequence operations. The non power of two length binary CCCs directly constructed using GBFs find many applications in wireless communication due to its good correlation properties. The construction of GCPs and Complementary sets of non power of two lengths are also provided in this paper.
\bibliographystyle{IEEEtran}
| {'timestamp': '2021-09-20T02:18:42', 'yymm': '2109', 'arxiv_id': '2109.08567', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08567'} | arxiv |
\section{Introduction}
\label{sec:introduction}
The availability of large datasets and inexpensive computational
resources has rendered the use of machine learning (ML) systems
instrumental for many critical decisions involving individuals,
including criminal assessment, landing, and hiring, all of which have
a profound social impact.
A key concern for the adoption of these system regards how they handle bias and discrimination
and how much information they leak about the individuals whose data
is used as input.
Differential Privacy (DP) \cite{dwork:06} is an algorithmic property
that bounds the risks of disclosing sensitive information of individuals
participating in a computation.
It has become the paradigm of choice in privacy-preserving machine
learning systems and its deployments are growing at a fast rate.
However, it was recently observed that DP systems may induce biased
and unfair outcomes for different groups of individuals
\cite{NEURIPS2019_eugene,pujol:20,xu2020removing}.
The resulting outcomes can have significant societal and economic
impacts on the involved individuals: classification errors may
penalize some groups over others in important determinations
including criminal assessment, landing, and hiring
\cite{NEURIPS2019_eugene} or can result in disparities regarding
the allocation of critical funds and benefits \cite{pujol:20}.
{\em While these surprising observations are becoming increasingly
common, their causes are largely understudied and not fully understood.}
This paper makes a step toward this important quest, and studies the
disparate impacts arising when training a model using \emph{Private Aggregation
of Teacher Ensembles} (PATE) \cite{papernot2018scalable} an important
and popular privacy-preserving machine learning framework. It combines multiple
agnostic learning models used as teachers for a student model that
learns to predict an output chosen by noisy voting among the
teachers. The resulting model satisfies differential privacy and has
been shown effective in learning high quality private models in
semisupervised settings or when one wishes to protect the data labels.
The paper analyzes which properties of the algorithm and the data are
responsible for the disproportionate impacts, why these aspects are
affecting different individuals or groups of individuals disproportionately, and proposes a solution that may aid mitigating these effects.
In summary, the paper makes the following contributions:
\begin{enumerate}[leftmargin=*, parsep=0pt, itemsep=2pt, topsep=0pt]
\item It uses a fairness notion that relies on the concept of excessive risk, and measures the direct impact of privacy to the model accuracy for individuals or groups.
\item It analyzes this fairness notion in PATE, a state-of-the-art privacy-preserving ML framework.
\item It isolates key components of the model parameters and the data properties which are responsible for the observed disparate impacts.
\item It studies when and why these components affect different individuals or groups disproportionately.
\item Finally, based on these findings, it proposes a method that may aid mitigating these unfairness effects while retaining high accuracy.
\end{enumerate}
To the best of the authors knowledge, this work represents a first effort toward understanding the reasons of the disparate impacts in
privacy-preserving ensemble models.
\section{Related Work}
\label{sec:related_work}
The study of the disparate impacts caused by privacy-preserving algorithms has recently seen several important developments.
\citet{ekstrand:18} raise questions about the tradeoffs involved between privacy and fairness. \citet{cummings:19} study the tradeoffs arising between differential privacy and equal opportunity, a fairness notion requiring a classifier to produce equal true positive rates across different groups. They show that there exists no classifier that simultaneously achieves $(\epsilon,0)$-DP, satisfies equal opportunity, and has accuracy better than a constant classifier.
This development has risen the question of whether one can practically build fair models while retaining sensitive information private.
To this end, \citet{jagielski:18} presents two algorithms that
satisfy $(\epsilon,\delta)$-differential privacy and equalized odds.
\citet{mozannar2020fair} develops methods to adapt a nondiscriminatory learner to work with privatized protected attributes and \citet{tran2020differentially} proposes a differentially private learning approach to enforce several group fairness notions using a Lagrangian dual method.
\citet{pujol:20} were seemingly the first to show, empirically, that
resource allocation decisions made using DP datasets may disproportionately affect some groups of individuals over others. These studies were complemented theoretically by \citet{Cuong:IJCAI21}.
Similar observations were also made in the context of model learning. \citet{NEURIPS2019_eugene} empirically observed that the accuracy of a DP model trained using DP-Stochastic Gradient Descent (DP-SGD) decreases disproportionately across groups causing larger negative impacts to the underrepresented groups. \citet{farrand2020neither,uniyal2021dpsgd} reaches similar conclusions and show that this disparate impact is not limited to highly imbalanced data.
This paper builds on this body of work and their important empirical observations. It provides an analysis for the reasons of unfairness in the context of semi-supervised private learning ensembles, a commonly adopted scheme in privacy-preserving ML systems as well as introduces mitigating guidelines.
\section{Preliminaries: Differential Privacy}
\label{sec:preliminaries}
Differential privacy (DP) \cite{dwork:06} is a strong privacy notion used to quantify and bound the privacy loss of an individual's participation in a computation.
Informally, it states that the probability of any output does not change much when a record is added or removed from a dataset, limiting the amount of information that the output reveals about any individual.
The action of adding or removing a record from a dataset $D$, resulting in a new dataset $D'$, defines the notion of \emph{adjacency}, denoted $D \sim D'$.
\begin{definition}
\label{dp-def}
A mechanism $\mathcal{M}} \newcommand{\cN}{\mathcal{N} \!:\! \mathcal{D} \!\to\! \mathcal{R}$ with domain $\mathcal{D}$ and range $\mathcal{R}$ is $(\epsilon, \delta)$-differentially private, if, for any two adjacent inputs $D \sim D' \!\in\! \mathcal{D}$, and any subset of output responses $R \subseteq \mathcal{R}$:
\[
\Pr[\mathcal{M}} \newcommand{\cN}{\mathcal{N}(D) \in R ] \leq e^{\epsilon}
\Pr[\mathcal{M}} \newcommand{\cN}{\mathcal{N}(D') \in R ] + \delta.
\]
\end{definition}
\noindent
Parameter $\epsilon > 0$ describes the \emph{privacy loss} of the algorithm, with values close to $0$ denoting strong privacy, while parameter
$\delta \in [0,1)$ captures the probability of failure of the algorithm to satisfy $\epsilon$-DP.
The global sensitivity $\Delta_\ell$ of a real-valued
function $\ell: \mathcal{D} \to \mathbb{R}$ is defined as the maximum amount
by which $\ell$ changes in two adjacent inputs:
\(
\Delta_\ell = \max_{D \sim D'} \| \ell(D) - \ell(D') \|.
\)
In particular, the Gaussian mechanism, defined by
\(
\mathcal{M}(D) = \ell(D) + \mathcal{N}(0, \Delta_\ell^2 \, \sigma^2),
\)
\noindent where $\mathcal{N}(0, \Delta_\ell^2\, \sigma^2)$ is
the Gaussian distribution with $0$ mean and standard deviation
$\Delta_\ell^2\, \sigma^2$, satisfies $(\epsilon, \delta)$-DP for
$\delta \!>\! \frac{4}{5} \exp(-(\sigma\epsilon)^2 / 2)$
and $\epsilon \!<\! 1$ \cite{dwork:14}.
\begin{figure*}[tb]
\centering
\includegraphics[width=0.75\linewidth]{scheme.pdf}
\caption{Illustration of PATE and aspects contributing to fairness impact.}
\label{fig:scheme}
\end{figure*}
\section{Problem Settings and Goals}
\label{sec:problem}
This paper considers a \emph{private} dataset $D$ consisting of $n$ individuals' data points $(\bm{x}_i, y_i)$, with $i \!\in\! [n]$, drawn i.i.d.~from an unknown distribution $\Pi$. Therein, $\bm{x}_i \!\in\! \cX$ is a feature vector that \emph{may} contain a protected group attribute $\bm{a}_i \!\in\! \cA \!\subset\! \cX$, and $y_i \!\in\! \cY = [C]$ is a $C$-class label.
{For example, consider a classifier that needs to predict criminal defendant’s recidivism. The training example features $\bm{x}_i$ may describe the individual's demographics, education, occupation, and crime committed, the protected attribute $\bm{a}_i$, if available, may describe the individual's gender or ethnicity, and $y_i$ represents whether or not the individual has high risk to reoffend.}
This paper studies the fairness implications arising when training privacy-preserving semi-supervised transfer learning models.
The setting is depicted in Figure \ref{fig:scheme}. We are given an ensemble of \emph{teacher} models $\bm{T} \!=\! \{f^i\}_{i=1}^k$, with each $f^i \!:\! \cX \!\to\! \cY$ trained on a non-overlapping portion $D_i$ of $D$. This ensemble is used to transfer knowledge to a \emph{student} model $\bar{f}_\theta \!:\! \cX \!\to\! \cY$, where ${\bm{\theta}}$ denotes a vector of real-valued parameters associated with model $\bar{f}$.
The student model $\bar{f}$ is trained using a \emph{public} dataset $\bar{D} \!=\! \{\bm{x}_i\}_{i=1}^m$ with samples drawn i.i.d.~from the same distribution $\Pi$ considered above but whose labels are unrevealed.
The paper focuses on learning {classifier} $\bar{f}_\theta$ using knowledge transfer from the teacher model ensemble $\bm{T}$ while guaranteeing the privacy of each individual's data $(\bm{x}_i, y_i) \!\in\! D$.
The sought model is learned by minimizing the regularized empirical risk function
\begin{align}
\label{eq:ERM}
\optimal{{\bm{\theta}}} &= \argmin_{\bm{\theta}} \cL\left({\bm{\theta}}; \bar{D}, \bm{T}\right)
= \sum_{\bm{x} \in \bar{D}}
\ell \left( \bar{f}_\theta(\bm{x}), \textsl{v}\left(\bm{T}(\bm{x}) \right)\right)
+ \lambda \left\| \theta \right\|^2,
\end{align}
where $\ell \!:\! \cY \times \cY \!\to\! \mathbb{R}_+$ is a loss function and measures the performance of the model,
$\textsl{v} \!:\! \cY^k \!\to\! \cY$ is a \emph{voting scheme} used to
decide the prediction label from the ensemble $\bm{T}$, with
$\bm{T}(\bm{x})$ used as a shorthand for $\{f^i(\bm{x})\}_{i=1}^k$, and $\lambda>0$ is a regularization parameter.
The paper focuses on learning classifiers that protect the disclosure of the individual's data using the notion of differnetial privacy and it analyzes the fairness impact (as defined below) of privacy on different groups and individuals.
\subsection*{Privacy}
\emph{Privacy} is achieved by using a differentially private version $\tilde{\textsl{v}}$ of the voting function $\textsl{v}$, defined
as
\begin{equation}
\label{eq:noisy_max}
\tilde{\textsl{v}} \left( \bm{T}(\bm{x}) \right) \!=\! \argmax_j
\left\{ \#_j \left(\bm{T}(\bm{x}) \right) \!+\!
\cN \left(0, \sigma^2 \right) \right\},
\end{equation}
which perturbs the reported counts $\#_j(\bm{T}(\bm{x}))\!=\!|\{i\!:\!i \!\in\![k], f^i(\bm{x}) \!=\! j\}|$ associated to label $j \!\in\! \cY$, via additive Gaussian noise of zero mean and standard deviation $\sigma$.
The overall approach, called \emph{PATE}, guarantees $(\epsilon, \delta)$-differential privacy, with privacy loss scaling with the magnitude of the standard deviation $\sigma$ and the size of the public dataset $\bar{D}$ \cite{papernot2018scalable}.
A detailed discussion reviewing the privacy analysis of PATE is reported in {Appendix \ref{app:privacy_analysis}}.
Throughout the paper, the privacy-preserving parameters of the model $\bar{f}$ are denoted with $\tilde{\bm{\theta}}$.
\subsection*{Fairness}
The fairness analysis focuses on the notion of \emph{excessive risk} \cite{NIPS2017_f337d999,ijcai2017548}. It defines the difference between the private and non private risk functions:
\begin{flalign}
\label{def:excessiver_risk}
R(S, \bm{T}) \stackrel{\text{def}}{=} \mathbb{E}} \newcommand{\RR}{\mathbb{R}_{\tilde{{\bm{\theta}}}}
\left[ \cL(\tilde{{\bm{\theta}}}; S, \bm{T}) \right]
- \cL(\optimal{{\bm{\theta}}}; S, \bm{T}),
\end{flalign}
where the expectation is defined over the randomness of the private mechanism, $S$ is a subset of $\bar{D}$, and
$\tilde{{\bm{\theta}}}$ denotes the private student's model parameters while $\optimal{{\bm{\theta}}}\, =\! \argmin_{\bm{\theta}} \cL({\bm{\theta}}; \bar{D}, \bm{T})$.
The above definition captures both individual $R(\{\bm{x}\}, \bm{T})$ excessive risk for a sample $\bm{x}$ and group $R(\bar{D}_{\leftarrow a}, \bm{T})$ excessive risk for a group $a$, where $\bar{D}_{\leftarrow a}$ denotes the subset of $\bar{D}$ containing exclusively samples whose group attribute is $a \in \cA$.
This paper uses shorthands $R(\bm{x})$ and $R(\bar{D}_{\leftarrow a})$ to denote $R(\bm{x}, \bm{T})$ and $R(\bar{D}_{\leftarrow a}, \bm{T})$.
Finally, this paper assumes that the private mechanisms are non-trivial, i.e., they minimize the population-level excessive risk
$R(\bar{D})$ and the fairness goal is to minimize excessive risk difference among all individuals and/or groups.
\section{PATE Fairness Analysis: Roadmap}
\label{sec:roadmap}
The next sections focus on two orthogonal aspects of PATE: the \emph{algorithm's parameters} and the \emph{public student data distribution characteristics} and analyze their fairness impact.
Within the algorithm's parameters, in addition to the privacy variable $\sigma$, the paper reveals two surprising aspects which have a direct impact on fairness: The size $k$ of the teacher ensemble and the regularization parameter $\lambda$ associated with the student risk function.
Regarding the public student data's characteristics, the paper shows that the magnitude of the sample input norms $\|\bm{x}\|$ and the distance of a sample to the decision boundary (denoted $s(\bm{x})$) play decisive roles to exacerbate the excessive risk induced by the student model.
These aspects are illustrated schematically with green dotted lines in Figure \ref{fig:scheme}.
Several aspects of the analysis in this paper rely on the following definition.
\begin{definition}[Flipping probability]
Given a data sample $(\bm{x}, y) \!\in\! D$, for an ensemble model $\bm{T}$ and voting scheme $\textsl{v}$, the \emph{flipping probability} of $\bm{T}$ is defined as:
\begin{equation}
\label{eq:flipping_pr}
\fp{\bm{x}} \stackrel{\text{def}}{=} \Pr\left[
\tilde{\textsl{v}}(\bm{T}(\bm{x})) \neq \textsl{v}(\bm{T}(\bm{x}))
\right].
\end{equation}
\end{definition}
\noindent It connects the \emph{voting confidence} of the teacher ensemble with the perturbation induced by the privacy-preserving voting scheme, and will be instrumental in the fairness analysis introduced below.
The following sections use several standard datasets including UCI Adults, Credit card, Bank, and Parkinsons \cite{UCIdatasets,article, Moro2014ADA} to support the theoretical claims. The results use feed-forward networks with two hidden layers and nonlinear ReLU activations for both the ensemble and student models. All reported metrics are average of 100 repetitions, used to compute the empirical expectations.
When not otherwise stated, the experiments refer to the \textsl{Credit card} dataset.
The main paper reports a glimpse of the empirical results, which appears in an extended form in the Appendix (\ref{app:exp_ext}).
Additional description of the dataset and proofs of all theorems are reported in the Appendix.
\section{Algorithm's Parameters}
\label{sec:alg_params}
This section focuses on analyzing the algorithm's parameters that affect the disparate impact of the student model outputs. In more details, it shows that, in addition to the privacy parameter $\sigma$, the
regularization term $\lambda$ of the empirical risk function
$\cL({\bm{\theta}}, \bar{D}, \bm{T})$ (see Equation \eqref{eq:ERM}) and the
size $k$ of the teacher ensemble $\bm{T}$ largely control the difference between model learned with noisy and clean labels.
The fairness analysis reported in this section assumes that the student model loss $\ell(\cdot)$ is convex and \emph{decomposable}:
\begin{definition}[Decomposable function]
\label{def:1}
A function $\ell(\cdot) $ is \emph{decomposable} if there exists a parametric function $h_{{\bm{\theta}}} \!:\! \cX \!\to\! \RR$, a constant real number $c$, and a function
$z \!:\! \RR \!\to\! \RR$, such that, for $\bm{x} \!\in\! \cX$,
and $y \!\in\! \cY$:
\begin{equation}
\label{eq:decomposable}
\ell(f_{{\bm{\theta}}}(\bm{x}), y) = z(h_{{\bm{\theta}}}(\bm{x}))
+ c \, y\, h_{\theta}(\bm{x}).
\end{equation}
\end{definition}
Note that a number of loss functions commonly adopted in machine
learning, including the logistic loss and the least square loss
function, are decomposable \cite{gao2016risk, patrini2014almost}.
Additionally, while it is common to impose restrictions on the nature
of the loss function to render the analysis tractable, our findings
are empirically validated on non-linear models, as shown next.
The following theorem sheds light on the unfairness induced by PATE and the dependency with its parameters.
It provides an upper bound on the expected difference between the
non-private and private student model parameters. As the paper will
show in Theorem \ref{thm:3}, this quantity is closely related with the excessive risk.
Therein, $\optimal{{\bm{\theta}}}$ and $\tilde{{\bm{\theta}}}$ represent the
parameters of student model $\bar{f}$ which are learned as a result of training, respectively, with a clean or noisy voting scheme.
\begin{theorem}
\label{thm:1}
Consider a student model $\bar{f}_{{\bm{\theta}}}$ trained with a convex and decomposable loss
function $\ell(\cdot)$. Then, the expected
difference between the private and non-private model parameters is
upper bounded as follows:
\begin{equation}
\mathbb{E}\left[ \| \optimal{{\bm{\theta}}} - \tilde{{\bm{\theta}}} \| \right]
\leq \frac{|c|}{m\lambda} \left[ \sum_{\bm{x} \in \bar{D}} p^{\leftrightarrow}_{\bm{x}} \| g_{\bm{x}}\| \right],
\end{equation}
where $c$ is a real constant and
$g_{\bm{x}}= \max_{{\bm{\theta}}}\| \nabla_{{\bm{\theta}}} h_{{\bm{\theta}}}(\bm{x}) \|$
represents the maximum gradient norm distortion introduced by a
sample $\bm{x}$. Both $c$ and $h$ are defined as in Equation
\eqref{eq:decomposable}.
\end{theorem}
\noindent
The proof relies on $\lambda$-strong convexity of the loss function ${\cL(\cdot)}$ (see Appendix \ref{app:missing_proofs}).
Theorem \ref{thm:1} relates the difference in the expected private and non-private student parameters with three key factors: {\bf (1)} the regularization term $\lambda$, {\bf (2)} the flipping probability $p^{\leftrightarrow}_{\bm{x}}$, and {\bf (3)} the the maximum gradient norm distortion $g_{\bm{x}}$ induced by a sample $\bm{x}$.
The former two factors are mechanisms-dependent components and the subject of study of this section. As it will be shown next, they are controlled by the size $k$ of the teacher ensemble and the noise parameter $\sigma$. The discussion about data dependent components, including those related with the gradient norms, is delegated to Section \ref{sec:data_prop}.
Throughout the paper, the quantity $\|\optimal{{\bm{\theta}}} - \tilde{{\bm{\theta}}}\|$ is referred to as \emph{model sensitivity to privacy}, or simply \emph{model sensitivity}, as it captures the effect of the private teacher voting on the student learned model.
\begin{figure}[!bt]
\centering
\includegraphics[width=0.75\linewidth]{section7_lambdareg_effect_parkinsons.pdf}
\caption{
Credit-card dataset with $\sigma \!=\! 50, k\!=\!150$.
Model sensitivity (left), empirical risk (middle), and model accuracy (right) as a function of the regularization term.}
\label{fig:lambda_effect}
\end{figure}
\subsection{The impact of the regularization term $\lambda$}
The first immediate observation of Theorem \ref{thm:1} is that variations of
the regularization term $\lambda$ can reduce or magnify the
difference between the private and non-private student model
parameters.
Since the model sensitivity $\mathbb{E}} \newcommand{\RR}{\mathbb{R}\| \optimal{{\bm{\theta}}} - \tilde{{\bm{\theta}}}\|$ relates directly to the excessive risk (see Theorem \ref{thm:3}), the regularization term affects the disparate impact of the privacy-preserving student model.
These effects are further illustrated in Figure \ref{fig:lambda_effect}. The figure shows how increasing $\lambda$ reduces the empirical expected difference between the privacy-preserving and original model parameters $\mathbb{E}} \newcommand{\RR}{\mathbb{R}\|\optimal{{\bm{\theta}}} - \tilde{{\bm{\theta}}}\|$ (left), as well as the excessive risk $R(\bar{D}_{\leftarrow a})$
difference between groups $a=0$ and $a=1$ (middle).
Note, however, that while larger $\lambda$ values may reduce the model unfairness, they can hurt the resulting model accuracy, as shown in the right plot.
The latter is an intuitive and recognized effect of large regularizers factors.
\subsection{The impact of the teachers ensemble size $k$}
The second aspect considered in this section is the relation between the ensemble size $k$ and the resulting private model fairness. The
following result relates the size of the ensemble with its voting confidence.
\begin{theorem}
\label{thm:2}
For a sample $\bm{x} \!\in\! \bar{D}$ assume that the teacher models
outputs $\hat{y}_i = f^i(\bm{x})$ $(i \in [k])$ are all in agreement. That is, $\hat{y}_i = \hat{y}_j$ for all $i,j \in [k]$.
Then, the flipping probability $p^{\leftrightarrow}_{\bm{x}}$ is given by:
\begin{equation}
p^{\leftrightarrow}_{\bm{x}} = 1 - \Phi\left(\frac{k}{\sqrt{2} \sigma}\right),
\end{equation}
where $\Phi(\cdot)$ is the CDF of the standard normal distribution
and $\sigma$ is the standard deviation in the Gaussian mechanism.
\end{theorem}
\noindent
The proof is based on the properties of independent Gaussian random variables.
The analysis above sheds light on the outcome of the teachers voting
scheme and its relation with the ensemble size $k$ (as well as the
privacy parameter $\sigma$). It indicates that larger $k$ values correspond to smaller flipping probability $p^{\leftrightarrow}_{\bm{x}}$. Combined with Theorem~\ref{thm:1}, the result suggests that the difference between the private and non-private model parameters is inversely proportional to $k$.
While for simplicity of analysis Theorem \ref{thm:2} requires the decision
of all teachers to agree on a given sample $\bm{x}$, our empirical
analysis supports this result for the more general scenario where
different teachers have different agreements on a sample.
Figure \ref{fig:flipping_pr_k} (left) illustrates the relation between
the number $k$ of teachers and the flipping probability $p^{\leftrightarrow}_{\bm{x}}$ of the ensemble. The plot shows a clear trend indicating that larger ensembles result in smaller flipping probabilities.
\begin{figure}[!tb]
\centering
\includegraphics[width=0.35\linewidth, height=100pt,valign=M]{flip_prob_num_teachers_credit_card.pdf}
\includegraphics[width=0.35\linewidth, height=104pt,valign=M]{inpNorm_gradNorm_corrCreditCard.pdf}
\caption{Credit card dataset: Average flipping probability $p^{\leftrightarrow}_{\bm{x}}$
for samples $\bm{x} \in \bar{D}$ as a function of the ensemble size $k$ (left)
and
relation between gradient and input norms (right).}
\label{fig:flipping_pr_k}
\label{fig:grad_inp_corr}
\end{figure}
\begin{figure}[!tb]
\centering
\includegraphics[width=0.75\linewidth]{section7_K_effect_income.pdf}
\caption{Income dataset with $\sigma\!=\!50, \lambda\!=\!100$. Expected model sensitivity (left),
empirical risk (middle), and model accuracy (right) as a function
of the ensemble size.}
\label{fig:effect_k}
\end{figure}
Next, analogously to what is reported in Figure \ref{fig:lambda_effect}, Figure \ref{fig:effect_k} shows that increasing $k$ reduces the difference in the expected private and non-private model parameters (left), reduces the
group excessive risk difference (middle), and increases the model $\bar{f}$
accuracy (right).
However, similarly as for the regularization term
$\lambda$, there is also a downside of using very large ensembles:
large values $k$ can reduce the accuracy of the (private and non-private)
models.
While studying these tradeoffs goes beyond the scope of this work,
we believe this behavior is related with the bias-variance tradeoff imposed on the growing ensemble: The larger the ensemble the less data each teacher is given to train their models, thus affecting their voting accuracy.
We believe this is an interesting and important direction for future work.
\noindent
This section concludes with a useful corollary of Theorem~\ref{thm:1}.
\begin{corollary}[Theorem~\ref{thm:1}]
\label{cor:1}
Let $\bar{f}_{\theta}$ be a \emph{logistic regression} classifier. Its
expected model sensitivity is upper bounded as:
\begin{equation}
\label{eq:8}
\mathbb{E}\left[ \| \optimal{{\bm{\theta}}} - \tilde{{\bm{\theta}}} \| \right]
\leq
\frac{1}{m\lambda} \left[ \sum_{\bm{x} \in \bar{D}} \fp{\bm{x}} \| \bm{x} \| \right].
\end{equation}
\end{corollary}
The result above highlights several interesting points.
First, in logistic regression, samples with large input norms can
have a non negligible impact on fairness. This place emphasis on an
nontrivial aspect of the student data properties which may affect
fairness and is subject of study of the next section.
Next, notice the similarities between Equation \eqref{eq:8} and Equation \eqref{eq:6}; In the former, gradient norms $\|\bm{x}\|$ multiply the associated flipping probabilities $p^{\leftrightarrow}_{\bm{x}}$ in place of the gradient norms $\|g_{\bm{x}}\|$.
Thus the result above indicates the presence of a relation between gradient norms and input norms, which is further highlighted in
Figure~\ref{fig:grad_inp_corr} (right). The plot illustrates the strong correlation between input norms and their associated gradient norms.
\section{Student's Data Properties}
\label{sec:data_prop}
Having examined the algorithmic properties of PATE affecting fairness,
this section turns on analyzing a set of properties concerning
the student data which regulate the disproportionate impacts of the algorithm.
The subsequent set of results shows that the norms of the student's data samples and their distance to the decision boundary are two key factor tied to the exacerbation of excessive risk in PATE.
The following is a corollary of Theorem \ref{thm:1} and bounds the
second order statistics of the model sensitivity to privacy.
\begin{corollary}[Theorem~\ref{thm:1}]
\label{cor:2}
Given the same settings and assumption of Theorem \ref{thm:1}, it follows:
\begin{equation}
\label{eq:9}
\mathbb{E}\left[ \| \optimal{{\bm{\theta}}} - \tilde{{\bm{\theta}}} \|^2 \right]
\leq \frac{|c|^2}{m \lambda^2} \left[ \sum_{\bm{x} \in \bar{D}} p^{\leftrightarrow 2}_{\bm{x}} \| g_{\bm{x}}\|^2 \right].
\end{equation}
\end{corollary}
\noindent
Note that, similarly to as shown by Corollary \ref{cor:1}, when $\bar{f}_\theta$ is a logistic regression model, the gradient norm $ \| g_{\bm{x}}\|$ in Equation \eqref{eq:9}
can be substituted with the input norm $\|\bm{x}\|$.
The result above is useful to derive an upper bound on the excessive risk,
as illustrated in the following theorem.
\begin{theorem}
\label{thm:3}
Let $\ell(\cdot)$ be a $\beta_{\bm{x}}$-smooth loss function.
The excessive risk $R(\bm{x})$ of a sample $\bm{x}$ is upper
bounded as:
\begin{equation}
\label{eq:ER_ub}
R(\bm{x}) \leq \| \nabla_{\optimal{{\bm{\theta}}}}
\ell(\bar{f}_{\optimal{{\bm{\theta}}}}(\bm{x}),y)\|U_1
+ \frac{1}{2} \beta_x U_2,
\end{equation}
where, $U_1 = \mathbb{E}\left[ \| \optimal{{\bm{\theta}}} - \tilde{{\bm{\theta}}} \| \right]$
and $U_2 = \mathbb{E}\left[ \| \optimal{{\bm{\theta}}} - \tilde{{\bm{\theta}}} \|^2 \right]$
capture the first and second order statistics of the model sensitivity.
\end{theorem}
\noindent The proof of the above theorem relies on Theorem \ref{thm:1} and
Corollary \ref{cor:2}, which provide bounds for the first and second
order statistics of the model sensitivity, and on the
properties of smooth functions.
Theorem \ref{thm:3} provides an upper bound on the
(individual) excessive risk. It shows the presence of three central
factors controlling this excessive risk: {\bf (1)} \emph{the gradient norm}
$\| \nabla_{\optimal{{\bm{\theta}}}} \ell(\bar{f}_{\optimal{{\bm{\theta}}}}(\bm{x}),y)\|$ for a sample $\bm{x}$,
{\bf (2)} \emph{the smoothness parameter} $\beta_{\bm{x}}$ associated with a sample $\bm{x}$,
and {\bf (3)} the \emph{model sensitivity} (captured by
terms $U_1$ and $U_2$).
As the paper shows next, these seemingly unrelated factors are
controlled \emph{indirectly} by two key data aspects: the samples
\emph{input norms} and their \emph{distance to the decision boundary}.
The rest of the section focuses on logistic regression models, however, as our experimental results illustrate, the observations extend to complex nonlinear models as well.
\subsection{The impact of the data input norms}
First notice that the norm $\| \bm{x} \|$ of a sample $\bm{x}$ strongly influences the quantities $U_1$ and $U_2$, as already observed by
Corollary~\ref{cor:1}. This aspect is further illustrated in
Figure \ref{fig:impact_norm_2_exp_diff} (left), which shows a strong
correlation between the input norms and the expected model sensitivity.
\begin{figure}[!tb]
\centering
\includegraphics[width=0.35\linewidth,height=100pt]{impact_input_norm_income.pdf}
\includegraphics[width=0.35\linewidth, height=100pt]{creditcard_corr_norm_accgap.pdf}
\caption{Credit-card data: Relation between input norms and model sensitivity (left)
and Spearman correlation between input norms and excessive risk (right). }
\label{fig:impact_norm_2_exp_diff}
\end{figure}
Thus, samples with higher input norms may have a nontrivial impact
to the model sensitivity and, in turn, to the private model disparate impacts.
\smallskip
Next, the following proposition sheds light on the relation between
the norm of a sample $\bm{x}$ and its associated gradient norm
$\| \nabla_{\optimal{{\bm{\theta}}}}\ell(\bar{f}_{\optimal{{\bm{\theta}}}}(\bm{x}),y)\|$.
\begin{proposition}\label{ex:grad_logreg}
Let $\bar{f}_{{\bm{\theta}}}$ be a logistic regression binary classifier
with cross entropy loss function $\ell( \bar{f}_{{\bm{\theta}}}(\bm{x}, y) ) =- y \log( \bar{f}_{{\bm{\theta}}}(\bm{x}))$.
For a given sample $(\bm{x}, y) \in \bar{D}$, the gradient
$\nabla_{\optimal{{\bm{\theta}}}}\ell(\bar{f}_{\optimal{{\bm{\theta}}}}(\bm{x}),y)$ is given by:
\begin{equation}
\label{eq:11}
\nabla_{\optimal{{\bm{\theta}}}}\ell(\bar{f}_{\optimal{{\bm{\theta}}}}(\bm{x}),y)
= (\bar{f}_{\optimal{{\bm{\theta}}}}(\bm{x}) -y \big) \bm{x}.
\end{equation}
\end{proposition}
\noindent
Recall that gradient norms have a proportional effect
on the upper bound of the excessive risk (Equation \eqref{eq:ER_ub}).
Notice further how applying the norm on both side of Equation \eqref{eq:11} illustrates the relation between the gradients and inputs norms.
Thus, the relation above sheds further light on the weight that samples with large norms may have in controlling their associated excessive risk.
This aspect can be appreciated in Figure \ref{fig:impact_norm_2_exp_diff} (right), which shows a strong correlation between these two quantities.
The result above can be generalized to multi-class classifiers, as shown in Appendix \ref{app:sec:input_norms}.
Finally, the discussion notes that the smoothness parameter $\beta_{\bm{x}}$
captures the local flatness of the loss function at a point $\bm{x}$.
A derivation of $\beta_{\bm{x}}$ for logistic regression classifier
is provided below.
\begin{proposition}\label{ex:hessian_logreg}
Consider again a binary logistic regression as in Proposition
\ref{ex:grad_logreg}. The smoothness parameter $\beta_{\bm{x}}$ for a
sample $\bm{x}$ is given by \cite{shi2021aisarah}:
$
\beta_{\bm{x}} = 0.25 \| \bm{x} \|^2.
$
\end{proposition}
\noindent
The above clearly illustrates the relationship between input norms $\|\bm{x} \|$ and
the smoothness parameters $\beta_{\bm{x}}$.
To summarize, propositions \ref{ex:grad_logreg} and \ref{ex:hessian_logreg}
illustrate that individuals $\bm{x}$ with large (small) input norms
tends to have large (small) gradient norm and smoothness parameters,
thus controlling the model sensitivity and, in turn, the excessive risk $R(\bm{x})$.
An extended analysis of the above claim is provided in Appendix \ref{app:exp_ext}.
\subsection{The impact of the distance to decision boundary}
As mentioned in the previous section, the flipping probability $p^{\leftrightarrow}_{\bm{x}}$associated with a sample $\bm{x} \in \bar{D}$ directly controls the model sensitivity $\mathbb{E}[ \| \optimal{{\bm{\theta}}} - \tilde{{\bm{\theta}}} \|]$. Beside the discussed factors, this section further studies which characteristics of sample $\bm{x}$ can causes it to have a high flipping probability.
Intuitively, samples close to the decision boundary are associated
to small ensemble voting confidence and vice-versa. To illustrate this
intuition the paper borrows the concept of \emph{closeness to
the decision boundary} from \citet{tran2021differentially}.
\begin{definition}[Closeness to decision boundary]
\label{def:dist_boundary}
Let $f_{{\bm{\theta}}}$ be a $C$-classes classifier trained using
data $\bar{D}$ with its true labels. The closeness to the decision boundary $s(\bm{x})$ is defined as:
$$ s(\bm{x}) \stackrel{\text{def}}{=} 1- \sum_{c=1}^C f_{{\bm{\theta}}, c} (\bm{x})^2,$$
where $f_{{\bm{\theta}},c}$ denotes the softmax probability for class $c$.
\end{definition}
\noindent The above, (together with Theorem 5 of \cite{tran2021differentially})
illustrate that large (small) $s(\bm{x})$ values are associated
to close (distant) projections of point $\bm{x}$ to the model decision boundary.
The concept of closeness to the decision boundary gives a way to indirectly quantify the flipping probability of a sample. Empirically, the correlation between the distance to decision boundary of sample $\bm{x}$ and its flipping probability $p^{\leftrightarrow}_{\bm{x}}$
is illustrated in Figure \ref{fig:corr_a_s} (left).
The plots are once again generated using a neural network with nonlinear objective and the relation holds for all datasets analyzed.
Notice the strong positive correlation between these two quantities. The plot indicates that the samples that are close to the decision boundary will have a higher probability of ``flipping'' their label, thus resulting in worse excessive risks. Finally, the proportional effect of the flipping probability on the excessive risks is illustrated in Figure \ref{fig:corr_a_s} (right).
Once again, the plot clearly illustrates that large flipping probabilities $p^{\leftrightarrow}_{\bm{x}}$ imply large excessive risks.
\begin{figure}[tb]
\centering
\includegraphics[width=0.35\linewidth, height=100pt]{corr_db_agreement_level_bank.pdf}
\includegraphics[width=0.35\linewidth,height=100pt]{corr_flip_prob_excess_risk_credit_card.pdf}
\caption{Credit-card data: Spearman correlation between the closeness
to decision boundary $s(\bm{x})$ and the flipping probability $p^{\leftrightarrow}_{\bm{x}}$ (left)
and relation between input norms and excessive risk (right).}
\label{fig:corr_a_s}
\end{figure}
\section{Mitigation solution}
\label{sec:mitigation}
The previous sections highlighted the presence of several algorithmic
and data-related factors which affect the disparate impact of the
student model.
A common role of these factors was their effects on the model
sensitivity $\mathbb{E}} \newcommand{\RR}{\mathbb{R}\| \optimal{{\bm{\theta}}} - \tilde{{\bm{\theta}}}\|$
which, in turn, is related with the excessive risk of different groups, whose difference we would like to minimize.
Motivated by these observations, this section proposes a mitigating
strategy that aims at reducing the sensitivity of the private model
parameters.
To do so, the paper exploits the idea of \emph{soft labels} (as
defined below).
When using the traditional voting process (denoted \emph{hard labels}
in this section), in low voting confidence regimes small
perturbations (aka additive noise) may significantly affect the result of the voting scheme.
Consider, for example, the case of a binary classifier where for a sample
$\bm{x}$, $\nicefrac{k}{2}+1$ teachers vote for label $0$ and
$\nicefrac{k}{2}-1$ for label $1$, for some even ensemble size $k$.
When perturbations are induced
to these counts to guarantee privacy, the process can report the incorrect
label ($\hat{y}=1$) with high probability.
As a results, the private student model parameters obtained from private training with hard labels can be sensitive to the noisy voting, and may deviate significantly from the non-private one.
This issue can be partially addressed by the introduction of soft labels:
\begin{definition}[Soft label]
\label{def:soft_labels} The \emph{soft label} of a sample $\bm{x}$ is:
$$ \bm{\alpha}(\bm{x})= \left( \frac{ \#_c(\bm{T}(\bm{x}))}{k}\right)^C_{c=1},$$
\end{definition}
and their privacy-preserving counterparts:
$$ \tilde{\bm{\alpha}}(\bm{x})= \left( \frac{ \#_c(\bm{T}(\bm{x})) +\mathcal{N}(0, \sigma^2)}{k}\right)^C_{c=1}.$$
\begin{figure}
\centering
\includegraphics[width=0.20\linewidth,height=80pt,valign=M]{expected_diff_norm_parkinsons.pdf}
\includegraphics[width=0.35\textwidth,height=130pt,valign=M]{mitigation_soft_labels_data_bank_K_40.pdf}
\includegraphics[width=0.35\linewidth,height=130pt,valign=M]{mitigation_soft_labels_data_parkinsons_K_40.pdf}
\caption{Training privately PATE with hard and soft labels:
Model sensitivity at varying of the privacy loss (left) on Parkinson dataset and excessive risk at varying of the privacy loss for Bank (middle) and Parkinson (right) datasets.
}
\label{fig:mitigation_solution}
\end{figure}
To exploit soft labels, the training step of the student model is
altered to use the following loss function:
\begin{equation}
\ell'(\hat{f}_{{\bm{\theta}}}(\bm{x}), \bm{\tilde{\alpha}}) = \sum_{c=1}^C \tilde{\alpha}_c \ell(f_{{\bm{\theta}}}(\bm{x}), c),
\end{equation}
which can be considered as a weighted version of the original loss function
$\ell(\hat{f}_{{\bm{\theta}}}(\bm{x}), c)$ on class label $c$, whose weight
is its confidence $\tilde{\alpha}_c $.
Note that $\ell'(\hat{f}_{{\bm{\theta}}}(\bm{x}), \bm{\tilde{\alpha}})
= \ell(\hat{f}_{{\bm{\theta}}}(\bm{x}))$
when all teachers in the ensemble chose the same label.
{The privacy analysis for this model is similar that of classical
PATE and is reported in Appendix \ref{app:privacy_analysis}}.
The effectiveness of this scheme is demonstrated in
Figure \ref{fig:mitigation_solution}.
The experiment settings are reported in details in the {Appendix} and reflect those described at the end of Section \ref{sec:roadmap}.
The left subplot shows the relation between the model sensitivity
$\mathbb{E}\left[ \| \optimal{{\bm{\theta}}} - \tilde{{\bm{\theta}}} \| \right]$
at varying levels of the privacy loss $\epsilon$ (dictated by the noise level
$\sigma$). Notice how the student models trained using soft labels
reduce their sensitivity to privacy when compared to the counterparts
that use hard labels.
The middle and right plots of Figure \ref{fig:mitigation_solution}
illustrate the effects of the proposed mitigating solution in terms
of utility/fairness tradeoff on the private student model.
The top subplots illustrate the group excessive risks $R(\bar{D}_{\leftarrow 0})$
and $R(\bar{D}_{\leftarrow 1})$ associated with {minority (0) and majority (1)
groups} while the bottom subplot illustrate the accuracy of the model
at increasing values of the privacy loss $\epsilon$.
Notice how soft labels can reduce the disparate impacts in private
training (top), which consistently reduces the difference in excessive risks
between two groups, suggesting an improvement in fairness.
Finally, notice that while fairness is improved there is seemingly no
cost in accuracy. On the contrary, using soft labels produces comparable
or better models to the counterparts produced with the hard labels.
Additional experiments, including illustrating the behavior of the
mitigating solution at varying of the number $k$ of teachers are
reported in the appendix and the general message is consistent with
what described above.
Finally, an important benefit about the proposed solution is that it \emph{does not} require the protected group information ($a \in \cA$) to be part of the training data. Thus, it is applicable in challenging situations when it is not feasible to collect or use protected features (e.g., under the General Data Protection Regulation (GDPR) \cite{lahoti2020fairness}).
\emph{These results are significant. They suggest that this mitigating
solution can be an effective strategy for improving the disparate impact of private model ensembles without sacrificing accuracy.}
\section{Discussion}
We note that the proposed mitigating solution relates to
concepts explored in robust machine learning. In particular,
\citet{papernot2016distillation} noted that training a classifiers
with soft labels can increase its robustness against adversarial samples.
This connection is not coincidental. Indeed, the model sensitivity
is affected by the voting outcomes of the teacher ensemble (Theorems \ref{thm:1} and \ref{thm:3}).
Similarly to robust ML models being insensitive to input perturbations, strongly agreeing ensemble will be less sensitive to noise and vice-versa.
Finally, we notice that the use of more advanced voting schemes, such as the interactive GNMAX \cite{papernot2018scalable}, may produce different fairness results. While this is an interesting avenue for extending our analysis, sophisticated voting schemes may introduce sampling bias (e.g., interactive GNMAX may exclude samples with low ensemble voting agreement). Such bias may trigger some nontrivial unfairness issues on its own.
\section{Conclusions}
This work was motivated by the recent observations regarding the
effects of differential privacy to the disparate impacts of machine
learning models. The paper introduced a notion of fairness that relies
on the concept of excessive risk and analyzed this notion in the
Private Aggregation of Teacher Ensembles (PATE) \cite{papernot2018scalable},
an important privacy-preserving machine learning framework used in
semisupervised settings or when one wishes to protect the data
labels.
This paper isolated key components related with the algorithms parameters
and the public training data characteristics which are responsible
for exacerbating the disparate impacts, it studied the factors affecting
these components, and introduced a mitigation solution.
Given the increasing presence of privacy-preserving data-driven algorithms
in consequential decisions, we believe that this work may represents an
important and broadly applicable step toward understanding the sources
of disparate impacts observed in differentially private learning systems.
\bibliographystyle{abbrvnat}
| {'timestamp': '2021-09-20T02:20:34', 'yymm': '2109', 'arxiv_id': '2109.08630', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08630'} | arxiv |
\section{Introduction}
\vspace{-8pt}
The rapid evolution of digital technologies, including mobile communications, cloud computing infrastructures, and distributed applications, has created an extended impact on society while also enabling the establishment of novel eGovernance models. The need for an inclusive eGovernance model with integrated multi-actor governance services is apparent and a key element towards a European Single Market. Digital Transformation of public services can remove existing digital and physical barriers, reduce administrative burdens, enhance governments' productivity, minimize the extra cost of traditional means to increase capacity, and eventually improve the overall quality of interactions with (and within) public administrations.
eGovernance includes novel and digital by default public services aiming for administrative efficiency and minimization of bureaucratic processes, enabling open government capabilities, behavior and professionalism, improved trust and confidence in governmental transactions. Towards the modernization of public services, public administrations need to transform their manual business flows and upgrade their existing internal processes and services.
However, the digitization of eGovernance services has also expanded the attack surface, thus making them attractive to malicious third parties. In 2017 the National Health Service of the United Kingdom suffered from the WannaCry ransomware, which resulted in missed appointments, deaths, and fiscal costs \cite{ghafur2019retrospective}. Recently, in May 2021 the American oil pipeline system suffered a ransomware cyberattack that impacted all the computerized equipment managing the pipeline. The company paid a ransom of 75 Bitcoins, approximately \$5 million, to the hackers in exchange for a decryption tool which eventually proved so slow that Colonial's own backups were used to bring the system back to service \cite{oxford2021efforts}.
As the need for privacy-preserving and secure solutions in eGovernance services is imminent, our decentralized solution, namely GLASS, moves towards that direction by examining the effectiveness and efficiency of distributed cutting edge technologies, demonstrating the capacity of a public, distributed infrastructure, based on the InterPlanetary File System (IPFS). Our contributions can be summarised as follows:
\vspace{-8pt}
\begin{itemize}
\item We analyze the threat landscape in the context of an eGovernance use case.
\item We create a distributed testbed environment based on IPFS and detail our methodology.
\item We analyze and critically evaluate the runtime performance of our implementation.
\end{itemize}
\vspace{-8pt}
The structure of the rest of the paper is organized as follows: Section 2 builds the background on distributed models and presents the related literature, while Section 3 details the GLASS architecture while briefly explaining the threat landscape in the context of an eGovernance services use case scenario. Section 4 consists of our methodology and implementation used to conduct the main experimental activity of our work, while Section 5 presents and evaluates the performance results of our experimental activity. Finally, Section 6 draws the conclusions, giving some pointers for future work.
\vspace{-16pt}
\section{Background and Related Literature}
\vspace{-12pt}
\subsection{Kademlia}
\vspace{-8pt}
In 2001 Maymounkov and Mazières published Kademlia, a Distributed Hash Table (DHT) that offered multiple features that were currently not available simultaneously in any other DHT \cite{xor-metric}. The paper introduced a novel XOR metric to calculate the distance between nodes in the key space and a node Id routing algorithm that enabled nodes to locate other nodes close to a given target key efficiently. The presented single routing algorithm was more optimal compared to other algorithms such as Pastry\cite{pastry}, Tapestry\cite{tapestry} and Plaxton\cite{Plaxton} that all required secondary routing tables. Kademlia was outlined as easily optimised with a base other than 2 with no need for secondary routing tables. The k-bucket table was configured so as to approach the target \(b\) (initial implementation was b = 5 ) bits per hop. With one bucket being used for nodes within distance range of \([j2^{160-(i+1)b)}, (j+1)2^{160-(i+1)b}]\) from the initial node for each \(0 < j < 2^{b}\) and \(0 \leq i < 160/b\) based on a SHA1 160 bit address space. At any point, it is expected that there would be no more than \((2^{b} - 1)log_{2^{b}}\) buckets with entries. The k-buckets were described as being resistant to certain DoS attacks \cite{xor-metric} due to the inability to flood the system with new nodes, as Kademlia only inserts new nodes once old ones leave.
In 2008 Baumgart and Mies introduced S/Kademlia \cite{S/Kad} which offered several further security enhancements designed to improve on the original specification. They examined various attacks that peer-to-peer networks were vulnerable to and offered practical solutions to protect against them. The key attacks identified by them were:
a) Eclipse Attack, b) Sybil Attack, and c) Adversarial Routing. In 2020 Prünster et al. \cite{eclipse} highlighted the need for further implementation of S/Kademlia mitigations by demonstrating an effective eclipse attack. They were able to generate a large number of ephemeral identities and poison multiple nodes routing tables for very little expense, and \textit{CVE-2020-10937} was assigned to the demonstrated attack.
\vspace{-16pt}
\subsection{IPFS}
\vspace{-8pt}
The InterPlanetary File System (IPFS) is a distributed system based on a peer-to-peer protocol that provides public data storage services to transform the web into a new decentralized and more efficient tool. Its primary purpose is to replace the HTTP protocol for document transactions by solving HTTP's most limiting problems like availability, cost, and centralization of data in data centers.
IPFS is based on a Merkle Directed Acyclic Graph (DAG) \cite{Kothari_2019}, the data structure to keep track of the location its data chunks are stored and the correlation between them. Each data block has a unique content identifier (CID) fabricated by hashing its content in this peculiar data structure. In case the content of a node's child changes, the CID of the parent node changes as well. For someone to access a file, knowing its unique Content Identifier, constructed by the hash of the data contained within it, is essential. Each participating node (user) keeps a list of the CIDs it hosts in a Distributed Hash Table (DHT) implemented using the Kademlia protocol \cite{10.1007/3-540-45748-8_5}. Each user ``advertises'' the CIDs they store in the DHT, resulting in a distributed ``dictionary'' used for looking up content. When a user tries to access a specific file, IPFS crawls the DHTs to locate the file by matching the unique content identifier. Using content-based addressing instead of location-based addressing serves in preventing saving duplicate files in the network and tracking down a file by its content rather than by its address.
IPFS enables its users to store and distribute data globally in a secure, resilient and efficient way. Each file uploaded on IPFS is fragmented into chunks of 256Kb and hashed before being scattered in participating nodes around the globe. Following the aforementioned methodology, data integrity is ensured since no one can tamper with a data block without affecting its unique hash. Furthermore, data resilience is ensured by placing the same data block in more than one participating node.
Mukne et al. \cite{8944471} are using IPFS and Hyperledger Fabric augmented to perform secure documentation of land record management. Andreev and Daskalov \cite{Andreev2018} are using IPFS to keep students’ personal information off-chain in a solution that manages students’ data through blockchain. Singh \cite{phdthesis2018} created an architecture for open government data where proof-of-concept uses Ethereum for decentralized processing and BigchainDB and IPFS for storage of large volumes of data and files, respectively.
\vspace{-20pt}
\subsection{Distributed ledger}
\vspace{-10pt}
A Distributed Ledger is a distributed database architecture that enables multiple members to maintain their own identical copy of information without the need for validation from a central entity while ensuring data integrity. Transaction data are scattered among multiple nodes using the P2P protocol principles and are synchronized simultaneously in all nodes.
By providing Identification Management through DLTs, it is ensured that the user has control of their identity records since the information is stored publicly on the ledger instead of the systems of a central authority. Furthermore, since editing information on past transactions on a blockchain system is not supported, protection against unauthorized alteration of the identity records is established. Finally, having a single record of identity information that the user can utilize on multiple occasions minimizes the data duplication on multiple databases \cite{Dunphy2018AFL}.
The second generation of blockchain technologies introduced the smart contracts that act as mini-programs used to automate code deployment when some pre-defined terms are met.
Our solution, GLASS, combines the advantages of IPFS with those offered by the Distributed Ledgers and Smart Contracts, thus creating a distributed scalable and secure eGovernance infrastructure. Moving towards the first steps of our implementation, we create an IPFS based testbed environment and empirically evaluate its runtime performance.
\vspace{-16pt}
\section{Architecture}
\vspace{-12pt}
We propose a combination of IPFS with Distributed Ledger and Smart Contracts which are proven to be beneficial for recording massive volumes of transactions. Extracting helpful information efficiently has significant computational challenges, such as analysing, aggregating, visualising, and storing data collected in distributed ledgers. More specifically, the volume and velocity of the data make it difficult for typical algorithms to scale while querying the ledger might come at high computation costs. State-of-the-art efforts seek to introduce new models that deal with such large-scale, distributed data queries to reduce data volume transferred over the network via adaptive sampling that maintains certain accuracy guarantees \cite{trihinas2017admin}. As the ledgers (and thus the data) keep getting bigger, a challenge is to make sense of the collected data for the users and perform analytics leveraging big data processing engines (i.e., Spark) that can deliver results quickly and efficiently. In order to adequately protect data resources, it is paramount to encrypt data in such a way that no one other than intended parties should be able to get the original data. The current practice compared to our approach can be seen in Figure~\ref{fig:practice_comparison}.
\begin{figure}[!h]
\centering
\makebox[\textwidth][c]{\includegraphics[width=1.2\textwidth]{images/practice_comparison.png}}
\caption{Current practice compared to our approach \cite{domalis2021trustable}}
\label{fig:practice_comparison}
\vspace{-5pt}
\end{figure}
A simple use case presenting a European Union's citizen, Alice, getting a job abroad from Greece to another member state, Portugal, using GLASS ecosystem, is presented in Algorithm~\ref{alice_portugal}.
\vspace{-16pt}
\setlength{\textfloatsep}{0pt
\begin{algorithm}[h!]
\caption{Alice getting a job to Portugal}
\begin{spacing}{1.2}
\begin{algorithmic}[1]
\STATE Starting from Greece, Alice finds a vacant job position in Portugal. She applies for the job, and thankfully she gets hired.
\STATE In Portugal, she has to deal with a series of bureaucratic processes (ID card, social security number, open a bank account).
\STATE To obtain a Portuguese Residence title, rent an apartment and open a bank account, Alice needs to present at least a validated ID documentation, birth certificate, nationality certification validated by a Greek Authority and proof that she works in Portugal.
\STATE Adopting the GLASS solution, Alice can request the proof of ID and the validated data from the Ministry of Digital Governance (MoDG).
\STATE The MoDG can issue the document, and after Alice's permission, the document can be forwarded to the Ministry of Justice (MoJ).
\STATE After this transaction is completed, Alice can access and securely share her Portuguese social security number through her Wallet.
\STATE Then Alice's employer in Portugal can directly get the validated social security number from the MoJ, after her approval, to register her credentials to their internal payroll system.
\STATE Using a decentralized application of the GLASS ecosystem, Alice can use her validated digital identity to request remotely the required documentation from the respective Greek Authority (MoDG), the Portuguese authority (MoJ) and her employer.
\STATE MoDG can digitally issue and validate the documentation and transmit the encrypted data into the distributed network while the transaction among the users is being recorded.
\STATE All the transactions, including requests, notifications, and permissions, can be monitored and stored, protecting Alice's (and each participant's) privacy.
\end{algorithmic}
\end{spacing}
\label{alice_portugal}
\end{algorithm}
\subsection{Threat Landscape}
\vspace{-8pt}
Distributed file systems, such as IPFS, need to solve several challenges related to the security and privacy of the stored data, the infrastructure's scalability, the decentralized applications and big data complexities. However, there is a number of promising solutions that aim to settle some of these hurdles.
\vspace{-12pt}
\subsubsection{Security and privacy challenges}
The key challenge of distributed file systems, including IPFS, is that when new peers participate in the system, they can access any stored file, including sensitive documents. Hence, the security and privacy of the system remain an open question, especially due to General Data Protection Regulation (GDPR) \cite{voigt2017eu} in the European Union. A prominent solution to that is the application of smart contract-based Access Control (AC) policies \cite{barati2021design,huang2020bridge,papadopoulos2020privacy,stamatellis2020privacy}, and further encryption mechanisms \cite{wang2018blockchain}.
Another security and privacy challenge is related to file erasure. By their nature, distributed file systems distribute all the stored files and documents among their participating peers. Hence, when data owners transmit ``erasure commands'' to the distributed network, it is not clear if all the peers would obey this command and delete their version of the ``deleted'' file or document. A solution to this data replication issue can be a common technique commonly present in data centers \cite{plank1997tutorial,huang2020blockchain}.
\vspace{-18pt}
\subsubsection{Scalability Challenges}
Since GLASS aims to create an eGovernance framework to be followed by all European Union's member states, the infrastructure's scalability poses a real threat. According to \cite{wennergren2018transparency,shen2019understanding}, one of the scalability issues on IPFS is the bandwidth limit in each IPFS instance due to the peer-to-peer nature of the system. Each participant needs to connect to another IPFS node to read or download the data objects. \cite{nyaletey2019blockipfs} proposed a combination of IPFS and blockchain technology, namely BlockIPFS, to improve the traceability of all the occurred access events on IPFS. The authors measured the latency of each event, such as storing, reading, downloading, by varying the number of IPFS nodes and presented that even incorporating large numbers of IPFS nodes does not significantly improve the latency of all the IPFS actions. However, the authors' experiments were limited to a maximum of 27 nodes; hence, the latency measurement on a vast scale remains an open question.
For the storage optimisation, two prominent solutions can be applied:
\vspace{-7pt}
\begin{itemize}
\item \textbf{Storing data off-chain} \cite{norvill2018ipfs,poon2017plasma,poon2016bitcoin}. The concept of utilising smart contracts off-chain and use IPFS as a storage database has been presented by some works. This solution is storage efficient since the IPFS nodes need to exchange only hash values of the data.
\item \textbf{Utilize erasure codes} \cite{rizzo1997effective,wilkinson2014storj,vorick2014sia}. In erasure codes, a file is divided into smaller batches and these batches are encoded. Following that, each batch can be decoded and reconstruct the full file. \cite{chen2017improved} utilized erasure codes in a scenario combining blockchain and IPFS.
\end{itemize}
\vspace{-20pt}
\subsubsection{Decentralized applications complexities}
Multiple novel decentralized applications have already been developed on top of IPFS, with luminous examples, a music streaming platform, and an open-access research publication repository \cite{jia2016opus,tenorio2019towards}. Distributing seemingly centralized applications offer multiple advantages, such as rewarding the creators of music or research publications directly without involving any trusted intermediaries and is feasible with the assistance of blockchain technologies \cite{truong2021blockchain}.
Within the GLASS ecosystem, it is critical to clearly define where these decentralized applications would be developed and executed to avoid obstacles due to the complexities of the underlying technologies. A potential solution is to carry out the execution of the decentralized applications off-chain \cite{truong2021blockchain}, similarly to other popular decentralized applications ecosystems, such as Blockstack \cite{ali2020stacks}.
\vspace{-25pt}
\section{Methodology and Implementation}
\vspace{-14pt}
IPFS uses Libp2p\footnote{Lib2p: https://github.com/libp2p/js-libp2p} as it's base. Originally Libp2p was part of the IPFS project but has since become standalone. It provides all of the transport abstractions and the Kad-DHT functionality. The main release is written in Go, with ports to Rust and JavaScript. To look at the implementation of the DHT, JavaScript was chosen as it natively would not rely on a multi-threading approach but instead asynchronous I/O and an event-driven programming model.
For small scale local testing of the DHT, a simple Libp2p node was created 40 times\footnote{Code can be found at: https://github.com/aaoi990/ipfs-kad-dht-evaluation} to listen on the host, and the port will differentiate each node. The DHT configuration \footnote{DHT configuration: https://github.com/libp2p/js-libp2p-kad-dht} is the standard recommended Libp2p Kad-DHT configuration with all standard defaults applied. The exception being the DHT random walk – which is not enabled by default but does allow for random host discovery. The connection encryption used is Noise protocol. \footnote{Noise Protocol: https://noiseprotocol.org/}
When a new node is initialized, it knows no peers. Typically in IPFS, this issue is solved by bootstrapping the node – providing it with a set of long-serving core nodes that have fully populated routing tables ready to share. In this case, to provide some basic routing entries, the initial node is populated by the address of the next created node, ensuring that each node knows of at least one other but only the next node. Although enabled, the random walk would be an untenable solution to peer discovery in such a small set of nodes given that the Libp2p implementation of the random walk involves dialling a random peerId created from a sha256 multi hash of 16 random bytes.
The last node initialized is then chosen to host the content. To transform the content into a CID, it is first hashed with the standard sha256 algorithm, and then a multi hash is created from this. As we are using CIDv0, the multi hash is then base 58 encoded (CIDv1 is base 32 encoded)and provided to the js-cids library to create the CID.
Once the CID is created, the final node starts providing it to the network. The content routing class of the Kad-DHT will then distribute the pointer to the nodes closest to the key itself. Each node DHT will then begin searching for other nodes and populating its routing table entries. The peer discovery process is best witnessed by examining the debug log for the Kad-DHT by starting the program with the following: \verb|DEBUG="libp2p:dht:*" node index.js|
Each instance of the Kad-DHT is initialized with an instance of the Providers class that manages all known providers – a peer known to have the content for a given CID. The providers class is initialized with an instance of the datastore, which houses the records of providers in the format of a key-value pair, with the key being created from the array of the CID and PeerID and the value being the time the record was entered into the store.
When the class is created, it spawns its own cleanup service. The service is a set interval clean up that runs and keeps the list of providers healthy. It is important to note at this point that although a list of providers are stored in the datastore, to ensure access is fast, there is an LRU (least recently used) cache in front of it which speeds up the process of not only cleaning up expired providers but accessing active ones as well. The default constant for the LRU size is 256, and the default cleanup interval is one hour. The cleanup service retrieves all provider entries from the datastore, checks the time of entry against the current time, and batch deletes any which have been in the store for longer than the one-hour window.
The getClosestPeers query is a direct query of the peers taken from the DHT's RoutingTable class, which is responsible for managing the kBuckets. The query looks through all nodes in the kBuckets and returns the closest 20 (as the default bucket size in IPFS is 20). Libp2p uses the javascript implementation k-bucket \footnote{K-bucket: https://github.com/tristanls/k-bucket} to handle the management of the buckets. The function does a raw calculation of the XOR distances by comparing each PeerId in the bucket as a unit8aray to the CID as a uint8array and then orders them from nearest to furthest.
With a populated routing table, it is now possible to query the network to find any provider of the created CID. In this instance, the very first initialised node – who only had contact details for the second initialised node – can query the DHT using the built-in \textit{findProviders} function. The result of the promise is an array containing the details of any node providing the requested content. More details on the system's configuration can be found in Appendix A.
\vspace{-16pt}
\section{Evaluation}
\vspace{-32pt}
\begin{figure}[!h]
\centering
\makebox[\textwidth][c]{\includegraphics[width=1.0\textwidth]{images/flame_dht.png}}
\caption{All processes - With Kad-DHT processes shown in green}
\label{fig_approach}
\vspace{-26pt}
\end{figure}
To evaluate the runtime performance of the JavaScript implementation of the Kad-DHT, we can examine the flame graph of the running processes. Figure 2 shows the performance of the entire program from start to finish. Each rectangle represents a stack frame, with the y-axis showing the number of frames on the stack – the stack depth. The bottom of each icicle shows the function on-CPU, with everything above it being the function ancestry. The x-axis spans the entirety of the sample population grouped alphabetically. The total width of each rectangle is the total time it was on-CPU or part of the ancestry that was on-CPU; the wider the rectangle, the more CPU consumed per execution. It is worth noting that time is not represented in flame graphs. The Graphs and the logs used to generate them can be found in the corresponding git repo\footnote{Code can be found at: https://github.com/aaoi990/ipfs-kad-dht-evaluation/tree/main/perf}.
\vspace{-30pt}
\bgroup
\def\arraystretch{1.3}
\begin{table}
\centering
\caption{CPU time by package based on Fig.~\ref{fig_approach}.}
\setlength{\tabcolsep}{3.2mm}
\begin{tabular}{|c c c|}
\hline
\textbf{Package} & \textbf{Function} & \textbf{Percentage} \\
\hline
libp2p-noise & performXXhandshake & 28.9\\
libp2p-noise & exchange & 18.87\\
libp2p-noise & finish & 10.07\\
peer-id & createFromPubKey & 4.86\\
libp2p & encryptOutbound & 2.43 \\
libp2p & encryptInbound & 2.005\\
\hline
\end{tabular}
\vspace{-25pt}
\end{table}
\egroup
Figure 2 illustrates that unsurprisingly the vast majority of CPU usage was spent in the crypto functions, either performing handshakes between nodes or in the functions that support the key generation process.
\vspace{-20pt}
\begin{figure}[!h]
\centering
\makebox[\textwidth][c]{\includegraphics[width=1.0\textwidth]{images/flame_inner_dht.png}}
\caption{Some of the Kad-DHT specific processes}
\label{fig_approach2}
\vspace{-22pt}
\end{figure}
The key generation for a basic Libp2p2 node is a base64 encoded string of a protobuf containing a DER-encoded buffer. A node buffer is then used to pass the base64 protobuf to the multi hash function for the final PeerId generation. By default, the public key is 2048 bit RSA. As suggested in the security improvements in \cite{S/Kad}, peerId generation should be an expensive process in order to mitigate the ease of performing Sybil attacks, and although it was expensive compared to the overall effort of the program, this was primarily because of the default usage of RSA. If EC had been used as per CVE-2020-10937 \cite{eclipse}, the CPU overhead would have been significantly lower. Figure 3 illustrates one of the full stack depths with Kad-DHT ancestry.
\vspace{-28pt}
\bgroup
\def\arraystretch{1.3}
\begin{table}
\centering
\caption{CPU time by DHT component based on Fig. 3.}
\setlength{\tabcolsep}{3.2mm}
\begin{tabular}{|c c c|}
\hline
\textbf{Package} & \textbf{Function} & \textbf{Percentage} \\
\hline
network & writeReadMessage & 1.08\\
worker-queue & processNext & 0.87\\
peer-routing & closerPeersSingle & 0.4 \\
routing & add & 0.1 \\
index & nearestPeersToQuery & 0.1 \\
\hline
\end{tabular}
\vspace{-41pt}
\end{table}
\egroup
\begin{figure}[!h]
\centering
\makebox[\textwidth][c]{\includegraphics[width=1.0\textwidth]{images/flame_dht_1_hour.png}}
\caption{Kad-DHT processes over an one-hour window}
\label{fig_approach3}
\vspace{-18pt}
\end{figure}
Overall the Kad-DHT functions occupied a very low percentage of the CPU time, consistently presenting at less than 3.00\%, with the highest usage coming from network functions. The test code being run is a simple start – provide – find – stop sequence, meaning the bulk of the work is being done to configure, connect and route the nodes. It is expected that the longer the program runs, the greater percentage of time the Kad-DHT functions would occupy due to the routing table maintenance functions. During normal operations, the Kad-DHT will force a refresh every 10 minutes by default. During this, each bucket is gone through - from bucket 0 up until the highest bucket that contains a peer (currently capped at 15). A random address from the address space that could fit in the chosen bucket is then selected, and a lookup is done to find the k closest peers to that random address. This constantly ensures that each bucket is filled with as many peers that will fit. Figure 4 results from timing the original code to run for an one-hour window, enabling multiple routing table refreshes. In the timed run, Kad-DHT functions accounted for 11.58\% of CPU usage up from the initial program run of 2.55\%, which is a 354\% increase in the amount of time spent in functions with Kad-DHT ancestry.
\vspace{-16pt}
\section{Conclusions}
\vspace{-12pt}
eGovernance presents unique challenges in terms of privacy-preserving and providing secure solutions in eGovernance services. Precisely when the utilized data is derived from industrial control systems and sensors. In this paper, we present GLASS, our decentralized solution, that moves towards that direction by examining the effectiveness and efficiency of distributed cutting-edge technologies and demonstrates the capacity of a public, distributed infrastructure based on the InterPlanetary File System (IPFS).
One practical implementation of the GLASS concept is being done within the aims of the GLASS project, highlighting how the GLASS concept can potentially be integrated into a broad field of use cases. Our proposed GLASS-oriented approach is a decentralized solution that combines the InterPlanetary File System (IPFS) with Distributed Ledger Technology and Smart Contracts to secure eGovernance services. We show in this paper how our approach can be used to fulfil the needs of the GLASS concept. Finally, and on top of the above, we created a testbed environment to measure the IPFS performance.
\vspace{-12pt}
\section*{Acknowledgments}
\vspace{-8pt}
The research leading to these results has been partially funded by the European Union's Horizon 2020 research and innovation programme, through funding of the GLASS project (under grant agreement No 959879).
\vspace{-16pt}
\bibliographystyle{splncs}
| {'timestamp': '2021-09-20T02:18:41', 'yymm': '2109', 'arxiv_id': '2109.08566', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08566'} | arxiv |
\section{Introduction}
\label{sec:intro}
\begin{figure*}
\vspace{-0.2cm}
\includegraphics[width=.9\textwidth]{figures/fig_2_generation.jpg}
\caption{\textbf{Diverse Single Video Generation:} Given an input video (red), VGPNN is able to generate similarly looking videos (blue) capturing both appearance of objects as well as their dynamics. Note the high quality of our generated videos. Please watch the full resolution videos in the supplementary material.}
\label{fig:generation_examples}
\end{figure*}
Generation and editing of natural videos remain challenging, mainly due to their large dimensionality and the enormous space of motion they span. Therefore, the tremendous recent advances in image generation cannot be readily applied to the video domain. The most common modern framework is training generative models on a large collection of videos. Such methods (e.g., \cite{vondrick2016generating, aigner2018futuregan}) can typically produce high quality results only for a limited class of videos such as face expressions (e.g., \cite{tulyakov2018mocogan}) or robot hand movement (e.g., \cite{denton2018stochastic}), and cannot be applied to arbitrary videos.
On the other side of the spectrum, \emph{single} video generative models have recently emerged \cite{gur2020hierarchical, arora2021singan}. These methods learn a generative video model from a single input video, in an unsupervised manner. As such, they learn the distribution of space-time patches within the single input video and are then able to generate a plethora of new videos with the same patch distribution.
However, single video GANs suffer from some heavy disadvantages - it takes days to train for each input video, thus making them applicable to only very small resolution and video length. They are also prone to optimization issues such as mode collapse, which often lead to poor visual quality and noticeable visual artifacts. These shortcomings render existing single-video methods impractical and unscalable.
Synthesizing and editing video content by modeling the distribution of space-time patches in a single video dates back to classical, pre-deep learning methods. These classical methods are based on optimization over space-time patches, which extended 2D patch-based methods to cope with videos, and demonstrated impressive results for various applications such as video summarization, video completion, and video texture synthesis. However, due to the intense computation required for working with space-time patches within a single video, these methods require long runtime and have been limited to low resolution and short videos.
We present a fast and practical method for video generation and manipulation from a single video, which generates \emph{diverse} high-quality video outputs within seconds/minutes (depending on the video size), and can be applied to high resolution (Full-HD) videos.
Our approach is inspired by the recent generative patch nearest neighbors approach, GPNN~\cite{granot2021drop}, which was shown to significantly outperform single-image GANs, both in run-time and in visual quality.
Here, we generalize this approach from images to videos, by casting classical space-time patch-based methods as a new \emph{generative video model}.
That is, given a single input video, our Video-Based Generative
Patch Nearest Neighbors (\textbf{VGPNN}) method can generate many random novel video outputs, all of which match the distribution of space-time patches of the original video.
Adapting GPNN to the realm of videos includes efficiently coping with the huge number of space-time patches in a single video, and also utilizing the temporal information in videos.
On the computational aspect, a na\"ive extension of GPNN from images to videos is prohibitive in both run time and memory consumption. To this end we extend PatchMatch~\cite{barnes2009patchmatch}, an efficient approximate nearest-neighbor search method, to search in a globally-weighted patch similarity space (we call our extension \emph{WeightedPatchMatch}). To our surprise, the approximated nearest neighbor field resulting from PatchMatch could still produce high quality results, while reducing generation run time by many orders of magnitude.
Thus, VGPNN makes diverse video generation from a single video realistically possible for the first time.
Our VGPNN results outperform single-video GANs, across all measures. Most of all, the runtime is incredibly reduced, from the impractical length of roughly 8 days to about 18 seconds for a $13 \times 144 \times 256$ video on a Quadro RTX 8000 GPU. This makes single video generative models practical for the first time. Beyond our main task of diverse, unconditional generation of videos, our framework gives rise to various classical and new video synthesis and manipulation applications including: spatio-temporal video retargeting (e.g., video extension \& video ``summarization''), video structural analogies, sketch-to-video, \emph{conditional} video-inpainting, and more, all produced with the same unified framework.
Some applications are schematically illustrated in Figs.~\ref{fig:teaser} and \ref{fig:generation_examples}. Full videos and many more results can be found in the supplementary material.
\hspace{0.4cm}
\noindent Our contributions are therefore several fold:
\begin{itemize} [topsep=0pt,itemsep=-1ex,partopsep=1ex,parsep=1ex]
\item VGPNN is the first single-video generative model that is scalable to high resolution (spatial or temporal).
\item We cast classical space-time patch nearest neighbor methods as a \emph{generative} video model.
\item We non-trivially adapt the patch-nearest-neighbor approach to video, making it affordable and practical. In particular, we present \emph{WeightedPatchMatch}, an extension of PatchMatch, that can handle per-patch global information.
\item Our approach can be used to a variety of new video applications, all within a single unified framework. These include diverse generation, spatio-temporal retargeting, sketch-to-video, and video structural analogies.
\end{itemize}
\section{Related work}
Synthesis and manipulation of videos is mostly done by generative models trained on large collections of videos.
The most common approach for unconditional video generative models is an extension of GAN \cite{goodfellow2014generative} to videos; \cite{vondrick2016generating, tulyakov2018mocogan, aigner2018futuregan, wang2021inmodegan}. There are also many GAN based methods for video-to-video translation \cite{wang2018video, wang2019few, mallya2020world, wang2020imaginator}. Another approach is by using GANs for images but predicting paths in the latent space \cite{saito2017temporal,lee2018stochastic}. A very common technique is considering the video as a sequence of frames and autoregressively predicting the next frame each time \cite{ballas2015delving,villegas2017decomposing, babaeizadeh2017stochastic, denton2018stochastic, villegas2018hierarchical, villegas2019high, aksan2019stcn, franceschi2020stochastic}.
All of these require lots of data to pre-train on, and can only generate videos from the same domain they were trained on.
Some video editing applications were demonstrated before deep-learning gained popularity. One such application is video retargeting or summarization \cite{rav2006making, rubinstein2008improved, wolf2007videoretarget, krahenbuhl2009disney, gygli2014creating, simakov2008summarizing}.
\cite{schodl2000video} considered 3D video textures and were able to synthesize them by statistical modeling. A similar, modern and very impressive approach by \cite{holynski2020animating} combined this rational with deep networks.
Some classical methods were based on optimizing similarity of space-time patches \cite{simakov2008summarizing, wexler2004space}. These were extensions of approaches mainly used for images ~\cite{efros1999texture,simakov2008summarizing}. As such, while performing reasonably on images in terms of runtime and memory, their extension to video is hardly scalable (hours for editing a single video).
Within the field of ``Deep Internal Learning" \cite{shocher2018zero, gandelsman2019double,zhang2019zero,zuckerman2020across,zhang2019internal,ghosh2020depth,ulyanov2018deep}, Deep Single-Image Generative Models have emerged.
These models train a GAN on a single image, in an unsupervised manner, and have shown to produce impressive results for image synthesis and manipulation tasks.
Being fully convolutional, these single-image GANs learn the patch distribution of the single input image, and are then able to generate a plethora of new images with the same patch distribution. These include SinGAN~\cite{shaham2019singan} for generating a \emph{large diversity} of different image instances -- all sampled from the input patch distribution, InGAN~\cite{shocher2018ingan} for flexible image retargeting, Structural-Analogies~\cite{benaim2021structural}, texture synthesis~\cite{jetchev2016texture,bergmann2017learning,zhou2018non, zhao2021solid}, and more~\cite{hinz2021improved,mastan2020dcil,mastan2021deepcfl,gur2020hierarchical,vinker2020deep,lin2020tuigan, chen2021mogan}. Single image GANs suffer from long training time per image, artifacts and mode collapse.
Recently, this approach was extended to single-video GANs. In the video domain, the main goal is to generate novel instances but with the same content as in the reference video.
\cite{arora2021singan} extends \cite{shaham2019singan} to video in a straightforward manner, by employing 3D (space-time) convolutions. \cite{gur2020hierarchical} Combines Variational Auto Encoders for the coarse scales, thus preventing mode collapse, with GANs for the fine scale to achieve improved quality. The single-input GANs shortcomings are significantly amplified in the video variants. The runtime is disproportionately increased (to several days per small input video) and the quality is reduced. Many unrealistic artifacts usually appear. Moreover, these methods only handle very short low-resolution videos and are unscalable. We argue that training for days, for each input and each task, only for short low-resolution videos can not be considered as a real solution.
A new practical solution in the image domain was recently introduced by \cite{granot2021drop}. They observed that ``good-old'' patch-based methods are superior in many aspects to single-image GANs. They suggested to reconsider simple patch nearest neighbors again, but cast them as a generative model that when given a single image can generate many diverse outputs. This approach significantly outperforms the GAN based methods, as well as older classical patch-based methods. The quality of the images is much better and the runtime is reduced dramatically.
\section{Method}
\label{sec:method}
Our goal is to make diverse video generation based on a single video possible.
By ``diverse'' we mean 3 things: (i)~diverse output samples from a single input video; (ii)~diverse natural dynamics (i.e., not restricted to a specific training video dataset, or specific type of video dynamics); (iii)~diverse set of applications within a single unified computational framework.
In order to capture both spatial and temporal information of a single video, VGPNN starts by building a spatio-temporal pyramid and operates coarse-to-fine to capture the internal statistics of the input video at multiple scales (Fig.~\ref{fig:method_pyramid}). Formally, given a source video $x$, we construct a spatio-temporal pyramid $\left\{x_0, \dots, x_N\right\}$, where $x_n = x {\downarrow_{r^n}}$ is a downscaled version of $x$ by factor $r^n$, both in space and in time (with $r>1$; in our current implementation $r=\frac{6}{5}$; downscaling via cubic interpolation in all 3 dimensions).
The output video is then generated in a progressive growing manner (as is common with generative models e.g., \cite{karras2017progressive,shaham2019singan,gur2020hierarchical}). Namely, VGPNN is a sequence of \textbf{VPNN} layers, each operates in its own scale.
At the coarsest scale, the input to the first VPNN layer is an \emph{initial coarse guess} of the output video. This is created by adding random Gaussian noise $z_N$ to $x_N$ (see Fig.~\ref{fig:method_pyramid}). The noise $z_N$ promotes high diversity in the generated output samples from the single input. The global structure (e.g., a head is above the body) and global motion (e.g., humans walk forward), is prompted by $x_N$, where such structure and motion can be captured by \emph{small space-time} patches (in this work we used $(3\times7\times7)$ patches, where~3 is in the temporal dimension). Other choices of the initial coarse-scale guess lead to a variety of other applications (presented in Sec.~\ref{sec:applications}).
The coarsest-scale $y_N$ of the output video (output of the coarsest-scale VPNN layer) is generated by replacing each space-time patch of the initial coarse guess $x_N + z_N$ with its nearest neighbor patch from the corresponding coarse input $x_N$. The resulting patches are then folded to a video, by choosing at each space-time pixel location the median of all suggestions from neighboring patches.
At each subsequent scale, the input to the corresponding VPNN layer is the bicubically \emph{upscaled} output of the previous VPNN layer (${y_{n+1}\uparrow}$). The output $y_n$ is then generated by replacing each space-time patch with its nearest neighbor patch from the corresponding input scale $x_n$ (using same patch-size as before, now capturing finer details; see also QKV scheme below). This way, the output $y_n$ in each scale is similar in structure and in motion to the initial guess, but contains the same space-time patch statistics of the corresponding input scale $x_n$. Finally, the resulting patches are folded to a video.
To further improve the quality and sharpness of the generated output at each pyramid scale ($y_n$), we iterate several times through the current scale VPNN layer, each time using the current output $y_n$ as input to the next iteration (similar to the EM-like approach employed in many patch-based works \cite{granot2021drop,simakov2008summarizing,barnes2009patchmatch,wexler2004space}).
\begin{figure*}
\includegraphics[width=\textwidth]{figures/fig_3_arch.pdf}
\caption{\textbf{VGPNN Architecture:} Given a single source video $x_0$, a spatio-temporal pyramid is constructed and an output video $y_0$ is generated coarse-to-fine. At each scale, VPNN module (see Fig.~\ref{fig:method_pnn}) is applied to transfer an initial guess $Q_n$ to the output $y_n$ which shares the same space-time patch distribution as the input $x_n$. At the coarsest scale, noise is injected to induce spatial and temporal randomness.
}
\label{fig:method_pyramid}
\end{figure*}
\begin{figure*}
\includegraphics[width=\textwidth]{figures/fig_4_module.pdf}
\caption{\textbf{VPNN Module:} At each scale, the VPNN modules generates an output $y_n$, which is similar in structure to the upscaled output from coarser scale, $y_{n+1}{\uparrow^r}$, and has similar patch distribution as $x_n$. Using PatchMatch, and our per-key weighted version WeightedPatchMatch, VPNN is able to construct $y_n$ efficiently, and maintain visual completeness if necessary, even for extremely large inputs. PatchMatch receives a source video $S$ and a target video $T$ and returns the nearest neighbor field (NNF) $f$ (location of nearest target patch for each source patch) and the distance map $D$ (distance between each source patch and its nearest neighbor target patch). WeightedPatchMatch receives, in addition, $W$, the per-key weights. The Aggregate component receives a video $V$ and an NNF $f$ and reconstruct and output video $Y$.}
\label{fig:method_pnn}
\end{figure*}
\paragraph{Noise initialization}
To better adjust this randomness to video data, we found that temporal consistency is best preserved in the generated output video when the noise is randomized for each \emph{spatial} location, but is then \emph{replicated through the temporal dimension}.
\paragraph{QKV scheme} The straightforward way to compare two patches is by using their RGB values. While this works well in most cases, we found out that in several cases it is better to compare patches in other search spaces. To this end we use a \emph{QKV scheme} (query, key, value) at each level (similar to GPNN \cite{granot2021drop}).
We denote the aforementioned two inputs to the VPNN layer as follows: the upscaled output of previous layer (${y_{n+1}\uparrow}$) denoted as $Q$, and the corresponding level from the pyramid of the original video ($x_n$) denoted as $V$. We now define $K$ as follows: each patch $Q_i$ in $Q$ search for its nearest neighbor $K_j$ in $K$. Then, $Q_i$ will be replaced with $V_j$ (the patch in $V$ corresponding to $K_j$).
This scheme helps in several cases. First, patches in the \emph{upscaled} generated output from the previous scale are blurry. Seeking their nearest neighbors in $x_n$ (whose patches are sharp) often results in improper matches. This is mitigated by using a ``key video''~$K$, created by saptio-temporally upscaling the previous-level video from the pyramid, $K = x_{n+1}{\uparrow^r}$, having similar degree of blur/degradation as in the query video~$Q$. After finding its match in the similarly-degraded set $K$, each patch $Q_i$ is then replaced with a patch $V_j$ (corresponding to $K_j$), which is crisp and sharp (undegraded).
If keys and values were not separated, patches from blurry and motion-aliased video~($Q$) would look for nearest neighbors in a video which does not suffer from similar degradation~($V$). This may lead to a blurry and temporally-inconsistent result. Since temporal interpolation causes severe artifacts (such as motion aliasing), using the query-key-value scheme has a significant effect on our video results, even greater than on images. (note that this choice of $K$ is done in the first iteration of each scale of VGPNN).
Second, this scheme is also used in other applications (see Sec.~\ref{sec:applications}) to better utilize the temporal information in videos when matching between patches.
\paragraph{WeightedPatchMatch} \label{sec:patchmatch} A key component in VGPNN is \emph{WeightedPatchMatch}, an extension of PatchMatch\cite{barnes2009patchmatch} to handle globally-dependent information (weights) in its objective. The original PatchMatch algorithm provides an approximate solution to the nearest-neighbor field (NNF) between two sets. For natural images/videos, the large correlations between adjacent pixels allow for a quick convergence to a very good approximated solution.
\emph{WeightedPatchMatch} uses the same propagation and random search steps as in the original PatchMatch (using the ``jump flood'' scheme \cite{rong2006jump}), and introduces weights to the distance metric. Let $S$ be the source (``query'') video, $T$ be the target (``key'') video, $D$ the metric function between two patches and $W$ the \emph{weight} function. Let $\mathbf{p}=(t, x, y)$ be a position in the source video and $f$ be the NNF. In each iteration, \emph{WeightedPatchMatch} solves for:
\begin{align}
f(\mathbf{p}) = \text{arg} \min_{\mathbf{v}} W(\mathbf{p+v}) \cdot D(S(\mathbf{p}), T(\mathbf{p+v}))
\end{align}
Where $\mathbf{v}=(t',x',y')$ are possible NNF candidates, such as the NNF at the current location $f(t,x,y)$ or at a neighbor location $f(t,x-1,y)$ in the propagation step.
Implemented on GPU using PyTorch~\cite{NEURIPS2019_9015}, our \emph{WeightedPatchMatch} has time complexity of $O(n \times d)$ and $O(n)$ additional memory {(where $n$ is the video size and $d$ is the patch size)}. Compared to GPNN, with time complexity of $O(n^2 \times d)$ and memory footprint $O(n \times d)$, our algorithm is significantly faster and requires far less memory. Run times comparison of VGPNN vs. GPNN is shown in Fig.~\ref{fig:runtime_single}.
\paragraph{Completeness score}
GPNN\cite{granot2021drop} introduced the normalized similarity score~(Eq.~\ref{eq:normalizedScore}) that encourages \emph{visual completeness} while maintaining \emph{visual coherence}
\footnote{``Visual completeness'' is obtained when all the patches in the input can be found in the generated output (hence no critical information was lost). ``Visual coherence” is obtained when the generated output contains only patches from the input (hence no new undesired artifacts were introduced in the output). While coherence is always desired, completeness is required only in some applications (e.g., in visual summarization).} \cite{simakov2008summarizing}.
The similarity score between a query patch $Q_i$ and a key patch $K_j$ is defined as follows:
\begin{align}
\label{eq:normalizedScore}
S\left(Q_i, K_j\right) \coloneqq \frac{1}{\alpha + \min_\ell {D(Q_\ell, K_j)}} D(Q_i, K_j) \ \ ,
\end{align}
where $D=MSE$, and $\alpha$ controls the degree of completeness (smaller $\alpha$ encourages more completeness). $S$ is essentially a weighted version of $D$, whose weights depends globally on $K$ and $Q$.
In its original form, PatchMatch supports complicated metrics in its nearest neighbor search but does not receive additional globally-dependent information as input (e.g., weights). Therefore, it requires modification in order to minimize the objective in Eq.~\ref{eq:normalizedScore} which uses knowledge of global information from all patches (the similarity score from $Q_i$ to $K_j$ depends on all other query patches). To this end we use our \emph{WeightedPatchMatch}, using per-key weights ${W_j = \nicefrac{1}{(\alpha + \min_\ell {D(Q_\ell, K_j)})}}$.
Note that $W_j$ includes a minimization term. Computing it exhaustively, as done in GPNN, would prohibit the extention to videos. Since this term is essentially the nearest neighbor of $K_j$ in $Q$, we solve the NNF using PatchMatch, thus obtaining an approximation of $W_j$ (as stated in Eq.~\ref{eq:normalizedScore}). As apparent from our results, we do not suffer loss in quality or lack of completeness, which might have arisen from the approximated solution.
The complete flow of VPNN is described in Fig.~\ref{fig:method_pnn}.
\section{Experimental Results}
We evaluate and compare the performance of our main application -- random/diverse video generation from a single input video.
Figs.~\ref{fig:teaser} and~\ref{fig:generation_examples} illustrate that our method can take a single video and generate new diverse videos sharing the same space-time patch distribution.
One can see how from a single video of a dancer, our method is able to generate diverse outputs both spatially (number of dancers and their locations) and temporally (generated dancers are not synced).
Or, how from a single video of traffic junction (second video in Fig.~\ref{fig:generation_examples}), VGPNN generates new videos such that the entire scene changes, yet the output is visually pleasing (both in space and in time).
Our efficient method is capable of generating diverse videos of high spatial resolution and of significant temporal extent within \emph{minutes}.
\textbf{Please refer to the supplementary material to view the full resolution videos (360p, and an example of Full-HD), and many more examples.}
\vspace*{0.2cm}
\noindent
\textbf{\textit{Comparison to other video generation methods:}}
We further compare our method to recently published methods of diverse video generation from single video: HP-VAE-GAN\xspace~\cite{gur2020hierarchical} and SinGAN-GIF \cite{arora2021singan}.
We show that our results are both qualitatively and quantitatively superior while reducing the runtime by a factor of ${\sim}35,000$ (from 8 days training on one video to 18 seconds for new generated video).
Since SinGAN-GIF did not make their code available, and the training time of HP-VAE-GAN\xspace for a single video (of size $13\times144\times256$) is roughly $8$ days, we are only able to compare to videos published by these methods.
HP-VAE-GAN\xspace dataset comprises of 10 input videos with 13 frames each, and of spatial resolution of $144\times256$ pixels. SinGAN-GIF dataset has 5 input videos with maximal resolution of $168\times298$ pixels and 8-16 frames.
\vspace*{0.2cm}
\noindent
\textbf{\textit{Qualitative comparison:}}
A side-by-side comparison of random generation of videos can be viewed in the supplementary material.
Our generated samples are more spatially and temporally coherent as well as of higher visual quality.
Generating new videos using the space-time patches of the original input video, rather than regressing output RGB values, give rise to high quality outputs.
Fig.~\ref{fig:generation_ours_vs_hpvaegan_singangif} highlights this important feature of our method by comparing the visual quality of representative generated frames of our method to frames generated by HP-VAE-GAN\xspace and SinGAN-GIF.
\begin{figure*}
\includegraphics[width=\textwidth]{figures/fig_5_comparison.jpg}
\caption{
\textbf{Comparing the visual quality of generated frames:} Our generated frames (blue) are not only sharper than those of HP-VAE-GAN\xspace or SinGAN-GIF, but also exhibit more coherent and plausible arrangements of the scenes. Note the artefacts in the generated frames of both HP-VAE-GAN\xspace and SinGAN-GIF. Please refer to the supplementary material for the actual videos and more comparisons.}
\label{fig:generation_ours_vs_hpvaegan_singangif}
\end{figure*}
\vspace*{0.2cm}
\noindent
\textbf{\textit{Quantitative comparison:}}
On the one hand, randomly generated samples should resemble (both in appearance and in dynamics) the input video. On the other hand, these samples should be diverse.
Therefore, we measure patch statistics similarity between a generated output and the input using the Single-Video-FID (SVFID) proposed by~\cite{gur2020hierarchical}: it computes the Fréchet distance between the statistics of the generated output and the original video using pre-computed C3D features~\cite{tran2015learning}.
Lower SVFID is better.
Additionally, we measure how diverse our different samples are, using an adaptation of the \textit{diversity} index proposed by \cite{shaham2019singan} for images: Given a source video, standard deviation of each video ``pixel'' (3D RGB element in the video, converted to grayscale) is calculated across all generations, and then averaged across all pixels. Finally, it is normalized by the std of pixels in the input video.
For each input video in HP-VAE-GAN\xspace and SinGAN-GIF datasets we generated the same number of random sample as publicly available (10 generations for each video in HP-VAE-GAN\xspace dataset, and 6 generations for each video in SinGAN-GIF dataset), and compared their SVFID and diversity.
You can find all videos (inputs and generated ones) in the supplementary material.
Table~\ref{table:comparison} reports SVFID and diversity scores of our generated videos compared to the random samples generated by either HP-VAE-GAN\xspace or SinGAN-GIF.
Our generated samples bear more substantial similarity to the input videos (indicated by lower SVFID) while exhibiting significant diversity.
\vspace*{0.2cm}
\noindent
\textbf{\textit{User study:}}
We further conducted a user study evaluation using Amazon Mechanical Turk (AMT). For each dataset we asked 100 turkers to judge between our and the other method's generated sample (both samples generated from the same input video), which sample is better in terms of sharpness, natural looking and coherence.
The 5$^{th}$ column in Table~\ref{table:comparison} shows the percentage of users who favored one method over the other.
While there is a significant user preference towards our method on the videos generated from HP-VAE-GAN\xspace dataset, the results are not that clear-cut for the SinGAN-GIF dataset. This might be due to the somewhat restricted nature of the videos in that particular dataset.
\vspace*{0.2cm}
\noindent
\textbf{\textit{Reducing running times:}}
As discussed in sec.~\ref{sec:method}, VGPNN is significantly more efficient than GPNN due to the use of efficient WeightedPatchMatch algorithm for nearest neighbors search, rather than exhaustive search as in GPNN. This change has decreased the memory footprint significantly, making the generation of high-resolution videos (including Full-HD 1080p) possible, while significantly shortening the runtime. A comparison of the generation time of VGPNN, GPNN* and HP-VAE-GAN\xspace can be seen in Fig.~\ref{fig:runtime_single}.
\begin{figure*}
\centering
\begin{tabular}{c@{}c}
\includegraphics[width=\columnwidth]{figures/fig_6_left.pdf}&
\includegraphics[width=\columnwidth]{figures/fig_6_right.pdf}
\end{tabular}
\vspace{-0.5cm}
\caption{\textbf{Left:} Video generation time of VGPNN vs GPNN* (a trivial extension of GPNN~\cite{granot2021drop} from 2D to 3D video data) and HP-VAE-GAN\xspace \cite{gur2020hierarchical} on Nvidia Quadro RTX 8000 (48GB). The x-axis scale is the number of pixels in a 13 frames video.
Note that the y-axis is cut, and that HP-VAE-GAN\xspace takes ${\sim7.5}$ days to complete (compared to minutes in VGPNN) on the same resolution.
\textbf{Right:} A detailed comparison between nearest neighbors search time with PatchMatch (VGPNN) and with exhaustive search (GPNN*). GPNN* exceeds GPU memory at medium resolution (480p) with the original patch size $(3,7,7)$. The dashed line with smaller patch size $(3,5,5)$ is intended to show the quadratic trend with more data points.}
\label{fig:runtime_single}
\end{figure*}
\begin{table*}[h]
\begin{adjustbox}{max width=\textwidth}
\begin{tabular}{clcccccccr}
\toprule
\multirow{2}{*}{\textbf{Dataset}} &
\multirow{2}{*}{{\textbf{Method}}} &
\textbf{SVFID} $\downarrow$ &
\textbf{Diversity} &
\textbf{Head-on competition [$\%$]} $\uparrow$ &
\textbf{Runtime} $\downarrow$ \\
& & \cite{gur2020hierarchical} & \cite{shaham2019singan} & (User study) & \\
\midrule
& HP-VAE-GAN\xspace & 0.0081 & 0.4049 & 32.16$\pm$1.77 & 7.625 days (658980 secs) \\
\multirow{-2}{*}{HP-VAE-GAN\xspace} & \textbf{VGPNN} (Ours) & {\textbf{0.0072}} & 0.4482 & \textbf{67.84}$\pm$1.77 & \textbf{18} secs \\
\midrule
& SinGAN-GIF & 0.0119 & 0.8593 & 49.42$\pm$3.27 & Unpublished \\
\multirow{-2}{*}{SinGAN-GIF} & \textbf{VGPNN} (Ours) & {\textbf{0.0058}} & 0.5955 & \textbf{50.57}$\pm$ 3.27 & \textbf{10} secs \\
\bottomrule
\end{tabular}
\end{adjustbox}
\caption{\textbf{Quantitative Evaluation:} We compared quality (SVFID) and diversity of randomly generated samples on HP-VAE-GAN\xspace and SinGAN-GIF datasets. Our method produces diverse samples that are resemble better (low SVFID) the input video.
Furthermore, in a user study, users tend to score our generated videos as better compared to HP-VAE-GAN\xspace or SinGAN-GIF. See text for details.
}
\label{table:comparison}
\end{table*}
\section{Applications}
\label{sec:applications}
Generating random samples of a single video is beneficial not only as an academic concept but also as a practical goal.
This section demonstrates several applications whose goal is to manipulate a given video and uses VGPNN as a video-specific prior.
\vspace*{0.2cm}
\noindent
\textbf{\textit{Spatial retargeting:}} The goal of video spatial retargeting is to change the spatial dimensions of a video without distorting its visual contents (e.g., fit a portrait video to a wide screen display).
Video spatial retargeting can be performed in a very similar manner to video generation, but instead of injecting noise at the coarsest scale, $Q_N$, we gradually resize $Q_n$ towards the target size.
For an input video with input spatial dimensions of $h\times w$ and target size of $h\cdot s_h\times w\cdot s_w$ we upscale $Q_n$ to scale $ s_h^{(N-n)/N}\times s_w^{(N-n)/N}$ of the corresponding $K_n$.
Note that the scales of $V_n$ are unchanged, hence no distortion is introduced to the patches reconstructing the retargeted video.
As can be seen in Fig.~\ref{fig:spatial_retargeting}, the result preserves the original size and aspect ratio of objects in the video while keeping the overall appearance coherent even though the aspect ratio is significantly different.
The dynamics and motions in the videos are also preserved, as can be seen in the videos in the supplementary material.
For instance, the balloons are not ``squashed" but are rather packed more compactly in the sky, more members were added to the choir, instead of stretching them. Nevertheless, the motion of the balloons or the sway of the choir members are preserved.
Unfortunately, we are unable to compare our results to those of \cite{simakov2008summarizing, wolf2007videoretarget, rubinstein2008improved}: these methods did not make their implementation available, and re-implementing requires elaborate engineering and tweaking of hyper-parameters.
\begin{figure*}
\includegraphics[width=\textwidth]{figures/fig_7_retargeting.jpg}
\caption{\textbf{Spatial Video Retargeting:} the input video (red) is retargeted to different sizes and aspect ratios, while maintaining object sizes, aspect ratios and composition. Note that when the frame was extended in width, more singers were added to each row, and when the frame was extended in height, additional rows of singers were added to the choir. Full videos and additional examples can be found in the supplementary material.}
\label{fig:spatial_retargeting}
\end{figure*}
\vspace*{0.2cm}
\noindent
\textbf{\textit{Temporal retargeting:}} Similar to spatial retargeting, one can change the \emph{temporal} extent of a video to create a temporal summary or an extension of the original video. Fig.~\ref{fig:teaser} illustrates this application.
Again, this is done by gradually changing the number of frames in $Q_n$, while leaving $V_n$ unchanged.
Several examples of video summarization can be found in the supplementary material.
Note how the \emph{speeds} of the different actions are maintained similar to the original long video, however a more compact representation of the action is generated when creating a summary.
Moreover, we can, in a similar manner, extend the temporal duration of a video creating longer dynamics while preserving the speed of the individual actions.
See examples in the supplementary material, where, e.g., the choreography of the ballet dancer is longer, but the pace of the dance motions remains the same.
\vspace*{0.2cm}
\noindent
\textbf{\textit{Video conditional inpainting:}}
Similar to conditional image inpainting \cite{granot2021drop}, in this task an input video with some occluded space-time volume is received, and the missing part should be completed based on crude color cues placed by the user in the occluded space.
These crude cues are used to steer the way the missing part is filled by VGPNN.
This video with the masked space-time volume and the uniform color cues is the input $x$.
The initial guess $y_{N+1}$ is set to be a downscaled version of $x$ by $r^N$. The number of pyramid levels $N$ is chosen such that the occluded part in the downscaled video is roughly the size of a single patch.
At the coarsest level the masked part is coherently reconstructed using other space-time patches adhering to the coarse color cue placed in the occluded region.
In finer levels, details and dynamic elements are added.
Fig.~\ref{fig:conditional_inpainting} shows how choosing different color cues results with VGPNN completing different elements in those regions. For instance, a blue mask steers the completion to a player from Barcelona while a white mask triggers VGPNN to add a player to Real.
The input and inpainted videos can be seen in the supplementary material.
\begin{figure*}
\includegraphics[width=\textwidth]{figures/fig_8_conditional_inpainting.jpg}
\caption{\textbf{Conditional Video Inpainting:} the input video (red) includes regions masked by the user to be inpainted by VGPNN. The completion output is conditioned on the crude color cue provided, for each masked region, by the user. Blue cues result with Barcelona players, while white ones steers VGPNN to inpaint with Real players. Note that for the birds video (right) white cue results with additional clouds in the sky. This completion persists through the video dynamics, please see full videos in the supplementary material.}
\label{fig:conditional_inpainting}
\end{figure*}
\vspace*{0.2cm}
\noindent
\textbf{\textit{Video analogies:}}
Inspired by Image Analogies \cite{hertzmann2001image} and \cite{benaim2021structural} we propose the task of video analogies, where we transfer the dynamic behavior from a content video $x^A$ using the dynamic elements of a style video $x^B$.
This is achieved by creating two spatio-temporal pyramids $x^A_{0..N}$ and $x^B_{0..N}$, setting $Q_N = x^A_N$, and at each step $(K_n, V_n) = (x^B_n\downarrow\uparrow, x^B_{n})$.
This way we are able to capture the global dynamic behavior depicted by the coarse spatio-temporal scale $x^A_N$ of the content video A, while taking the fine details from the patches of B.
In Fig.~\ref{fig:teaser} we show an example of video analogies between two videos, with two results: one takes style from $A$ and content from $B$ and vice versa.
Video analogies can also be extended to ``sketch to video": by providing a dynamic ``sketch" of an action we can use VGPNN to generate an analogy between the sketch and a style video.
Fig.~\ref{fig:sketch_to_video} illustrates this application, the actual sketches and resulting videos can be found in the supplementary material.
Note how the building blocks, along with their local motions, were taken from the style video, while the overall dynamic behavior of the sketch input is maintained.
\begin{figure*}
\includegraphics[width=\textwidth]{figures/fig_9_sketch.jpg}
\caption{\textbf{Sketch to Video:} Given an input video of parading soldiers (top) and a crude binary sketch video of morphing MNIST digits (middle) VGPNN is able to generate a new video with the soldiers parading to form the sketched shape (bottom). Full videos and additional examples can be found in the supplementary material.}
\label{fig:sketch_to_video}
\end{figure*}
\begin{figure*}
\centering
\includegraphics[width=\textwidth]{figures/fig_10_failure_cases.jpg}
\caption{\textbf{Limitations \& Failures:} VGPNN has no
notion of global 3D rigidity or semantic meaning of objects/actions.
Therefore, it may sometimes introduce non-rigid deformations to rigid scenes undergoing global camera motion (left). Each frame in the generated output looks very good on its own, and the motion varies smoothly and pleasantly over time. However, while all space-time patches are faithful to the original video, their overall composition may sometimes produce unrealistic (non-rigid) scenes undergoing 3D camera motion.
Furthermore, VGPNN might sometimes fall into undesired local minima and create semantically meaningless moving object parts and undesired visual artefacts (right).
Example videos of such failure cases can be found in the supplementary material.}
\label{fig:failure_mode}
\end{figure*}
\vspace*{0.2cm}
\noindent
\textbf{\textit{Limitations:}}
VGPNN is only concerned with video patches at multiple scales, and therefore it lacks any "global understanding" of the scene or any high-level semantic information. Hence, when a video contains global camera motion of a rigid scene, as in Fig.~\ref{fig:failure_mode}~(left), VGPNN often generates local deformations to the rigid scene (highlighted by red and green).
Note that despite the high visual quality of every generated frame on itself, when viewing the generated \emph{dynamics} the result is perceived as unrealistic.
Additionally, VGPNN has no high-level semantic information on the contents of the videos. Consequently, it often fails to generate plausible complex semantic objects such as dancing people (Fig.~\ref{fig:failure_mode} right).
\section{Conclusion}
In this work, we demonstrated how using simple patch-based methods allows us to perform random video generation from a single video and carry out challenging manipulations such as spatio-temporal retargeting, inpainting, and analogies.
Basing our method on learning-free efficient mechanisms allows us to perform these tasks, for the first time, in close to real-time.
Moreover, generating the output video by directly combining space-time patches from the input video, as opposed to indirectly regressing RGB values, substantially increases the visual quality of our outputs.
This game-changing reduction in run time and the improvement of output visual quality turn these applications from mere academic concepts to valuable tools that can actually be used by practitioners.
\section{Acknowledgements}
This project received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No 788535), from the D. Dan and Betty Kahn Foundation, and from the Israel Science Foundation (grant 2303/20). Dr. Bagon is a Robin Chemers Neustein AI Fellow.
{\small
\bibliographystyle{ieee_fullname}
\section{Introduction}
\label{sec:intro}
\begin{figure*}
\vspace{-0.2cm}
\includegraphics[width=.9\textwidth]{figures/fig_2_generation.jpg}
\caption{\textbf{Diverse Single Video Generation:} Given an input video (red), VGPNN is able to generate similarly looking videos (blue) capturing both appearance of objects as well as their dynamics. Note the high quality of our generated videos. Please watch the full resolution videos in the supplementary material.}
\label{fig:generation_examples}
\end{figure*}
Generation and editing of natural videos remain challenging, mainly due to their large dimensionality and the enormous space of motion they span. Therefore, the tremendous recent advances in image generation cannot be readily applied to the video domain. The most common modern framework is training generative models on a large collection of videos. Such methods (e.g., \cite{vondrick2016generating, aigner2018futuregan}) can typically produce high quality results only for a limited class of videos such as face expressions (e.g., \cite{tulyakov2018mocogan}) or robot hand movement (e.g., \cite{denton2018stochastic}), and cannot be applied to arbitrary videos.
On the other side of the spectrum, \emph{single} video generative models have recently emerged \cite{gur2020hierarchical, arora2021singan}. These methods learn a generative video model from a single input video, in an unsupervised manner. As such, they learn the distribution of space-time patches within the single input video and are then able to generate a plethora of new videos with the same patch distribution.
However, single video GANs suffer from some heavy disadvantages - it takes days to train for each input video, thus making them applicable to only very small resolution and video length. They are also prone to optimization issues such as mode collapse, which often lead to poor visual quality and noticeable visual artifacts. These shortcomings render existing single-video methods impractical and unscalable.
Synthesizing and editing video content by modeling the distribution of space-time patches in a single video dates back to classical, pre-deep learning methods. These classical methods are based on optimization over space-time patches, which extended 2D patch-based methods to cope with videos, and demonstrated impressive results for various applications such as video summarization, video completion, and video texture synthesis. However, due to the intense computation required for working with space-time patches within a single video, these methods require long runtime and have been limited to low resolution and short videos.
We present a fast and practical method for video generation and manipulation from a single video, which generates \emph{diverse} high-quality video outputs within seconds/minutes (depending on the video size), and can be applied to high resolution (Full-HD) videos.
Our approach is inspired by the recent generative patch nearest neighbors approach, GPNN~\cite{granot2021drop}, which was shown to significantly outperform single-image GANs, both in run-time and in visual quality.
Here, we generalize this approach from images to videos, by casting classical space-time patch-based methods as a new \emph{generative video model}.
That is, given a single input video, our Video-Based Generative
Patch Nearest Neighbors (\textbf{VGPNN}) method can generate many random novel video outputs, all of which match the distribution of space-time patches of the original video.
Adapting GPNN to the realm of videos includes efficiently coping with the huge number of space-time patches in a single video, and also utilizing the temporal information in videos.
On the computational aspect, a na\"ive extension of GPNN from images to videos is prohibitive in both run time and memory consumption. To this end we extend PatchMatch~\cite{barnes2009patchmatch}, an efficient approximate nearest-neighbor search method, to search in a globally-weighted patch similarity space (we call our extension \emph{WeightedPatchMatch}). To our surprise, the approximated nearest neighbor field resulting from PatchMatch could still produce high quality results, while reducing generation run time by many orders of magnitude.
Thus, VGPNN makes diverse video generation from a single video realistically possible for the first time.
Our VGPNN results outperform single-video GANs, across all measures. Most of all, the runtime is incredibly reduced, from the impractical length of roughly 8 days to about 18 seconds for a $13 \times 144 \times 256$ video on a Quadro RTX 8000 GPU. This makes single video generative models practical for the first time. Beyond our main task of diverse, unconditional generation of videos, our framework gives rise to various classical and new video synthesis and manipulation applications including: spatio-temporal video retargeting (e.g., video extension \& video ``summarization''), video structural analogies, sketch-to-video, \emph{conditional} video-inpainting, and more, all produced with the same unified framework.
Some applications are schematically illustrated in Figs.~\ref{fig:teaser} and \ref{fig:generation_examples}. Full videos and many more results can be found in the supplementary material.
\hspace{0.4cm}
\noindent Our contributions are therefore several fold:
\begin{itemize} [topsep=0pt,itemsep=-1ex,partopsep=1ex,parsep=1ex]
\item VGPNN is the first single-video generative model that is scalable to high resolution (spatial or temporal).
\item We cast classical space-time patch nearest neighbor methods as a \emph{generative} video model.
\item We non-trivially adapt the patch-nearest-neighbor approach to video, making it affordable and practical. In particular, we present \emph{WeightedPatchMatch}, an extension of PatchMatch, that can handle per-patch global information.
\item Our approach can be used to a variety of new video applications, all within a single unified framework. These include diverse generation, spatio-temporal retargeting, sketch-to-video, and video structural analogies.
\end{itemize}
\section{Related work}
Synthesis and manipulation of videos is mostly done by generative models trained on large collections of videos.
The most common approach for unconditional video generative models is an extension of GAN \cite{goodfellow2014generative} to videos; \cite{vondrick2016generating, tulyakov2018mocogan, aigner2018futuregan, wang2021inmodegan}. There are also many GAN based methods for video-to-video translation \cite{wang2018video, wang2019few, mallya2020world, wang2020imaginator}. Another approach is by using GANs for images but predicting paths in the latent space \cite{saito2017temporal,lee2018stochastic}. A very common technique is considering the video as a sequence of frames and autoregressively predicting the next frame each time \cite{ballas2015delving,villegas2017decomposing, babaeizadeh2017stochastic, denton2018stochastic, villegas2018hierarchical, villegas2019high, aksan2019stcn, franceschi2020stochastic}.
All of these require lots of data to pre-train on, and can only generate videos from the same domain they were trained on.
Some video editing applications were demonstrated before deep-learning gained popularity. One such application is video retargeting or summarization \cite{rav2006making, rubinstein2008improved, wolf2007videoretarget, krahenbuhl2009disney, gygli2014creating, simakov2008summarizing}.
\cite{schodl2000video} considered 3D video textures and were able to synthesize them by statistical modeling. A similar, modern and very impressive approach by \cite{holynski2020animating} combined this rational with deep networks.
Some classical methods were based on optimizing similarity of space-time patches \cite{simakov2008summarizing, wexler2004space}. These were extensions of approaches mainly used for images ~\cite{efros1999texture,simakov2008summarizing}. As such, while performing reasonably on images in terms of runtime and memory, their extension to video is hardly scalable (hours for editing a single video).
Within the field of ``Deep Internal Learning" \cite{shocher2018zero, gandelsman2019double,zhang2019zero,zuckerman2020across,zhang2019internal,ghosh2020depth,ulyanov2018deep}, Deep Single-Image Generative Models have emerged.
These models train a GAN on a single image, in an unsupervised manner, and have shown to produce impressive results for image synthesis and manipulation tasks.
Being fully convolutional, these single-image GANs learn the patch distribution of the single input image, and are then able to generate a plethora of new images with the same patch distribution. These include SinGAN~\cite{shaham2019singan} for generating a \emph{large diversity} of different image instances -- all sampled from the input patch distribution, InGAN~\cite{shocher2018ingan} for flexible image retargeting, Structural-Analogies~\cite{benaim2021structural}, texture synthesis~\cite{jetchev2016texture,bergmann2017learning,zhou2018non, zhao2021solid}, and more~\cite{hinz2021improved,mastan2020dcil,mastan2021deepcfl,gur2020hierarchical,vinker2020deep,lin2020tuigan, chen2021mogan}. Single image GANs suffer from long training time per image, artifacts and mode collapse.
Recently, this approach was extended to single-video GANs. In the video domain, the main goal is to generate novel instances but with the same content as in the reference video.
\cite{arora2021singan} extends \cite{shaham2019singan} to video in a straightforward manner, by employing 3D (space-time) convolutions. \cite{gur2020hierarchical} Combines Variational Auto Encoders for the coarse scales, thus preventing mode collapse, with GANs for the fine scale to achieve improved quality. The single-input GANs shortcomings are significantly amplified in the video variants. The runtime is disproportionately increased (to several days per small input video) and the quality is reduced. Many unrealistic artifacts usually appear. Moreover, these methods only handle very short low-resolution videos and are unscalable. We argue that training for days, for each input and each task, only for short low-resolution videos can not be considered as a real solution.
A new practical solution in the image domain was recently introduced by \cite{granot2021drop}. They observed that ``good-old'' patch-based methods are superior in many aspects to single-image GANs. They suggested to reconsider simple patch nearest neighbors again, but cast them as a generative model that when given a single image can generate many diverse outputs. This approach significantly outperforms the GAN based methods, as well as older classical patch-based methods. The quality of the images is much better and the runtime is reduced dramatically.
\section{Method}
\label{sec:method}
Our goal is to make diverse video generation based on a single video possible.
By ``diverse'' we mean 3 things: (i)~diverse output samples from a single input video; (ii)~diverse natural dynamics (i.e., not restricted to a specific training video dataset, or specific type of video dynamics); (iii)~diverse set of applications within a single unified computational framework.
In order to capture both spatial and temporal information of a single video, VGPNN starts by building a spatio-temporal pyramid and operates coarse-to-fine to capture the internal statistics of the input video at multiple scales (Fig.~\ref{fig:method_pyramid}). Formally, given a source video $x$, we construct a spatio-temporal pyramid $\left\{x_0, \dots, x_N\right\}$, where $x_n = x {\downarrow_{r^n}}$ is a downscaled version of $x$ by factor $r^n$, both in space and in time (with $r>1$; in our current implementation $r=\frac{6}{5}$; downscaling via cubic interpolation in all 3 dimensions).
The output video is then generated in a progressive growing manner (as is common with generative models e.g., \cite{karras2017progressive,shaham2019singan,gur2020hierarchical}). Namely, VGPNN is a sequence of \textbf{VPNN} layers, each operates in its own scale.
At the coarsest scale, the input to the first VPNN layer is an \emph{initial coarse guess} of the output video. This is created by adding random Gaussian noise $z_N$ to $x_N$ (see Fig.~\ref{fig:method_pyramid}). The noise $z_N$ promotes high diversity in the generated output samples from the single input. The global structure (e.g., a head is above the body) and global motion (e.g., humans walk forward), is prompted by $x_N$, where such structure and motion can be captured by \emph{small space-time} patches (in this work we used $(3\times7\times7)$ patches, where~3 is in the temporal dimension). Other choices of the initial coarse-scale guess lead to a variety of other applications (presented in Sec.~\ref{sec:applications}).
The coarsest-scale $y_N$ of the output video (output of the coarsest-scale VPNN layer) is generated by replacing each space-time patch of the initial coarse guess $x_N + z_N$ with its nearest neighbor patch from the corresponding coarse input $x_N$. The resulting patches are then folded to a video, by choosing at each space-time pixel location the median of all suggestions from neighboring patches.
At each subsequent scale, the input to the corresponding VPNN layer is the bicubically \emph{upscaled} output of the previous VPNN layer (${y_{n+1}\uparrow}$). The output $y_n$ is then generated by replacing each space-time patch with its nearest neighbor patch from the corresponding input scale $x_n$ (using same patch-size as before, now capturing finer details; see also QKV scheme below). This way, the output $y_n$ in each scale is similar in structure and in motion to the initial guess, but contains the same space-time patch statistics of the corresponding input scale $x_n$. Finally, the resulting patches are folded to a video.
To further improve the quality and sharpness of the generated output at each pyramid scale ($y_n$), we iterate several times through the current scale VPNN layer, each time using the current output $y_n$ as input to the next iteration (similar to the EM-like approach employed in many patch-based works \cite{granot2021drop,simakov2008summarizing,barnes2009patchmatch,wexler2004space}).
\begin{figure*}
\includegraphics[width=\textwidth]{figures/fig_3_arch.pdf}
\caption{\textbf{VGPNN Architecture:} Given a single source video $x_0$, a spatio-temporal pyramid is constructed and an output video $y_0$ is generated coarse-to-fine. At each scale, VPNN module (see Fig.~\ref{fig:method_pnn}) is applied to transfer an initial guess $Q_n$ to the output $y_n$ which shares the same space-time patch distribution as the input $x_n$. At the coarsest scale, noise is injected to induce spatial and temporal randomness.
}
\label{fig:method_pyramid}
\end{figure*}
\begin{figure*}
\includegraphics[width=\textwidth]{figures/fig_4_module.pdf}
\caption{\textbf{VPNN Module:} At each scale, the VPNN modules generates an output $y_n$, which is similar in structure to the upscaled output from coarser scale, $y_{n+1}{\uparrow^r}$, and has similar patch distribution as $x_n$. Using PatchMatch, and our per-key weighted version WeightedPatchMatch, VPNN is able to construct $y_n$ efficiently, and maintain visual completeness if necessary, even for extremely large inputs. PatchMatch receives a source video $S$ and a target video $T$ and returns the nearest neighbor field (NNF) $f$ (location of nearest target patch for each source patch) and the distance map $D$ (distance between each source patch and its nearest neighbor target patch). WeightedPatchMatch receives, in addition, $W$, the per-key weights. The Aggregate component receives a video $V$ and an NNF $f$ and reconstruct and output video $Y$.}
\label{fig:method_pnn}
\end{figure*}
\paragraph{Noise initialization}
To better adjust this randomness to video data, we found that temporal consistency is best preserved in the generated output video when the noise is randomized for each \emph{spatial} location, but is then \emph{replicated through the temporal dimension}.
\paragraph{QKV scheme} The straightforward way to compare two patches is by using their RGB values. While this works well in most cases, we found out that in several cases it is better to compare patches in other search spaces. To this end we use a \emph{QKV scheme} (query, key, value) at each level (similar to GPNN \cite{granot2021drop}).
We denote the aforementioned two inputs to the VPNN layer as follows: the upscaled output of previous layer (${y_{n+1}\uparrow}$) denoted as $Q$, and the corresponding level from the pyramid of the original video ($x_n$) denoted as $V$. We now define $K$ as follows: each patch $Q_i$ in $Q$ search for its nearest neighbor $K_j$ in $K$. Then, $Q_i$ will be replaced with $V_j$ (the patch in $V$ corresponding to $K_j$).
This scheme helps in several cases. First, patches in the \emph{upscaled} generated output from the previous scale are blurry. Seeking their nearest neighbors in $x_n$ (whose patches are sharp) often results in improper matches. This is mitigated by using a ``key video''~$K$, created by saptio-temporally upscaling the previous-level video from the pyramid, $K = x_{n+1}{\uparrow^r}$, having similar degree of blur/degradation as in the query video~$Q$. After finding its match in the similarly-degraded set $K$, each patch $Q_i$ is then replaced with a patch $V_j$ (corresponding to $K_j$), which is crisp and sharp (undegraded).
If keys and values were not separated, patches from blurry and motion-aliased video~($Q$) would look for nearest neighbors in a video which does not suffer from similar degradation~($V$). This may lead to a blurry and temporally-inconsistent result. Since temporal interpolation causes severe artifacts (such as motion aliasing), using the query-key-value scheme has a significant effect on our video results, even greater than on images. (note that this choice of $K$ is done in the first iteration of each scale of VGPNN).
Second, this scheme is also used in other applications (see Sec.~\ref{sec:applications}) to better utilize the temporal information in videos when matching between patches.
\paragraph{WeightedPatchMatch} \label{sec:patchmatch} A key component in VGPNN is \emph{WeightedPatchMatch}, an extension of PatchMatch\cite{barnes2009patchmatch} to handle globally-dependent information (weights) in its objective. The original PatchMatch algorithm provides an approximate solution to the nearest-neighbor field (NNF) between two sets. For natural images/videos, the large correlations between adjacent pixels allow for a quick convergence to a very good approximated solution.
\emph{WeightedPatchMatch} uses the same propagation and random search steps as in the original PatchMatch (using the ``jump flood'' scheme \cite{rong2006jump}), and introduces weights to the distance metric. Let $S$ be the source (``query'') video, $T$ be the target (``key'') video, $D$ the metric function between two patches and $W$ the \emph{weight} function. Let $\mathbf{p}=(t, x, y)$ be a position in the source video and $f$ be the NNF. In each iteration, \emph{WeightedPatchMatch} solves for:
\begin{align}
f(\mathbf{p}) = \text{arg} \min_{\mathbf{v}} W(\mathbf{p+v}) \cdot D(S(\mathbf{p}), T(\mathbf{p+v}))
\end{align}
Where $\mathbf{v}=(t',x',y')$ are possible NNF candidates, such as the NNF at the current location $f(t,x,y)$ or at a neighbor location $f(t,x-1,y)$ in the propagation step.
Implemented on GPU using PyTorch~\cite{NEURIPS2019_9015}, our \emph{WeightedPatchMatch} has time complexity of $O(n \times d)$ and $O(n)$ additional memory {(where $n$ is the video size and $d$ is the patch size)}. Compared to GPNN, with time complexity of $O(n^2 \times d)$ and memory footprint $O(n \times d)$, our algorithm is significantly faster and requires far less memory. Run times comparison of VGPNN vs. GPNN is shown in Fig.~\ref{fig:runtime_single}.
\paragraph{Completeness score}
GPNN\cite{granot2021drop} introduced the normalized similarity score~(Eq.~\ref{eq:normalizedScore}) that encourages \emph{visual completeness} while maintaining \emph{visual coherence}
\footnote{``Visual completeness'' is obtained when all the patches in the input can be found in the generated output (hence no critical information was lost). ``Visual coherence” is obtained when the generated output contains only patches from the input (hence no new undesired artifacts were introduced in the output). While coherence is always desired, completeness is required only in some applications (e.g., in visual summarization).} \cite{simakov2008summarizing}.
The similarity score between a query patch $Q_i$ and a key patch $K_j$ is defined as follows:
\begin{align}
\label{eq:normalizedScore}
S\left(Q_i, K_j\right) \coloneqq \frac{1}{\alpha + \min_\ell {D(Q_\ell, K_j)}} D(Q_i, K_j) \ \ ,
\end{align}
where $D=MSE$, and $\alpha$ controls the degree of completeness (smaller $\alpha$ encourages more completeness). $S$ is essentially a weighted version of $D$, whose weights depends globally on $K$ and $Q$.
In its original form, PatchMatch supports complicated metrics in its nearest neighbor search but does not receive additional globally-dependent information as input (e.g., weights). Therefore, it requires modification in order to minimize the objective in Eq.~\ref{eq:normalizedScore} which uses knowledge of global information from all patches (the similarity score from $Q_i$ to $K_j$ depends on all other query patches). To this end we use our \emph{WeightedPatchMatch}, using per-key weights ${W_j = \nicefrac{1}{(\alpha + \min_\ell {D(Q_\ell, K_j)})}}$.
Note that $W_j$ includes a minimization term. Computing it exhaustively, as done in GPNN, would prohibit the extention to videos. Since this term is essentially the nearest neighbor of $K_j$ in $Q$, we solve the NNF using PatchMatch, thus obtaining an approximation of $W_j$ (as stated in Eq.~\ref{eq:normalizedScore}). As apparent from our results, we do not suffer loss in quality or lack of completeness, which might have arisen from the approximated solution.
The complete flow of VPNN is described in Fig.~\ref{fig:method_pnn}.
\section{Experimental Results}
We evaluate and compare the performance of our main application -- random/diverse video generation from a single input video.
Figs.~\ref{fig:teaser} and~\ref{fig:generation_examples} illustrate that our method can take a single video and generate new diverse videos sharing the same space-time patch distribution.
One can see how from a single video of a dancer, our method is able to generate diverse outputs both spatially (number of dancers and their locations) and temporally (generated dancers are not synced).
Or, how from a single video of traffic junction (second video in Fig.~\ref{fig:generation_examples}), VGPNN generates new videos such that the entire scene changes, yet the output is visually pleasing (both in space and in time).
Our efficient method is capable of generating diverse videos of high spatial resolution and of significant temporal extent within \emph{minutes}.
\textbf{Please refer to the supplementary material to view the full resolution videos (360p, and an example of Full-HD), and many more examples.}
\vspace*{0.2cm}
\noindent
\textbf{\textit{Comparison to other video generation methods:}}
We further compare our method to recently published methods of diverse video generation from single video: HP-VAE-GAN\xspace~\cite{gur2020hierarchical} and SinGAN-GIF \cite{arora2021singan}.
We show that our results are both qualitatively and quantitatively superior while reducing the runtime by a factor of ${\sim}35,000$ (from 8 days training on one video to 18 seconds for new generated video).
Since SinGAN-GIF did not make their code available, and the training time of HP-VAE-GAN\xspace for a single video (of size $13\times144\times256$) is roughly $8$ days, we are only able to compare to videos published by these methods.
HP-VAE-GAN\xspace dataset comprises of 10 input videos with 13 frames each, and of spatial resolution of $144\times256$ pixels. SinGAN-GIF dataset has 5 input videos with maximal resolution of $168\times298$ pixels and 8-16 frames.
\vspace*{0.2cm}
\noindent
\textbf{\textit{Qualitative comparison:}}
A side-by-side comparison of random generation of videos can be viewed in the supplementary material.
Our generated samples are more spatially and temporally coherent as well as of higher visual quality.
Generating new videos using the space-time patches of the original input video, rather than regressing output RGB values, give rise to high quality outputs.
Fig.~\ref{fig:generation_ours_vs_hpvaegan_singangif} highlights this important feature of our method by comparing the visual quality of representative generated frames of our method to frames generated by HP-VAE-GAN\xspace and SinGAN-GIF.
\begin{figure*}
\includegraphics[width=\textwidth]{figures/fig_5_comparison.jpg}
\caption{
\textbf{Comparing the visual quality of generated frames:} Our generated frames (blue) are not only sharper than those of HP-VAE-GAN\xspace or SinGAN-GIF, but also exhibit more coherent and plausible arrangements of the scenes. Note the artefacts in the generated frames of both HP-VAE-GAN\xspace and SinGAN-GIF. Please refer to the supplementary material for the actual videos and more comparisons.}
\label{fig:generation_ours_vs_hpvaegan_singangif}
\end{figure*}
\vspace*{0.2cm}
\noindent
\textbf{\textit{Quantitative comparison:}}
On the one hand, randomly generated samples should resemble (both in appearance and in dynamics) the input video. On the other hand, these samples should be diverse.
Therefore, we measure patch statistics similarity between a generated output and the input using the Single-Video-FID (SVFID) proposed by~\cite{gur2020hierarchical}: it computes the Fréchet distance between the statistics of the generated output and the original video using pre-computed C3D features~\cite{tran2015learning}.
Lower SVFID is better.
Additionally, we measure how diverse our different samples are, using an adaptation of the \textit{diversity} index proposed by \cite{shaham2019singan} for images: Given a source video, standard deviation of each video ``pixel'' (3D RGB element in the video, converted to grayscale) is calculated across all generations, and then averaged across all pixels. Finally, it is normalized by the std of pixels in the input video.
For each input video in HP-VAE-GAN\xspace and SinGAN-GIF datasets we generated the same number of random sample as publicly available (10 generations for each video in HP-VAE-GAN\xspace dataset, and 6 generations for each video in SinGAN-GIF dataset), and compared their SVFID and diversity.
You can find all videos (inputs and generated ones) in the supplementary material.
Table~\ref{table:comparison} reports SVFID and diversity scores of our generated videos compared to the random samples generated by either HP-VAE-GAN\xspace or SinGAN-GIF.
Our generated samples bear more substantial similarity to the input videos (indicated by lower SVFID) while exhibiting significant diversity.
\vspace*{0.2cm}
\noindent
\textbf{\textit{User study:}}
We further conducted a user study evaluation using Amazon Mechanical Turk (AMT). For each dataset we asked 100 turkers to judge between our and the other method's generated sample (both samples generated from the same input video), which sample is better in terms of sharpness, natural looking and coherence.
The 5$^{th}$ column in Table~\ref{table:comparison} shows the percentage of users who favored one method over the other.
While there is a significant user preference towards our method on the videos generated from HP-VAE-GAN\xspace dataset, the results are not that clear-cut for the SinGAN-GIF dataset. This might be due to the somewhat restricted nature of the videos in that particular dataset.
\vspace*{0.2cm}
\noindent
\textbf{\textit{Reducing running times:}}
As discussed in sec.~\ref{sec:method}, VGPNN is significantly more efficient than GPNN due to the use of efficient WeightedPatchMatch algorithm for nearest neighbors search, rather than exhaustive search as in GPNN. This change has decreased the memory footprint significantly, making the generation of high-resolution videos (including Full-HD 1080p) possible, while significantly shortening the runtime. A comparison of the generation time of VGPNN, GPNN* and HP-VAE-GAN\xspace can be seen in Fig.~\ref{fig:runtime_single}.
\begin{figure*}
\centering
\begin{tabular}{c@{}c}
\includegraphics[width=\columnwidth]{figures/fig_6_left.pdf}&
\includegraphics[width=\columnwidth]{figures/fig_6_right.pdf}
\end{tabular}
\vspace{-0.5cm}
\caption{\textbf{Left:} Video generation time of VGPNN vs GPNN* (a trivial extension of GPNN~\cite{granot2021drop} from 2D to 3D video data) and HP-VAE-GAN\xspace \cite{gur2020hierarchical} on Nvidia Quadro RTX 8000 (48GB). The x-axis scale is the number of pixels in a 13 frames video.
Note that the y-axis is cut, and that HP-VAE-GAN\xspace takes ${\sim7.5}$ days to complete (compared to minutes in VGPNN) on the same resolution.
\textbf{Right:} A detailed comparison between nearest neighbors search time with PatchMatch (VGPNN) and with exhaustive search (GPNN*). GPNN* exceeds GPU memory at medium resolution (480p) with the original patch size $(3,7,7)$. The dashed line with smaller patch size $(3,5,5)$ is intended to show the quadratic trend with more data points.}
\label{fig:runtime_single}
\end{figure*}
\begin{table*}[h]
\begin{adjustbox}{max width=\textwidth}
\begin{tabular}{clcccccccr}
\toprule
\multirow{2}{*}{\textbf{Dataset}} &
\multirow{2}{*}{{\textbf{Method}}} &
\textbf{SVFID} $\downarrow$ &
\textbf{Diversity} &
\textbf{Head-on competition [$\%$]} $\uparrow$ &
\textbf{Runtime} $\downarrow$ \\
& & \cite{gur2020hierarchical} & \cite{shaham2019singan} & (User study) & \\
\midrule
& HP-VAE-GAN\xspace & 0.0081 & 0.4049 & 32.16$\pm$1.77 & 7.625 days (658980 secs) \\
\multirow{-2}{*}{HP-VAE-GAN\xspace} & \textbf{VGPNN} (Ours) & {\textbf{0.0072}} & 0.4482 & \textbf{67.84}$\pm$1.77 & \textbf{18} secs \\
\midrule
& SinGAN-GIF & 0.0119 & 0.8593 & 49.42$\pm$3.27 & Unpublished \\
\multirow{-2}{*}{SinGAN-GIF} & \textbf{VGPNN} (Ours) & {\textbf{0.0058}} & 0.5955 & \textbf{50.57}$\pm$ 3.27 & \textbf{10} secs \\
\bottomrule
\end{tabular}
\end{adjustbox}
\caption{\textbf{Quantitative Evaluation:} We compared quality (SVFID) and diversity of randomly generated samples on HP-VAE-GAN\xspace and SinGAN-GIF datasets. Our method produces diverse samples that are resemble better (low SVFID) the input video.
Furthermore, in a user study, users tend to score our generated videos as better compared to HP-VAE-GAN\xspace or SinGAN-GIF. See text for details.
}
\label{table:comparison}
\end{table*}
\section{Applications}
\label{sec:applications}
Generating random samples of a single video is beneficial not only as an academic concept but also as a practical goal.
This section demonstrates several applications whose goal is to manipulate a given video and uses VGPNN as a video-specific prior.
\vspace*{0.2cm}
\noindent
\textbf{\textit{Spatial retargeting:}} The goal of video spatial retargeting is to change the spatial dimensions of a video without distorting its visual contents (e.g., fit a portrait video to a wide screen display).
Video spatial retargeting can be performed in a very similar manner to video generation, but instead of injecting noise at the coarsest scale, $Q_N$, we gradually resize $Q_n$ towards the target size.
For an input video with input spatial dimensions of $h\times w$ and target size of $h\cdot s_h\times w\cdot s_w$ we upscale $Q_n$ to scale $ s_h^{(N-n)/N}\times s_w^{(N-n)/N}$ of the corresponding $K_n$.
Note that the scales of $V_n$ are unchanged, hence no distortion is introduced to the patches reconstructing the retargeted video.
As can be seen in Fig.~\ref{fig:spatial_retargeting}, the result preserves the original size and aspect ratio of objects in the video while keeping the overall appearance coherent even though the aspect ratio is significantly different.
The dynamics and motions in the videos are also preserved, as can be seen in the videos in the supplementary material.
For instance, the balloons are not ``squashed" but are rather packed more compactly in the sky, more members were added to the choir, instead of stretching them. Nevertheless, the motion of the balloons or the sway of the choir members are preserved.
Unfortunately, we are unable to compare our results to those of \cite{simakov2008summarizing, wolf2007videoretarget, rubinstein2008improved}: these methods did not make their implementation available, and re-implementing requires elaborate engineering and tweaking of hyper-parameters.
\begin{figure*}
\includegraphics[width=\textwidth]{figures/fig_7_retargeting.jpg}
\caption{\textbf{Spatial Video Retargeting:} the input video (red) is retargeted to different sizes and aspect ratios, while maintaining object sizes, aspect ratios and composition. Note that when the frame was extended in width, more singers were added to each row, and when the frame was extended in height, additional rows of singers were added to the choir. Full videos and additional examples can be found in the supplementary material.}
\label{fig:spatial_retargeting}
\end{figure*}
\vspace*{0.2cm}
\noindent
\textbf{\textit{Temporal retargeting:}} Similar to spatial retargeting, one can change the \emph{temporal} extent of a video to create a temporal summary or an extension of the original video. Fig.~\ref{fig:teaser} illustrates this application.
Again, this is done by gradually changing the number of frames in $Q_n$, while leaving $V_n$ unchanged.
Several examples of video summarization can be found in the supplementary material.
Note how the \emph{speeds} of the different actions are maintained similar to the original long video, however a more compact representation of the action is generated when creating a summary.
Moreover, we can, in a similar manner, extend the temporal duration of a video creating longer dynamics while preserving the speed of the individual actions.
See examples in the supplementary material, where, e.g., the choreography of the ballet dancer is longer, but the pace of the dance motions remains the same.
\vspace*{0.2cm}
\noindent
\textbf{\textit{Video conditional inpainting:}}
Similar to conditional image inpainting \cite{granot2021drop}, in this task an input video with some occluded space-time volume is received, and the missing part should be completed based on crude color cues placed by the user in the occluded space.
These crude cues are used to steer the way the missing part is filled by VGPNN.
This video with the masked space-time volume and the uniform color cues is the input $x$.
The initial guess $y_{N+1}$ is set to be a downscaled version of $x$ by $r^N$. The number of pyramid levels $N$ is chosen such that the occluded part in the downscaled video is roughly the size of a single patch.
At the coarsest level the masked part is coherently reconstructed using other space-time patches adhering to the coarse color cue placed in the occluded region.
In finer levels, details and dynamic elements are added.
Fig.~\ref{fig:conditional_inpainting} shows how choosing different color cues results with VGPNN completing different elements in those regions. For instance, a blue mask steers the completion to a player from Barcelona while a white mask triggers VGPNN to add a player to Real.
The input and inpainted videos can be seen in the supplementary material.
\begin{figure*}
\includegraphics[width=\textwidth]{figures/fig_8_conditional_inpainting.jpg}
\caption{\textbf{Conditional Video Inpainting:} the input video (red) includes regions masked by the user to be inpainted by VGPNN. The completion output is conditioned on the crude color cue provided, for each masked region, by the user. Blue cues result with Barcelona players, while white ones steers VGPNN to inpaint with Real players. Note that for the birds video (right) white cue results with additional clouds in the sky. This completion persists through the video dynamics, please see full videos in the supplementary material.}
\label{fig:conditional_inpainting}
\end{figure*}
\vspace*{0.2cm}
\noindent
\textbf{\textit{Video analogies:}}
Inspired by Image Analogies \cite{hertzmann2001image} and \cite{benaim2021structural} we propose the task of video analogies, where we transfer the dynamic behavior from a content video $x^A$ using the dynamic elements of a style video $x^B$.
This is achieved by creating two spatio-temporal pyramids $x^A_{0..N}$ and $x^B_{0..N}$, setting $Q_N = x^A_N$, and at each step $(K_n, V_n) = (x^B_n\downarrow\uparrow, x^B_{n})$.
This way we are able to capture the global dynamic behavior depicted by the coarse spatio-temporal scale $x^A_N$ of the content video A, while taking the fine details from the patches of B.
In Fig.~\ref{fig:teaser} we show an example of video analogies between two videos, with two results: one takes style from $A$ and content from $B$ and vice versa.
Video analogies can also be extended to ``sketch to video": by providing a dynamic ``sketch" of an action we can use VGPNN to generate an analogy between the sketch and a style video.
Fig.~\ref{fig:sketch_to_video} illustrates this application, the actual sketches and resulting videos can be found in the supplementary material.
Note how the building blocks, along with their local motions, were taken from the style video, while the overall dynamic behavior of the sketch input is maintained.
\begin{figure*}
\includegraphics[width=\textwidth]{figures/fig_9_sketch.jpg}
\caption{\textbf{Sketch to Video:} Given an input video of parading soldiers (top) and a crude binary sketch video of morphing MNIST digits (middle) VGPNN is able to generate a new video with the soldiers parading to form the sketched shape (bottom). Full videos and additional examples can be found in the supplementary material.}
\label{fig:sketch_to_video}
\end{figure*}
\begin{figure*}
\centering
\includegraphics[width=\textwidth]{figures/fig_10_failure_cases.jpg}
\caption{\textbf{Limitations \& Failures:} VGPNN has no
notion of global 3D rigidity or semantic meaning of objects/actions.
Therefore, it may sometimes introduce non-rigid deformations to rigid scenes undergoing global camera motion (left). Each frame in the generated output looks very good on its own, and the motion varies smoothly and pleasantly over time. However, while all space-time patches are faithful to the original video, their overall composition may sometimes produce unrealistic (non-rigid) scenes undergoing 3D camera motion.
Furthermore, VGPNN might sometimes fall into undesired local minima and create semantically meaningless moving object parts and undesired visual artefacts (right).
Example videos of such failure cases can be found in the supplementary material.}
\label{fig:failure_mode}
\end{figure*}
\vspace*{0.2cm}
\noindent
\textbf{\textit{Limitations:}}
VGPNN is only concerned with video patches at multiple scales, and therefore it lacks any "global understanding" of the scene or any high-level semantic information. Hence, when a video contains global camera motion of a rigid scene, as in Fig.~\ref{fig:failure_mode}~(left), VGPNN often generates local deformations to the rigid scene (highlighted by red and green).
Note that despite the high visual quality of every generated frame on itself, when viewing the generated \emph{dynamics} the result is perceived as unrealistic.
Additionally, VGPNN has no high-level semantic information on the contents of the videos. Consequently, it often fails to generate plausible complex semantic objects such as dancing people (Fig.~\ref{fig:failure_mode} right).
\section{Conclusion}
In this work, we demonstrated how using simple patch-based methods allows us to perform random video generation from a single video and carry out challenging manipulations such as spatio-temporal retargeting, inpainting, and analogies.
Basing our method on learning-free efficient mechanisms allows us to perform these tasks, for the first time, in close to real-time.
Moreover, generating the output video by directly combining space-time patches from the input video, as opposed to indirectly regressing RGB values, substantially increases the visual quality of our outputs.
This game-changing reduction in run time and the improvement of output visual quality turn these applications from mere academic concepts to valuable tools that can actually be used by practitioners.
\section{Acknowledgements}
This project received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No 788535), from the D. Dan and Betty Kahn Foundation, and from the Israel Science Foundation (grant 2303/20). Dr. Bagon is a Robin Chemers Neustein AI Fellow.
{\small
\bibliographystyle{ieee_fullname}
| {'timestamp': '2021-09-20T02:19:29', 'yymm': '2109', 'arxiv_id': '2109.08591', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08591'} | arxiv |
\section{Introduction}
The sociopolitical and sociocultural changes speakers undergo tend to be somehow reflected in their lexicon \cite{soto2018loanwords}. The borrowing of words from a donor language to a recipient one is a common mechanism driving language change and word formation \cite{trask2009languages}. The lexical units being incorporated into the recipient language usually undergo morphological and phonological transformations as to better conform with the features of the recipient language \cite{poplack1988social}. Interestingly, regardless of the reasons as to why languages borrow words from others, there are a few common patterns that emerge in the process. For example, it seems like content words are much more frequently borrowed than function words, since it is more likely for a language to borrow nouns or verbs rather than prepositions or conjunctions. Nouns in particular might be benefiting from referential transparency and morphosyntactic freedom \cite{matras2020language}. However, before a word becomes fully assimilated into a recipient language with the proper morphological or orthographic modifications, it is not uncommon to see the adapted and unadapted versions of borrowings coexisting (e.g., \textit{whisky} and \textit{güisqui} are both correct in the Spanish orthography). Identifying what words enter a language and how they do so is critical for the understanding of the development of a language.
\section{Related work}
Given its global dominance in many domains of our daily lives, automatic approaches for detecting borrowings are mainly focused on words of English origin, that is, anglicism detection \cite{furiassi2007retrieval,chesley2010predicting,andersen2012semi,furiassi2012anglicization}.
For Spanish, a loanword identification algorithm for Argentine Spanish was proposed in \cite{serigos2017applying}, which provided the lemmatized form of the tokens, identified named entities, and preserved loan phrases. Although somewhat successful in the identification of anglicisms in the chosen news corpus, the algorithm was designed as a binary classifier in which every word was labeled as Spanish or English. This impacted negatively the number of false positives and made the system incapable of reliably identifying code-switching or adapted loans.
More recently, \cite{alvarez2020lazaro} showed that framing the problem as a token classification task for the extraction of emergent anglicisms in Spanish newswire provided very good results. The approach compared a conditional random fields (CRF) classifier built upon handcrafted features with word and character-level embeddings, to a bidirectional long short-term memory neural network with an extra conditional random fields layer on top (BiLSTM-CRF). The CRF-only method outperformed the neural network and achieved an F1 score of 87.82 on the test. Interestingly, the corpora made explicit distinctions between unadapted borrowings of English origin or other origin.
\section{Language models}
Previous methods have not yet relied on modern language models for the detection of borrowings. In this work, we used pre-trained transformer-based language models to approach the problem of borrowing detection as a token classification task. Given the prevalence of morphological and orthographic differences between emergent unadapted borrowings and assimilated words that have been part of a language for a long time, our hypothesis is that if a language model is capable of acquiring enough morphological and syntactical information should also be able to use this information to perform well on the detection of borrowings.
In order to test this hypothesis, we compared the results of fine-tuning BERT-based language models \cite{devlin18} on a corpus of Spanish news articles with and without supplementary training on intermediate labeled-data tasks (STILTs) \cite{phang2018sentence} related to the kind of language features that precisely makes identifying unadapted borrowings possible. Specifically, named entity recognition, part of speech, code-switching, and language identification. The rationale is that if a model is able to perform well in any of these tasks, it should also do well at detecting borrowings.
Supplementary training is a technique that supplements ``language model-style pre-training with further training on data-rich supervised tasks" \cite{phang2018sentence}. When using intermediate tasks such as natural language inference, performance on benchmarks like GLUE \cite{wang2018glue} improves over BERT \cite{devlin18} or ELMo \cite{peters18}. Moreover, it seems to excel in situations with very limited training data \cite{vu-etal-2020-exploring}, as it is the case with the labels in the ADoBo corpus \cite{adobo2021}.
In this sense, recent work has focused on systematically analyzing the performance of STILTs on both token and sequence classification. In \cite{poth2021pretrain}, the authors experimented with a diverse set of 42 intermediate and 11 target English tasks. For the token classification tasks, supplementary tasks based on POS, NER, and emergent entity recognition datasets \cite{derczynski2017results} showed to benefit from each other. However, the authors mention the risks of not choosing a proper supplementary task as a bad chosen intermeditate task can degrade performance on the target task considerably.
\section{Methods}
The corpus, released as part of the IberLEF 2021 shared task on Automatic Detection of Borrowings (ADoBO) \cite{adobo2021}, contains articles from Spanish newswire which are annotated with direct, unadapted, lexical borrowings following a set of publicly made annotation guidelines with specific assimilated borrowings, proper names and code-mixed situations.
The articles are sentence segmented and split into words. The annotations are made at the word level following the BIO annotation schema with two possible categories: \texttt{ENG} for English borrowings, and \texttt{OTHER} for lexical borrowings originating in languages other than English. The rest, including punctuation marks, are labeled using \texttt{O} and omitted from evaluation. Table \ref{table.1} shows the distributions of sentences, words, and \texttt{ENG} and \texttt{OTHER} labels per corpus split. It is specially striking the number of words labeled as \texttt{ENG} in the validation set when compared to the validation and test sets. Also worth mentioning the scarcity of words labeled as \texttt{OTHER} in general, which made learning the label solely based on this corpus a really challenging task.
\begin{table} [htbp]
\caption{\label{table.1}Distributions of sentences, words, and \texttt{ENG} and \texttt{OTHER} labels.}
\begin{center}
\begin{tabular} {lrrrr}
\hline\rule{-4pt}{10pt}
{\bf Split} & {\bf Sentences } & {\bf Words } & {\bf \texttt{ENG} } & {\bf \texttt{OTHER} }\\
\hline\rule{-4pt}{10pt}
Train & 8,216 & 231,126 & 1,701 & 32 \\
Validation & 2,025 & 82,578 & 424 & 57 \\
Test & 1,811 & 57,998 & 1,671 & 52 \\
\hline
\end{tabular}
\end{center}
\end{table}
The general procedure for applying STILTs follows three steps:
\begin{enumerate}
\item First, a model is trained on a semi-supervised task with no labeled data such as a language modeling task to gain some language reasoning capabilities.
\item The model is then further trained on an intermediate task for which plenty of labeled data is available.
\item Finally, the resulting model is fine-tuned further on the target task and evaluated.
\end{enumerate}
Since by nature the task involves words in more than one language, as baselines models we first fine-tuned multilingual BERT (mBERT), XLM RoBERTa (XLM-R) \cite{liu19}, a 5 languages version of mBERT including English, French, Spanish, German and Chinese (mBERT-5lang) \cite{smallermbert}, and two different monolingual Spanish BERT versions, one extracted from mBERT (mBERT-1lang) \cite{smallermbert} and the other pre-trained from scratch (BETO) \cite{canete2020spanish}.
As intermediate tasks for supplementary training, we chose mBERT models already fine-tuned on LinCE \cite{aguilar-etal-2020-lince}, a benchmark for linguistic code-switching evaluation that includes language identification (LinCE-LID), parts of speech tagging (LinCE-POS), and named entity recognition (LinCE-NER) tasks over Spanish-English code-switched data. A version of the Spanish BERT BETO fine-tuned on CoNLL-2002 for Spanish POS tags \cite{tjong-kim-sang-2002-introduction} (BETO-POS) and a version of XLM-RoBERTa fine-tuned on the same dataset for NER (XLM-R-NER) tags were also included. Distributions of sentences and words for the datasets used in these supplementary tasks are shown in Table \ref{table.2}.
\begin{table} [h]
\caption{\label{table.2}Distributions of sentences and words (sentences / words) for the datasets used in STILTs.}
\center
\setlength{\tabcolsep}{1.2mm}{
\begin{tabular} {lccc}
\hline\rule{-4pt}{10pt}
{\bf Dataset} & {\bf Train } & {\bf Validation } & {\bf Test } \\
\hline\rule{-4pt}{10pt}
CoNLL-2002 & 8,324 / 264,715 & 1,916 / 52,923 & 1,518 / 51,533 \\
LinCE-LID & 21,030 / 253,221 & 3,332 / 40,391 & 8,289 / 97,341 \\
LinCE-NER & 27,893 / 217,068 & 4,298 / 33,345 & 10,720 / 82,656 \\
LinCE-POS & 33,611 / 404,428 & 10,085 / 122,656 & 23,527 / 281,579 \\
\hline
\end{tabular}
}
\end{table}
\section{Results}
We run all experiments on 2x24GB NVIDIA GPU RTX 6000, doing grid searches of hyperparameters for each model with learning rates of 1e-5, 2e-5, 3e-5, and 4e-5, and for 3, 5, and 10 epochs. We used the AdamW optimizer, with no weight decay, and a 10\% of steps for warmup. We did 3 runs with different seeds and chose the best model on the validation set while reporting results on the test set. We are reporting precision, recall, and F1 micro scores as obtained by \texttt{seqeval} \cite{seqeval18}.
\begin{table*}[h]
\caption{\label{tab2} Best values of precision (P), recall (R), and F1 score for the validation set on baseline and STILTs models. Best scores in \textbf{bold}, second best F1 scores \underline{underlined}. }
\center
\resizebox{1\textwidth}{!}{
\setlength{\tabcolsep}{1.2mm}{
\begin{tabular}{l|ccc|ccc|ccc}
\hline
\multirow{2}{*}{\bf Model} &
& {\bf \texttt{ENG}} &&& {\bf \texttt{OTHER}} &&& Total \\
&
\bf P & \bf R & \bf F1 &
\bf P & \bf R & \bf F1 &
\bf P & \bf R & \bf F1 \\
\hline
mBERT & 84.47 & 88.89 & 86.62 & 65.22 & 30.61 & 41.67 & 83.19 & 80.85 & 82.00 \\
mBERT-1lang & 80.65 & 88.56 & 84.42 & \textbf{73.91} & 34.69 & \underline{47.22} & 80.22 & 81.13 & 80.67 \\
mBERT-5lang & 85.98 & \textbf{90.20} & \underline{88.04} & 62.50 & \textbf{40.82} & \textbf{49.38} & 83.85 & \textbf{83.38} & \textbf{83.62} \\
BETO & 79.28 & 86.27 & 82.63 & 47.62 & 20.41 & 28.57 & 77.40 & 77.18 & 77.29 \\
XLM-R & \textbf{86.48} & 89.87 & \textbf{88.14} & 53.85 & 28.57 & 37.33 & \textbf{84.01} & 81.41 & \underline{82.69} \\
\hline
LinCE-LID$_{STILT}$ & 29.29 & 18.95 & 23.02 & 12.50 & 2.04 & 3.51 & \textbf{28.64} & 16.62 & 21.03 \\
XLM-R-NER$_{STILT}$ & 28.46 & \textbf{23.53} & \textbf{25.76} & 50.00 & 2.04 & \underline{3.92} & 28.63 & \textbf{20.56} & \textbf{23.93} \\
LinCE-NER$_{STILT}$ & 23.68 & 20.59 & 22.03 & 33.33 & 2.04 & 3.85 & 23.79 & 18.03 & 20.51 \\
BETO-POS$_{STILT}$ & 24.43 & 17.65 & 20.49 & \textbf{100.00} & 2.04 & \textbf{4.00} & 24.77 & 15.49 & 19.06 \\
LinCE-POS$_{STILT}$ & \textbf{29.65} & 19.28 & \underline{23.37} & 16.67 & 2.04 & 3.64 & 29.27 & 16.9 & \underline{21.43} \\
\hline
\end{tabular}
}}
\end{table*}
Tables \ref{tab2} and \ref{tab3} overwhelmingly show that STILTs have absolutely no positive effect on the classification of borrowings. No matter what kind of supplementary training is used, the STILT models perform almost 4 times worse than the baseline finetuning. Among the best performing models on direct finetuning on the validation set, XLM-R and mBERT-5lang achieve somewhat similar F1 scores in total, with 83.62 F1 points for mBERT-5lang and 82.69 for XLM-R; both above mBERT. The biggest difference lies in the scores for the \texttt{OTHER} label, where all mBERT varieties perform better than XLM-R.
\begin{table*}[h]
\caption{\label{tab3} Best values of precision (P), recall (R), and F1 score for the test set on baseline and STILTs models using the best validation parameters. Best scores in \textbf{bold}, second best F1 scores \underline{underlined}. }
\center
\resizebox{1\textwidth}{!}{
\setlength{\tabcolsep}{1.2mm}{
\begin{tabular}{l|ccc|ccc|ccc}
\hline
\multirow{2}{*}{\bf Model} &
& {\bf \texttt{ENG}} &&& {\bf \texttt{OTHER}} &&& Total \\
&
\bf P & \bf R & \bf F1 &
\bf P & \bf R & \bf F1 &
\bf P & \bf R & \bf F1 \\
\hline
mBERT & 89.10 & 83.13 & 86.01 & 46.43 & 28.26 & \underline{35.14} & 88.09 & \textbf{81.17} & 84.49 \\
mBERT-1lang & 88.54 & 81.68 & 84.97 & 50.00 & 15.22 & 23.33 & 88.07 & 79.30 & 83.46 \\
mBERT-5lang & 90.38 & 82.65 & \underline{86.34} & 45.00 & \textbf{39.13} & \textbf{41.86} & 88.83 & 81.09 & \underline{84.78} \\
BETO & 88.18 & \textbf{83.70} & 85.88 & \textbf{66.67} & 13.04 & 21.82 & 88.02 & \textbf{81.17} & 84.45 \\
XLM-R & \textbf{91.47} & 82.24 & \textbf{86.61} & 43.75 & 15.22 & 22.58 & \textbf{90.8} & 79.84 & \textbf{84.97} \\
\hline
LinCE-LID$_{STILT}$ & \textbf{59.04} & 15.82 & \underline{24.95} & 33.33 & 6.52 & 10.91 & \textbf{58.36} & 15.49 & \underline{24.48} \\
XLM-R-NER$_{STILT}$ & 53.02 & \textbf{19.85} & \textbf{28.89} & 40.00 & 4.35 & 7.84 & 52.88 & \textbf{19.30} & \textbf{28.28} \\
LinCE-NER$_{STILT}$ & 49.47 & 15.17 & 23.22 & 37.50 & 6.52 & \underline{11.11} & 49.23 & 14.86 & 22.83 \\
BETO-POS$_{STILT}$ & 43.18 & 13.80 & 20.92 & \textbf{60.00} & 6.52 & \textbf{11.76} & 43.39 & 13.54 & 20.64 \\
LinCE-POS$_{STILT}$ & 58.54 & 15.50 & 24.51 & 30.00 & 6.52 & 10.71 & 57.69 & 15.18 & 24.03 \\
\hline
\end{tabular}
}}
\end{table*}
Taking the best models when evaluated on the validation test, we evaluated the performance on the test set. As shown in Table \ref{tab3} and Figure \ref{fig1}, results are similar, with mBERT-5lang performing slightly below XLM-R (84.78 vs 84.97), and presenting an F1 score for the \texttt{OTHER} label almost twice as that of the XLM-R.
\begin{figure*}
\includegraphics[width=\textwidth]{ALL_20210618T180737.pdf}
\caption{F1 scores for the different models on the validation and test sets per label and in total.} \label{fig1}
\end{figure*}
\begin{table*}[h]
\caption{\label{tab4} Best values of precision (P), recall (R), and F1 score for the test set on baseline and STILTs models using the best test parameters. Best scores in \textbf{bold}, second best F1 scores \underline{underlined}. }
\center
\resizebox{1\textwidth}{!}{
\setlength{\tabcolsep}{1.2mm}{
\begin{tabular}{l|ccc|ccc|ccc}
\hline
\multirow{2}{*}{\bf Model} &
& {\bf \texttt{ENG}} &&& {\bf \texttt{OTHER}} &&& Total \\
&
\bf P & \bf R & \bf F1 &
\bf P & \bf R & \bf F1 &
\bf P & \bf R & \bf F1 \\
\hline
mBERT & 91.10 & 84.26 & \underline{87.55} & 70.00 & 30.43 & \underline{42.42} & 90.74 & 82.33 & \underline{86.33} \\
mBERT-1lang & 89.84 & 81.36 & 85.39 & 54.17 & 28.26 & 37.14 & 89.09 & 79.46 & 84.00 \\
mBERT-5lang & 90.59 & \textbf{86.28} & \textbf{88.38} & 59.26 & \textbf{34.78} & \textbf{43.84} & 89.89 & \textbf{84.44} & \textbf{87.08} \\
BETO & 90.34 & 84.58 & 87.37 & 47.06 & 17.39 & 25.40 & 89.72 & 82.18 & 85.78 \\
XLM-R & \textbf{92.11} & 81.92 & 86.72 & \textbf{71.43} & 10.87 & 18.87 & \textbf{91.97} & 79.38 & 85.21 \\
\hline
LinCE-LID$_{STILT}$ & \textbf{55.65} & 16.71 & \underline{25.70} & \textbf{50.00} & 6.52 & \underline{11.54} & \textbf{55.56} & 16.34 & \underline{25.26} \\
XLM-R-NER$_{STILT}$ & 53.02 & \textbf{19.85} & \textbf{28.89} & 40.00 & 4.35 & 7.84 & 52.88 & \textbf{19.30} & \textbf{28.28} \\
LinCE-NER$_{STILT}$ & 53.16 & 16.95 & 25.70 & 42.86 & 6.52 & 11.32 & 52.99 & 16.58 & 25.25 \\
BETO-POS$_{STILT}$ & 47.47 & 13.64 & 21.19 & 37.50 & 6.52 & 11.11 & 47.25 & 13.39 & 20.86 \\
LinCE-POS$_{STILT}$ & \textbf{55.65} & 16.30 & 25.22 & 40.00 & \textbf{8.70} & \textbf{14.29} & 55.23 & 16.03 & 24.85 \\
\hline
\end{tabular}
}}
\end{table*}
Given the differences between the number of labeled words in the validation and test sets for each label, we also obtained the best scores based solely on the test set. As seen in Table \ref{tab4}, the highest F1 scores are obtained by mBERT-5lang (87.08) and mBERT (86.33), more than doubling the F1 score for the \texttt{OTHER} label with respect to the score obtained by XLM-R. In general, the models achieving higher F1 scores for the \texttt{ENG} label also get higher scores in total.
\section{Conclusions}
In this work, we framed the detection of borrowings in Spanish as a token classification task. We hypothesized that supplementary learning could improve the performance of simply fine-tuned models. However, our results strongly suggest that supplementary learning might not be as effective for token classification of borrowings as it is for sequence classification on natural language understanding tasks. This results is inline with recent research. For example, \cite{glavas-vulic-2021-supervised} noted that supervised parsing might not be as availing as expected for high-level semantic natural language understanding. Given the very nature of the ADoBo task, in which only a small set of all words tagged as verbs or nouns actually occur to be borrowings, supplementary tasks that flag all parts of speech or all named entities might have a hard time trying to figure out exactly which of those are borrowings. In this sense, although not reported as part of the results, we found that when using language identification, with no further training, LinCE-LID$_{STILT}$ correctly assigns the \texttt{ENG} label with an F1 score of 44.31. It would be interesting as future work to check how much models trained on supplementary tasks unlearn once they are trained on borrowing detection. This could also be an indication that a hybrid approach merging both language models and handcrafted features useful in language identification such as a character 3-grams could potentially boost the performance of the detection of borrowings. Additionally, adding a CRF or even a LSTM layer on top of the classifiers could see some performance gains for the simple finetuning. Auto-regressive models such as mT5 or GTP-J could also be leveraged for the task. A proper error analysis should be conducted to know exactly where and how the different approaches are failing.
We also believe that re-shuffling the train and validation sets could potentially solve the unbalance issue present in the labels of the corpus, improving the quality of the training data and making model selection more effective.
\bibliographystyle{splncs04}
| {'timestamp': '2021-09-20T02:19:43', 'yymm': '2109', 'arxiv_id': '2109.08607', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08607'} | arxiv |
\section{Introduction}
Multi-robot navigation is one of the significant problems for multi-robot systems and
practical to cooperative tasks such as search and rescue, formation control, and area coverage. As each robot has limited communication and sensing ranges,
cooperative behaviors among robots rely on the connectivity of the communication network.
Therefore, maintaining connectivity over time is important for multi-robot navigation.
The problem of connectivity maintenance for multi-robot systems has been widely studied, and various connectivity
strategies~\cite{li2013bounded,sabattini2013decentralized,williams2015global,gasparri2017bounded} have been proposed.
Most of these works consider global connectivity because of its flexibility as
it allows robots to break communication links
as long as the communication graph is connected over time.
This is guaranteed by preserving the second-smallest eigenvalue of the underlying graph Laplacian of robot networks to be positive, which is well-known as algebraic connectivity~\cite{fiedler1973algebraic}.
As these works attempt to complete various tasks,
some of them validate their strategies in obstacle-free environments for formation control~\cite{gasparri2017bounded}, visiting multiple waypoints~\cite{wang2016multi} and area coverage~\cite{capelli2020connectivity}.
Potential field methods are widely studied to combine connectivity maintenance with system objectives and obstacle avoidance.
Williams\textit{~et al.}~\cite{williams2015global} select a dispersive potential with collision avoidance to validate the designed connectivity controller at the presence of disc-obstacles. Li\textit{~et al.}~\cite{li2013bounded} have proposed a potential-based method towards circle obstacles avoidance with connectivity maintenance.
Sabattini\textit{~et al.}~\cite{sabattini2013decentralized} evaluate their
gradient-based controller in rendezvous applications.
They use a collision avoidance strategy which is not mentioned in experiments as the controller is designed for general purposes.
\begin{figure}[t]
\centering
\includegraphics[width=0.4\textwidth]{fig/complex-cover}
\caption{Illustration of our research task. The proposed decentralized policy navigates multiple robots to a destination with global network connectivity maintenance.}
\label{cover}
\vspace{-7mm}
\end{figure}
One of the major challenges of multi-robot navigation is the imperfect environment
information due to limited sensing capabilities. Connectivity controllers may fail since they can be trapped at the presence of obstacles without the explicit design of navigation strategies. Moreover, simple assumptions on obstacle shapes have limitations in complex environments.
To navigate in complex environments,
RL-based approaches are alternatives that
have shown promising results in map-less navigation.
Many of these works have developed end-to-end navigation policies which
directly map raw sensor measurements to control commands without prior knowledge
of the environment~\cite{pfeiffer2018reinforced, long2018towards,lin2019end}.
While few of them focus on connectivity of the robot team, Lin\textit{~et al.}~\cite{lin2020connectivity} propose a RL framework that combines a constrained optimization module to enforce local connectivity constraints. However, local connectivity may lead to restrictive behaviors since each
robot has to maintain communication links with all other robots in the team over time. Moreover, the effects of action correction from the optimization module are nontrivial in RL as it may break the Markov assumption~\cite{cheng2019end, mysore2020regularizing}.
In this work, we focus on multi-robot navigation with connectivity maintenance
at the presence of unknown obstacles.
We consider global connectivity to allow flexible changes of communication graphs
and incorporate it as constraints into RL methods.
Although the connectivity-constrained multi-robot navigation problem can be formulated as a Constrained Partial Observable Markov Decision Process (Constrained POMDP), existing constrained RL methods are infeasible due to sample inefficiency and the inherent difficulty of this multi-objective problem (reaching target points and avoiding collisions while bounding connectivity constraints).
To address this issue, we present a model-free constrained RL approach
that combines behavior cloning (BC) to make policy training tractable.
By learning from demonstrations, the actions of robots are guided towards expert navigation behaviors and therefore improve efficiency in policy search.
Following the centralized training decentralized execution scheme~\cite{lowe2017multi,foerster2016learning}, a shared policy is optimized by experiences of all agents during training.
As a result, a decentralized policy is developed that takes information of other agents into account to maintain global connectivity and leverages range sensor data for collision avoidance.
The contributions of this work are:
\begin{itemize}
\item A constrained RL-based approach is proposed to
navigate multiple robots in unknown environments while maintaining global connectivity in a decentralized manner.
\item An effective way to facilitate policy training by combing BC and RL
without breaking the connectivity constraint.
\item The performance of the developed policy is empirically evaluated in simulation and real-world robotic platforms.
\end{itemize}
\section{Related Work}
RL-based approaches have been intensively studied in the last few years and have shown great potentials in navigation with imperfect sensing in unknown complex environments.
For single-robot navigation,
Pfeiffer\textit{~et al.}~\cite{pfeiffer2018reinforced} propose a sample efficient approach
that uses expert demonstrations for policy pre-training and further improve the
policy performance by RL. The experiments show that the policy outperforms their previous approach, where an end-to-end policy is trained by supervised learning only~\cite{pfeiffer2017perception}. In particular, they treat collision avoidance as constraint to ensure safety and use pre-training to improve sample efficiency. In our approach, a connectivity-maintained expert is infeasible, and thus we impose connectivity constraints and provide navigation demonstrations in one-stage RL training without pre-training.
Zhang\textit{~et al.}~\cite{zhang2020map} aim to develop a flexible policy and propose a transfer method that can handle various range sensor dimensional configurations. Later, they propose a support-point approach to distinguish critical points from LiDAR range measurements and handle different LiDAR configurations without re-training.
In multi-robot settings,
Chen\textit{~et al.}~\cite{chen2017decentralized} propose an approach called CADRL that considers observable states of other robots and pedestrians instead of direct mapping from perception to motion commands. With a trained value function, the robots perform one-step lookahead to generate collision-free actions. Later, they extend CADRL and design a socially-aware reward function for learning a policy that incorporates social norms towards pedestrian-rich navigation.
Everett\textit{~et al.}~\cite{everett2018motion} augment this framework with Long short-term memory to improve performance on complex interactions with pedestrians.
The parameter sharing scheme~\cite{gupta2017cooperative,nguyen2020deep} is popular for efficient multi-agent policy training and applicable to multi-robot navigation.
Long\textit{~et al.}~\cite{long2018towards} train a multi-robot collision avoidance policy with a multi-agent extended variant of Proximal Policy Optimization (PPO) and adopt curriculum learning to facilitate training.
This policy is shared among robots and navigates each robot to its desired goal
from 2D laser measurements without communications in a decentralized manner.
Lin\textit{~et al.}~\cite{lin2019end} aim to navigate the geometric center of a robot team to reach waypoints and develop an end-to-end policy shared among the robots that consider raw laser data inputs and position information of other robots. Han\textit{~et al.}~\cite{han2020cooperative} also consider observable states of other robots and dynamic obstacles with Gaussian noises. They propose a greedy target allocation method to efficiently navigate the robots to multiple targets.
\vspace{-0.5mm}
\section{Approach}
\begin{figure}[t]
\centering
\includegraphics[width=0.43\textwidth]{fig/overview}
\vspace{-2mm}
\caption{An overview of our approach. Each robot computes its control command $\mathbf{a}^{i,t}$ with the shared policy $\pi_{\boldsymbol\theta}$ given its observation $\mathbf{o}^{i,t}$ and receives reward $r^{i,t+1}$ and connectivity signal $c^{t+1}$. The policy $\pi_{\boldsymbol\theta}$ is optimized by the experiences of all robots under supervised actions of an expert $\pi_E$ and connectivity constraints. }
\vspace{-6.5mm}
\label{fig:overview}
\end{figure}
\subsection{Problem formulation}
The multi-robot navigation problem can be formulated as
a Partial Observable Markov Decision Process (POMDP).
Formally, a POMDP is defined by tuple
$<\mathcal{S}, \mathcal{A}, \mathcal{O}, \mathcal{P}, \mathcal{Z}, r, \gamma>$
where $\mathcal{S}$ is the state space, $\mathcal{A}$ is the action space,
$\mathcal{O}$ is the observation space,
$\mathcal{P}(s^\prime|s,a)$ is the transition probabilities of taking action
$a$ at state $s$,
$\mathcal{Z}(o|s^\prime,a)$ is the observation distribution at the new state $s^\prime$,
$r(s,a):\mathcal{S}\times\mathcal{A}\to \mathbb{R}$ is the reward function
and $\gamma\in(0,1]$ is the discount factor.
Specifically, we consider a team of $N$ robots navigate to a target zone $\mathbf{g}$ with radius $R_g$. The robots are considered homogeneous and modeled as discs with the same radius $R_r$ and communication range $R_c$.
At each timestep $t$,
each robot $i$ obtains 2D laser scans $\mathbf{o}_l^{i,t}$
and its velocity $\mathbf{o}_v^{i,t}$.
The relative goal position $\mathbf{o}_g^{i,t}$
and the positions of other robots in the team $\mathbf{o}_p^{i,t} = [\mathbf{p}_1^t, \dots,\mathbf{p}_{i-1}^t,\mathbf{p}_{i+1}^t,\dots,\mathbf{p}_N^t]$
are informed to the robot $i$.
Given the observation $\mathbf{o}^{i,t} = [\mathbf{o}_l^{i,t}, \mathbf{o}_v^{i,t}, \mathbf{o}_g^{i,t}, \mathbf{o}_p^{i,t}]$, the robot aims to obtain a parameterized policy $\pi_{\boldsymbol\theta}$ that directly maps $\mathbf{o}^{i,t}$ to control command $\mathbf{a}^{i,t}$.
The policy $\pi_{\boldsymbol\theta}$ is shared among robots, and each robot is allowed to take different actions since they receive different observations.
The objective of RL is to find the optimal parameter $\boldsymbol\theta$, where the corresponding policy $\pi_{\boldsymbol\theta}$ maximizes the expected cumulative discounted rewards:
\begin{equation}\label{eq:primal-obj}
J(\boldsymbol\theta) = \mathbb{E}\left[ \sum_{t=0}^T \gamma^t r(s_t, a_t) \right]
\end{equation}
where $T$ is the horizon of an episode.
\subsubsection{Observation space and action space}
As mentioned above, the observation for each robot consists of four parts $[\mathbf{o}_l, \mathbf{o}_v, \mathbf{o}_g, \mathbf{o}_p]$. The 2D laser scans data $\mathbf{o}_l$ consists of 90 measurements from a 360$^\circ$ LiDAR, the velocity $\mathbf{o}_v$ is in Cartesian coordinate, and all of the positions (i.e., $\mathbf{o}_g$ and $\mathbf{o}_p$) are transformed to the local robot coordinate frame from global coordinates.
In our case, the robots are omnidirectional and the control command is the velocity in Cartesian coordinate, i.e., $\mathbf{a} = [v_x, v_y]$. For practical purpose, we shrink the output of the policy $\pi_{\boldsymbol\theta}$ to fit the maximum value of velocity, i.e., $\lVert\mathbf{a}\rVert \leq v_{max}$.
\subsubsection{Reward design}\label{sec:reward}
The robot team is supposed to get into the target zone without collisions.
To achieve this, the reward function for each robot $i$ is designed to encourage approaching the target zone and avoiding collisions with other robots and obstacles $\mathbf{p}_{obs}$:
\vspace{-2mm}
\begin{equation}
r^{i}(s_t,a_t) = r_g^{i,t} + r_c^{i,t}
\end{equation}
where $r_g^{i,t}$ is the reward when the robot approaches the target, or all of the robots enter the target zone:
\begin{align}
r_g^{i, t} =
\begin{cases}
r_{goal}
&
\begin{aligned}
&\text{if}\; \text{dst}(j,t) < R_g - R_r \\
&\forall j\in [1,N]
\end{aligned}\\
w_g( \text{dt}(i,t-1) - \text{dst}(i,t) ) &\text{otherwise}
\end{cases}
\end{align}
where $\text{dst}(i,t) = \norm{ \mathbf{p}_i^t - \mathbf{g} }$ denotes the distance to goal for robot $i$ at timestep $t$ and $w_g > 0$.
$r_c^{i,t}$ is to penalize collisions among robots or obstacles:
\begin{align}
r_c^{i, t} =
\begin{cases}
r_{coll}
&
\begin{aligned}
&\text{if} \norm{ \mathbf{p}_i^t - \mathbf{p}_{obs} } < R_r \\
&\text{or} \norm{\mathbf{p}_i^t - \mathbf{p}_j^t} < 2R_r\;\forall j\in[1,N],j\ne i
\end{aligned}\\
0
&\text{otherwise}
\end{cases}
\end{align}
We empirically set $r_{coll}=-100$, $r_{goal}=100$ and $w_g=10$.
\subsection{Global connectivity constraint}\label{sec:conn_constraint}
The approach for global connectivity maintenance of communication networks is based on the second smallest eigenvalue of the associated graph Laplacian, which is briefly described below and used to formulate a connectivity constraint later on.
Consider a multi-agent systems with positions denoted as $\mathbf{p}_i\in\mathbb{R}^2, i\in\{1,2,\dots,N\}$.
Each pair of agents $i$ and $j$ can communicate with each other within an identical limited distance $R_c$,
i.e., $\lVert \mathbf{p}_i - \mathbf{p}_j\rVert\leq R_c$.
The communication topology can be represented as an undirected
graph $\mathcal{G}=\{ V, E \}$ where each vertex $v_i\in V$ denotes the $i$-indexed agent
and each edge $e_{ij}\in E$ denotes the communication availability between agents $i$ and $j$.
The Laplacian matrix of graph $\mathcal{G}$ is defined as $L=D-A$
where $A\in\mathbb{R}^{N\times N}$ is the adjacency matrix and each element $a_{ij}=1$
if $e_{ij}\in E$ and $a_{ij}=0$ otherwise.
$D\in\mathbb{R}^{N\times N}$ is the degree matrix,
which is diagonal, i.e., $D= \text{diag}\{ \phi_1, \phi_2,\dots,\phi_N \}$
and the $i$-th element of the diagonal is $\phi_{i}=\sum_{j=1}^N a_{ij}$.
The second smallest eigenvalue of the Laplacian matrix, denoted as $\lambda_2(\mathcal{G})$,
describes \textit{algebraic connectivity} of the graph $\mathcal{G}$
as $\lambda_2(\mathcal{G}) \geq 0$ always holds if $\mathcal{G}$ is connected~\cite{fiedler1973algebraic}.
With the RL formulation, the robot team learns to navigate to the target zone.
To impose global connectivity to the team, we introduce a cost function $c(s_t,a_t):\mathcal{S}\times\mathcal{A}\to\mathbb{R}$ that use the algebraic connectivity measurement::
\begin{equation}
c(s_t,a_t) = \mathbb{I}(\lambda_2(\mathcal{G}_t) < 0 )
\end{equation}
where $\mathbb{I}$ is the indicator function and $\lambda_2(\mathcal{G}_t)$ is the algebraic connectivity of the graph $\mathcal{G}_t$ which is constructed by $[\mathbf{p}_1^t,\mathbf{p}_2^t,\dots,\mathbf{p}_N^t]$ at timestep $t$.
Note that the robots can infer $\lambda_2(\mathcal{G}_t)$ from positions of the teammates $\mathbf{o}_p^t$. As global connectivity serves as a constraint, the multi-robot navigation problem is extended to a constrained RL formulation. Specifically, constrained RL aims to optimize the policy while bounding expected discounted returns with respect to the cost function:
\vspace{-2mm}
\begin{equation}\label{eq:second_obj}
J_c(\boldsymbol\theta) = \mathbb{E}\left[ \sum_{t=0}^T \gamma_c^t c(s_t, a_t) \right]
\end{equation}
The Eq.~(\ref{eq:second_obj}) is formed in terms of the expected value of trajectories. Similar to~\cite{pfeiffer2018reinforced}, by setting the discount factor $\gamma_c$ close to 1, we are able to constrain the total number of constraint violations per trajectory to be less than the desired threshold $d$.
In this work, we use Constrained Policy Optimization (CPO)~\cite{achiam2017constrained} to solve this constrained RL problem:
\vspace{-2.5mm}
\begin{equation}\label{eq:constrained-rl}
\begin{aligned}
\boldsymbol\theta^\ast =\;& \arg\max \;J(\boldsymbol\theta) \\
\text{s.t.} & \;J_c(\boldsymbol\theta) \leq d
\end{aligned}
\end{equation}
where $d$ is the upper bound. CPO adopts trust region methods for local policy search, which is introduced in Trust Region Policy Optimization (TRPO)~\cite{schulman2015trust}. TRPO uses a constraint on the Kullback-Leiber (KL) divergence of two stochastic policies between updates to stabilize policy training with monotonic improvement guarantees.
Similarly, CPO replaces the original objective and constraint in Eq.~(\ref{eq:constrained-rl}) with surrogate functions in a trust region:
\vspace{-2.5mm}
\begin{equation}\label{eq:cpo-problem}
\begin{aligned}
\boldsymbol\theta^{k+1} =\;& \arg\max_{\boldsymbol\theta} \;\mathbb{E}_{s,a\sim d^{\pi_{k}}}\left[\frac{\pi_{\boldsymbol\theta}(s)}{\pi_k(s)} A^{\pi_k}(s,a) \right] \\
\text{s.t.} & \; J_c(\boldsymbol\theta^k) + \mathbb{E}_{s,a\sim d^{\pi_k}}\left[ \frac{\pi_{\boldsymbol\theta}(s)}{\pi_k(s)} \frac{A_c^{\pi_k}(s,a)}{1-\gamma_c} \right] \leq d \\
& \;\bar{D}_{KL}(\pi_{\boldsymbol\theta} || \pi_{k}) \leq \eta
\end{aligned}
\end{equation}
\vspace{-0.5mm}
where $\bar{D}_{KL}(\pi_{\boldsymbol\theta} || \pi_{\boldsymbol\theta_k})$ is the average KL divergence between two consecutive policies and $\eta > 0$ is the step size.
Advantages functions $A^{\pi_k}(s,a),A_c^{\pi_k}(s,a)$ are introduced in Eq.~(\ref{eq:cpo-problem}) which can be estimated by function approximators $V_{\boldsymbol\phi}, V_{\boldsymbol\phi_c}$ with one-step TD error
$A(s,a) = r(s,a) + \gamma V(s_{t+1}) - V(s_t)$.
CPO approximately solves the surrogate optimization in Eq.~(\ref{eq:cpo-problem}). Due to approximation errors, CPO asymptotically bounds the constraint during training.
One may refer to \cite{achiam2017constrained} for details.
\subsection{Behavior cloning}\label{sec:bc}
In fact, the optimization problem in Eq.~(\ref{eq:constrained-rl}) regarding two objectives (i.e., Eq.~(\ref{eq:primal-obj}) and Eq.~(\ref{eq:second_obj})) is usually infeasible as it leads to conservative policy explorations in stochastic domains even without a trust region constraint. In our case, connectivity constraint leads to in-place oscillations, and the robots can not learn to navigate to the target.
To make this policy optimization tractable, we introduce the behavior cloning (BC) technique during RL training.
In many robotic tasks such as manipulation, limited demonstration data can be collected, but an expert policy for all states is usually infeasible~\cite{vecerik2017leveraging,rajeswaran2017learning}.
However, for map-less navigation, recent successful practices have shown that an expert can be obtained by RL methods without great effort.
In particular, given observation $\tilde{\mathbf{o}} = [\mathbf{o}_l, \mathbf{o}_v, \mathbf{o}_g]$ and the same reward structure ($N=1$) in Sec\ref{sec:reward}, RL (we use Soft Actor-Critic~\cite{haarnoja2018soft} here) can train a navigation expert policy $\pi_E(\tilde{\mathbf{o}})$ for a single robot efficiently.
Though BC is widely used for pre-training to provide initialization for RL. As a result, pre-training from a navigation expert can not provide a good bootstrap for this problem since it performs undesired behaviors that break the global connectivity.
Instead, we incorporate BC into RL training.
With a navigation expert $\pi_E$, a supervised mean square error (MSE) loss function is constructed to minimize the difference with $\pi_{\boldsymbol\theta}$:
\vspace{-1.5mm}
\begin{equation}\label{eq:bc}
J_{BC}(\boldsymbol\theta) =
\frac{1}{T}\sum_{t=0}^T
\norm{ \pi_E(\tilde{\mathbf{o}}^t) - \pi_{\boldsymbol\theta}(\mathbf{o}^t) }^2
\end{equation}
Then the original RL objective Eq.~(\ref{eq:primal-obj}) is modified with this additional BC loss term:
\vspace{-1.5mm}
\begin{equation}\label{eq:new_obj}
\tilde{J}(\boldsymbol\theta) = J(\boldsymbol\theta) - \lambda_e J_{BC}(\boldsymbol\theta)
\end{equation}
where $\lambda_e > 0$ is a hyper-parameter.
As a result, the robots attempt to mimic the expert behaviors when optimizing the objective Eq.~(\ref{eq:new_obj}) but eventually surpass the performance of expert $\pi_E$ due to improvements from the policy gradients of the RL term Eq.~(\ref{eq:primal-obj}).
\subsection{Neural network structure}
We follow the common practices~\cite{long2018towards,lin2019end, zhang2020map} in the parameterization of policy $\pi_{\boldsymbol\theta}$ and adopt a similar network structure as shown in Fig.~\ref{fig:network}. The raw laser data $\mathbf{o}_l$ is processed by two 1D convolution (\texttt{Conv1D}) layers and a fully connected (\texttt{FC}) layer for feature extraction. The output feature vector is concatenated with the rest of observation vector $[\mathbf{o}_v, \mathbf{o}_g, \mathbf{o}_p]$ and are fed into two hidden \texttt{FC} layers. Then the velocity output $\mathbf{a}_{mean}$ is obtained from the last \texttt{FC} layer. As suggested by a large scale experimental results~\cite{engstrom2019implementation}, we use hyperbolic tangent (\texttt{tanh}) as activation functions and orthogonal initialization scheme to initialize network weights.
The output $\mathbf{a}_{mean}$ is supposed to be the mean of the action distribution. A separate vector $\mathbf{a}_{logstd}$ with the same dimension as $\mathbf{a}_{mean}$ is defined as the log standard deviation that will be updated alone. In this way, the stochastic policy $\pi_{\boldsymbol\theta}$ is formed as a Gaussian distribution $\mathcal{N}\left(mean=\mathbf{a}_{mean}, std=\exp(\mathbf{a}_{logstd})\right)$. At each timestep $t$, the robots take random actions $\mathbf{a}^t\sim \pi_{\boldsymbol\theta}(\mathbf{o}^t)$ for on-policy exploration.
The value networks $V_{\boldsymbol\phi}$ and $V_{\boldsymbol\phi_c}$ are introduced for advantage estimation and both constructed with two hidden and one output \texttt{FC} layers to map the observation $\mathbf{o}$ to value estimates.
\begin{figure}[t]
\centering
\begin{subfigure}{0.25\textwidth}
\centering
\includegraphics[width=0.85\textwidth]{fig/value-network}
\caption{Value network}
\end{subfigure}%
\begin{subfigure}{0.25\textwidth}
\centering
\includegraphics[width=0.95\textwidth]{fig/policy-network}
\caption{Policy network}%
\end{subfigure}
\caption{Network structure. Conv1D (filters, kernel, stride) denotes the 1D convolutional layer, FC denotes the fully-connected layer.}
\vspace{-5mm}
\label{fig:network}
\end{figure}
\subsection{Policy training}
\subsubsection{Simulation setup}
Since RL is considerably sample inefficient, the expert policy $\pi_E$ and the shared policy $\pi_{\boldsymbol\theta}$ are trained in the simulation where sufficient samples are available. The multi-robot navigation is simulated in a custom OpenAI Gym environment~\cite{1606.01540}. We use the domain randomization technique~\cite{tobin2017domain} in order to avoid overfitting and bridge the sim-to-real gap. Concretely, we build 100 2D maps in total where several elements are randomly initialized, including target positions, starting points of robots, and obstacle configurations (numbers, shapes, positions, and sizes) as shown in Fig.~\ref{fig:simulation-scenes}.
\vspace{-2mm}
\begin{figure}[h]
\begin{subfigure}{0.12\textwidth}
\centering
\includegraphics[width=\textwidth]{fig/sim1}
\end{subfigure}\hspace{\fill}%
\begin{subfigure}{0.12\textwidth}
\centering
\includegraphics[width=\textwidth]{fig/sim2}
\end{subfigure}\hspace{\fill}%
\begin{subfigure}{0.12\textwidth}
\centering
\includegraphics[width=\textwidth]{fig/sim3}
\end{subfigure}\hspace{\fill}%
\begin{subfigure}{0.12\textwidth}
\centering
\includegraphics[width=\textwidth]{fig/sim4}
\end{subfigure}
\caption{ Selected simulation scenarios. Simulation configurations are randomly generated. The robots (colorful circles) aim to get into the target (red dashed line) and avoid obstacles (gray). The green lines represent connectivity links between robots. }
\label{fig:simulation-scenes}
\end{figure}
\hypersetup{linkcolor=black}
\hypersetup{linkcolor=RoyalPurple}
\vspace{-3mm}
\subsubsection{CPO policy update}
The policy training algorithm is shown in Algorithm~\ref{algo:cpo}.
The robots collect transition data simultaneously in several maps that are randomly selected. At each timestep $t$, each robot takes actions generated from the shared policy $\pi_{\boldsymbol\theta}$ given its own observation $\mathbf{o}^{i,t}$ and then receives its immediate reward $r^{i,t}$ and a shared connectivity cost signal $c^t$.
When the number of collected transition data is sufficient (i.e., greater than $N_{batch}$), we use the batch of episodes collected by all robots to update policy $\pi_{\boldsymbol\theta}$.
To build up CPO formulation,
the objective and the constraint are approximated with advantage estimates (line \ref{line:adv}). We then use the well-behaved expert $\pi_E$, which is trained in advance to compute the supervised BC loss with all transition data (line \ref{line:bc}). The policy network $\pi_{\boldsymbol\theta}$ is optimized by CPO with regard to the combined objective in Eq. (\ref{eq:new_obj}).
The value networks $V_{\boldsymbol\phi}$ is optimized with the following loss function:
\begin{equation}\label{eq:value_loss}
L_V(\boldsymbol\phi) =
\sum_{t=1}^T \norm {V_{\boldsymbol\phi}(s_t) - \sum_{l=0}^\infty \gamma^t r(s_{t+l},a_{t+l}) }^2
\end{equation}
Eq.~(\ref{eq:value_loss}) is computed with all sampled trajectories and minimized with an L-BFGS optimizer.
The cost value network $V_{\boldsymbol\phi_c}$ is updated in the same fashion in terms of cost signals.
\begin{algorithm}[t]
\begin{algorithmic}[1]
\State Apply orthogonal initialization to policy network $\pi_{\boldsymbol\theta}$ and value networks $V_{\boldsymbol\phi}, V_{\boldsymbol\phi_c}$, provide expert policy $\pi_E$
\State $\psi_{s} = 1$
\For{ episode $\psi=1,2,\dots$ }
\State Receive initialized observations $\{ \mathbf{o}^{i,t} \}_{i=1}^N$ from the environment
\For{robot $i=1,2,\dots,N$ }
\State Take action $\mathbf{a}^{i,t}\sim \pi_{\boldsymbol\theta}(\mathbf{o}^{i,t})$\label{line:sample}
\State Receive reward $r^{i,t}$ and cost signal $c^t$ \label{line:r_c}
\State Repeat \ref{line:sample} and \ref{line:r_c}, collect transition data $(\mathbf{o}^{i,t},\mathbf{a}^{i,t},r^{i,t},c^t)$ for $T_\psi$ timesteps
\EndFor
\hypersetup{linkcolor=RoyalPurple}
\If{ $\sum_{j=\psi_{s}}^\psi T_j > N_{batch}$ }
\State // \textit{Update $\pi_{\boldsymbol\theta}$ and $V_{\boldsymbol\phi}, V_{\boldsymbol\phi_c}$ in batch }
\State Compute advantage estimates for batch data
$r^{i,t} + \gamma V_{\boldsymbol\phi}(\mathbf{o}^{i+1,t}) - V_{\boldsymbol\phi}(\mathbf{o}^{i,t})$,
$c^{t} + \gamma V_{\boldsymbol\phi_c}(\mathbf{o}^{i+1,t}) - V_{\boldsymbol\phi_c}(\mathbf{o}^{i,t})$\label{line:adv}
\State Compute BC loss term Eq. (\ref{eq:bc}) with expert policy $\pi_E$ and add to the surrogate objective\label{line:bc}
\State Update $\boldsymbol\theta$ by approximately solving CPO in Eq. (\ref{eq:cpo-problem})
\State Update $\boldsymbol\phi, \boldsymbol\phi_c$ by minimizing Eq. (\ref{eq:value_loss}) with L-BFGS~\cite{liu1989limited}
\EndIf{}
\State $\psi_s = \psi$
\hypersetup{linkcolor=black}
\EndFor
\end{algorithmic}
\caption{Policy Training with CPO and BC}
\label{algo:cpo}
\end{algorithm}
We implement our neural network models in PyTorch. All training procedures and simulation experiments are performed on a computer with an Nvidia RTX 2080 GPU and an Intel Xeon Gold 6254 CPU.
Each timestep takes about 2 $\mathrm{ms}$ in various simulations.
The primal hyper-parameters for Algorithm~\ref{algo:cpo} are shown in Tab.~\ref{tab:param}.
\vspace{-3mm}
\begin{table}[h]
\caption{Key parameter settings for training}
\label{tab:param}
\centering
\begin{tabular}{c|c|c}
\hline
\hline
Parameter & Description & Value \\
\hline
$N_{batch}$ & number of timesteps for each update & 2048 \\
$\gamma$ & discount factor for reward & 0.99 \\
$\gamma_c$ & discount factor for cost & 0.999 \\
$\lambda_e$ & coefficient for BC loss & 0.1 \\
$lr_\phi$, $lr_{\phi_c}$ & L-BFGS step size for $V_{\boldsymbol\phi}, V_{\boldsymbol\phi_c}$ & 0.1 \\
$\eta$ & KL constraint threshold & 0.01 \\
$d$ & connectivity constraint threshold & 0.1 \\
\hline
\hline
\end{tabular}
\end{table}
\vspace{-4mm}
\section{Experiments and results}
To demonstrate the effectiveness of our approach, we first investigate the influences of behavior cloning and the connectivity constraint on policy performance.
Then we evaluate the performance of our approach in real-world experiments.\begin{table}[t]
\caption{Evaluation of generalization performance on various approaches with the different number of robots. The results are evaluated in 100 unseen scenarios.}
\label{tab:performance}
\centering
\begin{tabular}{c|c|c|c|c}
\hline
\hline
Metrics & Approach & 3 robots & 4 robots & 5 robots \\
\hline
\multirow{3}{*}{Success Rate} & CPO & 0.05 & 0.02 & 0.03\\ & TRPO+BC & 0.9 & 0.95 & 0.95 \\
& CPO+BC & 0.87 & 0.88 & 0.82\\
\hline
\multirow{3}{*}{Connectivity Rate} & CPO & 0.97 & 0.98 & 0.97\\
& TRPO+BC & 0.3 & 0.13 & 0.07\\
& CPO+BC & 0.73 & 0.77 & 0.71\\
\hline
\multirow{3}{*}{Travel Time} & CPO & 16.68 & 14.732 & 10.307\\ & TRPO+BC & 7.853 & 9.564 & 11.421\\
& CPO+BC & 7.28 & 8.697 & 9.163\\
\hline
\hline
\end{tabular}
\vspace{-3mm}
\end{table}
\vspace{-4mm}
\subsection{Comparisons on various approaches in simulation}
To study the influences of behavior cloning and connectivity constraint in our approach, we compare three approaches with different combinations:
\begin{itemize}
\item \textit{CPO}: policy optimization under the connectivity constraint without supervised BC loss term, i.e., the BC loss coefficient $\lambda_e=0$
\item \textit{TRPO+BC}: unconstrained policy optimization with supervised BC loss term where the connectivity constraint is removed.
\item \textit{CPO+BC (our approach)}: policy optimization under the connectivity constraint and the supervised BC loss term
\end{itemize}
The three approaches are compared in terms of average rewards and constraint value during training.
To quantitatively measure the final performance of the approaches, we use the following metrics:
\begin{itemize}
\item \textit{Success Rate}: the ratio of the robot team to reach targets without collisions
\item \textit{Connectivity Rate}: the ratio of the robot team to maintain connectivity during navigation
\item \textit{Travel Time}: the average travel time for the robot team successfully navigates to targets
\end{itemize}
We randomly re-generate 100 maps for final performance evaluation. We conduct experiments with the various number of robots in simulation and evaluate the performance on average with 5 random seeds for each approach. The evolution of learning curves is consistent across different simulation settings, and we present one of the results (3 robots) in Fig.~\ref{fig:avg-reward} and Fig.~\ref{fig:constraint-val}.
\begin{figure*}
\resizebox{\textwidth}{!}{
\begin{subfigure}{0.23\textwidth}
\centering
\includegraphics[width=\textwidth]{fig/avg-reward-new}
\caption{}%
\label{fig:avg-reward}
\end{subfigure}
\begin{subfigure}{0.23\textwidth}
\centering
\includegraphics[width=\textwidth]{fig/constraint-val-new}
\caption{}%
\label{fig:constraint-val}
\end{subfigure}
\begin{subfigure}{0.23\textwidth}
\centering
\includegraphics[width=\textwidth]{fig/conn0-new}
\caption{}%
\label{fig:conn-real-world}
\end{subfigure}
}
\caption{(a) The evolution of average rewards throughout the training process of various approaches. (b) The evolution of constraint value throughout the training process of various approaches. The black dashed line indicates the predefined threshold of constraint values. (c) Algebraic connectivity of the robot team in real-world experiments. The dashed line represents the connectivity threshold.}
\vspace{-7mm}
\label{fig:my_label}
\end{figure*}
\textit{Influence of behavior cloning}:
Comparing $\textit{CPO}$ and $\textit{CPO+BC}$ shows that behavior cloning help to improve the policy convergence speed, as shown in Fig.~\ref{fig:avg-reward}. In fact, \textit{CPO} fails to learn to navigate in most of the training maps because of influences of the connectivity constraint. This is supported by the constraint value evolution over time in Fig.~\ref{fig:constraint-val}. As shown in Tab.~\ref{tab:performance}, the \textit{CPO} policy leads to terrible failures in terms of navigation success rate and dedicates to preserve connectivity in testing scenarios, which are undesired behaviors for navigation tasks.
\textit{CPO+BC} stabilizes the constraint value to be close to the threshold and succeeds in the majority of unseen scenarios. We conclude that BC has significant effects on policy improvement.
\textit{Influence of connectivity constraint}:
Comparing \textit{CPO+BC} and \textit{TRPO+BC} shows that \textit{CPO+BC} is inferior in terms of policy convergence speed. This is due to the fact that \textit{CPO+BC} learns to satisfy the constraint. However, \textit{TRPO+BC} leads to
high constraint values without bounding the constraint on training convergence. The final performance presented in Tab.~\ref{tab:performance} also proves that \textit{TRPO+BC} fails to maintain connectivity in most cases even it has good navigation performance. Surprisingly, \textit{CPO+BC} outperforms \textit{TRPO+BC} at travel time. We believe that it is because \textit{CPO+BC} learns implicit cooperative schemes as presented in many cases.
Compared to \textit{TRPO+BC}, \textit{CPO+BC} leads to sub-optimal navigation success rate but we find that most of the failures are caused where the team struggles in complex scenarios which require great exploration abilities. This result indicates that enforcing connectivity constraints degrades the ability of navigation exploration. Compared with CPO, TRPO allows to take "risky" actions without concerns of constraints satisfaction. Both \textit{CPO+BC} and \textit{TRPO+BC} show consistent performance across the various number of robots in the experiment results listed in Tab.~\ref{tab:performance}.
\vspace{-10mm}
\subsection{Real-world experiments}
\vspace{-4mm}
As \textit{CPO+BC} and \textit{TRPO+BC} have good navigation performance in simulation, we deploy the policies trained by both methods to evaluate their sim-to-real capabilities. The deployed policies take around 2M training timesteps.
\textit{Real robot configuration}:
Our holonomic robot model is shown in Fig.~\ref{fig:robot}.
The robot is equipped with DJI Mecanum wheel chassis for omnidirectional mobility and an RPLIDAR A2 laser range scanner. Each LiDAR on a robot is deployed at a different height to detect each other. We evenly pick 90 measurements from every 360$^\circ$ laser scan.
The robot is controlled by a Jetson TX2 module that publishes the policy output at 10Hz.
For both the simulations and the real-world experiments we set
the radius of the robot $R_r=0.18\mathrm{m}$ and the maximum moving speed $v_{max}=0.7\mathrm{m}/\mathrm{s}$. We set $R_c=1.2\mathrm{m}$ to emulate limited communication range.
To distribute position information to the robots, we use an OptiTrack global tracking system to capture and inform the states of robots and the target position.
The
robots receive laser data and position information by subscribing to ROS nodes of LiDAR and OptiTrack.
\begin{minipage}[!t]{0.48\textwidth}
\begin{minipage}[h]{0.5\textwidth}
\begin{figure}[H]
\includegraphics[width=\textwidth]{fig/robot}
\caption{Illustration of the robot.}
\label{fig:robot}
\end{figure}
\end{minipage}\hspace{\fill}
\begin{minipage}[h]{0.44\textwidth}
\begin{figure}[H]
\begin{subfigure}{0.92\textwidth}
\centering
\includegraphics[width=\textwidth]{fig/scene1}
\end{subfigure}\vspace{1mm}
\begin{subfigure}{0.92\textwidth}
\centering
\includegraphics[width=\textwidth]{fig/scene2}
\end{subfigure}\vspace{1mm}
\begin{subfigure}{0.92\textwidth}
\centering
\includegraphics[width=\textwidth]{fig/scene3}
\end{subfigure}
\caption{ Real-world scenarios. }
\label{fig:scene}
\end{figure}
\end{minipage}
\vspace{3mm}
\end{minipage}
The policies are tested in various scenarios (shown in Fig.~\ref{fig:scene}) and show consistent performance as in simulation on the three metrics in Tab.~\ref{tab:performance}. The experiment results are summarized in Fig.~\ref{fig:conn-real-world}, which shows the value of algebraic connectivity of the robots, as the multi-robot system evolves. Our approach (i.e., \textit{CPO+BC}) takes less travel time and maintains connectivity at all time while \textit{TRPO+BC} fails in connectivity perseverance (the value goes to 0).
\vspace{-1.5mm}
\section{Conclusion}
In this work, we present an RL-based approach to develop a decentralized policy for multi-robot navigation with connectivity maintenance.
The policy is shared among robots and jointly optimized by transition data of all robots in simulation during training. By enforcing the connectivity constraint and providing expert demonstrations, the policy learns to generate navigation actions with connectivity concerns. We compare different combinations of our key designs and validate the effectiveness of our approach. We also evaluate the generalization performance of our approach in both various simulated scenarios and real-world experiments.
As a case study of RL-based approach, this work presents an effective way to reduce exploration complexity with concerns of constraints satisfaction.
| {'timestamp': '2021-09-20T02:17:32', 'yymm': '2109', 'arxiv_id': '2109.08536', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08536'} | arxiv |
\section{Introduction}
Recent breakthroughs of Reinforcement learning (RL) have shown promising results from Atari games \citep{mnih2013atari}, MuJoCo continuous control \citep{todorov2012mujoco}, robotics \citep{levine2016robotics}, to autonomous driving \citep{highway-env}. However, in industrial scenarios such as power systems \citep{marot2021power-env}, resource allocation \citep{zoltners1980integer}, and scheduling \citep{wang2005scheduling}, the decision variables are often represented by integer quantities. Because the integer variables are not easily differentiable, they raise an issue to the DDPG-style policy gradient \citep{silver2014ddpg,haarnoja2018sac,fujimoto2018td3}, a state-of-the-art RL method. While the REINFORCE-based methods \citep{glynn1990reinforce,schulman2015trpo,schulman2017ppo} are still alternatives to the integer problem, they tend to have high variance \citep{Schulman2015advantage,wu2018variance} and have been shown to be outperformed by the DDPG-style methods \citep{haarnoja2018sac,fujimoto2018td3}. Therefore, it is of practical interest to study methods to parameterize integer random variables and apply them to DDPG-style RL methods.
Gumbel-Softmax is a state-of-the-art reparameterization method for discrete random variables \citep{Jang2017gumbel,Chris2017gumbel}. Combining with the Straight-Through estimators \citep{bengio2013st,Chung2017st}, the Straight-Through Gumbel-Softmax parameterization can represent a discrete random variable in the forward pass (of a neural network) and maintain differentiability in the backward pass. Since integer variables admit a discrete structure, it is appealing to apply the Gumbel trick for our integer problems.
Our key insight is that integer and discrete variables are fundamentally different: integer variables are comparable while the discrete variables aren't in general. For example, the elements in the integer set $\{1,2,3\}$ are comparable because $1<2<3$, while the discrete set $\{\text{dog},\text{cat},\text{frog}\}$ can't assign such a relation. Recall that the one-hot encoding is required for representing a discrete sample due to its incomparability. An integer set has comparability. Ideally, we only need an integer, not a one-hot vector, to represent an integer sample. In light of this fact, we propose a reparameterization for an integer random variable: use a linear mapping from a one-hot vector of Straight-Through Gumbel-Softmax to an integer. The mapped integer is random and differentiable (w.r.t. parameters of a neural network) because the one-hot vector is. Therefore, this is a valid reparameterization for integer random variables.
Another advantage of the integer-mapping trick is that the integer space can be mapped back to the ambient space, making the effective dimension irrelevant to the fineness of discretization. For example, suppose the ambient action space is an interval $\mathcal{A}=[-1,1]$, and the interval is discretized into $N\geq 2$ points. Then the discretized action space $\mathcal{A}_d=\{0,..,N-1\}$ is mapped back to the ambient action space using $\mathcal{T}(\mathcal{A}_d)=\mathcal{A}_d\frac{2}{N-1}-1$. Since $\mathcal{T}(\mathcal{A}_d)\subset [-1,1]$, the effective dimension of $\mathcal{T}(\mathcal{A}_d)$ remains to be one and irrelevant to the fineness of discretization $N$.
With (1) the differentiability and (2) the advantage on the effective dimension of action space, the proposed integer reparameterization is particularly useful for the DDPG-style method such as the Soft-Actor Critic (SAC) \citep{haarnoja2018sac}. Thereby, we propose a variant of SAC under integer actions by incorporating our integer reparameterization into the actor network (policy) with the critic network (Q function) staying the same. This is possible because (1) allows us to differentiate through actions and (2) makes the input/output dimension of the actor and critic networks the same as that of the continuous action version.
We validate the proposed SAC with integer actions on PyBullet robot control \citep{coumans2021bullet} and PowerGym power systems control \citep{fan2021powergym}. The results show the proposed SAC under integer actions achieve similar performance as the continuous action counterpart in PyBullet and can outperform the PPO \citep{schulman2017ppo} algorithm in PowerGym. Hence, this is a certificate of the effectiveness of our SAC with integer actions.
\section{Reinforcement Learning}
We consider an infinite-horizon Markov Decision Process (MDP) $\langle\mathcal{S},~\mathcal{A},~ T,~r,~\gamma\rangle$. $\mathcal{S},~\mathcal{A}$ are state and action spaces, $r(s,a,s')$ is the reward function, $\gamma\in(0,1)$ is the discount factor, and $T(s'|s,a)$ is the state transition density. Let the initial state distribution be $\rho_0$. The objective of RL is to find a policy $\pi$ that maximizes the $\gamma$-discounted cumulative reward:
\begin{equation}
\max_\pi J(\pi) = \max_\pi \mathbb{E}\left[\sum_{i=0}^\infty \gamma^i r(s_i,a_i)\Big\lvert s_0\sim\rho_0,~a_i\sim\pi(\cdot|s_i),~s_{i+1}\sim T(\cdot|s_i,a_i)\right].
\label{eq:rl_obj}
\end{equation}
Suppose the policy is parameterized by $\theta$ as $\pi_\theta$. A typical way to optimize Eq.~\eqref{eq:rl_obj} by tuning over $\theta$ is to use the policy gradient, which depends on the Q function under $\pi_\theta$:
\begin{equation}
Q^{\pi_\theta}(s,a)=\mathbb{E}\left[\sum_{i=0}^\infty\gamma^i r(s_i,a_i)\Big\lvert s_0=s,~a_0=a,~a_i\sim\pi_\theta(\cdot|s_i),~s_{i+1}\sim T(\cdot|s_i,a_i)\right].
\label{eq:qfunc}
\end{equation}
With $Q^{\pi_\theta}$ defined above, the policy gradient theorem~\citep{sutton2000policy} states that
\begin{equation}
\nabla_\theta J(\pi_\theta)=\mathbb{E}_{s\sim\rho^\pi,~a\sim\pi_\theta}[\big(\nabla_\theta \ln \pi_\theta(a|s)\big)Q^{\pi_\theta}(s,a)],
\label{eq:pg}
\end{equation}
where $\rho^\pi$ is the unnormalized discounted state distribution. Since the expectation of Eq.~\eqref{eq:pg} cannot be exactly computed, the gradient estimation becomes an important problem. We will review this topic specifically on discrete random variables in the next section.
\section{Gradient Estimation for Discrete Random Variables}
Let $D$ be a random variable from a discrete distribution with $N\geq 2$ elements. Let $S=\{s_1,...,s_N\}$ be the support of this discrete distribution. Without loss of generality, suppose the discrete distribution $p_\theta$ is parameterized by a neural network with parameter $\theta$. We can write
$$D\sim p_\theta,\quad\sum_{d\in S}p_\theta(d)=1.$$
Given an objective function $f:S\rightarrow\mathbb{R}$, we minimize
$$\min_\theta \mathbb{E}[f(D)],$$
where the expectation is taken over the random sample $D$. This can be done by computing some estimates of the gradient $\nabla_\theta \mathbb{E}[f]$, which we will review in this section.
\subsection{REINFORCE Estimator}
The REINFORCE estimator \citep{glynn1990reinforce,williams1992reinforce} utilizes a fact from the chain rule:
$$\nabla_\theta p_\theta(d)=p_\theta(d)\nabla_\theta \ln p_\theta(d)$$
Therefore, $\nabla_\theta \mathbb{E}[f]$ is reformulated as
$$\nabla_\theta \mathbb{E}[f]=\sum_{d}\nabla_\theta p_\theta(d)f(d)=\sum_{d}p_\theta(d)\nabla_\theta \ln p_\theta(d)f(d)=\mathbb{E}[\nabla_\theta\ln p_\theta(D)f(D)],$$
and the REINFORCE estimator simply takes Eq.~\eqref{eq:grad-reinforce} as an unbiased estimate of $\nabla_\theta \mathbb{E}[f]$.
\begin{equation}
\nabla_\theta\ln p_\theta(D)f(D)
\label{eq:grad-reinforce}
\end{equation}
Since the policy gradient Eq.~\eqref{eq:pg} and the REINFORCE estimator Eq.~\eqref{eq:grad-reinforce} share a similar form, it is tempting to develop a policy gradient algorithm upon the REINFORCE estimator. Examples of such algorithms include TRPO \citep{schulman2015trpo} and PPO \citep{schulman2017ppo}. With the REINFORCE estimator, TRPO and PPO have high variances and however do not require differentiable random actions. On the contrary, without the REINFORCE estimator, the DDPG-style methods have lower variances but require differentiable random actions. Hence, to reduce the variance, we want to build models for differentiable random actions and use DDPG-style methods such as the SAC to tackle our integer-constrained problem.
\subsection{Gumbel-Softmax}
Gumbel-Softmax \citep{Jang2017gumbel,Chris2017gumbel,paulus2021raoblackwellizing} provides an alternative solution of discrete random variable modeling. By introducing the softmax relaxation, it is considered to be of lower variances during the gradient computation.
Concretely, define the softmax function $\text{Softmax}:\mathbb{R}^n\rightarrow\mathbb{R}^n$ as $[\text{Softmax}(x)]_i=e^{x_i}/\sum_{j=1}^ne^{x_j}$ and suppose $\text{logit}_\theta\in \mathbb{R}^n$, the unnormalized log probability vector, is parameterized by $\theta$. The Gumbel-Max trick \citep{chris2014gumbel} states that
\begin{equation}
D\sim \text{Softmax}(\text{logit}_\theta)\overset{d}{=}\arg\max (\text{logit}_\theta+G),
\label{eq:gumbel-max}
\end{equation}
where G is an i.i.d. $n$-dimensional Gumbel(0,1) vector. $D\sim \text{Softmax}(\text{logit}_\theta)$ means that $D$ is sampled from the discrete probability distribution formed by $\text{Softmax}(\text{logit}_\theta)$. The notation $\overset{d}{=}$ means the left and the right have the same distribution.
Since Eq.~\eqref{eq:gumbel-max} is not differentiable (both the sampling and the argmax), the Gumbel-Softmax approximates the $\arg\max$ of Eq.~\eqref{eq:gumbel-max} using a Softmax function, which is differentiable.
\begin{equation}
D_{\text{GS}}=\text{Softmax} (\text{logit}_\theta+G)
\label{eq:gs}
\end{equation}
Despite bringing back the differentiability, Eq.~\eqref{eq:gs} inevitably introduces a bias since $D_{\text{GS}}$ is not an one-hot vector. This can be solved by the Straight-Through estimator \citep{hinton2012neural}[lecture 15b]. Let $D_{\text{hot}}=\text{OneHot}(D)$ be the one hot version of $D$ from the $\arg\max$ of Eq.~\eqref{eq:gumbel-max}. The Straight-Through Gumbel-Softmax \citep{Jang2017gumbel} introduces a constant shift of $D_{\text{GS}}$:
\begin{equation}
D_{\text{STGS}}=D_{\text{hot}}-[D_{\text{GS}}]_{\text{const}}+D_{\text{GS}},
\label{eq:stgs}
\end{equation}
where $[D_{\text{GS}}]_{\text{const}}$ treats $D_{\text{GS}}$ as a constant by detaching the dependency on $\theta$ during the backward propagation of a neural network. Both $D_{\text{hot}}$ and $[D_{\text{GS}}]_{\text{const}}$ are constants for derivatives w.r.t. $\theta$ are zeros. Therefore, $D_{\text{STGS}}$ is one-hot in the forward propagation (of a neural network) and differentiable in the backward propagation. Redefine the objective function as a differentiable $f:\mathbb{R}^n\rightarrow\mathbb{R}$. The gradient estimate under $D_{\text{STGS}}$ becomes
\begin{equation}
\nabla_{\theta} f(D_{\text{STGS}})=\bigg[\frac{\partial f(D_{\text{STGS}})}{\partial \theta_i}\bigg]_{i},
\label{eq:grad-stgs}
\end{equation}
where $\theta_i$ is the ith element of the model parameter $\theta$. The Straight-Through Gumbel-Softmax estimator is believed to be of lower variance, prevents error in forward propagation, and maintains sparsity \citep{bengio2013st,Chung2017st,Jang2017gumbel}. Hence, Eq.~\eqref{eq:grad-stgs} has become a popular alternative of Eq.~\eqref{eq:grad-reinforce}, and we would like to incorporate it into the SAC algorithm under a integer constraint setting.
\section{Differentiable Random Integers Using STGS}
Although Straight-Through Gumbel-Softmax (STGS) provides a good reparameterization for discrete random variables, directly using discrete variables from STGS to represent integer variables will result in high dimensionality. Thereby, in this section, we will discuss the structure of integer variables and propose a simple linear map trick to reparameterize an integer variable from STGS.
Integer variables usually appear in the industrial setting for the modeling of integer-only or binary decision variables. Integer-only variables can be the number of products or the number of a device's modes. Binary decision variables can be whether to open/close a connection or occupy/release a resource. Despite the discreteness, integer and continuous variables share one thing in common: comparability, or more mathematically, form a totally ordered set. This is the key that makes integer variables distinct from discrete counterparts and allows us to treat integer variables like continuous instead of discrete/categorical variables.
Precisely, a totally ordered set $S$ is a set that satisfies reflexivity ($a\leq a,~\forall~a\in S$), antisymmetry ($a\leq b~\&~b\leq a\Rightarrow a=b$), transitivity ($a\leq b~\&~b\leq c\Rightarrow a\leq c$), and comparability ($\forall~a,b~\in~S,~\text{either}~a\leq b~\text{or}~b\leq a$). It is obvious that a continuous variable (e.g.~$x\in~[-1,1]$) and a integer variable (e.g.~$x\in\{0,1,2\}$) range in totally order sets. On the other hand, a discrete/categorical set does not admit a natural comparison; e.g.,~for~$\{\text{dog},\text{cat}\}$, cat and dog are incomparable. Thus, the comparability fails, and neither do the other properties of the totally ordered set.
Due to the lack of comparability, we usually use an one-hot encoding to represent a discrete/categorical variable; e.g., for $\{\text{dog},\text{cat}\}$, we have dog$\rightarrow[1,0]$ and cat$\rightarrow[0,1]$. The encoding dimension inevitably depends on the size of the range, and this becomes problematic when the range is of large size or when there are multiple discrete variables. On the other hand, with the comparability, an integer variable's effective dimension is only one, regardless of the size of its range; e.g., both variables with range $\{0,1\}$ or $\{0,...,32\}$ need only one dimension to represent. Since the integer variable does not require a one-hot encoding, once being generated, we can treat it like a continuous variable in the subsequent computation. This greatly reduces the computational overhead and is the key to designing a SAC algorithm under integer actions.
The proposed integer reparameterization is as follows. Recall that the Straight-Through Gumbel Softmax, Eq.~\eqref{eq:stgs}, generates a differentiable one-hot random vector $D_{\text{STGS}}$. Then, $\underset{i}{\arg\max} D_{\text{STGS}}[i]$, the index/argument of $1$ in $D_{\text{STGS}}$, is an integer random variable following the distribution formed by $\text{Softmax}(\text{logit}_\theta)$, as the LHS of Eq.~\eqref{eq:gumbel-max}. Thereby, once establishing an differentiable mapping from $D_{\text{STGS}}$ to $\underset{i}{\arg\max} D_{\text{STGS}}[i]$, we can have an differentiable random integer parameterized by $\theta$. Such a differentiable mapping can be constructed by a simple linear map:
\begin{equation}
\text{Ind}_\theta=\langle [0,1,...,n-1],D_{\text{STGS}} \rangle,
\label{eq:integer-para}
\end{equation}
where $\langle\cdot,\cdot\rangle$ is an inner product and $D_{\text{STGS}}$ is assumed to be $n$-dimensional.
Eq.~\eqref{eq:integer-para} gives a parameterized random integer $\text{Ind}_\theta$ with value equaling to $\underset{i\in[0,...,n-1]}{\arg\max} D_{\text{STGS}}[i]$. We apply this to the SAC under integer actions as follows. Since each integer action is of effective dimension 1 (in a euclidean space), the action dimension is precisely the number of integer action variables. Thereby, the input/output dimension of the actor network (policy) and the critic network (Q function) is the same as their continuous action counterparts. The only difference lies in the policy network design, where we restrict the output to have an integer structure using Eq.~\eqref{eq:integer-para}
while the continuous action version doesn't have such a restriction.
\section{Related Work}
Reinforcement learning (RL) with discrete action space has been studied in different aspects over the literature. Due to the high dimensionality of a discretized action space, it has been of great interest to scale RL to large spaces using a neural network. Examples of this line of research include sequentially predicting an action dimension at a time \citep{metz2017discrete}, training a Q function for each action dimension \citep{tavakoli2018action}, and factorizing the action across dimension using the natural ordering
between discrete actions \citep{tang2020discretizing} or normalizing flows \citep{tang2018boosting,delalleau2019discrete}. Various techniques have been proposed in different settings. When the action space admits a continuity structure, a discrete action can be derived by rounding a continuous one \citet{Hasselt2009discrete}. When the action is represented by a one-hot vector, discrete soft actor-critic \citep{christodoulou2019sac-disc} and Gumbel-Softmax \citep{yan2021discrete} have been taken as key techniques to tackle RL problems.
Our work and the literature share the same motivation as to apply RL to large action spaces. Although our work includes techniques that have been studied (e.g., SAC and Gumbel-Softmax), we reformulate them using a more efficient representation. For example, the one-hot encoding is required in discrete soft actor-critic \citep{christodoulou2019sac-disc} and Gumbel-Softmax for image-text matching \citep{yan2021discrete}. However, as proposed in Eq.~\eqref{eq:integer-para}, our integer representation is much simpler than a one-hot encoding. The key reason for having such a reduction is that an integer set admits a continuity structure. Although this continuity observation has been used to justify the rounding technique \citep{Hasselt2009discrete}, rounding gives only a non-differentiable integer, rather than a differentiable one as required in this work. Hence, our work is different from the literature in the sense that we re-organize the techniques and give a simpler representation of differentiable random integers.
\section{Experiments and Discussions}
We evaluate our integer reparameterization for SAC on two OpenAI Gym environments \citep{brockman2016openai}: PyBullet robot control \citep{coumans2021bullet} and PowerGym power network control\cite{fan2021powergym}. The results show the proposed SAC under integer actions achieve similar performance as the continuous action version in Pybullet and outperform PPO \citep{schulman2017ppo} algorithm in PowerGym. Hence this shows the effectiveness of SAC under the proposed integer reparameterization.
\subsection{PyBullet Environment}
PyBullet is an open-source version of the MuJoCo environment \citep{todorov2012mujoco} for robot control tasks. Compared to MuJoCo, PyBullet is license-free and is reported to be more difficult to solve \citep{tan2018bullet-exp,fayad2021bullet-exp}. Since the actions in PyBullet are continuous and bounded, we can derive the integer action version of PyBullet by discretizing the actions. Hence, we adopt the PyBullet environment to evaluate the performance discrepancy between integer actions and continuous actions for robot control tasks.
Since each dimension of a PyBullet action is bounded in an interval $I=[-1,1]$, we can discretize each dimension of the action as follows. Suppose the interval $I$ is discretized into $N\geq 2$ integers as $I_\text{d}=\{0,~1,...,N-1\}$. After having an integer action $a\in I_\text{d}$, $a$ is embedded into $I$ by
$$\mathcal{T}(a)=a\frac{2}{N-1}-1\in I.$$
Such discretization produces a discrete action space with size $N^K$ where $K$ is the euclidean dimension of the original continuous action space. The size quickly becomes intractable if using a one-hot encoding for the discrete actions. Even if using a multi-hot encoding, the size of a multi-hot vector, $NK$, is still undesirable for the implementation of the actor and critic networks. On the other hand, the proposed integer reparameterization, Eq.~\eqref{eq:integer-para} produces an integer vector of size $K$ because each integer action is of effective dimension 1. Hence, the discretized environment is highly nontrivial under one-hot and multi-hot encodings but is feasible under the proposed integer reparameterization.
\begin{figure}[!ht]
\centering
\includegraphics[width=0.4\textwidth]{Reacher.pdf}
\includegraphics[width=0.4\textwidth]{Hopper.pdf}
\includegraphics[width=0.4\textwidth]{HalfCheetah.pdf}
\includegraphics[width=0.4\textwidth]{Walker2D.pdf}
\caption{Experiments on PyBullet. The solid lines are the averages and the shaded regions are the standard deviation. d9 and d17 mean to discretize each dimension of the action space into 9 and 17 integers, respectively.}
\label{fig:bullet-exp}
\end{figure}
\begin{table}[!ht]
\centering
\begin{tabular}{lllll}
\hline
\hline
\textbf{Environment} & Reacher & Hopper & HalfCheetah & Walker2D \\ \hline
\textbf{Temperature} & 0.005 & 0.05 & 0.02 & 0.06\\
\hline
\hline
\end{tabular}
\caption{Temperature parameters for PyBullet environments.}
\label{tbl:bullet-temp}
\end{table}
We run SAC in continuous or discretized (integer) actions in four PyBullet environments: Reacher, Hopper, HalfCheetah, Walker2D. Both (cont. or int.) use the same temperature parameters from Table~\ref{tbl:bullet-temp}. Figure~\ref{fig:bullet-exp} shows SAC with continuous or integer actions share very similar performances. Note SAC with continuous actions is known to perform well on PyBullet tasks \citep{raffin2021bullet-exp, fayad2021bullet-exp} in the sense that it outperforms PPO. Therefore, this shows our SAC with integer actions is among the best and certifies the usefulness of the proposed integer reparameterization trick.
\subsection{PowerGym Environment}
We demonstrate a use case of the proposed integer constraint SAC in an industrial setting. PowerGym \citep{fan2021powergym} is an open-source reinforcement learning environment for Volt-Var control in power distribution systems. By controlling the circuit elements such as capacitors, regulators, and batteries, the Volt-Var control aims to minimize the voltage violations, control loss, and power loss subject to physical networked constraints and device constraints.
The device constraints restrict the decisions on the controllers to be integers. As shown in Table~\ref{tbl:act_space}, a capacitor's status is binary (on/off), a regulator's tap number is an integer in finite range, and a battery's discharge power is also represented by an integer in finite range. Hence, PowerGym is a good example of a practical environment with integer actions.
\begin{table}[!ht]
\centering
\begin{tabular}{l|ll}
\hline
\hline
\textbf{Variable} & \textbf{Type} & \textbf{Range} \\ \hline
Capacitor status & disc. & $\{0,1\}$ \\
Regulator tap number & disc. & $\{0,...,N_{\text{reg\_act}}-1\}$ \\
Discharge power & disc. & $\{0,...,N_{\text{bat\_act}}-1\}$ \\
\hline
\hline
\end{tabular}
\caption{Action Space. $N_{\text{reg\_act}}$ and $N_{\text{bat\_act}}$ are 33 by default.}
\label{tbl:act_space}
\end{table}
\begin{table}[!ht]
\centering
\begin{tabular}{l|lll}
\hline
\hline
System & \# Caps & \# Regs & \# Bats\\ \hline
13Bus & 2 & 3 & 1\\
34Bus & 2 & 6 & 2\\
123Bus & 4 & 7 & 4\\
8500Node & 10 & 12 & 10\\ \hline
\hline
\end{tabular}
\caption{Specifications of PowerGym environment.}
\label{tbl:sys}
\end{table}
\begin{figure}[!ht]
\centering
\includegraphics[width=0.4\textwidth]{13Bus.pdf}
\includegraphics[width=0.4\textwidth]{34Bus.pdf}
\includegraphics[width=0.4\textwidth]{123Bus.pdf}
\includegraphics[width=0.4\textwidth]{8500Node.pdf}
\caption{Experiments on PowerGym. "random" denotes a uniform random policy that takes actions uniformly at random from the action space.}
\label{fig:powergym-exp}
\end{figure}
We evaluate SAC with integer reparameterization on four PowerGym environments, as shown in Table~\ref{tbl:sys}. Since the actions are pure integers, we cannot have a comparison between continuous and discretized actions as Figure~\ref{fig:bullet-exp}. Instead, take PPO \citep{schulman2017ppo} as a benchmark against our SAC under integer actions. Note that the literature always implements SAC with reparameterization and PPO without reparameterization \citep{haarnoja2018sac,raffin2021bullet-exp, fayad2021bullet-exp}. This is because PPO is based on the REINFORCE estimator \citep{glynn1990reinforce} and does not need differentiable random actions. Following this convention, in this experiment, SAC is equipped with integer reparameterization while PPO is using REINFORCE.
Figure~\ref{fig:powergym-exp} shows that SAC outperforms PPO in all four environments. This demonstrates the usefulness of the proposed integer reparameterization for SAC. In addition, because PPO does a clipping at its policy gradient while SAC doesn't, PPO starts near the random policy and improves steadily but slowly. On the other hand, SAC is susceptible to the accuracy of the Q function, so it deviates from the random policy in the early steps but improves quickly as the Q function becomes more accurate, which explains the swing of cumulative reward in the 8500Node experiment.
\section{Conclusion}
Motivated by industrial scenarios, we study reinforcement learning under integer actions. We approach the problem by incorporating the Soft Actor-Critic (SAC) algorithm with an integer reparameterization on actions. Although the Gumbel-Softmax is capable of modeling discrete random variables, the discreteness of the integer actions can be simplified using the comparability property. The proposed integer reparameterization is based on Gumbel-Softmax followed by a linear mapping for output dimension reduction. Experiments show that the proposed SAC under integer actions is as good as the continuous action version on robot control tasks and can outperform Proximal Policy Optimization on power distribution tasks. Hence, it suggests the usefulness of the proposed integer reparameterization on the SAC algorithm.
\bibliographystyle{unsrtnat}
\section{Introduction}
Recent breakthroughs of Reinforcement learning (RL) have shown promising results from Atari games \citep{mnih2013atari}, MuJoCo continuous control \citep{todorov2012mujoco}, robotics \citep{levine2016robotics}, to autonomous driving \citep{highway-env}. However, in industrial scenarios such as power systems \citep{marot2021power-env}, resource allocation \citep{zoltners1980integer}, and scheduling \citep{wang2005scheduling}, the decision variables are often represented by integer quantities. Because the integer variables are not easily differentiable, they raise an issue to the DDPG-style policy gradient \citep{silver2014ddpg,haarnoja2018sac,fujimoto2018td3}, a state-of-the-art RL method. While the REINFORCE-based methods \citep{glynn1990reinforce,schulman2015trpo,schulman2017ppo} are still alternatives to the integer problem, they tend to have high variance \citep{Schulman2015advantage,wu2018variance} and have been shown to be outperformed by the DDPG-style methods \citep{haarnoja2018sac,fujimoto2018td3}. Therefore, it is of practical interest to study methods to parameterize integer random variables and apply them to DDPG-style RL methods.
Gumbel-Softmax is a state-of-the-art reparameterization method for discrete random variables \citep{Jang2017gumbel,Chris2017gumbel}. Combining with the Straight-Through estimators \citep{bengio2013st,Chung2017st}, the Straight-Through Gumbel-Softmax parameterization can represent a discrete random variable in the forward pass (of a neural network) and maintain differentiability in the backward pass. Since integer variables admit a discrete structure, it is appealing to apply the Gumbel trick for our integer problems.
Our key insight is that integer and discrete variables are fundamentally different: integer variables are comparable while the discrete variables aren't in general. For example, the elements in the integer set $\{1,2,3\}$ are comparable because $1<2<3$, while the discrete set $\{\text{dog},\text{cat},\text{frog}\}$ can't assign such a relation. Recall that the one-hot encoding is required for representing a discrete sample due to its incomparability. An integer set has comparability. Ideally, we only need an integer, not a one-hot vector, to represent an integer sample. In light of this fact, we propose a reparameterization for an integer random variable: use a linear mapping from a one-hot vector of Straight-Through Gumbel-Softmax to an integer. The mapped integer is random and differentiable (w.r.t. parameters of a neural network) because the one-hot vector is. Therefore, this is a valid reparameterization for integer random variables.
Another advantage of the integer-mapping trick is that the integer space can be mapped back to the ambient space, making the effective dimension irrelevant to the fineness of discretization. For example, suppose the ambient action space is an interval $\mathcal{A}=[-1,1]$, and the interval is discretized into $N\geq 2$ points. Then the discretized action space $\mathcal{A}_d=\{0,..,N-1\}$ is mapped back to the ambient action space using $\mathcal{T}(\mathcal{A}_d)=\mathcal{A}_d\frac{2}{N-1}-1$. Since $\mathcal{T}(\mathcal{A}_d)\subset [-1,1]$, the effective dimension of $\mathcal{T}(\mathcal{A}_d)$ remains to be one and irrelevant to the fineness of discretization $N$.
With (1) the differentiability and (2) the advantage on the effective dimension of action space, the proposed integer reparameterization is particularly useful for the DDPG-style method such as the Soft-Actor Critic (SAC) \citep{haarnoja2018sac}. Thereby, we propose a variant of SAC under integer actions by incorporating our integer reparameterization into the actor network (policy) with the critic network (Q function) staying the same. This is possible because (1) allows us to differentiate through actions and (2) makes the input/output dimension of the actor and critic networks the same as that of the continuous action version.
We validate the proposed SAC with integer actions on PyBullet robot control \citep{coumans2021bullet} and PowerGym power systems control \citep{fan2021powergym}. The results show the proposed SAC under integer actions achieve similar performance as the continuous action counterpart in PyBullet and can outperform the PPO \citep{schulman2017ppo} algorithm in PowerGym. Hence, this is a certificate of the effectiveness of our SAC with integer actions.
\section{Reinforcement Learning}
We consider an infinite-horizon Markov Decision Process (MDP) $\langle\mathcal{S},~\mathcal{A},~ T,~r,~\gamma\rangle$. $\mathcal{S},~\mathcal{A}$ are state and action spaces, $r(s,a,s')$ is the reward function, $\gamma\in(0,1)$ is the discount factor, and $T(s'|s,a)$ is the state transition density. Let the initial state distribution be $\rho_0$. The objective of RL is to find a policy $\pi$ that maximizes the $\gamma$-discounted cumulative reward:
\begin{equation}
\max_\pi J(\pi) = \max_\pi \mathbb{E}\left[\sum_{i=0}^\infty \gamma^i r(s_i,a_i)\Big\lvert s_0\sim\rho_0,~a_i\sim\pi(\cdot|s_i),~s_{i+1}\sim T(\cdot|s_i,a_i)\right].
\label{eq:rl_obj}
\end{equation}
Suppose the policy is parameterized by $\theta$ as $\pi_\theta$. A typical way to optimize Eq.~\eqref{eq:rl_obj} by tuning over $\theta$ is to use the policy gradient, which depends on the Q function under $\pi_\theta$:
\begin{equation}
Q^{\pi_\theta}(s,a)=\mathbb{E}\left[\sum_{i=0}^\infty\gamma^i r(s_i,a_i)\Big\lvert s_0=s,~a_0=a,~a_i\sim\pi_\theta(\cdot|s_i),~s_{i+1}\sim T(\cdot|s_i,a_i)\right].
\label{eq:qfunc}
\end{equation}
With $Q^{\pi_\theta}$ defined above, the policy gradient theorem~\citep{sutton2000policy} states that
\begin{equation}
\nabla_\theta J(\pi_\theta)=\mathbb{E}_{s\sim\rho^\pi,~a\sim\pi_\theta}[\big(\nabla_\theta \ln \pi_\theta(a|s)\big)Q^{\pi_\theta}(s,a)],
\label{eq:pg}
\end{equation}
where $\rho^\pi$ is the unnormalized discounted state distribution. Since the expectation of Eq.~\eqref{eq:pg} cannot be exactly computed, the gradient estimation becomes an important problem. We will review this topic specifically on discrete random variables in the next section.
\section{Gradient Estimation for Discrete Random Variables}
Let $D$ be a random variable from a discrete distribution with $N\geq 2$ elements. Let $S=\{s_1,...,s_N\}$ be the support of this discrete distribution. Without loss of generality, suppose the discrete distribution $p_\theta$ is parameterized by a neural network with parameter $\theta$. We can write
$$D\sim p_\theta,\quad\sum_{d\in S}p_\theta(d)=1.$$
Given an objective function $f:S\rightarrow\mathbb{R}$, we minimize
$$\min_\theta \mathbb{E}[f(D)],$$
where the expectation is taken over the random sample $D$. This can be done by computing some estimates of the gradient $\nabla_\theta \mathbb{E}[f]$, which we will review in this section.
\subsection{REINFORCE Estimator}
The REINFORCE estimator \citep{glynn1990reinforce,williams1992reinforce} utilizes a fact from the chain rule:
$$\nabla_\theta p_\theta(d)=p_\theta(d)\nabla_\theta \ln p_\theta(d)$$
Therefore, $\nabla_\theta \mathbb{E}[f]$ is reformulated as
$$\nabla_\theta \mathbb{E}[f]=\sum_{d}\nabla_\theta p_\theta(d)f(d)=\sum_{d}p_\theta(d)\nabla_\theta \ln p_\theta(d)f(d)=\mathbb{E}[\nabla_\theta\ln p_\theta(D)f(D)],$$
and the REINFORCE estimator simply takes Eq.~\eqref{eq:grad-reinforce} as an unbiased estimate of $\nabla_\theta \mathbb{E}[f]$.
\begin{equation}
\nabla_\theta\ln p_\theta(D)f(D)
\label{eq:grad-reinforce}
\end{equation}
Since the policy gradient Eq.~\eqref{eq:pg} and the REINFORCE estimator Eq.~\eqref{eq:grad-reinforce} share a similar form, it is tempting to develop a policy gradient algorithm upon the REINFORCE estimator. Examples of such algorithms include TRPO \citep{schulman2015trpo} and PPO \citep{schulman2017ppo}. With the REINFORCE estimator, TRPO and PPO have high variances and however do not require differentiable random actions. On the contrary, without the REINFORCE estimator, the DDPG-style methods have lower variances but require differentiable random actions. Hence, to reduce the variance, we want to build models for differentiable random actions and use DDPG-style methods such as the SAC to tackle our integer-constrained problem.
\subsection{Gumbel-Softmax}
Gumbel-Softmax \citep{Jang2017gumbel,Chris2017gumbel,paulus2021raoblackwellizing} provides an alternative solution of discrete random variable modeling. By introducing the softmax relaxation, it is considered to be of lower variances during the gradient computation.
Concretely, define the softmax function $\text{Softmax}:\mathbb{R}^n\rightarrow\mathbb{R}^n$ as $[\text{Softmax}(x)]_i=e^{x_i}/\sum_{j=1}^ne^{x_j}$ and suppose $\text{logit}_\theta\in \mathbb{R}^n$, the unnormalized log probability vector, is parameterized by $\theta$. The Gumbel-Max trick \citep{chris2014gumbel} states that
\begin{equation}
D\sim \text{Softmax}(\text{logit}_\theta)\overset{d}{=}\arg\max (\text{logit}_\theta+G),
\label{eq:gumbel-max}
\end{equation}
where G is an i.i.d. $n$-dimensional Gumbel(0,1) vector. $D\sim \text{Softmax}(\text{logit}_\theta)$ means that $D$ is sampled from the discrete probability distribution formed by $\text{Softmax}(\text{logit}_\theta)$. The notation $\overset{d}{=}$ means the left and the right have the same distribution.
Since Eq.~\eqref{eq:gumbel-max} is not differentiable (both the sampling and the argmax), the Gumbel-Softmax approximates the $\arg\max$ of Eq.~\eqref{eq:gumbel-max} using a Softmax function, which is differentiable.
\begin{equation}
D_{\text{GS}}=\text{Softmax} (\text{logit}_\theta+G)
\label{eq:gs}
\end{equation}
Despite bringing back the differentiability, Eq.~\eqref{eq:gs} inevitably introduces a bias since $D_{\text{GS}}$ is not an one-hot vector. This can be solved by the Straight-Through estimator \citep{hinton2012neural}[lecture 15b]. Let $D_{\text{hot}}=\text{OneHot}(D)$ be the one hot version of $D$ from the $\arg\max$ of Eq.~\eqref{eq:gumbel-max}. The Straight-Through Gumbel-Softmax \citep{Jang2017gumbel} introduces a constant shift of $D_{\text{GS}}$:
\begin{equation}
D_{\text{STGS}}=D_{\text{hot}}-[D_{\text{GS}}]_{\text{const}}+D_{\text{GS}},
\label{eq:stgs}
\end{equation}
where $[D_{\text{GS}}]_{\text{const}}$ treats $D_{\text{GS}}$ as a constant by detaching the dependency on $\theta$ during the backward propagation of a neural network. Both $D_{\text{hot}}$ and $[D_{\text{GS}}]_{\text{const}}$ are constants for derivatives w.r.t. $\theta$ are zeros. Therefore, $D_{\text{STGS}}$ is one-hot in the forward propagation (of a neural network) and differentiable in the backward propagation. Redefine the objective function as a differentiable $f:\mathbb{R}^n\rightarrow\mathbb{R}$. The gradient estimate under $D_{\text{STGS}}$ becomes
\begin{equation}
\nabla_{\theta} f(D_{\text{STGS}})=\bigg[\frac{\partial f(D_{\text{STGS}})}{\partial \theta_i}\bigg]_{i},
\label{eq:grad-stgs}
\end{equation}
where $\theta_i$ is the ith element of the model parameter $\theta$. The Straight-Through Gumbel-Softmax estimator is believed to be of lower variance, prevents error in forward propagation, and maintains sparsity \citep{bengio2013st,Chung2017st,Jang2017gumbel}. Hence, Eq.~\eqref{eq:grad-stgs} has become a popular alternative of Eq.~\eqref{eq:grad-reinforce}, and we would like to incorporate it into the SAC algorithm under a integer constraint setting.
\section{Differentiable Random Integers Using STGS}
Although Straight-Through Gumbel-Softmax (STGS) provides a good reparameterization for discrete random variables, directly using discrete variables from STGS to represent integer variables will result in high dimensionality. Thereby, in this section, we will discuss the structure of integer variables and propose a simple linear map trick to reparameterize an integer variable from STGS.
Integer variables usually appear in the industrial setting for the modeling of integer-only or binary decision variables. Integer-only variables can be the number of products or the number of a device's modes. Binary decision variables can be whether to open/close a connection or occupy/release a resource. Despite the discreteness, integer and continuous variables share one thing in common: comparability, or more mathematically, form a totally ordered set. This is the key that makes integer variables distinct from discrete counterparts and allows us to treat integer variables like continuous instead of discrete/categorical variables.
Precisely, a totally ordered set $S$ is a set that satisfies reflexivity ($a\leq a,~\forall~a\in S$), antisymmetry ($a\leq b~\&~b\leq a\Rightarrow a=b$), transitivity ($a\leq b~\&~b\leq c\Rightarrow a\leq c$), and comparability ($\forall~a,b~\in~S,~\text{either}~a\leq b~\text{or}~b\leq a$). It is obvious that a continuous variable (e.g.~$x\in~[-1,1]$) and a integer variable (e.g.~$x\in\{0,1,2\}$) range in totally order sets. On the other hand, a discrete/categorical set does not admit a natural comparison; e.g.,~for~$\{\text{dog},\text{cat}\}$, cat and dog are incomparable. Thus, the comparability fails, and neither do the other properties of the totally ordered set.
Due to the lack of comparability, we usually use an one-hot encoding to represent a discrete/categorical variable; e.g., for $\{\text{dog},\text{cat}\}$, we have dog$\rightarrow[1,0]$ and cat$\rightarrow[0,1]$. The encoding dimension inevitably depends on the size of the range, and this becomes problematic when the range is of large size or when there are multiple discrete variables. On the other hand, with the comparability, an integer variable's effective dimension is only one, regardless of the size of its range; e.g., both variables with range $\{0,1\}$ or $\{0,...,32\}$ need only one dimension to represent. Since the integer variable does not require a one-hot encoding, once being generated, we can treat it like a continuous variable in the subsequent computation. This greatly reduces the computational overhead and is the key to designing a SAC algorithm under integer actions.
The proposed integer reparameterization is as follows. Recall that the Straight-Through Gumbel Softmax, Eq.~\eqref{eq:stgs}, generates a differentiable one-hot random vector $D_{\text{STGS}}$. Then, $\underset{i}{\arg\max} D_{\text{STGS}}[i]$, the index/argument of $1$ in $D_{\text{STGS}}$, is an integer random variable following the distribution formed by $\text{Softmax}(\text{logit}_\theta)$, as the LHS of Eq.~\eqref{eq:gumbel-max}. Thereby, once establishing an differentiable mapping from $D_{\text{STGS}}$ to $\underset{i}{\arg\max} D_{\text{STGS}}[i]$, we can have an differentiable random integer parameterized by $\theta$. Such a differentiable mapping can be constructed by a simple linear map:
\begin{equation}
\text{Ind}_\theta=\langle [0,1,...,n-1],D_{\text{STGS}} \rangle,
\label{eq:integer-para}
\end{equation}
where $\langle\cdot,\cdot\rangle$ is an inner product and $D_{\text{STGS}}$ is assumed to be $n$-dimensional.
Eq.~\eqref{eq:integer-para} gives a parameterized random integer $\text{Ind}_\theta$ with value equaling to $\underset{i\in[0,...,n-1]}{\arg\max} D_{\text{STGS}}[i]$. We apply this to the SAC under integer actions as follows. Since each integer action is of effective dimension 1 (in a euclidean space), the action dimension is precisely the number of integer action variables. Thereby, the input/output dimension of the actor network (policy) and the critic network (Q function) is the same as their continuous action counterparts. The only difference lies in the policy network design, where we restrict the output to have an integer structure using Eq.~\eqref{eq:integer-para}
while the continuous action version doesn't have such a restriction.
\section{Related Work}
Reinforcement learning (RL) with discrete action space has been studied in different aspects over the literature. Due to the high dimensionality of a discretized action space, it has been of great interest to scale RL to large spaces using a neural network. Examples of this line of research include sequentially predicting an action dimension at a time \citep{metz2017discrete}, training a Q function for each action dimension \citep{tavakoli2018action}, and factorizing the action across dimension using the natural ordering
between discrete actions \citep{tang2020discretizing} or normalizing flows \citep{tang2018boosting,delalleau2019discrete}. Various techniques have been proposed in different settings. When the action space admits a continuity structure, a discrete action can be derived by rounding a continuous one \citet{Hasselt2009discrete}. When the action is represented by a one-hot vector, discrete soft actor-critic \citep{christodoulou2019sac-disc} and Gumbel-Softmax \citep{yan2021discrete} have been taken as key techniques to tackle RL problems.
Our work and the literature share the same motivation as to apply RL to large action spaces. Although our work includes techniques that have been studied (e.g., SAC and Gumbel-Softmax), we reformulate them using a more efficient representation. For example, the one-hot encoding is required in discrete soft actor-critic \citep{christodoulou2019sac-disc} and Gumbel-Softmax for image-text matching \citep{yan2021discrete}. However, as proposed in Eq.~\eqref{eq:integer-para}, our integer representation is much simpler than a one-hot encoding. The key reason for having such a reduction is that an integer set admits a continuity structure. Although this continuity observation has been used to justify the rounding technique \citep{Hasselt2009discrete}, rounding gives only a non-differentiable integer, rather than a differentiable one as required in this work. Hence, our work is different from the literature in the sense that we re-organize the techniques and give a simpler representation of differentiable random integers.
\section{Experiments and Discussions}
We evaluate our integer reparameterization for SAC on two OpenAI Gym environments \citep{brockman2016openai}: PyBullet robot control \citep{coumans2021bullet} and PowerGym power network control\cite{fan2021powergym}. The results show the proposed SAC under integer actions achieve similar performance as the continuous action version in Pybullet and outperform PPO \citep{schulman2017ppo} algorithm in PowerGym. Hence this shows the effectiveness of SAC under the proposed integer reparameterization.
\subsection{PyBullet Environment}
PyBullet is an open-source version of the MuJoCo environment \citep{todorov2012mujoco} for robot control tasks. Compared to MuJoCo, PyBullet is license-free and is reported to be more difficult to solve \citep{tan2018bullet-exp,fayad2021bullet-exp}. Since the actions in PyBullet are continuous and bounded, we can derive the integer action version of PyBullet by discretizing the actions. Hence, we adopt the PyBullet environment to evaluate the performance discrepancy between integer actions and continuous actions for robot control tasks.
Since each dimension of a PyBullet action is bounded in an interval $I=[-1,1]$, we can discretize each dimension of the action as follows. Suppose the interval $I$ is discretized into $N\geq 2$ integers as $I_\text{d}=\{0,~1,...,N-1\}$. After having an integer action $a\in I_\text{d}$, $a$ is embedded into $I$ by
$$\mathcal{T}(a)=a\frac{2}{N-1}-1\in I.$$
Such discretization produces a discrete action space with size $N^K$ where $K$ is the euclidean dimension of the original continuous action space. The size quickly becomes intractable if using a one-hot encoding for the discrete actions. Even if using a multi-hot encoding, the size of a multi-hot vector, $NK$, is still undesirable for the implementation of the actor and critic networks. On the other hand, the proposed integer reparameterization, Eq.~\eqref{eq:integer-para} produces an integer vector of size $K$ because each integer action is of effective dimension 1. Hence, the discretized environment is highly nontrivial under one-hot and multi-hot encodings but is feasible under the proposed integer reparameterization.
\begin{figure}[!ht]
\centering
\includegraphics[width=0.4\textwidth]{Reacher.pdf}
\includegraphics[width=0.4\textwidth]{Hopper.pdf}
\includegraphics[width=0.4\textwidth]{HalfCheetah.pdf}
\includegraphics[width=0.4\textwidth]{Walker2D.pdf}
\caption{Experiments on PyBullet. The solid lines are the averages and the shaded regions are the standard deviation. d9 and d17 mean to discretize each dimension of the action space into 9 and 17 integers, respectively.}
\label{fig:bullet-exp}
\end{figure}
\begin{table}[!ht]
\centering
\begin{tabular}{lllll}
\hline
\hline
\textbf{Environment} & Reacher & Hopper & HalfCheetah & Walker2D \\ \hline
\textbf{Temperature} & 0.005 & 0.05 & 0.02 & 0.06\\
\hline
\hline
\end{tabular}
\caption{Temperature parameters for PyBullet environments.}
\label{tbl:bullet-temp}
\end{table}
We run SAC in continuous or discretized (integer) actions in four PyBullet environments: Reacher, Hopper, HalfCheetah, Walker2D. Both (cont. or int.) use the same temperature parameters from Table~\ref{tbl:bullet-temp}. Figure~\ref{fig:bullet-exp} shows SAC with continuous or integer actions share very similar performances. Note SAC with continuous actions is known to perform well on PyBullet tasks \citep{raffin2021bullet-exp, fayad2021bullet-exp} in the sense that it outperforms PPO. Therefore, this shows our SAC with integer actions is among the best and certifies the usefulness of the proposed integer reparameterization trick.
\subsection{PowerGym Environment}
We demonstrate a use case of the proposed integer constraint SAC in an industrial setting. PowerGym \citep{fan2021powergym} is an open-source reinforcement learning environment for Volt-Var control in power distribution systems. By controlling the circuit elements such as capacitors, regulators, and batteries, the Volt-Var control aims to minimize the voltage violations, control loss, and power loss subject to physical networked constraints and device constraints.
The device constraints restrict the decisions on the controllers to be integers. As shown in Table~\ref{tbl:act_space}, a capacitor's status is binary (on/off), a regulator's tap number is an integer in finite range, and a battery's discharge power is also represented by an integer in finite range. Hence, PowerGym is a good example of a practical environment with integer actions.
\begin{table}[!ht]
\centering
\begin{tabular}{l|ll}
\hline
\hline
\textbf{Variable} & \textbf{Type} & \textbf{Range} \\ \hline
Capacitor status & disc. & $\{0,1\}$ \\
Regulator tap number & disc. & $\{0,...,N_{\text{reg\_act}}-1\}$ \\
Discharge power & disc. & $\{0,...,N_{\text{bat\_act}}-1\}$ \\
\hline
\hline
\end{tabular}
\caption{Action Space. $N_{\text{reg\_act}}$ and $N_{\text{bat\_act}}$ are 33 by default.}
\label{tbl:act_space}
\end{table}
\begin{table}[!ht]
\centering
\begin{tabular}{l|lll}
\hline
\hline
System & \# Caps & \# Regs & \# Bats\\ \hline
13Bus & 2 & 3 & 1\\
34Bus & 2 & 6 & 2\\
123Bus & 4 & 7 & 4\\
8500Node & 10 & 12 & 10\\ \hline
\hline
\end{tabular}
\caption{Specifications of PowerGym environment.}
\label{tbl:sys}
\end{table}
\begin{figure}[!ht]
\centering
\includegraphics[width=0.4\textwidth]{13Bus.pdf}
\includegraphics[width=0.4\textwidth]{34Bus.pdf}
\includegraphics[width=0.4\textwidth]{123Bus.pdf}
\includegraphics[width=0.4\textwidth]{8500Node.pdf}
\caption{Experiments on PowerGym. "random" denotes a uniform random policy that takes actions uniformly at random from the action space.}
\label{fig:powergym-exp}
\end{figure}
We evaluate SAC with integer reparameterization on four PowerGym environments, as shown in Table~\ref{tbl:sys}. Since the actions are pure integers, we cannot have a comparison between continuous and discretized actions as Figure~\ref{fig:bullet-exp}. Instead, take PPO \citep{schulman2017ppo} as a benchmark against our SAC under integer actions. Note that the literature always implements SAC with reparameterization and PPO without reparameterization \citep{haarnoja2018sac,raffin2021bullet-exp, fayad2021bullet-exp}. This is because PPO is based on the REINFORCE estimator \citep{glynn1990reinforce} and does not need differentiable random actions. Following this convention, in this experiment, SAC is equipped with integer reparameterization while PPO is using REINFORCE.
Figure~\ref{fig:powergym-exp} shows that SAC outperforms PPO in all four environments. This demonstrates the usefulness of the proposed integer reparameterization for SAC. In addition, because PPO does a clipping at its policy gradient while SAC doesn't, PPO starts near the random policy and improves steadily but slowly. On the other hand, SAC is susceptible to the accuracy of the Q function, so it deviates from the random policy in the early steps but improves quickly as the Q function becomes more accurate, which explains the swing of cumulative reward in the 8500Node experiment.
\section{Conclusion}
Motivated by industrial scenarios, we study reinforcement learning under integer actions. We approach the problem by incorporating the Soft Actor-Critic (SAC) algorithm with an integer reparameterization on actions. Although the Gumbel-Softmax is capable of modeling discrete random variables, the discreteness of the integer actions can be simplified using the comparability property. The proposed integer reparameterization is based on Gumbel-Softmax followed by a linear mapping for output dimension reduction. Experiments show that the proposed SAC under integer actions is as good as the continuous action version on robot control tasks and can outperform Proximal Policy Optimization on power distribution tasks. Hence, it suggests the usefulness of the proposed integer reparameterization on the SAC algorithm.
\bibliographystyle{unsrtnat}
| {'timestamp': '2021-09-20T02:16:32', 'yymm': '2109', 'arxiv_id': '2109.08512', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08512'} | arxiv |
\section{INTRODUCTION}
We study the problem of dense semantic parsing of 3D point clouds. As illustrated by Fig.~\ref{fig:abstract_imag}-(a), a bedroom can be reconstructed by TSDF-based fusion methods like \cite{b1} \cite{b2}. Then taking it as input, a 3D scene parsing network generates a semantic label for each point in it, as demonstrated by Fig.~\ref{fig:abstract_imag}-(f). This is a core environment sensing capability for intelligent robots. Knowing the semantic class of the 3D world lays the foundation for decision making. However, training such a model needs point-wise annotation, which is very expensive and time-consuming to obtain. As such, we address the challenge of learning such models using an extremely small subset of annotations. For example, Fig.~\ref{fig:abstract_imag}-(e) shows the parsing result generated by a model trained using 200 points per scene, which is almost as good as Fig.~\ref{fig:abstract_imag}-(f). Since a scene in the ScanNet database \cite{b3} typically contains more than 50000 points, a subset of 200 points only amounts to 0.4\% data usage.
\begin{figure}[t]
\centerline{\includegraphics[width=0.48\textwidth]{abstract_image.png}}
\caption{We address the challenging problem of learning 3D scene parsing models using only semantic annotations on limited points (20 to 200 points per scene). (a) shows a point cloud of an indoor scene. (b)-(e) demonstrate 3D semantic understanding results using 20 to 200 point annotations per scene. (f) shows the result generated by a fully supervised model. Except for highlighted regions in boxes, most points are correctly segmented, showing the effectiveness of our viewpoint bottleneck method.}
\label{fig:abstract_imag}
\end{figure}
The key to effective pointly-supervised learning is leveraging numerous unlabelled points (e.g., the other 99.6\% data in the aforementioned case). If we can learn meaningful representations from them without the usage of semantic annotation, a subsequent pointly-supervised fine-tuning is expected to give good results. This is usually referred to as self-supervised representation learning (SSRL). While exciting progress has been achieved in 2D SSRL \cite{b4}\cite{b5}\cite{b6}, 3D SSRL in point clouds \cite{b7}\cite{b8} is still an under-explored emerging topic. Many open problems exist and challenge the effectiveness of existing 3D SSRL methods:
(1) Former 2D SSRL methods treat each image as a sample. While 3D SSRL for dense semantic parsing naturally requires us to treat each point as a sample. This fact leads to an extremely large sample set.
(2) Former contrastive learning methods operate on the sample dimension. As conceptually shown in Fig.~\ref{fig:teaser}-left, embeddings for the same sample under different viewpoints are drawn near, and embeddings for different samples are pushed away. Selecting good sample pairs is an unclear and difficult problem, especially when the 3D sample set is large.
(3) Former contrastive learning methods are troubled with degenerated solutions thus requires sophisticated techniques to break the symmetry like weight averaging with momentum \cite{b6}. Complex implementation details make them hard to tune.
Very recently, several works \cite{b10}\cite{b11}\cite{b12} propose to switch representation learning from the sample dimension to the feature dimension. Inspired by them, we propose a new 3D representation learning method called viewpoint bottleneck. It starts with an objective defined with the mutual information between features and samples. A principled analysis under mild distribution assumptions shows that an efficient surrogate loss implementation can be used to optimize the objective. The surrogate loss is conceptually shown in Fig.~\ref{fig:teaser}-right. In one word, it maximizes the correlation between corresponding feature channels while decorrelates different feature channels. This paradigm shift brings some advantages over former 3D SSRL methods based on contrastive learning, like PointContrast \cite{b7} or Contrastive Scene Context \cite{b8}. There is no need to select sample pairs or design sophisticated symmetry breaking techniques, leading to a simple implementation. This simpleness does not come with a prize of performance drop. By contrast, viewpoint bottleneck is more effective than the state-of-the-art (SOTA) method Contrastive Scene Context \cite{b8}. When evaluated on our goal downstream task pointly-supervised scene parsing, it consistently out-performs \cite{b8} in all inspected settings. To summarize, we make following contributions:
\begin{itemize}
\item[$\bullet$] We propose a new self-supervised 3D representation learning framework named viewpoint bottleneck, which is free of typical drawbacks of contrastive learning.
\item[$\bullet$] We provide a principled analysis to motivate viewpoint bottleneck, which is absent in former 3D SSRL methods based upon contrastive learning.
\item[$\bullet$] We demonstrate the effectiveness of learned representations for pointly-supervised scene parsing. We evaluate on the public benchmark ScanNet and achieve consistently better results than existing SOTA 3D SSRL solutions. A public implementation is provided.
\end{itemize}
\section{Related Work}
\subsection{Self-supervised Representation Learning}
SSRL is a special form of unsupervised learning, which aims to learn meaningful representations of the input data without relying on annotations. The common ground of these methods is to learn representations that are invariant to distortions. There are several different ways to achieve this generic principle. For example, early attempts use different surrogate tasks whose labels can be naturally generated, like pixel value inpainting \cite{b21}\cite{b23}, cross-channel feature regression \cite{b22}, or rotation prediction \cite{b24}. Recently, contrastive learning \cite{b27}, which was firstly proposed for metric learning, has drawn significant attention and witnessed great success for SSRL. However, it is now clear that a trivial contrastive learning formulation suffers from degeneration. As such, many variants have been proposed to address the issue like weight averaging \cite{b6}\cite{b28} or stop gradient \cite{b29} among others \cite{b14}\cite{b26}.
Compared to its 2D counterpart, 3D SSRL is more urgent because of the difficulty of annotating 3D data. There are already some pioneering works that address the 3D SSRL problem borrowing ideas of contrastive learning, like PointContrast\cite{b7} and Contrastive Scene Contexts\cite{b8}. The former proposes a PointInfoNCE loss and verifies its effectiveness on a diverse set of scene understanding tasks. However, it ignores the spatial context around local points, which limits its transferability to complex downstream tasks. The latter introduces a loss function that contrasts features aggregated in local partitions. It demonstrates the possibility of using extremely few annotations to obtain good performance on a series of weakly-supervised settings. \cite{b9}\cite{b13} propose to use multi-modal pairs and tuples as elements for RGB-D constrastive learning and scene understanding. \cite{b35} develops a sophisticated spatio-temperal contrastive learning framework for point clouds.
\begin{figure}[t]
\centerline{\includegraphics[width=0.48\textwidth]{teaser.png}}
\caption{Five colored dots demonstrate five point samples, under random geometric transformations. Vectors of corresponding colors demonstrate features generated by a shared Sparse ConvNet. Conventional contrastive learning methods are shown in the left. Same samples under different viewpoints (red) are drawn near while different samples (blue and orange) are pushed away, in the embedding space. Viewpoint bottleneck is shown in the right. It operates on the feature dimension instead of the sample dimension. The corresponding channel is correlated while different channels are decorrelated.}
\label{fig:teaser}
\end{figure}
To address the common issues of contrastive learning, a recent SSRL method \cite{b10} proposes an objective function that measures the cross-correlation matrix between the representations of two distorted versions of a sample. It naturally avoids representation collapse and sample selection since no negative samples are required. \cite{b11}\cite{b12} enrich this new scheme with a variance term and a principled kernel-based statistical measure. Inspired by them, we propose the viewpoint bottleneck principle, which is the first non-contrastive 3D SSRL method.
\subsection{Weakly-supervised Scene Parsing}
State-of-the-art scene parsing approaches generally depend on expensive sample-wise annotation to obtain good performance. To this end, many weakly-supervised solutions are proposed. \cite{b15} exploits deep metric learning to regularize the embedding, while collecting pseudo labels online by expansion. \cite{b25} identifies a statistical phenomenon called uncertainty mixture to harvest labels in an unsupervised manner. BoxSup\cite{b16} generates pseudo labels by evaluating the overlap between box supervision and bottom-up region proposals. STC\cite{b17} treats salient regions as the initial pseudo labels for image-level semantic classes. \cite{b18} proposes a method that exploits class activation maps (CAMs) to generate positive and negative affinity labels for pixel pairs. For 3D parsing, \cite{b19} generates pseudo point-wise labels by applying CAM on sub-point-clouds. \cite{b20} transfers 2D image annotations to 3D space to produce labels in point cloud. In this paper, we follow the path of 3D SSRL introduced by \cite{b7}\cite{b8} and propose a formulation free of sample selection.
\section{Method}
In this section, we describe the procedure of learning pointly-supervised scene parsing models with viewpoint bottleneck. As shown in Fig.\ref{fig:overview}, our approach is consisted of two stages: (1) a 3D SSRL stage using the newly proposed viewpoint bottleneck loss, and (2) fine-tuning the pretrained model for scene parsing with point supervision.
\subsection{Overview}
A fully-supervised 3D scene parsing dataset is denoted as $\{P_i, L_i\}, i\in\{1,2,...,N\}$, in which $P_i (M\times 6)$ is the point cloud represented by the concatenation of 3D coordinates and colors and $L_i (M\times 1)$ is the point-wise semantic label set for $P_i$. A weakly-supervised 3D scene parsing dataset is depicted as $\{P_i, S_i\}$, where $S_i$ is an annotation-efficient version of $L_i$. In $S_i$, only few points have been labeled and other points' labels are set to
\emph{None}. Firstly, we train a pre-trained model $\rm VB(*,\Theta)$ only using $P_i$, as shown in Fig.\ref{fig:overview}-(A). Secondly, we fine-tune the pre-trained model $\rm VB(*,\Theta)$ with the weakly-supervised scene parsing dataset $\{P_i, S_i\}$. A new prediction head is added as illustrated by the light blue block in Fig.\ref{fig:overview}-(B). The network parameterized by $\Psi$ predicts the probability $Q(y_{ijs}|P_{ij}
;\Psi)$, in which $j$ indexes points in $P_i$ and $s$ indexes semantic categories. We train it with the Softmax cross-entropy loss as below:
\begin{equation}
L_{\rm ce}=-\frac{1}{NM}\sum_{i=1}^{N}\sum_{j=1}^{M}{-\log{Q(y_{ij\bar{s}}|P_{ij};\Psi)}}\label{eqce}
\end{equation}
Note here $\bar{s}$ is the ground truth label for $P_{ij}$. Finally, we run the trained scene parsing model, as in Fig.\ref{fig:overview}-(C).
\subsection{Self-supervised Pre-training}
Here we describe our self-supervised learning stage.
Firstly, a point cloud $X={\{p_i\}}$ is augmented into two viewpoints by random geometric transformations. Transformed 3D point clouds are denoted by $X_p=\{p_i'\}$ and $X_q=\{p_i''\}$ respectively. As Fig.~\ref{fig:pre-train} shows, these two randomly transformed point clouds are fed into the same sparse convolutional network $f_\theta$ to obtain two high-dimensional representations $Z_p = f_\theta(X_p)$ and $Z_q = f_\theta(X_q)$.
Next, we sample the representations by Farthest Point Sampling (FPS) from $M\times D$ to $H\times D$, where $D$ is the dimension of the representations and $M,H$ are the numbers of points before and after sampling. FPS starts with a random point as the first proposal candidate, and iteratively selects the farthest point from the already selected points until $H$ candidates are selected. We set $H\ll M$ to keep computation tractable, while FPS guarantees that the sampled subset is a reasonable abstraction of the original point cloud.
After FPS, the cross-correlation matrix $\mathcal{Z} (D\times D)$ is computed on the batch dimension, from two sampled representations $Z_{p}'$ and $Z_{q}'$. Finally, the network is trained with the proposed viewpoint bottleneck loss as detailed later.
\subsection{Viewpoint Bottleneck: Analysis}
\begin{figure}[t]
\centerline{\includegraphics[width=0.48\textwidth]{wslframework.pdf}}
\caption{The overall pipeline of our method. In the first stage (A), we pretrain the backbone network with a self-supervised learning objective named viewpoint bottleneck. In the second stage (B), we fine-tune the weights from (A) for scene parsing, while only using a very small number of annotated points. Finally, we illustrate an inference stage (C).}
\label{fig:overview}
\end{figure}
Inspired by Barlow Twins \cite{b10}, we derive our viewpoint bottleneck objective from an information theory perspective \cite{b30}\cite{b31}. As shown in Fig.\ref{fig:VBP}, the information bottleneck principle assumes that meaningful representations should reserve as much information as possible about the input, while affected by random viewpoint transformations as little as possible. Formally the objective is stated as:
\begin{equation}
{\rm VB}_\theta\triangleq{I(C_\theta,B)-\beta I(C_\theta,A)}\label{eq:IB}
\end{equation}
where $I(\cdot,\cdot)$ is mutual information between two random vectors. Here $A$, $B$, and $C_\theta$ correspond to input point clouds, randomly transformed point clouds and learnt representations respectively. $\beta$ is a balancing weight. By definition, the mutual information can be calculated as $I\left(C_\theta,B\right)=H\left(C_\theta\right)-H\left(C_\theta\middle|B\right)$ (similarly for $I\left(C_\theta,A\right)$). $H\left(C_\theta\right)$ is the entropy of $C_\theta$ while $H\left(C_\theta\middle|B\right)$ is the conditional entropy of $C_\theta$ given $B$. As the function $f_\theta$ is deterministic, $H(C_\theta|B)$ cancels to 0. We rewrite the Eq.\ref{eq:IB} as:
\begin{equation}
{\rm VB}_\theta=H\left(C_\theta\right)-\beta\left[H\left(C_\theta\right)-H\left(C_\theta\middle|A\right)\right]\label{eq:entropy}
\end{equation}
\begin{figure*}[t]
\centerline{\includegraphics[width=0.88\textwidth]{main.pdf}}
\caption{Illustration of viewpoint bottleneck. $X$ is a point cloud represented by the concatenation of 3D coordinates and colors. After two random geometric transformations, we obtain its two augmentations $X_p$ and $X_q$. They are sent to a shared Sparse ConvUnet $f_\theta$, forming two high-dimensional feature sets $Z_p$ and $Z_q$. To keep computation tractable, we apply farthest point sampling on them to get down-sampled $Z_p'$ and $Z_q'$. Finally, the viewpoint bottleneck is imposed on the cross-correlation matrix between $Z_p'$ and $Z_q'$, which is denoted as $Z$.}
\label{fig:pre-train}
\end{figure*}
\begin{figure}[t]
\centerline{\includegraphics[width=0.48\textwidth]{ib.pdf}}
\caption{A conceptual illustration of the viewpoint bottleneck principle, in which $A$, $B$ and $C_\theta$ are random vectors, representing the original input point clouds, randomly transformed point clouds and high-dimensional representations generated by $f_\theta$ respectively. We aim to minimize the mutual information between $B$ and $C_\theta$ and maximize the mutual informaiton between $A$ and $C_\theta$. As such, there exists a bottleneck at $B$.}
\label{fig:VBP}
\end{figure}
By dividing Eq.\ref{eq:entropy} with $\beta$, we have:
\begin{equation}
{\rm VB}_\theta=H\left(C_\theta\middle|A\right)+\frac{1-\beta}{\beta}H\left(C_\theta\right)\label{eq:ibp}
\end{equation}
However, the optimization of ${\rm VB}_\theta$ becomes a challenge as evaluating the entropy of a generic random vector is intractable. We derive a surrogate loss as below:
We assume the representation $C_\theta$ is distributed as a Gaussian: $C_\theta = (c_{\rm \theta i})_{i=1}^D \sim\mathcal{N}_D(\mu,\Sigma_{C_\theta})$. $\Sigma_{C_\theta}$ can be decomposed into $\Sigma_{C_\theta}\ =\ E^TE$, and $Y=E^{-1}({\vec{C_\theta}-\vec{\mu}})\sim\mathcal{N}\left(\vec{0},I\right)$. In the following derivation, $|\cdot|$ means taking determinant. The probability density function of $C_\theta$ is:
\begin{equation}
\begin{split}
&p\left(c_{\rm \theta 1},c_{\rm \theta 2},\cdots,c_{\rm \theta D}\right)\\
&=\frac{1}{\left(2\pi\right)^\frac{n}{2}\left|\Sigma_{C_\theta}\right|^\frac{1}{2}}e^{-\frac{1}{2}\left[\left({\vec{C_\theta}-\vec{\mu}}\right)^T\Sigma_{C_\theta}^{-1}\left(\vec{C_\theta}-\vec{\mu}\right)\right]}
\end{split}
\end{equation}
Then according to \cite{b33}:
\begin{equation}
\begin{split}
H\left(C_\theta\right)&=-\int{p\left(c_\theta\right)\log{p\left(c_\theta\right)dc_\theta}}\\
&=-\int{p\left(c_\theta\right)\log{\frac{e^{-\frac{1}{2}\left({\vec{C_\theta}-\vec{\mu}}\right)^T\Sigma_{C_\theta}^{-1}\left(\vec{C_\theta}-\vec{\mu}\right)}}{\left(2\pi\right)^\frac{D}{2}\left|\Sigma_{C_\theta}\right|^\frac{1}{2}}}dc_\theta}\\
&=-\int{p\left(c_\theta\right)\log{\frac{1}{\left(2\pi\right)^\frac{D}{2}\left|\Sigma_{C_\theta}\right|^\frac{1}{2}}}}dc_\theta\\
&\quad-{\int{p\left(c_\theta\right)\log{e^{-\frac{1}{2}\left({\vec{C_\theta}-\vec{\mu}}\right)^T\left(E^{-1}\right)^{T}E^{-1}\left(\vec{C_\theta}-\vec{\mu}\right)}}dc_\theta}}\\
&=\log{\left(2\pi\right)^\frac{D}{2}\left|\Sigma_{C_\theta}\right|^\frac{1}{2}}-\int{p\left(Y\right)\log{e^{-\frac{1}{2}Y^TY}}dY}\\
&=\log{\left(2\pi\right)^\frac{D}{2}\left|\Sigma_{C_\theta}\right|^\frac{1}{2}}-\sum_{i=1}^{D}\log{e^{-\frac{1}{2}\left|y_i^2\right|}}\\
&=\log{\left(2\pi\right)^\frac{D}{2}\left|\Sigma_{C_\theta}\right|^\frac{1}{2}}+\log{e^\frac{D}{2}}\\
&=\frac{1}{2}\log{{(2 \pi e)}^D}\left|\Sigma_{C_\theta}\right|\label{eq}
\end{split}
\end{equation}
\begin{algorithm}
\caption{3D SSRL with Viewpoint Bottleneck}\label{algorithm:1}
\KwIn{
\begin{itemize}
\item[1] $\mathbb{X}$: a set of 3D point clouds;
\item[2] $\mathcal{T}$: the distribution of geometric transformations;
\item[3] $f_\theta$: sparse ConvUnet parameterized by $\theta$;
\item[4] $K$: the number of optimization steps;
\item[5] $\lambda$: the control parameter in VB loss
\end{itemize}}
\KwOut{feature network $f_\theta$}
\For{$k=1$ \KwTo $K$}{
\tcc{sample transformations}
$T_{p},T_{q} \sim \mathcal{T}$
\tcc{take an input point cloud}
$X \in \mathbb{X}$
\tcc{apply transformations}
$X_{p}=T_{p}(X), \ X_{q}=T_{q}(X)$
\tcc{extract features}
$Z_{p}={f}_{\theta_k}(X_{p}), \ Z_{q}={f}_{\theta_k}(X_{q})$
\tcc{farthest point sampling}
$Z_{p}' = {\rm FPS}(Z_{p}), \ Z_{q}' = {\rm FPS}(Z_{q})$
\tcc{calculate cross-correlation}
$\mathcal{Z} = (Z_{p}')^T Z_{q}'$
\tcc{calculate VB loss}
$\mathcal{L}_{\rm VB}= \|\Gamma_{\lambda}(\mathcal{Z})-\mathcal{I}\|_F$
\tcc{optimize network parameters}
$\theta_{k+1}={\rm optim}(\theta_{k},\mathcal{L}_{\rm VB})$
}
\end{algorithm}
\begin{equation}
\begin{split}
H\left(C_\theta\middle|A\right) &=\sum_{a} p\left(a\right)H\left(C_\theta\middle|A=a\right)\\
&=\frac{1}{2}\mathbb{E}_A\log(2 \pi e)^{n}|\Sigma_{C_{\theta}|A}|\label{eq}
\end{split}
\end{equation}
As such the viewpoint bottleneck objective Eq.\ref{eq:ibp} is turned into a practical surrogate loss function as:
\begin{equation}
{\rm VB}_\theta=\mathbb{E}_A\log{\left|\Sigma_{C_\theta|A}\right|}+\frac{1-\beta}{\beta}\log{\left|\Sigma_{C_\theta}\right|}\label{eq:ibf}
\end{equation}
Finally, we make several more simplifications: 1) Since Eq.\ref{eq:ibf} is only meaningful when $\beta > 1$, we use a positive constant $\lambda$ to replace $\frac{\beta-1}{\beta}$.
2) In the second term of the Eq.\ref{eq:ibf} we use the Frobenius norm of $\Sigma_{C_\theta}$ as the metric.
3) Recall that the first term of Eq.\ref{eq:ibf} is derived from the conditonal entropy of the representation $C_\theta$ given $A$. Minimizing it is equivalent to maximizing the diagonal elements of $\mathcal{Z}$ (the aforementioned $D \times D$ cross-correlation matrix).
\begin{figure*}[t]
\centerline{\includegraphics[width=1\textwidth]{results1.png}}
\caption{Qualitative visualizations for point-supervised 3D scene parsing. The first column is ground truth and the last is generated by a fully-supervsied model. The middle columns are generated by models pretrained by viewpoint bottleneck and supervised by sparse point annotations. }
\label{fig:all_results}
\end{figure*}
\begin{table}
\centering
\caption{Pointly-supervised 3D Parsing results on the ScanNet validation set (mIOU:\%)}
\begin{tabular}{lcccc}
\toprule
Points & $200$ & $100$ & $50$ & $20$\\
\midrule
Baseline & 64.3 & 60.6 & 55.4 & 45.9\\
CSC \cite{b8} & 68.2 (+3.9) & 65.9 (+5.3) & 60.5 (+5.1) & 55.5 (+9.6) \\
VB (256) & 68.4 (+4.1) & 66.5 (+5.9) & 63.3 (+7.9) & 56.2(+10.3) \\
VB (512) & \textbf{68.5 (+4.2)} & \textbf{66.8 (+6.2)} & 63.6 (+8.2) & \textbf{57.0 (+11.1)} \\
VB (1024) & 68.4 (+4.1) & 66.5 (+5.9) & \textbf{63.7 (+8.3)} & 56.3 (+10.4) \\
\bottomrule
\end{tabular}
\label{tbl:table2}
\end{table}
\begin{table}[t]
\centering
\caption{Results reported by ScanNet online test server (mIOU:\%)}
\begin{tabular}{lcccc}
\toprule
Points & 200 & 100 & 50 & 20\\
\midrule
Viewpoint\_BN\_LA\_AIR (ours) & \textbf{66.9} & \textbf{65.0} & \textbf{62.3} & 54.8\\
CSC\_LA\_SEM \cite{b8} & 66.5 & 64.4 & 61.2 & 53.1\\
PointContrast\_LA\_SEM \cite{b7} & 65.3 & 63.6 & 61.4 & \textbf{55.0}\\
\bottomrule
\end{tabular}
\label{tbl:benchmark}
\end{table}
\subsection{Viewpoint Bottleneck: Implementation}
After making aforementioned three simplifications to Eq.\ref{eq:ibf}, we obtain the final viewpoint bottleneck loss function as:
\begin{equation}
\mathcal{L}_{\rm VB}\triangleq \|\Gamma_{\lambda}(\mathcal{Z})-\mathcal{I}\|_F \label{eq:vb}
\end{equation}
where $\mathcal{I}$ denotes the identity matrix, $\Gamma_{\lambda}(\cdot)$ denotes scaling off-diagonal elements by positive constant $\lambda$, and $\mathcal{Z}$ is the cross-correlation matrix computed between the two representations of different viewpoints along the feature dimension:
\begin{equation}
\mathcal{Z} \triangleq \left(\widetilde{Z_p'}\right)^T\widetilde{Z_q'}\label{eq_cc}\\
\end{equation}
$\widetilde{Z'}$($H\times D$) is the representation obtained by normalizing $Z'$ along the sample dimension.
$\mathcal{L}_{\rm VB}$ aims to push the diagonal elements of $\mathcal{Z}$ towards 1, so that the representations are invariant to random geometric transformations. Meanwhile, by forcing the off-diagonal elements towards 0, we decorrelate different vector components of the representations, so that they contain non-redundant information about the original point cloud.
\subsection{Pointly-supervised Scene Parsing}
After self-supervised representation learning with the proposed viewpoint bottleneck loss $\mathcal{L}_{\rm VB}$, we fine-tune on the pre-trained backbone by adding a scene parsing head (shown as light blue blocks in Fig.\ref{fig:overview}) with $\{P_i,S_i\}$. This training scheme is much better than directly training with $\{P_i,S_i\}$, since the intrinsic structure between enormous unlabelled points are fully leveraged by self-supervised pre-training.
\section{Experiments}
\subsection{Datasets}
\subsubsection{Dataset for SSRL}
In this study, we use the official training split of ScanNet for unsupervised representation pre-training. ScanNet is a large-scale RGB-D video dataset with 3D mesh reconstructions of indoor scenes. It contains over 1500 scans reconstructed from around 2.5 million views. This dataset is annotated with both point-level and instance-level semantic labels. These labels are defined in a protocol of 20 categories. The official training split has 1201 scans.
\subsubsection{Dataset for pointly-supervised 3D scene parsing}
For fair comparison, we use the point annotations provided by \cite{b8} during fine-tuning. Four settings are evaluated, in which only 20 points, 50 points, 100 points, or 200 points of one point cloud in the training split have semantic labels. Other unlabeled points are ignored during the calculation of cross entropy loss Eq.~\ref{eqce}. We firstly evaluate on the official validation set of 312 scans, using the mean intersection of union (mIOU) metric. We also provide quantitative results on the held-out test set, which is reported by an online server\footnote{http://kaldir.vc.in.tum.de/scannet\_benchmark/data\_efficient/}.
\subsection{Implementation details}
Then, we sample a combination of following transformations to apply to the selected point cloud:
\begin{itemize}
\item[1] Random rotation. We rotate the point cloud along z-axis by a random angle sampled from $\mathcal{U}[0, 2\pi]$.
\item[2] Random mirroring. For each axis, we apply mirroring transformation with a probability of 0.5.
\item[3] Random chromatic jitter. For each channel, we apply a noise sampled from $\mathcal{N}(0, 255 \times 0.05)$.
\end{itemize}
Our Sparse ConvUnet is implemented with the MinkowskiNet codebase \cite{b34}, taking both 3D coordinates and point-wise RGB values as inputs. After farthest point sampling, a subset of 1024 points are selected as the abstraction of a point cloud. To investigate the robustness of VB, we inspect three settings for feature dimension $D$: 256, 512, and 1024.
For SSRL, all experiments are trained with a batch size 2 for 20000 iterations on two GeForce RTX 3090 GPUs, using a SGD optimizer with a momentum of 0.99 and an initial learning rate of 0.1. The learning rate is decayed according to a polynomial rule.
The pointly-supervised scene parsing experiments are trained with a batch size 12 for 30000 iterations on two GeForce RTX 3090 GPUs with the same optimizer setting. For both pre-training and fine-tuning experiments, the voxel size for Sparse ConvUNet is set to 2.0 cm.
\subsection{Results and Analysis}
\subsubsection{Results on ScanNet validation set} Fristly, we show the effectiveness of viewpoint bottlenck on the ScanNet validation set. Quantitative results are summarized in Table.\ref{tbl:table2}. Baseline means training on point supervision without any SSRL. CSC stands for the contrsative scene context method \cite{b8}, which is a contrastive learning scheme applied on local point cloud partitions. Our method is denoted as VB with feature dimension $D$ marked in brackets. For fair comparison, the network architectures are exactly the same.
Viewpoint bottleneck achieves clearly better results than CSC, in all four settings. In the 50 points setting, VB outperforms CSC by +3.2 mIOU. In the 20 and 100 points settings, the positive margins are also clear. In the 200 points setting, due to performance saturation, our quantitative results are comparable to CSC. Note that better performance in the down-stream pointly-supervised scene parsing task is not the only advantage of viewpoint bottleneck. As mentioned before, our method is easier to implement and tune than contrastive learning, as no sample pairs need to be selected.
Our method also out-performs the baseline by large margins. As shown in Table.~\ref{tbl:table2}, in the 20 points setting, VB brings +11.1 mIOU over the trivial point supervision baseline. This demonstrates that viewpoint bottleneck is an effective solution for ponitly-supervised 3D scene parsing, as rich representations that capture the intrinsic structure of point clouds are firstly learnt in an unsupervised manner. An interesting fact is that with the supervision point number decreases, the margins grow bigger, for both CSC and VB.
Qualitative results with different numbers of supervised points are shown in Fig.\ref{fig:all_results}. With the number of supervision points increasing, from 20 points to 200 points, the parsing results are getting closer to the fully-supervised setting. More qualitative results and category-wise quantitative results are provided in the supplementary material.
\subsubsection{Results on ScanNet test set}
We also evaluate on the held-out test set by submitting to an oneline server, with results shown in Table.~\ref{tbl:benchmark}. Only comparable 3D SSRL methods are listed. Compared with CSC\_LA\_SEM \cite{b8} and PointContrast\_LA\_SEM \cite{b7}, We achieve better performance in three settings. In the 20 points setting, our results are roughly the same as \cite{b7}. There are other complicated method with iterative pseudo label generation like \cite{b36}, which are not compared here due to the concern of fairness.
\subsubsection{Results with full supervision}
Although our goal is effective pointly-supervised scene parsing, we also evaluate with full supervision. As shown in Table.\ref{tbl:table1}, VB pre-training improves the fully supervised baseline by +0.9 mIOU.
\section{Conclusion}
In this paper, we address the challenging problem of learning 3D scene parsing models with only semantic annotations on sparse points. We develop a self-supervised representation learning framework named viewpoint bottleneck. We leverage a principled objective motivated by information theory and develops it into a practical surrogate loss. Pre-training with viewpoint bottleneck captures rich intrinsic structures between enormous unlabelled points. Pointly-supervised scene parsing performance on the public benchmark ScanNet is significantly improved, while reaching a new state-of-the-art among 3D SSRL methods
\begin{table}[t]
\centering
\caption{Results on ScanNet validation set using full supervision}
\begin{tabular}{lc}
\toprule
& mIOU\\
\midrule
Baseline & 71.0\\
VB (1024) & \textbf{71.9 (+0.9)}\\
\bottomrule
\end{tabular}
\label{tbl:table1}
\end{table}
| {'timestamp': '2021-09-20T02:18:08', 'yymm': '2109', 'arxiv_id': '2109.08553', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08553'} | arxiv |
\section{Introduction \& Related Work}
The topic of sarcasm has received attention in various research fields like linguistics~\cite{utsumi2000verbal}, psychology~\cite{gibbs1986psycholinguistics, kreuz1989sarcastic} and the cognitive sciences~\cite{gibbs2007irony}. Identifying sarcasm is essential to understanding the opinion and intent of a user in downstream tasks like opinion mining, sentiment classification, etc. Initial approaches for this task~\cite{kreuz1989sarcastic} mostly relied on handcrafted features to capture the lexical and contextual information. On similar lines, the efficacy of special characters, emojis and n-gram features in the discrimination task have also been studied~\cite{carvalho2009clues, lukin2017really}.
In recent years, this task has gained traction in the machine learning and computational linguistic community~\cite{davidov2010semi, gonzalez2011identifying, riloff2013sarcasm, maynard2014cares, wallace2014humans, ghosh2015sarcastic, joshi2015harnessing, muresan2016identification, amir2016modelling, mishra2017harnessing, ghosh2017magnets, chakrabarty2020r}. Several approaches have studied the role of context in this sarcasm detection task~\cite{ghosh2020report}. However, none of the previous works have explored the idea of incorporating commonsense knowledge in sarcasm detection. Common sense has been used in several natural-language based tasks like controllable story generation~\cite{zhang2020story, brahman2020modeling}, sentence classification~\cite{chen2019deep}, question answering~\cite{dzendzik2020q}, natural language inference~\cite{annervaz2018learning, wang2019improving} and other related tasks but not for sarcasm detection. We hypothesize that commonsense knowledge, capturing general beliefs and world knowledge, can prove instrumental in understanding sarcasm. For example in Figure~\ref{fig:1}, for the event ``I loved the movie so much that I left during the interval" (an example of sarcasm with polarity contrast), we show how commonsense is able to capture the contrast between the intentions of the subject before and during the event. Incorporating such commonsense knowledge ideally should make it easier for the learning model to detect sarcasm where it is not apparent from the input.
\begin{figure}[t!]
\includegraphics[width=0.5\textwidth]{figures/COMET.pdf}
\centering
\caption{COMET output for the sentence ``I loved the movie so much that I left during the interval". The commonsense sequences capture the contrast between intent and action of the subject.}
\label{fig:1}
\end{figure}
With this motivation, we study the utility of common sense information for sarcasm detection. For this, we leverage COMET~\cite{bosselut2019comet} to extract the relevant {social} commonsense information for a sentence.
Given an event, COMET provides likely scenarios relating to various attributes like intent of the subject, effect on the object etc.
We use a GCN~\cite{kipf2016semi} based model for infusing commonsense knowledge in the sarcasm detection task. Our experiments reveal that the commonsense augmented model performs at par with the baseline model. We perform an array of analysis experiments to identify where the commonsense infused model outperforms the baseline and where it fails.
\begin{figure}[t!]
\includegraphics[width=0.45\textwidth]{figures/GCN_model.pdf}
\centering
\caption{Proposed model architecture. Representations of the input sentence along with two COMET sequences are retrieved from pre-trained DistilBERT that are used to initialize a GCN. Post training, node representations of the graph is passed through a fully-connected neural network to generate the output.}
\label{fig:6}
\end{figure}
\section{Model}
We use a graph convolution-based model to enable incorporation of COMET sequences given an input sentence. The sentence representations are retrieved from the pre-trained encoder of our baseline model. Our \textbf{baseline model} consists of a Transformer~\cite{vaswani2017attention} based DistilBERT~\cite{sanh2019distilbert} encoder followed by a feed-forward neural network (FFNN). DistilBERT is a light-weight encoder, which enables faster training, while achieving similar performance as other Transformer based encoders.
The model is shown in Figure~\ref{fig:6}. For every input instance, a graph is formed with edges between the input sentence and COMET sequences. No edges are present between individual COMET sequences. Sentence embeddings retrieved from the baseline DistilBERT form the initial graph embeddings. The intuition behind leveraging a graph-based architecture was to enable information flow between the representations of the input sentence and COMET sequences, thereby reducing the domain discrepancy between them.
The graph is then fed into a GraphSage~\cite{hamilton2017inductive} network which produces the node embedding vector $V \in {\rm I\!R}^{(M + 1) \times N}$, where $M$ is the number of COMET sequences and $N$ is the output dimension of the GCN. The node embedding vector $V$ is then forwarded to a fully connected neural network layer to produce the final output. In section~\ref{gcn-exp}, we experiment with different edge configurations and observe how each edge configuration affects the downstream performance.
We experimented with another model that incorporated COMET sequences with an attention-mechanism. In that model, the representation of the input sentence was concatenated with an aggregate representation of the COMET sequences, formed in an attentive fashion.
Its performance was not better than the GCN-based model, so we do not describe it here.
\begin{table}[t!]
\begin{center}
\resizebox{0.45\textwidth}{!}{
\begin{tabular}{l|c|c}
\toprule[1pt]
\textsc{Dataset} & \textsc{Training} & \textsc{Test} \TBstrut\\
\midrule[1pt]
{SemEval Irony } & 3833 & 958 \Tstrut\\
{News Headline} & 27691 & 27691 \\
{FigLang 2020 Reddit} & 3520 & 880 \\
\bottomrule[1pt]
\end{tabular}
}
\caption{Number of training samples in train/test split for each dataset.}
\label{table0}
\end{center}
\end{table}
\begin{table*}[t!]
\centering
\begin{tabular}{p{0.34\textwidth}|c|c|c}
\toprule[1pt]
\multirow{2}{*}{\textsc{Approach}}
& \multirowcell{2}{News \\ Headlines}
& \multirowcell{2}{SemEval\\ Irony}
& \multirowcell{2}{FigLang 2020\\ (Reddit)}\Tstrut\\
& & & \Bstrut\\
\midrule[1pt]
Baseline & 96.13\% & 69.09\%& 67.95\%\Tstrut\\
GCN (\textit{bidirectional} edges) & 96.16\% & 67.88\%& 67.50\%\\
GCN (input $\rightarrow$ COMET edges) & 96.14\% & 68.66\%& 67.35\%\\
GCN (COMET $\rightarrow$ input edges) & 96.18\% & 68.40\%& 67.54\%\\
\bottomrule[1pt]
\end{tabular}
\caption{Accuracy of the baseline DistilBERT and GCN model (in various edge configurations). We do not observe any significant change in sarcasm detection performance with the incorporation of commonsense sequences.}
\label{table5}
\end{table*}
\section{Experimental Setup}
\label{sec:exp}
We evaluate the models on three datasets (a) \textbf{Irony detection SemEval task}: \citeauthor{van2018semeval} (\citeyear{van2018semeval}) conducted a SemEval task for irony detection considering an utterance in isolation. They also released a secondary task where the sarcastic samples were classified into \textit{three} broad categories: verbal irony with polarity contrast, situational irony, and others. (b) \textbf{News Headlines dataset} \cite{misra2019sarcasm}: contains sarcastic news headlines from \textit{TheOnion}
and non-sarcastic ones from \textit{HuffPost}. (c) \textbf{FigLang 2020 Sarcasm detection task}: We experiment on the Reddit dataset of the shared task introduced by \citeauthor{ghosh2020report} (\citeyear{ghosh2020report}). The statistics of the datasets are specified in Table~\ref{table0}.
All the aforementioned datasets are balanced. We report our results by randomly splitting into training and test set, and averaging the accuracy over 5 iterations. In our experiments, we incorporate a subset of COMET predicates (\textit{xWant} and \textit{xEffect}) related to the subject in a sentence
\begin{table}[t!]
\begin{center}
\resizebox{0.42\textwidth}{!}{
\begin{tabular}{l|c}
\toprule[1pt]
{Edge configuration} & {Performance} \TBstrut\\
\midrule[1pt]
GCN (\textit{bidirectional}) & 67.27\%\Tstrut\\
GCN (COMET $\rightarrow$ input) & 55.00\% \\
GCN (input $\rightarrow$ COMET) & 67.36\% \\
\bottomrule[1pt]
\end{tabular}
}
\caption{Performance of the proposed model for different edge configurations. We observe a sharp performance drop in (COMET $\rightarrow$ input) configuration.}
\label{table10}
\end{center}
\end{table}
\section{Results}
\label{gcn-exp}
We report the classification accuracy of the models for all datasets in Table~\ref{table5}. The baseline denotes the DistilBERT performance. We see a high performance in the \textit{News headline} dataset where the sentences are self-contained and language is not noisy. We see relatively lower performance of the baseline in FigLang 2020 Reddit, where we ignored the available context. Performance in SemEval dataset is low due to noisy tweets.
We conduct an ablation study with three configurations of the graph edges (a) \textit{bidirectional} edges (b) edges from \textit{input} $\rightarrow$ \textit{COMET} sequences and (c) edges from \textit{COMET sequences }$\rightarrow$ \textit{input}. The results of the GCN-based model in different settings are shown in Table~\ref{table5}. The performance of the GCN model is at par with the baseline and varying edge configurations doesn't have any effect on the downstream performance.
COMET produces sequences for an input event in the following format.
\noindent\textit{Input}: ``they should have put \$125 million termination payout in each of their contract"\\
\textit{xWant} : \textit{to save money}
\noindent We wish to have more complete COMET sentences like: \textit{they wanted to save money}.
In order to improve the setup, we replace COMET sequences with complete sentences
of the form:
\texttt{[subject] [MASK] [raw COMET sequence]}.
We replace the \texttt{[subject]} placeholder with the SUBJECT POS tag in the input sentence. We leverage a pre-trained
BERT model to predict the unknown \texttt{[MASK]} word. All reported results use this setup.
We examine whether the COMET representations leverage information from the input in the GCN setup by \textbf{removing the input sentence representation} before the FFNN module (shown in Figure~\ref{fig:6}) and experimenting with different edge-configurations. In Table~\ref{table10}, we observe a significant performance dip with COMET$\rightarrow$input setup. This illustrates that the information flowing from input sentence to COMET sequences is more relevant
\begin{table}[t!]
\begin{center}
\resizebox{0.35\textwidth}{!}{
\begin{tabular}{l|c}
\toprule[1pt]
{Dataset} & {Overlap} \TBstrut\\
\midrule[1pt]
News Headline & 99.5\%\Tstrut\\
SemEval Irony & 91.6\% \\
FigLang 2020 (Reddit) & 92.7\% \\
\bottomrule[1pt]
\end{tabular}
}
\caption{Test set overlap where the output label from the GCN and DistilBERT model is the same. }
\label{table8}
\end{center}
\end{table}
\begin{figure*}[h!]
\centering
\includegraphics[width=\textwidth, keepaspectratio]{figures/gradient.png}
\caption{Visualization of gradient-based saliency tests. Darker shade denotes lower absolute values. The first row shows the features corresponding to the input sentence, and the other two rows are features from COMET sequences \textit{xWant} and \textit{xEffect}. We observe that features from input sentence (first row) receive high saliency values.}
\label{fig:8}
\end{figure*}
We also measure the share of instances in the test set having the same predicted label from the baseline and the model. We observe a significant overlap ($>$90\%) between the predictions of the baseline and the proposed model across all datasets in Table~\ref{table8}, illustrating that the model isn't able to tackle new instances.
\begin{table}[t!]
\begin{center}
\begin{tabular}{l|c}
\hline
{Occluded Element} & $\Delta$ \TBstrut\\
\hline
Input sentence & 27.99\%\Tstrut\\
COMET sequences & 1.38\% \\
\hline
\end{tabular}
\caption{Confidence change when different segments of the input are occluded. $\Delta$ denotes the change in confidence when different parts of the input is occluded. }
\label{table9}
\end{center}\vspace{-5pt}
\end{table}
\begin{figure}[t!]
\includegraphics[width=0.5\textwidth, keepaspectratio]{figures/occlusion.png}
\centering
\caption{Occlusion setup. First setup shows that the input sentence representation (first row) is occluded. Second setup commonsense sequence representations are occluded (second and third rows).}
\label{fig:9}
\end{figure}
\section{Saliency Test}
We perform saliency tests to investigate whether the model is reliant on commonsense sequences while taking decisions.
\noindent(a) \textbf{Gradient-based saliency} \cite{bastings2020elephant} measure for a feature $x_i$ given an output class $c$ is computed as $\nabla_{x_i} \mathcal{L}(y, f(x)) \cdot x_i $, where $\mathcal{L}(\cdot, \cdot)$ is the loss function. The saliency map is shown in Figure~\ref{fig:8}. The saliency map vector has a dimension of $3 \times 768$, where the first row showcases the saliency values of the features corresponding to the input sentence while the remaining two rows correspond to the saliency of COMET sequences. For better visualization, all values are normalized between 0-1 and average pooling is performed on adjacent blocks of 8 to form a vector of dimension $3 \times 192$. From Figure~\ref{fig:8}, it is evident that the model learns to identify important input features but assigns similar saliency values to all COMET features.
\noindent(b) \textbf{Occlusion-based saliency} test involves occluding a part of the input and observing the change in the output probability vector. We occlude the input representation and COMET representations respectively as shown in Figure~\ref{fig:9}. The occlusion metric \cite{bastings2020elephant} is defined as $ \mathrm{E}_{x \sim \mathcal{D}} [|f_c(\bm{\mathrm{x}}) - f_c(\bm{\mathrm{x}}| x_i = 0)|]$. Table~\ref{table9} reports the results of this test. We observe that occluding the input sentence leads to a significant change in the output confidence while occluding the COMET sequences has little impact.
These tests demonstrate that the model is more reliant on the input sentence and less on the COMET sequences for making the prediction.
\section{Efficacy of Commonsense}
In this section, we try to uncover why COMET sequences don't help in the sarcasm detection task.
In order to identify instances where commonsense incorporation hurts the performance, we focus on samples where the model's prediction is wrong but the baseline is correct. Among these samples, we measure how many were non-sarcastic by defining a new measure \textbf{non-sarcastic class coverage},
$$\mathcal{C}^{NS}_{\textsc{GCN}} = \frac{|\{x | x \in \mathcal{S}^B_{\textsc{GCN}}, l(x) = \mathcal{NS}\}|}{|\mathcal{S}^B_{\textsc{GCN}}|}$$
\begin{table}[t!]
\begin{center}
\begin{tabular}{l|c}
\toprule[1pt]
\textsc{Dataset} & \text{$\mathcal{C}^{NS}_{\textsc{GCN}}$} \TBstrut\\
\midrule[1pt]
News Headline & 83.8\%\Tstrut\\
SemEval Irony & 64.6\% \\
FigLang 2020 Reddit & 96.8\% \Bstrut\\
\bottomrule[1pt]
\end{tabular}
\caption{$\mathcal{C}^{NS}_{\textsc{GCN}}$ statistic across different datasets.}
\label{table11}
\end{center}
\vspace{-5pt}
\end{table}
\begin{table*}[t!]
\small
\centering
\begin{tabular}{p{0.12\textwidth}|p{0.2\textwidth}|p{0.27\textwidth}|p{0.32\textwidth}}
\toprule[1pt]
\multirowcell{2}{\textbf{Ground} \textbf{Truth}}
& \multirowcell{4}{\textbf{Input Sentence}}
& \multirowcell{4}{\textbf{COMET Support} \\[0.25em]\textit{(xWant and xEffect)}}
& \multirowcell{4}{\textbf{Explanations}}\\
& & & \\[0.25em]
\midrule[1pt]
\multirowcell{2}{Non-sarcastic}
&
{\textit{@usertag} i wonder if they have that in an audio book}
&
~~\llap{\textbullet}~~ He gets to learns something new
~~\llap{\textbullet}~~ He wants to be entertained
&
{COMET sequences don't add value for classifying the non-sarcastic sample.} \TBstrut\\
\hline & & &\\[-0.75em]
\multirowcell{3}{Sarcastic}
&
{Going to watch a movie about murder. merry christmas ;)}
&
~~\llap{\textbullet}~~ The person wants to have fun
~~\llap{\textbullet}~~ The person gets tired as a result
&
{COMET sequences fail to explain the satire.} \TBstrut\\
\hline & & &\\[-0.75em]
\multirowcell{2}{Sarcastic}
&
\multirowcell{2}{final at 7am, I'm ready}
&
~~\llap{\textbullet}~~ The person wants to go to bed
~~\llap{\textbullet}~~ The person has to go to work
&
COMET captures the contrast between the intentions and results. \TBstrut\\
\hline & & &\\[-0.75em]
\multirowcell{3}{Sarcastic}
&
As a girl my reason not to put on makeup is I'm satisfied with my face
&
~~\llap{\textbullet}~~ She wanted to look pretty
~~\llap{\textbullet}~~ As a result she got complements
&
COMET doesn't provide relevant commonsense for capturing polarity contrast. \TBstrut\\
\bottomrule[1pt]
\end{tabular}
\caption{Example input instances along with their ground truth label and corresponding commonsense sentences retrieved from COMET. We analyze the utility of COMET sequences described as explanations. }
\label{examples}
\end{table*}
\noindent where $\mathcal{S}^B_{\textsc{GCN}}$ is the set of samples in which the model predicted incorrectly while the baseline was correct, $l(\cdot)$ is the oracle function which returns the true label of an input instance $x$, and $\mathcal{NS}$ denotes the non-sarcastic class label. Results in Table~\ref{table11} demonstrate a high value of $\mathcal{C}^{NS}_{\textsc{GCN}}$ across all datasets, this indicates that the large fraction of the instances where the model was incorrect but the baseline was correct were non-sarcastic. After surveying non-sarcastic instances we infer that commonsense knowledge fails to explain non-sarcastic samples and is present as irrelevant context hurting downstream performance~\cite{petroni2020context}.
There are cases where the prediction failed either due to noisy input (prevalent in the Twitter based SemEval dataset) or subtle play of words which COMET sequences fail to explain.
In order to investigate the utility of commonsense for specific type of sarcasm, we form a subset of the SemEval Irony dataset with samples only from irony with polarity contrast and non-sarcastic class by leveraging labels from the secondary SemEval task (mentioned in Section~\ref{sec:exp}).
$\mathcal{C}^{NS}_{\textsc{GCN}}$ for the new dataset is 57.1\%, a significant reduction from the 64.6\% in SemEval dataset in Table~\ref{table11}. We infer that commonsense is only useful in detecting sarcasm with polarity contrast but struggles with other types of sarcasm.
\section{Qualitative Analysis}
\label{appendix:relevancecs}
In this section, we analyze a few examples shown in Table~\ref{examples} and observe whether the COMET sequences are helpful in detecting sarcasm.
We have anonymized any twitter handle with ``@\textit{usertag}" to prevent any leak of private information.
\begin{itemize}[leftmargin=*]
\topsep0mm
\item In the first example of Table~\ref{examples}, the input sentence is non-sarcastic. Retrieved commonsense sequences don't capture any information that may help in prediction.
\item In several instances, a sentence is sarcastic due to a subtle play of words or use of language. The commonsense based model struggles in such scenarios as COMET sequences cannot explain such events as shown in the second instance of Table~\ref{examples}.
\item In the third example of Table~\ref{examples}, we show that COMET sequences are able to perfectly capture the contrast between the intention and effect on the person.
\item In rare cases like the fourth instance of Table~\ref{examples}, which is an example of irony with polarity contrast. It is still difficult for the commonsense model to explain the satire.
\end{itemize}
\section{Conclusion and Future work}
In this paper, we proposed the idea of integrating commonsense knowledge in the task of sarcasm detection. We observe that COMET infused model performs at par with the baseline. Through saliency tests, we observe that the model is less reliant on the commonsense representations in many cases. From our analysis, we infer that commonsense is most effective in identifying sarcasm with polarity contrast but fails to explain non-sarcastic samples or other types of sarcasm effectively, which hurts the overall performance. In the future, we will explore the utility of other forms of external knowledge such as factual world knowledge for sarcasm detection. We will also try to leverage commonsense to \textit{explain} why a certain remark is sarcastic.
| {'timestamp': '2021-09-20T02:19:18', 'yymm': '2109', 'arxiv_id': '2109.08588', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08588'} | arxiv |
\section{Introduction}
Huddled around television sets or with ears clung to radio receivers, people all around the world heard Neil Armstrong utter the words: ``[t]hat's one small step for man; one giant leap for mankind.'' This landmark event took place on July 21, 1969. The date denotes the day on which the landing took people, even though one could convincingly argue that this day is part of a sequence of events leading up to this historic moment. In the days before the landing, newspapers published articles that counted down to the event and added commentary to the event, fueling anticipation in public discourse. On a longer time scale, the moon landing was part of a larger event: the space race, a competition between the United States and the Soviet Union for technological dominance. This distinction calls to mind Fernand Braudel's famous description of events as ``surface disturbances, crests of foam that the tides of history carry on their strong backs~\cite{braudel_1995}.''
Events, such as the moon landing, are essential for our experience of history. We do not perceive time as is but through our experience of change in which events demarcate historical temporality. We rely on events to structure the world around us, as individuals and as societies~\cite{wagner-pacificiWhatEvent2017}. William H. Sewell, Jr. describes an event as ``an occurrence that is remarkable in some way - one that is widely noted and commented on by contemporaries~\cite{sewell_historical_1996}.''
In the book \textit{What is an Event?}, Wagner-Pacifici uses 9/11 as a key example to theorize about the form and flow of events. She points out that historians have been preoccupied with bounding events in time and space, while she emphasizes ``the \textit{ongoingness} of events.'' As an event unfolds, it disrupts the historical flow while the public tries to make sense of what is happening. Afterward, the public reflects on these events and sets out to integrate these events into a historical narrative. As events gain traction, they transform how we experience historical time.
Understanding how historical temporality differs from natural temporality is crucial for ``understanding how history has shaped the identity of modern society and culture.\cite{koselleck_futures_2004}'' History is a process of both remembering and forgetting events and their relations. For contemporary, the moon landing was a singular event unlike any other, yet, canonized history knows more than one of these singular events. Was the moon really as impactful at the time, or has the wheel of time strengthen its position in our collective memories.
As Wagner-Pacifici points out, events cannot always be tied to exact dates, even though historical events are often connected to specific dates, such as the moon landing, the fall of the Berlin Wall, or winning a European soccer final. Rather than only departing from specific dates in a top-down manner, can we also detect the unfolding of events and their impact on the historical flow in a more data-driven, bottom-up manner? This paper sets out to answer this question by analyzing the relationship between events and the historical flow, represented by the information presented on the front pages of newspapers.
In our case, we model the ways events impacted language use. More specifically, we examine disruptions in the information flow of news on front pages. For example, events can disrupt the flow of the news by decreasing the amount of novel information presented on the front pages. In the run-up to an event, an increasing focus of the public's eye might be reflected in the increasing uniformity of discourse. Alternatively, an event could have a sudden impact while retaining the public's attention for an extended period. One could hypothesize different archetypical forms of events. In what follows, we try to establish universal motifs, or event flows, from the data itself. The three central questions to this paper are: (1) Do events impact historical flow, as represented by front pages in newspapers? (2) Can we cluster events based on the way they impacted the flow of information? (3) Can we use these clusters to query for events? We call these clusters, event flows, as they represent generalized manners in which events have impacted historical flow.\footnote{Data and code supporting this paper have been made available at \url{https://doi.org/10.5281/zenodo.5509949} (data) and \url{https://github.com/melvinwevers/event-flow} (code).}
A recent special forum in the journal \textit{History and Theory} clearly describes the long-standing historiographical debate on the concept of the event~\cite{jungTimesEventIntroduction2021}. One of the main challenges in history is to combine theoretical work on events with empirical studies of the temporality of events and their relationship to collective memory. The authors claim that systemic analysis of the temporal nature of events, which could shed light on an event's identity, are largely unexplored. This paper offers a computational method that contributes to this effort to understand better how events and their temporal structure have affected public discourse and, by extension, collective memory.
\section{Related Work}
Previous studies have shown that word usage in newspapers is sensitive to the dynamics of socio-cultural events~\cite{guldi_measures_2019, van_eijnatten_eurocentric_2019, daems_workers_2019}. Furthermore, the co-occurrence of words in newspaper reporting has been shown to capture thematic development accurately~\cite{newman_probabilistic_2006}, and, when modeled dynamically, is indicative of the evolution of cultural values and biases~\cite{van_eijnatten_eurocentric_2019, paul2019bursty, wevers_using_2019}. Methods from complexity science, such as Adaptive Fractal Analysis, have been used to identify distinct domains of newspaper content based on temporal patterns in word use (e.g., advertisements and articles)~\cite{wevers_tracking_2020} and to discriminate between different classes of catastrophic events that display class-specific fractal signatures in, among other things, word usage in newspapers~\cite{gao_culturomics_2012}.
Several studies have shown that measures of (relative) entropy can detect fundamental conceptual differences between distinct periods~\cite{guldi_measures_2019, degaetano-ortliebUsingRelativeEntropy2018, kestemont_mining_2014}, concurrent ideological movements (e.g. progressive and conservative politics) \cite{barron_individuals_2018, bos_quantifying_2016}, and even, the development of ideational factors (e.g., creative expression) in writing with a serial structure~\cite{murdock_exploration_2015, nielbo_automated_2019, nielbo_curious_2019}. More specifically, a set of methodologically related studies have applied windowed relative entropy to thematic text representations to generate signals that capture information \emph{novelty} as a reliable content difference from the past and \emph{resonance} as the degree to which future information conforms to said novelty~\cite{barron_individuals_2018, murdock_exploration_2015}. Two recent studies have found that successful social media content shows a strong association between novelty and resonance~\cite{nielbo_trend_2021}, and that variation in the novelty-resonance association can predict significant change points in historical data~\cite{vrangbaek_composition_2021}.
Our paper builds upon this work and will adapt the windowed relative entropy approach to a method that we call Jump Entropy. This method allows us to examine how events have impacted the flow of information in and between newspapers. We compare time series between newspapers and events, using Dynamic Time Warping Barycenter Averaging (DBA)~\cite{petitjean2011global}.
\section{Data}
Front pages function as the pulse of the nation, displaying current and pressing events at specific time points. Figure~\ref{fig:frontpage_example}, for example, depicts the front page in \textit{Algemeen Handelsblad} published on the day after the moon landing, which took place on a Sunday. In big, bold letters, we read: ``Walking on the Moon.''\footnote{Translated from the Dutch phrase ``Wandelen op de maan''.} Multiple articles on this event feature on this front page. In addition to the text, we see three images documenting this historic moment. For this study, we only looked into the textual content---captured by optical character recognition (OCR)---and not at the images.
The data consists of the textual content represented on the front pages of ten Dutch national and regional newspapers published between 1950 and 1995 (See Table~\ref{tab:data-overview} for details).\footnote{It is important to note that not all newspapers run for the entire period.}
\begin{figure}
\centering
\includegraphics[width=.75\linewidth]{figures/img1.jpg}
\caption{Frontpage of \textit{Algemeen Handelsblad} on July 21, 1969}
\label{fig:frontpage_example}
\end{figure}
\begin{table}[]
\centering
\caption{Overview of newspapers in dataset}
\begin{tabular}{@{}lllll@{}}
\toprule
Newspaper & period & type & \\ \midrule
Algemeen Handelsblad (AH) & 1950-1969 & national & \\
De Tijd (DT) & 1950-1974 & national & \\
Leeuwarder Courant (LC) & 1950-1994 & regional & \\
Limburgs Dagblad (LD) & 1950-1989 & regional & \\
Nieuwe Rotterdamsche Courant (NRC) & 1950-1994 & national & \\
Parool (PA) & 1950-1995 & regional & \\
Telegraaf (TG) & 1950-1994 & national & \\
Trouw (TR) & 1950-1995 & national & \\
Volkskrant (VK) & 1950-1995 & national & \\
Vrije Volk (VV) & 1950-1990 & national & \\
\bottomrule
\end{tabular}
\label{tab:data-overview}
\end{table}
For the data processing, which is not perfect due to flaws in the OCR technology, we removed stop words, punctuation, digits, and words shorter than three and longer than seventeen characters. We lemmatized the text using the NLP toolkit SpaCy.\footnote{https://spacy.io/} Next, we used Latent Dirichlet Allocation (LDA) with collapsed Gibbs sampling to train a topic model of the data.\footnote{Using topic coherence, the optimal number of topics ($k$) centered on 100. Going above or slightly below this number did not impact the results. However, when too few topics are selected the matrix becomes too sparse which makes it difficult to detect shifts in entropy.}
The input document for topic modeling consisted of a concatenation of all the articles on one single front page. This yields a matrix per newspaper of $P(topic_k|document_d)$ or $\theta$, in this case $document_d$ refers to a front page on a specific date and $topic_k$ holds the probability distribution of topics over documents. These ten matrices functioned as input for the calculation of the Jump Entropy.
In addition to the newspaper data, we constructed a list of sixty events for 1950-1995, using historical subject-matter knowledge combined with Wikipedia.\footnote{See Appendix \ref{section:Appendix_A} for an overview of these events.} This list includes global and national events.
\section*{Method}
\paragraph{Jump Entropy} To measure the flow of information between front pages, we propose an adapted version of the approach introduced by~\cite{barron_individuals_2018}. Barron et al.~\cite{barron_individuals_2018} measured the amount of novelty (how unexpected is a document, given previous documents) and transience (the degree to which patterns in documents fade or persist in future documents). They calculate this using varying window sizes, i.e. comparing the novelty of document compared to the average relative entropy contained in a varying number of documents. Relative entropy is a divergence measure that is able to capture the amount of ``surprise'' between two probability distributions, where (in this case) the reader learns to expect one distribution, $\vec{p}$, and then encounters second, say $\vec{q}$. These probability distributions are captured in $\theta$, i.e. the topic distributions from one time point compared to another. In our case, this would be between front pages in one newspaper.
Calculating novelty and transience using this windowed approach assumes that information accumulates in a continuous flow. This approach is quite sensitive to outliers, especially for shorter time windows. Also, due to the cyclical nature of events (e.g. seasonal or annual events), or the cascading, ripple effect in which an event might have impacted newspaper discourse, taking a continuous window might flatten out these effects.
To better capture the effect of an event on different time scales and trace ripple effects in public discourse, we adapted their approach. We introduce Jump Entropy, an approach that replaces the shifting window for jumps of different sizes. Rather than moving through the set linearly, we compare sets of front pages that are separated by a given distance. This distance between the two sets is expressed by $J$, the jump size. While using a fixed range of documents (14 days, t - 7 and t + 7), we vary the jump size ($J$) and calculate the JSD between a set of front pages around the focal point $t$ and front pages around a focal point either in the past (negative jump size) or the future (positive jump size).\footnote{We also experimented with shorter time windows, but this adds noise to the signal.}
While \cite{barron_individuals_2018} compare one front page with a range of front pages, this method compares two ranges of front pages separated by a jump. Put differently, we measure the average entropy for a range of documents and then jump into the past or future and compare this range to a similar range in this period. This approach allows us to measure the amount of ``surprise'' between the focal set to a set in the past or the future; as such, we can spot re-use of themes or recurring debates. Compared to the windowed approach, this method is less sensitive to outliers. We can find cyclical patterns, i.e., which period in the past or future is most similar to the focal period.
In addition to adding jumps, we also used a different metric than~\cite{barron_individuals_2018}. Rather than using Kullback-Leibler (KLD), we used Jensen-Shannon divergence (JSD), a less well-known formulation of relative entropy. JSD has several favorable properties when dealing with cultural information that is not produced in a strictly one-directional fashion. While newspapers are published day by day, the information represented in the papers is not necessarily produced in a one-directional fashion. Articles might have been written earlier, or authors might reflect back onto earlier events. We contend that JSD better reflects these assumptions. First and foremost, JSD is symmetric ensuring that $JSD(P|Q) = JSD(Q|P)$ for probability distributions $P$ and $Q$. Second, as a smooth version of KLD, JSD is well-behaved when $P$ and $Q$ are small. Finally, the square root of JSD is a proper distance metric that can be, for example, be used for clustering probability distributions. A disadvantage of JSD compared to KLD is that it is more computationally costly. However, this additional cost does not significantly impact the current study.
We model the difference between articles $s^{(j)}$ and $s^{(k)}$ as their relative entropy:
\begin{equation}
JSD (s^{(j)} \mid s^{(k)}) = \frac{1}{2} D (s^{(j)} \mid M) + \frac{1}{2} D (s^{(k)} \mid M)\label{eq:4}
\end{equation}
\noindent with $M = \frac{1}{2} (s^{(j)} + s^{(k)})$ and $D$ is the Kullback-Leibler divergence:
\begin{equation}
D (s^{(j)} \mid s^{(k)}) = \sum_{i = 1}^{K} s_i^{(j)} \times \log_2 \frac{s_i^{(j)}}{s_i^{(k)}}\label{eq:5}
\end{equation}
We calculated the average relative entropy between a range ($t$) of topic distributions ($s$) at moment $i$ ($s^{i+t}$) and the same range of documents at moment $j$ ($s^{j+t}$). $t$ ranged from -14 to 14, and the jump size ($J$) ranges between -1500 and 1500 with steps of 15:
\begin{equation}
\mathcal{J}_{J}(i) = \frac{1}{w} \sum_{j=1}^{w} D (s^{(i)} \mid s^{(i + vj)}
\label{eq:jump_entropy}
\end{equation}
\noindent where $v = -1$ for $t < 0$ otherwise $v = 1$, and $D$ is the distance measure (in this case $JSD$), $w$ is a window size and $J$ is the set of jumps of size $w$, and $t$ is the time point (`direction') at which $\mathcal{J}_{J}(i)$ is computed.
After calculating the jump entropies for a newspaper, we can use them to visualize event flows. Figure~\ref{fig:event_flows_vk} shows the event flow for eight random event in the newspaper \textit{De Volkskrant}. For each figure, on the x-axis, we see the jump size, and on the y-axis, the relative entropy. The center of the x-axis (0) indicates the date of the event, and to the left we see jumps in the past and to the right jumps into the future. This graph captures the flow of information leading up to and after the event.
\begin{figure}
\centering
\includegraphics[width=\linewidth]{figures/img2.png}
\caption{Event Flows of \textit{De Volkskrant}, window size of 50, rolling mean of 5 (orange line).The center of the x-axis reflects the date of the event, and to the left we see jumps in the past, and the right jumps into the future. This graph captures the flow of information leading up to and after the event. On the y-axis, we capture the amount of new information. A lower score means that front pages are more similar, thus a line going down means an increasing focus on a topic.}
\label{fig:event_flows_vk}
\end{figure}
\paragraph{Comparing Event Flows}
To group events within and between newspapers in an unsupervised manner requires a method to cluster dynamic processes and compute archetypical (averaged) representations of these time series. Dynamic-Time Warping Barycenter Averaging (DBA) is an ideal solution for exactly that. DBA is based on Dynamic Time Warping (DTW), a technique for optimally aligning time series and flexibly capturing similarities inside the series \cite{petitjean2011global}. As such, DTW accounts for non-linear variations in the time series, i.e., fluctuations do not need to occur at the same time steps~\cite{rakthanmanon2013addressing}. This makes DTW a better distance metric for clustering than traditional Euclidean distance metrics, which have been found to be an inaccurate measure for clustering~\cite{liao2005clustering,petitjean2011global}.
In principle, DTW allows us to align and compare events between newspapers. However, as pointed out by \cite{petitjean2011global}, while DTW is one of the most used similarity measures for time series, it cannot be reliably used for clustering using well-known algorithms since they rely on K-medoids, which require no averaging. DBA offers an extension of DTW to compute a consensus representation for a set of time series~\cite{petitjean2011global}. This allows us to calculate the average event flow for one event using data from ten newspapers. Figure~\ref{fig:event_flow_moon_landing} gives an example of this process using a DBA and a smoothened version of DTW (soft-DTW) using a soft minimum. \cite{petitjean2011global} show that DBA can be used as input for the k-means clustering of time series.
\begin{figure}
\centering
\includegraphics[width=\linewidth]{figures/img3.png}
\caption{Dynamic Time Warping Barycenter Averaging (DBA) of the time series of the Moon Landing. The red line shows the average time series, while the colored lines show individual time series per newspaper. On the left, we apply the default DBA method, on the right we see Soft-DTW, which uses a differentiable loss function to find the barycenter. The x-axis indicates the window before and after the event (centered at 0).}
\label{fig:event_flow_moon_landing}
\end{figure}
Rather than using k-means clustering, we applied agglomerative clustering. This approach has two main advantages over k-means clustering. First, the method is more explainable; we can inspect how clusters are created, how they are distributed over the dataset, and which clusters are more similar than others. Second, agglomerative clustering led to better separation of the clusters than k-means clustering (see~Figure~\ref{fig:clustering_projections}).
We clustered using the following steps:
\begin{enumerate}
\item Applying a window size of 28.\footnote{There were four to five clusters for all window sizes between five and fifty. We settled for 28 days for interpretative reasons, as it corresponds to four weeks, or approximately a month of front pages.}
\item Time series were z-normalized.
\item Calculate pairwise DTW distance between the events, acquiring a distance matrix.
\item Project the distance matrix in to two dimensions using UMAP (Uniform Manifold Approximation and Projection).
\item Grid search through clustering parameters (number of clusters, clustering method), aiming for a high Silhouette score. Additional sanity checks of cluster coherence were taken using the UMAP projection.
\item After the grid search, euclidean distance was picked as the clustering metric, while UPGMA (unweighted pair group method with arithmetic mean), also known as average linkage, was picked as the linkage criterion.
\item Calculate an archetypical time series using DBA for each found cluster.
\end{enumerate}
\begin{figure}
\centering
\begin{subfigure}{0.5\textwidth}
\centering
\includegraphics[width=.9\linewidth]{figures/img4.png}
\caption{K-means clustering}
\label{fig:sub1}
\end{subfigure}%
\begin{subfigure}{0.5\textwidth}
\centering
\includegraphics[width=.9\linewidth]{figures/img5.png}
\caption{Agglomerative clustering}
\label{fig:sub2}
\end{subfigure}
\caption{UMAP projection of clusters learned by k-means (left) and agglomerative clustering (right).}
\label{fig:clustering_projections}
\end{figure}
\noindent Using the described methods, we executed the following steps:
\begin{itemize}
\item compare similarities and differences between events across newspapers
\item establish archetypical event flows using agglomerative clustering
\item use an averaged event flow to query for similar events
\end{itemize}
\section{Results}
In what follows, we will first check whether there exists a difference between newspapers and specific event flows. This step helps us establish for which events there was consensus among newspapers or which newspapers deviated in their reporting on a particular event. Rather than just focusing on our selection of events, we also use a list of random dates as a baseline.
\paragraph{Newspaper difference using random dates}
We selected the event flows with a jump size of thirty, i.e, thirty days in the future and thirty in the past, for 1,000 random dates between 1950 and 1995 from all the included newspapers. After z-normalizing the time series for every date, we calculated the average event flow per date using DBA. Next, we calculated the distance for each newspaper to each date's average event flow using DTW. This distance to the mean shows us which newspapers deviated the most from the average for that date. In Figure~\ref{fig:newspaper_difference}, we see the distance from the mean per newspaper grouped per decade.
\begin{figure}
\centering
\includegraphics[width=\linewidth]{figures/img6.png}
\caption{Distance per newspaper to average time series for a random set of 1,000 dates. Mean-aggregated by decade with CI at 95\%.}
\label{fig:newspaper_difference}
\end{figure}
From Figure~\ref{fig:newspaper_difference}, we can gauge that the regional newspaper \textit{Leeuwarder Courant (LC)} and national newspaper \textit{De Telegraaf} deviated the most from the mean, with the latter diverging considerably over the course of these fifty years. This confirms what we knew about the country's most popular newspaper's ideological course, which moved to the right in this period~\cite{hoevenConcentratieKritischeAutonomie2019}. Also, the changing course of the \textit{Leeuwarder Courant} dovetails with the merger of the newspaper with another regional newspaper \textit{Friese Koerier}~\cite{broersmaNieusteTydingenLeeuwarder2002}. It might be that this merger has pushed the newspaper toward to average Dutch newspaper landscape.
\paragraph{Newspaper differences using selected events}
In addition to calculating the difference between papers for random dates, we used our list of events. For each event, we calculated an average event flow using DBA. Next, we calculated the distance from each event per newspaper to the average event flow. From this, we learn for which events the event flows in newspapers were the most similar, and for which events newspapers diverged.\footnote{Since \textit{Algemeen Handelsblad} and \textit{De Tijd} only appeared for a small subset of the period, we excluded these two newspapers}
\begin{figure}
\centering
\includegraphics[width=\linewidth]{figures/img7.png}
\caption{Distance to average event time series. The newspapers and events are sorted based on their mean distance. Dark refers to a shorter distance, while light refers to longer distances. White indicates missing values. For legibiilty, we only included the top 10 events closest to the mean and every other second from the remainder of the list of events.}
\label{fig:newspaper_event_difference}
\end{figure}
Figure~\ref{fig:newspaper_event_difference} shows that the top five events on which the newspapers reported uniformly were: the Suez crisis in 1956, the 1973 oil crisis, the Nigerian civil war (1967-1970), the fall of Saigon (April 30, 1975), and the moon landing (July 21, 1969). We also see that \textit{NRC Handelsblad}, \textit{Het Parool}, \textit{Het Vrije Volk}, and \textit{De Volkskrant}, were most closely aligned in terms of their event flows, with \textit{De Telegraaf} and \textit{Leeuwarder Courant}, again, being the outliers. Here we also clearly see how \textit{De Telegraaf} is behaving quite distinct compared to the other newspapers. Especially on Middle Eastern affairs, such as the Yom Kippur War (1973) and the Iran hostage crisis (1979-1981), other papers were very much in line with \textit{De Telegraaf} being the exception.
\paragraph{Archetypical time series}
Using DBA in combination with agglomerative clustering, we looked for clusters of event flows in our data. We excluded \textit{De Telegraaf} because of its deviant behavior. Using a window size of 28, we used the 58 events for the nine remaining newspapers as input. Using Silhouette analysis and cluster separation in the UMAP projection, we determined that the optimal number of clusters was closest to five. Figure~\ref{fig:event_flow_clusters} shows the average event flows within these five clusters.
From this clustering, we learn that events impacted the news in five characteristic manner. These manner capture how this impact unfolded over time and helps us to understand how events impacted the flow of information in the news, and by extension, how events impacted our historical temporality. The five clusters can be described as follows:
\begin{itemize}
\item \textbf{Cluster 1}: The downward slope before the event indicates a growing focus on an event, with a slow release indicating persisting, albeit abating focus on the topic after the event.
\item \textbf{Cluster 2}: The downward slope before the event indicates a growing focus on an event, with a flat line after the event indicative of a persistent focus on a topic after the event. Compared to Cluster 1, the event's impact is more sudden, and it captured the public's attention for a longer period.
\item \textbf{Cluster 3}: A noisy pattern that indicates no clear anticipation and a quick release after the event. Events with this signature might have occurred in periods with a quick news cycle, i.e., many news events rapidly superseding each other.
\item \textbf{Cluster 4}: Stable entropy, indicated by lack of slope, which suggests an increasing focus on a topic in the days before an event. The slope after the event indicates a release of focus after the event. This cluster is the mirror version of Cluster 2 and, to a lesser extent, Cluster 1.
\item \textbf{Cluster 5}: This cluster is most similar to cluster 4, albeit more balanced. There is growing anticipation and a release after the event. These event characteristics are indicative of events, such as the Moon Landing, that capture the public's attention in the days before \emph{and} after an event.
\end{itemize}
\begin{figure}
\centering
\includegraphics[width=\linewidth]{figures/img8.png}
\caption{Clustering dendrogram (top) with per-cluster archetypical time series (bottom). DBA time series are indicated by bold lines. Underlying event flows used for the calculation are shown in thin lines. Selected events, window size of 28.}
\label{fig:event_flow_clusters}
\end{figure}
\paragraph{Querying for Events}
One of the applications of the cluster-based approach is that we can use the average event flow of a cluster (indicated by bold lines), to query for front pages that exhibit a similar pattern. This allows us to search for all the front pages in a particular newspaper that exhibit a sudden focus on a topic, as expressed by Cluster 5. Alternatively, we could also take a specific event, for example, the Oil Crisis in the 1970s, and look for similar events.
\section{Conclusion}
We have presented an adaptation to the method introduced in ~\cite{barron_individuals_2018}, which allows us to capture how events impacted newspaper discourse, and by extension, reveal how the public's eye was drawn to specific events. We have shown how this method can be used to compare how newspapers responded to events and characterize events based on their impact on newspaper discourse.
The interaction between newspapers and the outside world is a complex interaction. Nonetheless, we managed to characterize ways in which front pages responded to world events. We can use these characterizations to define archetypical time series that can be used to query newspaper data to locate similar events. In this study, we have shown that there were events that impacted the news even though they are not remembered as having an impact, or vice versa. In future work, we will examine how these disjunctions between the public's memory of events and their impact on the news related to the canonization of historical events.
Also, we found that some noteworthy events displayed no clear signal (cluster 3). For example, the accident with the Challenger space shuttle on January 28, 1986, or the Coup in Ethiopia on December 13, 1960, did not elicit a clear response in the newspapers. For now, we can only speculate about the reasons that these events did not impact the information flow on the front pages of Dutch newspapers. One possibility is that the events did not grasp public attention. Alternatively, it could be that the event was discussed in a more specialized section or that the general public only identified an event as newsworthy well after it occurred.
Closer examination shows that the earthquakes in Chili in May 1960 followed the event flow displayed in Cluster 1, which might seem surprising. However, in this case, there was also a summit with world leaders taking place that increasingly captured the public's attention. The earthquake disrupted this trend and suddenly introduced a new topic, herewith increasing the entropy.
This example also highlights one of the shortcomings of this approach. Events can overlap each other, move away from the front pages, and after a turn of events they might return to the front again. This movement throughout the papers is not yet captured with this approach. Future work will examine the relationships between topics on the front pages and how they propagated throughout the newspaper. Retention, for instance, could also be expressed by more in-depth reflections on the events in dedicated newspaper sections.
\section{Acknowledgments}
This study was a NeiC's Nordic Digital Humanities Laboratory project (DeiC-AU1-L-000001), executed on the DeiC Type-1 HPC cluster. We acknowledge The National Library of the Netherlands (KB) for making their newspaper data available. Also, we express our gratitude to Simon DeDeo for his input during the early stages of this paper.
| {'timestamp': '2021-09-20T02:19:18', 'yymm': '2109', 'arxiv_id': '2109.08589', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08589'} | arxiv |
\section{Introduction}
With the advancement of digital media, the online retail sector has started to gain a lot of importance. Coupled with other factors like the COVID-19 pandemic, people often tend to prefer online shopping for fashion items. Hence, the content that is shown to users on fashion websites is very important. In order to sustain user interest on a platform, it is important to display as much relevant information as possible and also rank the items according to their relevance. Hence, the development of a robust recommendation system is very important. The main task in the FARFETCH Recommendation Challenge is to predict the optimal ranking of the 6 products in a given impression, such that products with higher probability of being clicked by the user in that recommendation context have lower rank (first positions). We can use click through data and product attributes along with the contextual similarity of a product in order to improve the quality of recommendations. We have tried to approach the problem using various ranking algorithms as well as a binary classification task, and the latter approach has proven to be more effective. We have been able to improve our results by around 15\% using a context-aware post-processing approach that makes use of the similarity of a product to the user context, achieving a final MRR of 0.4814 on the validation set and 0.4658 on the test set during the original course of the competition. Post evaluation, we have been able to improve our performance on the test set drastically by fine-tuning the threshold parameter in our post-processing approach, achieving an MRR of 0.4784.
\section{Problem Description}
The problem statement has been provided as a part of the FARFETCH Fashion Recommendations Challenge 2021~\cite{farfetch2021challenge}. We have been provided with a large sample of FARFETCH's recommendations system impressions and associated click events. An impression is a list of 6 products that were shown to a user in a recommendations UI module in a given context(type of page, date, etc), with a label identifying which of the 6 products have been clicked. The goal of the competition is to predict the optimal ranking of the 6 products in a given impression, such that products with a higher probability of being clicked by the user in the recommendation context has lower rank.
\subsubsection{Dataset Description : }
The dataset is a large sample of FARFETCH's recommendations system impressions and associated click events, captured over a period of 2 months. Each row of data has a query\_id which is a unique identifier of a recommendation impression. In the initial phase of the competition, we had access to a training set of 3.5 million rows that includes a target label, is\_click, and a validation set of about 0.6 million rows without a target label for making the initial submissions. The dataset contains 229064 unique users, 443150 unique products, and 813729 unique impression lists.
A separate attribute dataset is provided which contains the attribute information for each of the products. Considering all the data present, there are 3 numerical attributes and around 20 categorical ones.
The target label identifies which of the 6 products in the impression were clicked. The position of the products within the list is unknown in this dataset.
In the final phase, we had access to another unlabelled test set with around 0.6 million rows for final evaluation.
\subsubsection{Evaluation Metric : }
During the competition, models were evaluated using Mean Reciprocal Rank (MRR), defined as follows:
\begin{equation}
MRR=\frac{1}{|N|} \sum_{i=1}^{|N|} \frac{1}{rank_{i}}
\end{equation}
where, where N is the number of impressions, and for the i-th impression in the dataset, $rank_i$ is the rank of the first correct prediction.
\section{Methodology}
Initially, we tried to approach the problem as a ranking task with lambdarank as the objective function. However, further experimentation proved that approaching it as a simple binary classification problem to predict the clickout probability of a product using the binary cross-entropy objective, and ranking the products using the prediction probabilities yield much superior results. One of the most important steps in our solution was the feature engineering part, since it was challenging as well as time-consuming. We have created around 80 features based on user, session, product, clickout, and other relevant attributes. Our results have been further boosted using the context-aware post processing technique that we have employed.
\subsection{Preprocessing}
The main data preprocessing that we needed to employ in this problem was categorical variable encoding. The given dataset has a lot of categorical columns, most of which have a large number of distinct categories. We have used label encoding as the standard categorical variable encoding technique over approaches like one-hot encoding due to the sparsity in the data.
\subsection{Feature Extraction}
This is the most important step of our solution. A carefully engineered feature may have the potential to explain the significance of a product within a query quite effectively. Broadly, we have two types of features- click-out features and non click-out features.
\subsubsection{Non Click-out Features} \hfill \break
\hfill \break
These features are not dependent on whether a particular product has been clicked out or not. They are further sub-divided into the following categories: \par
\textbf{Session-based Features: }
These features include session specific aggregate and frequency features. Aggregate features include the mean, maximum, minimum product price and start online date in a session while frequency features include product frequency, main colour frequency, etc in a particular session. For example, the \textit{product\_session\_click\_proportion} feature, which is the most important feature of our best performing method, is a type of repeated clicks rate feature. It is the ratio of the total number of clicks on the product under consideration in a particular session to the total number of clicks on all the products in the same session.
\textbf{Query-based Features}:
These features include the aggregated like mean, maximum and minimum product price and start online date within a particular query.
\textbf{Global Static Features}:
Features like the total number of users who have interacted with a particular product, number of impressions that a particular product appears in, etc. compose this set of features.
\textbf{Popularity Features}:
These features provide information about various product attributes like popularity of brand id, category id, main colour, etc.
\textbf{User-tier features}:
User-tier specific aggregate features like the mean, maximum and minimum product price and start online date are included in this sub-category of features.
\textbf{Ranking Features}:
This features are basically the ranking of a product within an impression based on the product price and start online date.
\textbf{Difference Features}:
These features basically convey the comparison of a particular feature against an aggregate like feature, for example, the difference between a particular product price and the mean product price in that session.
\subsubsection{Click-out Features} \hfill \break
\hfill \break
These features are dependent on whether a particular product has been clicked out or not. They are further sub-divided into the following categories:\par
\textbf{Global Static features}:
These features include details about click interactions of a product like number of unique users who have clicked on a particular product, the price of a product when it was last clicked, etc.
\textbf{Popularity features}:
These features indicate the popularity of an attribute by computing percentage of click on a particular attribute. For example, the percentage click on a particular brand id among all clicked brands, the percentage click on a particular main colour among all clicked main colours, etc.
\textbf{User-tier features}:
Users are segmented into various tiers based on some attributes. The user-tier features include the aggregates like mean, maximum and minimum product price and start online date of clicked products based on the user tier.
\textbf{Difference Features}:
The difference features include the difference of product price and start online date and the mean of those features among the clicked products. They convey how a particular product attribute compares to the same attribute among clicked products.
\textbf{Weekly features}:
These features explain attribute variation at a weekly level. For example, the mean price of clicked products each week, the frequency of product clicks each week, etc. make up some of these features.
\subsubsection{Product-Context Similarity(PCS) Feature}\hfill \break
\hfill \break
The main motivation behind incorporation context-awareness in the recommendation system is that it enables us to generate recommendations more relevant to the specific contextual situation of an user. A context-based recommendation system gains special importance when information from multiple contexts are aggregated. For example, the products that a user might be interested in from the “Books” context might be totally irrelevant and have no predictive value for recommendations for the same user when he decides to purchase some products from the “Clothing” context. Gediminas et al.~\cite{adomavicius2011context} has shown how context provides additional capabilities in recommendation systems and how the general notion of context can be modelled in recommendation systems.
We have designed a PCS feature, that computes the similarity of a particular product to its corresponding user context. The context is basically a product that a user originally searched for, and recommendations are shown based on the context item. Hence, the similarity of the context item to another product provides an understanding about the relevance of a particular product to the original context. The PCS value is computed as follows:
For each product $P_i$, let $U^{i}_{c} = \{c^{1}_{i},c^{2}_{i}, \dots c^{k_{1}}_{i}\}, U^{i}_{f} = \{f^{1}_{i},f^{2}_{i}, \dots f^{k_{2}}_{i}\}, U^{i}_{l} = \{l^{1}_{i},l^{2}_{i}, \dots l^{k_{3}}_{i}\}$, where $U^{i}_{c}$ is the set of single-element categorical features, $U^{i}_{f}$ is the set of numerical features, and $U^{i}_{l}$ is the set of multiple-element (list) categorical features.
$S(P_i,P_j) = \frac{1}{N_p}[\sum_{h=0}^{k_{1}}\phi_C(c^{h}_{i}, c^{h}_{j}) + \sum_{h=0}^{k_{3}}\frac{n(l^{h}_{i} \cap l^{h}_{j})}{max(n(l^{h}_{i}), n(l^{h}_{j}))} + \sum_{h=0}^{k_{2}}(1 - |f^{h}_{i} - f^{h}_{j}|)]$
\\
where, $S(P_i,P_j)$ is the PCS value between $P_i$ and $P_j$, $N_p$ is the total number of product attributes,
$\phi_C(c^{h}_{i}, c^{h}_{j})=1 \:if\: c^{h}_{i}=c^{h}_{j}, \:else \:0$,
$l^{h}_{i} \cap l^{h}_{j}$ denotes the common features of the feature lists, and n(.) is the set cardinality.
\subsection{Gradient Boosting Model}
Gradient Boosting is a classical machine learning approach of converting weak learners into a strong one, by gradually, additively, and sequentially training numerous models. In the boosting approach, a new tree is a fit on a modified version of the original data set. We have employed this approach to build our classifier model.
\subsubsection{Ranking Approach}
We have used LightGBM for the ranking approach. In order to use it for ranking, we use lambdarank as an objective function. The idea of lambdarank is to use the gradient of cost with respect to model score instead of cost. An important input to the ranking model is a list containing the length of each group, or the number of products in each impression, i.e. number of impressions corresponding to each query id, besides the features and the labels. The products within a query are ranked using the predicted probability values obtained using the trained LightGBM Ranker model.
\subsubsection{Binary Classification Approach}
In this approach, we treat the task as a simple binary classification problem with the target being whether a product is clicked or not, i.e. is\_click is 0 or 1. A value is predicted between 0 to 1, which indicates the probability of the product being clicked, where a value closer to 1 denotes a higher click probability. We have experimented with LightGBM-\cite{ke2017lightgbm} and XGBOOST~\cite{chen2016xgboost} classifiers. The latter one has proven to be more effective as, we can notice from the results Table \ref{result_table} that the XGBOOST model achieves a higher MRR than the LightGBM model in both the cases, with and without filtering on both validation and test sets. The model is trained using binary cross-entropy as the objective function. During inference, we rank the products within a query using their predicted probability values obtained from the model, i.e. the probability that the product will be clicked.
\subsection{Post Processing}
In order to improve the ranking of products within an impression, we have employed context-aware post-processing technique. Basically, we need to decide upon a threshold product-context similarity value. If the maximum product-context similarity within an impression is lower than this threshold, we rank the products within the impression using the model prediction probabilities. However, if the maximum value is higher than the threshold, we rank the products in the impression using the product-context similarity values only.
The threshold value for a particular dataset is decided upon using an ablation study of the product-context similarity column with different threshold values. Post evaluation, after the availability of the validation and test labels, we have observed that setting a threshold value around 0.45-0.50 helps us achieve the best results.
\section{Experiments}
We have performed all our experiments on a system with 32GB RAM and 2.2 GHz QuadCore Intel Core i7 Processor. It was also equipped with a NVIDIA GTX 1080 GPU with 12 GB VRAM. We have tried to approach this problem both as a ranking task as well as a binary classification problem. The latter approach has proven to be more effective since the XGBOOST model achieves a higher MRR than the LightGBM model in both the cases, with and without filtering on both validation and test sets as shown in Table \ref{result_table}. We have also been able to improve our results drastically using a post-processing approach, making use of the similarity of a product to the corresponding user context.
\subsubsection{Experimental Settings : }
In the case of the ranking approach, we have used the LightGBM-\cite{ke2017lightgbm}Ranker algorithm with lambdarank as the objective function. In the binary classification approach, we have run 2 experiments using LightGBM and XGBOOST~\cite{chen2016xgboost} with binary cross-entropy as the objective function.
\subsubsection{Training and Inference Process : }
We had access to a labelled dataset of around 3.5 million rows. We have randomly sampled out 25000 query ids, i.e. 150,000 rows without replacement and used it as a validation set to tune our models during the competition. The remaining rows in the labelled dataset was used to train our model. Whenever the MRR on the validation set is more than that of a previous iteration, we save the corresponding trained model.
During inference, we load up the best model based on the performance on the validation set and use it to obtain predictions. After obtaining the raw model predictions, we apply the post-processing technique to rank the products within a query.
\subsubsection{Hyperparameter Tuning : }
In each of our approaches, we need to tune around 10 hyperparameters. Some of these include learning rate, max leaves, max depth, etc. We observed that we need to search over a fairly large range of values to get the optimum values of these parameters. Hence, we are using a Bayesian search approach. More specifically, we are using the BayesSearchCV\footnote{https://scikit-optimize.github.io/stable/modules/generated/skopt.BayesSearchCV.html} utility from scikit-learn\footnote{https://scikit-learn.org/stable/} and the scikit-opt\footnote{https://scikit-optimize.github.io/stable/} library to get the optimum value of parameters. Our best parameters obtained for each of the models are tabulated in section \ref{sec:best_param} from Appendix \ref{sec:appendix}.
\subsection{Experimental Results}
The results from our 3 approaches are tabulated in Table \ref{result_table} below. These results have been obtained after fine-tuning the threshold parameter post completion of the competition. As we can observe from the results, the XGBOOST~\cite{chen2016xgboost} Classifier has been able to achieve the best results. The feature importances for this model are tabulated in \ref{sec:featureImp}. We have also been able to improve our final performance on the test set by setting an appropriate threshold value of 0.51. As observed from the results in figures \ref{Fig:Data1} and \ref{Fig:Data2}, the best results are obtained for a threshold value around 0.45-0.50. We can observe that initially, the MRR increases with the increase in the value of threshold till it reaches a peak for both the validation and test sets, and thereafter decreases.
As far as the features are concerned, the proportion of clicks on a product in a particular session seems to be a really important one as can be observed from Table \ref{feature_imp} in Appendix \ref{sec:appendix}. This might be due to the fact that it provides some information about the overall popularity of a product within a user session, and hence, helps the model make a better prediction. The other important features are mainly based on the absolute value of the product price or its related features, like the price of the product when it was clicked last, the difference of a particular product price from the mean price of clicked products, etc. This shows that the price of a product is a major area of concern for users, which is quite expected. The popularity of a product revolves around its price to a great extent.
\begin{table}[]
\small
\centering
\caption{Results of different approaches on validation and test set}
\label{result_table}
\resizebox{\textwidth}{!}{%
\begin{tabular}{|c|c|c|c|c|}
\hline
\multirow{2}{*}{Models} & \multicolumn{2}{c|}{Val} & \multicolumn{2}{c|}{Test} \\ \cline{2-5}
& Without filter & With filter & Without filter & With filter \\ \hline
LightGBM-\cite{ke2017lightgbm} Ranker & 0.4088 & 0.4706 & 0.3870 & 0.4712 \\ \hline
LightGBM-\cite{ke2017lightgbm} Classifier & 0.4123 & 0.4840 & 0.3929 & 0.4760 \\ \hline
XGBOOST~\cite{chen2016xgboost} Classifier & 0.4196 & 0.4884 & 0.4111 & 0.4784 \\ \hline
\end{tabular}%
}
\end{table}
\begin{figure}[!htb]
\begin{minipage}{0.49\textwidth}
\centering
\includegraphics[width=\linewidth]{Val_Graph.jpg}
\caption{MRR Variation with PCS threshold on Validation Set}\label{Fig:Data1}
\end{minipage}\hfill
\begin{minipage}{0.49\textwidth}
\centering
\includegraphics[width=\linewidth]{Test_Graph.jpg}
\caption{MRR Variation with PCS threshold on Test Set}\label{Fig:Data2}
\end{minipage}
\end{figure}
\iffalse
\begin{table}[]
\small
\centering
\caption{MRR variation with PCS Threshold on Validation and Test sets}
\label{threshold_abalation_table}
\resizebox{\textwidth}{!}{%
\begin{tabular}{|c|c|c|}
\hline
\textbf{Threshold} & \textbf{Val MRR} & \textbf{Test MRR} \\ \hline
0.33 & 0.48442 & 0.47838 \\ \hline
0.36 & 0.48442 & 0.47841 \\ \hline
0.39 & 0.48443 & 0.47841 \\ \hline
0.42 & 0.48444 & 0.47843 \\ \hline
0.45 & 0.48444 & 0.47843 \\ \hline
0.48 & 0.48444 & 0.47843 \\ \hline
0.51 & 0.48441 & 0.47844 \\ \hline
0.54 & 0.48438 & 0.47796 \\ \hline
0.57 & 0.48433 & 0.47787 \\ \hline
0.60 & 0.48417 & 0.47776 \\ \hline
\end{tabular}%
}
\end{table}
\fi
\section{Conclusion and Future Work}
In this paper, we have presented an approach to effectively rank the products within a recommendation impression module. We have experimented with both a ranking approach and a binary classification one, and the latter one has proven to be more effective. Our unique product-context similarity feature helps us improve the performance from a vanilla classification approach drastically, and achieve a significantly higher MRR on the validation and test sets.
In the future, various ensembles of classification techniques or hybrid ensembles of classification and ranking techniques can be tried out in combination with the context-aware post-processing. Also, it might also be worthy to try out deep learning approaches using CNN, LSTM, etc.
\section*{Code}
The code for this paper is available \href{https://github.com/diptamath/Context-aware-Retail-Product-Recommendation}{here}.
\bibliographystyle{splncs04}
| {'timestamp': '2021-09-20T02:18:17', 'yymm': '2109', 'arxiv_id': '2109.08561', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08561'} | arxiv |
\section{Introduction}
Since the scaling of automated driving systems\footnote{We follow the SAE J3016\textsubscript{202104} standard \cite{sae_j3016c_2021}, where \emph{driving automation system} (DAS) refers to level 1-5, \emph{automated driving system} (ADS) to level 3-5, and \emph{driver support} (DS) to level 1-2 systems. Details on the levels can be found in the standard.} (ADS) is progressing rapidly, with first level 4 systems publicly available \cite{ackerman2021WhatFullAutonomy}, dealing with rare situations such as corner cases is becoming more relevant. While the maturity of ADS is steadily increasing, such situations still need human support. Thus, many systems are capable of detecting situations in which they are unsure on how to proceed. In such situations they can receive input from a remotely located human, which we refer to as \emph{remote operator} (ROp). There are many parties discussing such \emph{remote human input systems} (RHIS) - as a result, a wide variety of different terms have been used within this domain. This paper offers a survey on existing literature, approaches and terminologies and provides the research community with a taxonomy on \emph{remote human input systems}.
\section{Survey on Remote Human Input Systems}
\label{sec:survey}
We classify existing approaches based on the SAE J3016\textsubscript{202104} levels \cite{sae_j3016c_2021}. While these are well known, it is important to highlight that a DAS-equipped vehicle does not necessarily perform on a constant level during any given trip. For instance, a DAS which is currently running at level 4, might encounter a situation it can not handle anymore. While the DAS would continue on level 4 with a successful \emph{remote assistance}, it would degenerate to the level range 1-2 if \emph{remote driving} would be necessary for recovery. An overview can be found in Table \ref{tab:survey}. The survey is divided into four categories: Standards and technical reports, corporate approaches, contributions from the scientific community and legislative bills. In the first column, the source including the utilized, general term for RHIS is shown. The second and third column follow the same pattern, while differing in the respective SAE level. In each cell, we first list the task-related terminology, followed by the human-related terminology.
\begin{table}[]
\resizebox{\textwidth}{!}{%
\begin{tabular}{lcc}
\hline
\multicolumn{1}{|l|}{\textbf{Source}} & \multicolumn{1}{c|}{\textbf{Level 1-2}} & \multicolumn{1}{c|}{\textbf{Level 4-5}} \\ \hline
\multicolumn{1}{|l|}{SAE \cite{sae_j3016c_2021}} & \multicolumn{1}{c|}{Remote Driving} & \multicolumn{1}{c|}{Remote Assistance} \\
\multicolumn{1}{|l|}{\textbf{Remote Support Functions}} & \multicolumn{1}{c|}{Remote Driver} & \multicolumn{1}{c|}{Remote Assistant} \\ \hline
\multicolumn{1}{|l|}{CSCRS \cite{cummings2020ConceptsOperationsAutonomous}} & \multicolumn{1}{c|}{Teleoperation} & \multicolumn{1}{c|}{Goal-based Supervisory Control} \\
\multicolumn{1}{|l|}{\textbf{Remote Control / Operation}} & \multicolumn{1}{c|}{Remote Driver} & \multicolumn{1}{c|}{\begin{tabular}[c]{@{}c@{}}Remote Dispatcher / Operator /\\ Remote Supervisor\end{tabular}} \\ \hline
\multicolumn{1}{|l|}{APTIV et al. \cite{aptiv2019SafetyFirstAutomated}} & \multicolumn{1}{c|}{Operating the vehicle} & \multicolumn{1}{c|}{Indirect Teleoperation} \\
\multicolumn{1}{|l|}{\textbf{Teleoperation / Remote Control}} & \multicolumn{1}{c|}{Remote (Vehicle) Operator / Teleoperator} & \multicolumn{1}{c|}{\begin{tabular}[c]{@{}c@{}}Remote (Vehicle) Operator /\\ Teleoperator\end{tabular}} \\ \hline
& & \\ \hline
\multicolumn{1}{|l|}{Nissan \cite{nissan2019SeamlessAutonomousMobility}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{Remote Human Support} \\
\multicolumn{1}{|l|}{\textbf{Seamless Autonomous Mobility}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{Mobility Manager} \\ \hline
\multicolumn{1}{|l|}{Waymo \cite{ackerman2021WhatFullAutonomy}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{Fleet Response} \\
\multicolumn{1}{|l|}{\textbf{Fleet Response}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{\begin{tabular}[c]{@{}c@{}}Fleet Response Specialist /\\ Operator\end{tabular}} \\ \hline
\multicolumn{1}{|l|}{Aurora \cite{aurora_teleassist_2019}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{Teleassist} \\
\multicolumn{1}{|l|}{\textbf{Teleassist}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{Teleassist Specialist} \\ \hline
\multicolumn{1}{|l|}{Zoox \cite{zoox_how_2020}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{Remote Assistance} \\
\multicolumn{1}{|l|}{\textbf{TeleGuidance / TeleOps}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{\begin{tabular}[c]{@{}c@{}}Teleguidance Operators /\\ Teleoperators\end{tabular}} \\ \hline
\multicolumn{1}{|l|}{ARGO AI \cite{argo_ai_argo_2021}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{Remote Guidance} \\
\multicolumn{1}{|l|}{\textbf{Remote Guidance}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{Remote Guidance Operator} \\ \hline
\multicolumn{1}{|l|}{UBER \cite{aitken2019TelecommunicationsNetworkVehicles}} & \multicolumn{1}{c|}{\begin{tabular}[c]{@{}c@{}}Manual Control incl. Vehicle\\ Operating Assistance Technology\end{tabular}} & \multicolumn{1}{c|}{Semi-Autonomous Mode} \\
\multicolumn{1}{|l|}{\textbf{\begin{tabular}[c]{@{}l@{}}Remote (Autonomous)\\ Vehicle Assistance System\end{tabular}}} & \multicolumn{1}{c|}{Operator} & \multicolumn{1}{c|}{Operator} \\ \hline
\multicolumn{1}{|l|}{Bosch \cite{geraldy2020SystemSafeTeleoperated}} & \multicolumn{1}{c|}{Drive} & \multicolumn{1}{c|}{Guide} \\
\multicolumn{1}{|l|}{\textbf{Teleoperated Driving}} & \multicolumn{1}{c|}{Remote Operator} & \multicolumn{1}{c|}{Remote Operator} \\ \hline
\multicolumn{1}{|l|}{Baidu Apollo \cite{baidu2020BuildingSelfdrivingCar}} & \multicolumn{1}{c|}{Teleoperation} & \multicolumn{1}{c|}{-} \\
\multicolumn{1}{|l|}{\textbf{5G Remote Driving Service}} & \multicolumn{1}{c|}{Remote Human Operator} & \multicolumn{1}{c|}{-} \\ \hline
\multicolumn{1}{|l|}{Valeo \cite{valeo2019ValeoDrive4URemote}} & \multicolumn{1}{c|}{Teleoperation} & \multicolumn{1}{c|}{-} \\
\multicolumn{1}{|l|}{\textbf{Drive4U Remote}} & \multicolumn{1}{c|}{Operator} & \multicolumn{1}{c|}{-} \\ \hline
\multicolumn{1}{|l|}{Einride \cite{einride2021EinrideShowcasesOne}} & \multicolumn{1}{c|}{Remote Operation} & \multicolumn{1}{c|}{-} \\
\multicolumn{1}{|l|}{\textbf{Remote Operation}} & \multicolumn{1}{c|}{Remote Operator} & \multicolumn{1}{c|}{-} \\ \hline
\multicolumn{1}{|l|}{Phantom Auto \cite{phantomauto2021HomePhantomAuto}} & \multicolumn{1}{c|}{Tele-Driving} & \multicolumn{1}{c|}{Tele-Assistance} \\
\multicolumn{1}{|l|}{\textbf{Remote Operation}} & \multicolumn{1}{c|}{Driver / Operator} & \multicolumn{1}{c|}{Driver / Operator} \\ \hline
\multicolumn{1}{|l|}{Ottopia \cite{rosenzweig2021OttopiaUniversalTeleoperation}} & \multicolumn{1}{c|}{\begin{tabular}[c]{@{}c@{}}Direct Control incl. Advanced\\ Teleoperator Assistance System\end{tabular}} & \multicolumn{1}{c|}{\begin{tabular}[c]{@{}c@{}}Indirect Control /\\ Advanced Teleoperation\end{tabular}} \\
\multicolumn{1}{|l|}{\textbf{Teleoperation}} & \multicolumn{1}{c|}{Teleoperator / Remote Operator} & \multicolumn{1}{c|}{Teleoperator / Remote Operator} \\ \hline
\multicolumn{1}{|l|}{Vay \cite{vay2021}} & \multicolumn{1}{c|}{\begin{tabular}[c]{@{}c@{}}Teledriving / Remotely Driving\end{tabular}} & \multicolumn{1}{c|}{\begin{tabular}[c]{@{}c@{}}-\end{tabular}} \\
\multicolumn{1}{|l|}{\textbf{Teledriving}} & \multicolumn{1}{c|}{Teledriver} & \multicolumn{1}{c|}{-} \\ \hline
\multicolumn{1}{|l|}{Fernride \cite{fernride2021FernrideEnablingDriverless}} & \multicolumn{1}{c|}{Teleoperation} & \multicolumn{1}{c|}{-} \\
\multicolumn{1}{|l|}{\textbf{Teleoperation}} & \multicolumn{1}{c|}{Remote Operator} & \multicolumn{1}{c|}{-} \\ \hline
& \multicolumn{1}{l}{} & \multicolumn{1}{l}{} \\ \hline
\multicolumn{1}{|l|}{Sheridan \cite{sheridan1989Telerobotics}} & \multicolumn{1}{c|}{Teleoperation} & \multicolumn{1}{c|}{Telerobotics / Supervisory Control} \\
\multicolumn{1}{|l|}{\textbf{Teleoperation}} & \multicolumn{1}{c|}{Human Operator} & \multicolumn{1}{c|}{Human Operator} \\ \hline
\multicolumn{1}{|l|}{Schitz et al. \cite{schitz2020CorridorBasedSharedAutonomy}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{Remote Operation} \\
\multicolumn{1}{|l|}{\textbf{Teleoperated Driving / Teleoperation}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{Human Operator} \\ \hline
\multicolumn{1}{|l|}{Neumeier et al. \cite{neumeier2018WayAutonomousVehicles,neumeier2019MeasuringFeasibilityTeleoperated,NeumeierTeleoperation2019}} & \multicolumn{1}{c|}{\begin{tabular}[c]{@{}c@{}}Remote Driving / \\ Remote Control (Driving)\end{tabular}} & \multicolumn{1}{c|}{-} \\
\multicolumn{1}{|l|}{\textbf{Teleoperation / Teleoperated Driving}} & \multicolumn{1}{c|}{\begin{tabular}[c]{@{}c@{}}Remote Operator / \\Teleoperated Driver\end{tabular}} & \multicolumn{1}{c|}{-} \\ \hline
\multicolumn{1}{|l|}{Graf et al. \cite{graf2020DesignSpaceAdvanced,graf2020ImprovingPredictionAccuracy,graf2020PredictiveCorridorVirtual}} & \multicolumn{1}{c|}{\begin{tabular}[c]{@{}c@{}}Teleoperation / Direct Control\\ (incl. Teledriving Assistance Systems)\end{tabular}} & \multicolumn{1}{c|}{Indirect Control} \\
\multicolumn{1}{|l|}{\textbf{\begin{tabular}[c]{@{}l@{}}Teleoperation / Teleoperated\\ Autonomous Vehicles\end{tabular}}} & \multicolumn{1}{c|}{Teleoperator / (Remote) Operator} & \multicolumn{1}{c|}{Teleoperator / (Remote) Operator} \\ \hline
\multicolumn{1}{|l|}{Georg et al. \cite{georg2018TeleoperatedDrivingKeya,georg2019AdaptableImmersiveReal,georg2020SensorActuatorLatency}} & \multicolumn{1}{c|}{Teleoperation} & \multicolumn{1}{c|}{-} \\
\multicolumn{1}{|l|}{\textbf{Teleoperated Driving / Teleoperation}} & \multicolumn{1}{c|}{(Remote) Operator} & \multicolumn{1}{c|}{-} \\ \hline
\multicolumn{1}{|l|}{Schimpe et al. \cite{schimpe2020SteerMePredictive,schimpe2021AdaptiveVideoConfiguration}} & \multicolumn{1}{c|}{\begin{tabular}[c]{@{}c@{}}Teleoperation / Stabilization level\\ Control (incl. Semi-Autonomous Controller)\end{tabular}} & \multicolumn{1}{c|}{Human-Machine Collaboration} \\
\multicolumn{1}{|l|}{\textbf{Teleoperated Driving / Teleoperation}} & \multicolumn{1}{c|}{Human Operator / Teleoperator} & \multicolumn{1}{c|}{Human Operator / Teleoperator} \\ \hline
\multicolumn{1}{|l|}{HF-IRADS \cite{hf-irads2020HumanFactorsChallenges}} & \multicolumn{1}{c|}{Remote Management} & \multicolumn{1}{c|}{Remote Control} \\
\multicolumn{1}{|l|}{\textbf{Remote Support and Control}} & \multicolumn{1}{c|}{Remote Human / Operator} & \multicolumn{1}{c|}{Remote Human / Operator} \\ \hline
\multicolumn{1}{|l|}{Mutzenich et al. \cite{mutzenich2021UpdatingOurUnderstanding}} & \multicolumn{1}{c|}{Remote Control / Teleoperation} & \multicolumn{1}{c|}{\begin{tabular}[c]{@{}c@{}}Remote Management / \\Goal-based Supervision\end{tabular}} \\
\multicolumn{1}{|l|}{\textbf{Remote Operation}} & \multicolumn{1}{c|}{Remote Operator / Driver} & \multicolumn{1}{c|}{Remote Operator / Controller} \\ \hline
\multicolumn{1}{|l|}{Fennel et al. \cite{fennel2021HapticGuidedPathGeneration}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{Shared Autonomy} \\
\multicolumn{1}{|l|}{\textbf{Teleoperation}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{Human Operator} \\ \hline
\multicolumn{1}{|l|}{Kettwich et al. \cite{kettwich2021TeleoperationHighlyAutomated}} & \multicolumn{1}{c|}{Direct Approach} & \multicolumn{1}{c|}{Indirect Approach} \\
\multicolumn{1}{|l|}{\textbf{\begin{tabular}[c]{@{}l@{}}Teleoperation / Remote-Operation /\\ Remote-Control\end{tabular}}} & \multicolumn{1}{c|}{Remote-Operator / Teleoperator} & \multicolumn{1}{c|}{Remote-Operator / Teleoperator} \\ \hline
\multicolumn{1}{|l|}{Hofbauer et al. \cite{hofbauer2020TELECARLAOpenSource}} & \multicolumn{1}{c|}{\begin{tabular}[c]{@{}c@{}}Teleoperated Driving / Teleoperation /\\ Teledriving\end{tabular}} & \multicolumn{1}{c|}{-} \\
\multicolumn{1}{|l|}{\textbf{\begin{tabular}[c]{@{}l@{}}Teleoperated Driving / Teleoperation /\\ Teledriving\end{tabular}}} & \multicolumn{1}{c|}{Teleoperator / Human Operator} & \multicolumn{1}{c|}{-} \\ \hline
& \multicolumn{1}{l}{} & \multicolumn{1}{l}{} \\ \hline
\multicolumn{1}{|l|}{German Government \cite{bundesregierung_entwurf_2021}} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{\begin{tabular}[c]{@{}c@{}}Authorization of driving maneuvers,\\ provision of alternatives\end{tabular}} \\
\multicolumn{1}{|l|}{-} & \multicolumn{1}{c|}{-} & \multicolumn{1}{c|}{Technical Supervisor} \\ \hline
\multicolumn{1}{|l|}{UK Government \cite{ukgovernment2019CodePracticeAutomated}} & \multicolumn{1}{c|}{Remote-Control Function} & \multicolumn{1}{c|}{-} \\
\multicolumn{1}{|l|}{\textbf{Remote-controlled Operation}} & \multicolumn{1}{c|}{(Remote) Safety Driver / Operator} & \multicolumn{1}{c|}{-} \\ \hline
\multicolumn{1}{|l|}{State of California \cite{departmentofmotorvehiclescaliforniausa2021ArticleTestingAutonomous}} & \multicolumn{1}{c|}{Performance of the DDT} & \multicolumn{1}{c|}{-} \\
\multicolumn{1}{|l|}{\textbf{-}} & \multicolumn{1}{c|}{Remote Operator} & \multicolumn{1}{c|}{-} \\ \hline
\multicolumn{1}{|l|}{State of Arizona \cite{stateofarizona2015ExecutiveOrder201509SelfDrivingVehicle}} & \multicolumn{1}{c|}{Direct a vehicle's movement} & \multicolumn{1}{c|}{Provide direction} \\
\multicolumn{1}{|l|}{\textbf{-}} & \multicolumn{1}{c|}{Operator} & \multicolumn{1}{c|}{Operator} \\ \hline
\end{tabular}%
}
\newline
\caption{Overview of RHIS terminologies from standards and technical reports, corporates, scientific publications and legislative bills}
\label{tab:survey}
\end{table}
\subsection{Standards and Technical Reports}
The SAE standard J3016 \cite{sae_j3016c_2021} has been defining taxonomies on DAS since 2014, leading to the levels 0-5 which are the de-facto standard in systemizing capabilites of DAS. With the latest revision J3016\textsubscript{202104}, the standard has also defined the terms \emph{remote assistance} and \emph{remote driving}. While no general term is introduced, \cite{2021SAELevelsDriving} lists those under the category \emph{remote support functions}.
Both \emph{remote driving} and \emph{remote assistance} are closely linked to the \emph{dynamic driving task} (DDT) specified by the standard, which includes the following tasks:
\begin{itemize}
\item Object and event detection and response (OEDR),
\item Tactical maneuver planning,
\item Lateral and longitudinal motion control,
\item Enhancing conspicuity via lighting [...] etc.
\end{itemize}
Level 3-5 demand that the ADS is performing the whole DDT, while only level 4-5 need to be able to additionally perform \emph{DDT fallbacks}, which are necessary in case of system failures or the exit of the operational design domain (ODD). These fallbacks lead to the \emph{minimal risk condition}, which is "a stable, stopped condition [...] in order to reduce the risk of a crash [...]" on their own. In contrast, level 3 ADS can rely on a human \emph{fallback-ready user}.
\emph{Remote assistance} is defined as "event-driven provision, by a remotely located human, of information [...] in order to facilitate trip continuation when the ADS encounters a situation it cannot manage." In such situations, the ADS performs the DDT at all times and no real-time requirements for the human support exist. Examples are provision of pathways or revised goals, and classification of objects\footnote{While classification of objects might be a task performed by a remote assistant, they cannot provide this classification to the ADS, since it is part of the DDT, which needs to be performed by the ADS. Since it is unclear how to classify RHIS which provide information about the environment, we will assign them to level 4-5.}.
\emph{Remote assistance} is only available at levels 4 and 5. It includes supporting the DDT as well as the DDT fallback.
\emph{Remote driving} is defined as "real-time performance of part or all of the DDT and/or DDT fallback [...] by a \emph{remote driver}." The standard recommends against using the term \emph{teleoperation} instead of \emph{remote driving}, since it is "not defined consistently in the literature". \emph{Remote driving} is only available at levels 1 and 2. A special case exists for level 3, where a \emph{(remote) fallback-ready user} is necessary. When performing the fallback remotely, such a user immediately becomes a \emph{remote driver}. Since the \emph{(remote) fallback-ready user} only performs a special form of (passive) monitoring, we will not further include level 3 within the survey, but include the role within the monitoring section in the taxonomy found in Section \ref{sec:taxonomy}.\\
Cummings et al. \cite{cummings2020ConceptsOperationsAutonomous} identify in their \emph{CSCRS Concepts of Operations for Autonomous Vehicle Dispatch Operations} report \emph{remote control} as a basic function necessary for ADS and use the term \emph{remote operation} interchangeably. They classify existing approaches into two categories: \emph{Teleoperation} and \emph{Goal-based supervisory control}.
In regards to \emph{teleoperation}, they have the understanding that a \emph{remote driver} takes over full control. However, they see latencies (of the human and the network) as critical, which is why they do not consider level 3 use to be reasonable. For level 1-2, they mostly consider slow driving tasks up to ~15 km/h.
\emph{Goal-based supervisory control} is how they name services in which a \emph{remote dispatcher}, also called \emph{operator} or \emph{remote supervisor}, provides the ADS with goals, which the ADS executes on its own. They see disadvantages in situations where a sensor of the vehicle is degraded, which might affect the performance of the ADS significantly.\\
In the \emph{Safety First for Automated Driving} \cite{aptiv2019SafetyFirstAutomated} report, an international consortium of eleven companies provides an overview of "safety by design and verification and validation" methods of level 3-4 ADS. While they put no special emphasis on RHIS, \emph{teleoperation}, also called \emph{remote control}, by \emph{remote (vehicle) operators} or \emph{teleoperators} is included in their analysis. They differentiate between \emph{operating the vehicle} and \emph{indirect teleoperation}, without going into further detail.
\subsection{Corporate approaches}
In this section we refer to approaches of companies around the world, be it on a concept level or already implemented and running. Most of these approaches have not been published in scientific papers, but as part of PR campaigns, safety reports or in the form of patents. However, since we are primarily looking at the systematic level in this survey, this does not pose a problem, as details on technical implementations are secondary. While several companies have dissolved or been acquired, we always refer to the original source.\\
The \emph{Nissan Seamless Autonomous Mobility} \cite{nissan2019SeamlessAutonomousMobility} technology provides \emph{remote human support} for ADS in cases when "human judgment is required for the appropriate course". After the vehicle has brought itself to a safe stop, vehicle sensor data is streamed to a \emph{mobility manager}, who remotely provides the vehicles with a path or lane to follow.
\emph{Bosch} \cite{geraldy2020SystemSafeTeleoperated} proposes \emph{teleoperated driving}, where an \emph{external operator} can either \emph{guide} the ADS or {drive} the vehicle.
\emph{Valeo} demonstrated the \emph{Drive4U Remote} \cite{valeo2019ValeoDrive4URemote}
service, where an \emph{operator} can \emph{teleoperate} the vehicle, i.e. to control a vehicle directly.
The Waymo level 4 ADS, also called \emph{Waymo Driver}, is currently publicly available in Phoenix, Arizona, USA \cite{ackerman2021WhatFullAutonomy}. In situations where human input is necessary, it can call on \emph{fleet response}. The \emph{fleet response specialists}, also called \emph{fleet response operators} \cite{waymo2021SoftwareEngineerFleet}, will then support the vehicle with strategical input, which is not part of the DDT, such as waypoints.
The \emph{Aurora Teleassist} \cite{aurora_teleassist_2019} system utilizes the input of so called \emph{teleassist specialists}. They will have access to raw and abstracted sensor data, when the ADS, also called \emph{Aurora Driver}, is unsure on how to continue. Based on this information, they will be able to support the ADS on the levels "mapping, perception, route planning, and trajectory planning". The ADS will then incorporate this information to continue the trip.
The \emph{Zoox TeleGuidance} \cite{zoox_how_2020} system, also called \emph{TeleOps}, gets activated as soon as the ADS encounters rare, unusual or complex scenarios it cannot handle on its own. \emph{Teleguidance operators}, also called \emph{teleoperators}, then provide \emph{remote assistance}. They have access to raw camera data and abstracted sensor data and interact with the system via a touchscreen. Examples for their guidance are provision of suggested paths and labeling objects.
The \emph{Voyage Telesisst} \cite{cameron_introducing_2020} is a multi-level system for \emph{remote assistance}. When the ADS is unsure on how to proceed, \emph{discrete decision making} can be activated for \emph{remote assistance}. On this level, \emph{ROp} provide high-level inputs, which can range from simple commands, such as "Proceed", to provision of a path to follow.
In cases where this does not suffice, \emph{remote driving} can be activated. In this case, a \emph{ROp} is directly controlling the car. To avoid collisions and dangerous situations, an additional \emph{remote drive assist} monitors the state of the vehicle and avoids collisions by stopping it or limiting the maximum speed. The \emph{ROp} are located within a so-called "telessist pod", which is a workstation that consists of components for steering, throttle, and brake as well as a touchscreen. Operators receive raw camera data and an abstracted environment model and have additional access to the state of the vehicle and the behavior planner outputs.
The \emph{ARGO AI Remote Guidance} system \cite{argo_ai_argo_2021} is activated when the ADS requires additional guidance, in which case a \emph{remote guidance operator} can provide "authorization to the [ADS] to perform specific driving tasks it has recommended". Thus, the \emph{remote guidance operator} does not provide additional input to the system, but authorizes an appropriate action suggested by the ADS.
The \emph {UBER remote vehicle assistance system} \cite{aitken2019TelecommunicationsNetworkVehicles}, also called \emph{autonomous vehicle assistance system} or \emph{remote autonomous vehicle assistance} \cite{chen2020ContextBasedRemoteAutonomous}, allows an ADS to request \emph{remote assistance} if it encounters problems. A \emph{human operator} can \emph{manually control} the ADS, while being supported by a \emph{vehicle operating assistance technology} that can provide collision mitigation. The ADS can also operate in a \emph{semi-autonomous mode}, in which the \emph{human operator} can provide \emph{task management data} \cite{chen2020ContextBasedRemoteAutonomous}. As examples, object classification and the provision of waypoints to follow are listed.
\emph{Baidu Apollo} integrates a \emph{5G remote driving service} \cite{baidu2020BuildingSelfdrivingCar}, which they also refer to as \emph{5G-enabled teleoperation}. \emph{Remote human operators} can directly control the vehicles if necessary.
\emph{Einride} \cite{einride2021EinrideShowcasesOne} showcases a \emph{remote operation} service, in which \emph{ROp} can take control over a vehicle from a \emph{remote drive station}.
\subsubsection{Dedicated RHIS Companies}
\emph{Phantom Auto} \cite{phantomauto2021HomePhantomAuto} provides a service for \emph{remote operation} of a wide variety of vehicles. \emph{(Remote) drivers/operators} can interact via \emph{tele-driving}, which enables "real-time, direct remote control" and \emph{tele-assistance}, where they "remotely guide and command automated functions". Drivers typically have HD video data and a steering wheel as the interface.
\emph{Ottopia} \cite{rosenzweig2021OttopiaUniversalTeleoperation} provides services for \emph{teleoperation}, by which they define \emph{direct} and \emph{indirect control}. Their \emph{advanced teleoperation (ATO)} suite provides \emph{indirect methods} such as the proposition of possible paths from which to choose from or the provision of a reference-path to follow. \emph{Direct control} on the other hand is supported by their \emph{advanced teleoperator assistance systems (ATAS)}, which is a collision-avoidance system while a \emph{teleoperator}, also called \emph{ROp}, is directly controlling the vehicle.
\emph{Fernride} \cite{fernride2021FernrideEnablingDriverless} provides a \emph{teleoperation} solution where \emph{remote operators} directly control vehicles.
\emph{Vay} \cite{vay2021} uses a similar concept, where \emph{teledrivers} remotely drive, also called \emph{teledrive}, remote vehicles.
\subsection{Research approaches}
Already in 1989 there was confusion about the term \emph{teleoperation}. Sheridan \cite{sheridan1989Telerobotics} describes \emph{teleoperation} very general as "extension of a person's sensing and manipulation capability to a remote location", but also admits that "\emph{teleoperation} refers most commonly to direct and continuous human control [...], but can also be used generally to encompass \emph{telerobotics} as well." \emph{Telerobotics} then is described as "[...] a form of teleoperation in which a human operator acts as a supervisor, intermittently communicating to a computer information about goals, constraints, plans, contingencies, assumptions, suggestions and orders relative to a limited task, getting back information about accomplishments, difficulties, concerns, and, as requested, raw sensory data while the subordinate telerobot executes the task based on information received from the human operator plus its own artificial sensing and intelligence." As a synonym, \emph{supervisory control} is utilized as a broader term for "any semi-autonomous system". It becomes obvious that already in 1989 the concepts of direct and indirect RHIS were well known. While most of the technologies of DAS stem from the field of robotics, this paper puts a focus on current terminologies and therefore examines recent publications in relation to DAS. \\
Beginning in 2018, Georg et al. primarily utilize the term \emph{teleoperated driving}, also sometimes referred to as \emph{teleoperation}, together with \emph{(remote) operator}, also referred to as \emph{human operator} in multiple publications \cite{georg2018TeleoperatedDrivingKeya} \cite{georg2019AdaptableImmersiveReal} \cite{georg2020SensorActuatorLatency} consistently to describe direct control approaches. In the following we list multiple authors from the same research group. Schimpe et al. \cite{schimpe2020SteerMePredictive,schimpe2021AdaptiveVideoConfiguration} follow the terms, while also utilizing the term \emph{teleoperator}. In \cite{schimpe2020SteerMePredictive} they also distinguish between direct \emph{stabilization level control} and indirect \emph{human-machine collaboration}. They also introduce a \emph{semi-autonomous controller} "to correct the steering input given by the teleoperator if the vehicle is at risk of hitting an obstacle." Saparia et al. \cite{saparia2021ActiveSafetySystem} and Hoffmann and Diermeyer \cite{hoffmann2021SystemsTheoreticSafetyAssessment} also follow these terms. \\
In 2019, Neumeier et al. \cite{NeumeierTeleoperation2019} performed a user study on latency-effects for direct \emph{teleoperation}. They use the terms \emph{teleoperated driving}, \emph{remote driving} and \emph{remote control} interchangeably and also refer to the broader term \emph{remote operation}. \emph{ROp}, also called \emph{teleoperated drivers} are introduced as "remote operating fallback authority". In \cite{neumeier2019MeasuringFeasibilityTeleoperated}, Neumeier et al. also introduce the term \emph{remote control driving}. \\
In 2020, Schitz et al. \cite{schitz2020CorridorBasedSharedAutonomy} demonstrate an approach where a remote \emph{human operator} provides an ADS with a corridor instead of waypoints, in which the ADS computes a collison-free path by itself. The authors use the terms \emph{teleoperated driving}, \emph{teleoperation} and \emph{remote operation} interchangeably.
Hofbauer et al. \cite{hofbauer2020TELECARLAOpenSource} provide a simulation-based framework for direct \emph{teleoperation}, which they also refer to as \emph{teleoperated driving} or \emph{teledriving} by a \emph{teleoperator}, also called \emph{human operator}.
Graf et al. \cite{graf2020PredictiveCorridorVirtual} utilize the terms \emph{teleoperated autonomous vehicles}, \emph{teleoperation} and \emph{teleoperator} respectively \emph{(remote) operator} consistently for direct control methods. In \cite{graf2020ImprovingPredictionAccuracy} they show progress on \emph{teledriving assistance systems} that support direct control methods to improve situational awareness. Only in \cite{graf2020DesignSpaceAdvanced} they broaden the term \emph{teleoperation} to include both \emph{direct control} and \emph{indirect control} as \emph{driving modes}. Examples for \emph{indirect control} include maneuver selection or provision of a trajectory.
A position paper from HF-IRADS \cite{hf-irads2020HumanFactorsChallenges} defines three major categories for \emph{Remote Support and Control} by \emph{remote humans}, also called \emph{ROp}:
\begin{itemize}
\item \emph{Remote Assistance} for passenger-related services and breakdown-assistance
\item \emph{Remote Management} for indirect assistance of the ADS
\item \emph{Remote Control} for full remote control over the DDT
\end{itemize}
Mutzenich et al. \cite{mutzenich2021UpdatingOurUnderstanding} follow the categories provided by \cite{hf-irads2020HumanFactorsChallenges}, while using the term \emph{goal-based supervision} interchangeably with \emph{remote management} by a \emph{remote controller}. The same holds for \emph{teleoperation} and \emph{remote control} by a \emph{remote driver}. They propose a revised version of the J3016\textsubscript{201806} \cite{saeinternational2018J3016BTaxonomyDefinitions} from 2018 to include \emph{remote interventions} at levels 3, 4 and 5. While their proposal, published on February 19, 2021, was not adopted identically, it is worth noting that the on May 3, 2021 updated SAE standard \cite{sae_j3016c_2021} does include \emph{remote support functions}.
Fennel et al. \cite{fennel2021HapticGuidedPathGeneration} use the term \emph{teleoperation} in a broad fashion but present an indirect \emph{shared autonomy} approach, where a \emph{human operator} provides a reference path.
Kettwich et al. \cite{kettwich2021TeleoperationHighlyAutomated} use the terms \emph{teleoperation} and \emph{remote-operation / control} interchangeably. They separate \emph{direct} and \emph{indirect approaches}, describing the latter as \emph{human interventions}. They primarily use the term \emph{remote-operator}, while occasionally referring to them as \emph{remote human} or \emph{teleoperator}.
\subsection{Legislative Frameworks}
In May 2021, The German government has laid the legal conditions for level 4-5 driving in regular operation \cite{bundesregierung_entwurf_2021}. In cases where the vehicles cannot continue on their own, a \emph{technical supervisor} can assist remotely. Their main task is to either deactivate the vehicle or authorize possible driving maneuvers provided by the ADS. Additionally, the \emph{technical supervisor} can provide alternative driving maneuvers for the ADS.
In the \emph{Autonomous Vehicle Policy Framework: Selected National and Jurisdictional Policy Efforts to Guide Safe AV Development} report \cite{worldeconomicforum2020AutonomousVehiclePolicy} the situation in Israel, Singapore, UK, Australia and the US states California and Arizona is summarized. Only the UK and both US states have regulation in regards to RHIS.
In the UK \emph{Code of Practice: Automated vehicle trialling}, RHIS is summarized as \emph{remote-controlled operation} \cite{ukgovernment2019CodePracticeAutomated}. A \emph{safety driver}, who can also be located remotely, or a \emph{(remote) safety operators} who is "ready and able to override the vehicle" if necessary is required. \emph{Remote-controlled operation}, which is a general term for \emph{remote-control functions}, is a direct approach, described as "two-way, real-time communication".
In the US state California, performance of the DDT can be done by a \emph{ROp}, who can also command the ADS to get into a minimal risk condition \cite{departmentofmotorvehiclescaliforniausa2021ArticleTestingAutonomous}. In Arizona, an \emph{operator} can monitor and "provide direction remotely" respectively "direct a vehicle's movement" \cite{stateofarizona2015ExecutiveOrder201509SelfDrivingVehicle}. While the executive order was updated in 2018 \cite{stateofarizona2018ExecutiveOrder201804}, no further information on RHIS is available. As the wording is very vague, we assume that both direct and indirect approaches can be meant.
\section{Taxonomy on Remote Human Input Systems}
\label{sec:taxonomy}
We propose the terminology \emph{remote human input systems} in the context of \emph{driving automation systems} for all situations, such as corner cases, where a remote human, called \emph{remote operator} in this taxonomy, is needed to continue the DDT, if necessary. The determination of when RHIS becomes necessary is outside the scope of this work. While terms as \emph{remote driving}, \emph{remote guidance}, \emph{remote assistance}, \emph{remote support}, \emph{teleoperation} and more can be found in the literature, they are not well suited as general terms, since they only include very specific types of input. The formulation \emph{remote human input systems} is agnostic to the input form and suited for all cases.
\begin{figure}[h]
\centering
\includegraphics[width=1\textwidth]{img/taxonomy.pdf}
\caption{Taxonomy on \emph{remote human input systems} (RHIS), with RHIS levels 1 to 5 and 0. \emph{Remote operators} (ROp) provide different types of input to the \emph{driving automation system} (DAS). RHIS level 1 and 2 are of type \emph{remote driving} where a \emph{remote driver} performs the \emph{dynamic driving task} (DDT). In RHIS level 3 to 5 the ROp provides assistive input, like authorizing provided options. Level 0 is a non-interactive state only used for remote monitoring, such as diagnosing system states.}
\label{fig:taxonomy}
\end{figure}
Centered around our proposed RHIS levels, Fig. \ref{fig:taxonomy} provides both a classification of the different levels by RHIS type, their relationship to the SAE J3016\textsubscript{202104} levels \cite{sae_j3016c_2021}, as well as naming conventions and descriptions and thus forms the taxonomy on RHIS. In the following we discuss the dimensions of this taxonomy.
\subsection{RHIS Levels}
RHIS levels are designed to assess the sophistication of a RHIS. Going from left to right in Figure \ref{fig:taxonomy}, the DAS takes on more and more tasks. RHIS level 1 to 5 describe remote systems where the ROp has the possibility to actively control the vehicle or interact with the ADS. Levels rise according to the intelligence of the ADS needed. DS systems with no ADS capability require the complete DDT to be executed by the ROp and thus are located at RHIS levels 1 and 2. Levels 3 and 4 describe higher-level input from a ROp. If only provided options need to be chosen by the ROp, such systems are of RHIS level 5. RHIS level 0 has a special meaning and is only used for monitoring the ADS remotely.
\subsection{RHIS Types}
There is no distinct remote operation technique but several operation modes. The operation mode with no interaction from the ROp to the ADS is called \emph{remote monitoring}, only present at RHIS level 0. Here, the ROp receives data from the ADS and has no possibility to intervene. The received data can be anything from just diagnostic information on the vehicles state, localization information, abstracted environmental data to complete sensor data like camera images. These information are used by the ROp to check and surveil. Remote monitoring is the basis for all other RHIS types which, in addition, allow for intervention by the ROp. The readiness to be available as a "remote fallback-ready user" also falls into RHIS level 0 and corresponds to SAE level 3.\\
The levels 1 and 2 fall into the category \emph{remote driving}, where a ROp directly controls the vehicle in the form of steering and throttle/brake commands. In level 2, the DAS can additionally control the input, avoiding collisions. In its true meaning, the term \emph{teleoperation} refers to this category.\\
Levels 3 to 5 are classified as \emph{remote assistance}. In level 3, the ROp can support the OEDR task of an ADS, e.g. by classifying objects or interpreting situations, such as hand gestures. In level 4, the ROp suggests abstracted driving commands, like goals or waypoints, which the ADS needs to interpret and execute. In level 5, the ADS provides available options, which the ROp authorizes.
\subsection{Vehicle Types}
The SAE J3016\textsubscript{202104} \cite{sae_j3016c_2021} standard defines the \emph{(motor) vehicle} as a non-human user, comprising \emph{conventional vehicles}, \emph{(ADS-equipped) dual-mode vehicles} as well as \emph{ADS-dedicated vehicles (ADS-DV)}. Whereas \emph{conventional vehicles} are always operated by an \emph{in-vehicle driver} and \emph{ADS-dedicated vehicles} are designed for driverless operation for all trips, \emph{(ADS-equipped) dual-mode vehicles} allow for both "driverless operation under routine/normal operating conditions" and for "operation by an in-vehicle driver". This dual mode eventually allows for the completion of all kinds of trips, even after the ADS exits its ODD. Furthermore, level 5 vehicles which offer an interface for manual operation are classified as \emph{dual-mode vehicles}. The RHIS levels are vehicle agnostic, thus all types are supported by the taxonomy.
\subsection{Technical Equipment}
The required technical equipment necessary for RHIS may vary strongly, depending on the user's specific task. For \emph{remote monitoring}, a basic setup consisting of one or multiple screens displaying vehicle information or camera streams for monitoring purposes can be sufficient.
In contrast, \emph{remote driving} also requires additional hardware for sending inputs to the vehicle. Therefore, a simple keyboard and mouse input is not sufficient, which is why most often a steering wheel, pedals and a gear shifter are installed at the remote side as for example shown in \cite{NeumeierTeleoperation2019}. For \emph{remote assistance}, where high-level inputs such as waypoints or paths are provided by a ROp, classical input components are sufficient.\\
In addition to a basic setup consisting of multiple computer screens, remote driving using a head-mounted display (HMD) has also been investigated. Krückel et. al \cite{Krueckel2015} use the HMD to display the current field of view from the perspective of the remote robot, which is extracted from a spherical camera. This allows the operator to look around freely. Kot and Novak \cite{Kot2014} use a HMD to render images from a stereovision camera, allowing for a better depth estimation of the operator. In addition, they simultaneously display complementing information within the operator's field of view, for example an image from a rear camera and additional status icons.
Furthermore, HMD can not only be used to show the real camera's video streams, but also complementary data such as lidar pointclouds or the highlighted boundaries of the driving lane. A recent user study has shown that using a HMD does not automatically increase remote driving performance compared to using conventional screens, however, additional information can be visualized in an intuitive way \cite{georg2018TeleoperatedDrivingKeya}.
\subsection{Human Actors}
The SAE J3016\textsubscript{202104} \cite{sae_j3016c_2021} standard defines five categories of human actors: \emph{(Remote) driver}, \emph{passenger}, \emph{DDT fallback-ready user}, \emph{driverless operation dispatcher}, and \emph{remote assistant}. For RHIS the focus lies on \emph{remote drivers} and \emph{remote assistance}. We have adopted these terms in the RHIS taxonomy, since they are fitting in regards to the included functionalities in our categories. A \emph{(remote) driver} "performs in real time part or all of the DDT and/or DDT fallback for a particular vehicle", meaning he manually controls throttle, brake, steering and gear selection. A \emph{(remote)driver} becomes a \emph{DDT fallback-ready user} during the engagement of a level 3 ADS. He has to be able to respond to \emph{requests to intervene} by taking over control of the vehicle.\\
In this taxonomy we extend the human users of a DAS by \emph{remote operator (ROp)} as a general term for both \emph{remote driver}, \emph{remote assistant} and \emph{remote observer}. Depending on the RHIS level the ROp is a \emph{remote driver} when performing the complete DDT. The \emph{remote assistant} improves upon the SAE understanding of a \emph{remote assistant} who cannot possibly assist with the DDT. In the RHIS taxonomy, a \emph{remote assistant} can additionally assist with the OEDR task, as seen in many examples across the literature. The \emph{remote observer} just monitors and diagnoses the ADS and is located at RHIS level 0. Typically, ROp are trained individuals.\\
Our taxonomy focuses strongly on DAS-centric RHIS in relation to the DDT. Nevertheless, as also described in \cite{sae_j3016c_2021,hf-irads2020HumanFactorsChallenges}, there are further remote roles for dispatching or interaction with \emph{passengers}. These roles are broadly classified as \emph{remote management}.
\section{Conclusion and Future Work}
The first part (Sec. \ref{sec:survey}) of this article presents a survey on \emph{remote human input systems} (RHIS) for driving automation systems (DAS). Different terminologies exist in the literature, making it hard to compare these approaches. As part of this survey we perform an especially meticulous analysis of the most recent SAE J3016\textsubscript{202104} standard, which as we found has an insufficient definition of \emph{remote assistance}, which offers no possibility to classify many approaches presented in the survey.\\
The second part (Sec. \ref{sec:taxonomy}) introduces a taxonomy on RHIS. The taxonomy of RHIS provided allows to distinguish between the different RHIS techniques and makes comparing approaches possible. We have put a special focus on combining approaches from academia, industry and legislation. Our taxonomy introduces RHIS levels that can also serve as input for further revisions of the SAE standard.\\
Questions arise when considering the delimitation of the DAS from the ROp on a functional and also temporal perspective. Also, there is not much research on the relation between the type of event, which lead to a RHIS activation, and the RHIS classification. Such questions will be addressed in future work.
\section*{Abbreviations}
\begin{itemize}
\item[] \makebox[2cm][l]{\textbf{ADS}} Automated Driving System
\item[] \makebox[2cm][l]{\textbf{ADS-DV}} Automated Driving System-Dedicated Vehicle
\item[] \makebox[2cm][l]{\textbf{DAS}} Driver Automation System
\item[] \makebox[2cm][l]{\textbf{DDT}} Dynamic Driving Task
\item[] \makebox[2cm][l]{\textbf{DS}} Driver Support
\item[] \makebox[2cm][l]{\textbf{ODD}} Operational Design Domain
\item[] \makebox[2cm][l]{\textbf{OEDR}} Object and event detection and response
\item[] \makebox[2cm][l]{\textbf{HMD}} Head-mounted display
\item[] \makebox[2cm][l]{\textbf{RHIS}} Remote Human Input System
\item[] \makebox[2cm][l]{\textbf{ROp}} Remote Operator
\end{itemize}
\paragraph{Acknowledgment.}
This work results from the KIGLIS project supported by the German Federal Ministry of Education and Research (BMBF), grant number 16KIS1231.
\bibliographystyle{bibtex/spmpsci.bst}
| {'timestamp': '2021-10-01T02:01:05', 'yymm': '2109', 'arxiv_id': '2109.08599', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08599'} | arxiv |
\section{Introduction}\label{Introduction}
A group of collaborating robots has the ability to explore, interact with, and experience their environment as a collective much faster than a single robot acting alone. This ability to rapidly gather a large volume and variety of data makes multi-robot systems especially well suited for tasks that involve training deep neural networks using data gathered by the robots. In a cloud robotics scenario, one can imagine thousands of robots networked over a cloud server, able to collectively gather and process vast volumes of data for a common task (e.g. manipulation, autonomous driving, or human behavior prediction). In a mesh network scenario, one can similarly imagine a team of robots collaborating to map an environment, learn a control policy, or learn to visually recognize threats in the environment. A central unsolved problem in collaborative robotics, therefore, is how to train neural network models on the robots through local communication such that each robot benefits from the data collected by the entire multi-robot system.
\begin{figure}[t]
\centering
\includegraphics[width=\linewidth]{figs/abstact_fig.png}
\caption{DiNNO allows robots to cooperatively optimize local copies of a neural network model without explicitly sharing data. In this figure (representative of Section \ref{ex:implicit}), three robots use DiNNO to cooperatively optimize a building occupancy map represented as a neural network. Each robot only sees part of the building, collecting a local lidar data set (colored cylinders). The robots communicate over a wireless network (dashed lines) to cooperatively optimize their local neural network copies. The resulting model is as good as if it were trained centrally with all data at once.}
\label{fig:abstract}
\end{figure}
To solve this problem, we propose Distributed Neural Network Optimization (DiNNO), an algorithm built on the alternating direction method of multipliers (ADMM) \cite{boyd2011distributed}, and that integrates easily with standard deep learning tool sets like PyTorch. Using DiNNO, robots alternate between local optimization of an objective function, and communication of intermediate network weights over the wireless network. The robots eventually reach a consensus on their network weights, with each robot learning a neural network that is as good as if it had been trained centrally with the data from all robots, as illustrated graphically in Figure \ref{fig:abstract}. DiNNO inherits the strong convergence properties of ADMM---for convex objective functions we prove that all robots obtain globally optimal parameters. However, neural network training is rarely convex. Using standard deep learning tools within DiNNO we are able to retrieve state-of-the-art deep learning performance, but in a distributed, multi-robot implementation. DiNNO can accommodate time-varying communication graphs (e.g., due to robot motion), and also suits streaming data or online learning, if robots train their network while they move and collect data. Finally, DiNNO operates by sharing network weights over the communication network, not raw data. Therefore, robots using DiNNO preserve the privacy and integrity of their own local data set. This is crucial in scenarios where user data or observations of humans are involved, or when different robot manufacturers need to preserve the privacy of their own data sets.
A naive approach to solving the multi-robot deep learning problem is to use a mesh network routing protocol to aggregate the data gathered by all of the robots in the system to a single ``leader" robot which then optimizes a deep neural network model, and sends a copy of that trained model back to all of the other robots in the system. We refer to this approach as a ``centralized" solution, and it has a number of distinct drawbacks. First, depending on the size of the gathered data, algebraic connectivity of the communication graph, bandwidth of the communication links, and efficiency of the routing protocol it can take a significant amount of time to aggregate the gathered data at the leader node. A centralized approach is not robust to failure of the leader node, and there are some applications for which it may not be possible to transmit data due to privacy considerations, for instance, due to the European Union General Data Protection Regulation article 46 \cite{EU}. DiNNO overcomes all of these limitations by enabling leaderless distributed neural network training through local communication among the robots.
The paper is organized as follows. We give related work in Section \ref{Related Work} and introduce the distributed collaborative learning problem in Section \ref{Problem Formulation}. In Section \ref{Distributed Training} we derive DiNNO starting from a well-known variant of ADMM called Consensus ADMM. In Section \ref{Examples} we present three example robotic deep learning tasks that showcase our method.
\section{Related Work}\label{Related Work}
Learning has been used to address a variety of problems for multi-robot systems and is becoming more popular as deep learning tools are made more accessible. A deep learned controller is used to model multi-quadrotor interactions in \cite{shi2020neural} and \cite{shi2021neural}, and is shown to considerably outperform traditional non-linear controllers. Reinforcement learning can also be a useful tool in multi-robot contexts and \cite{chen2017decentralized} shows that an offline learned value function can be used to perform real-time and uncertainty aware collision avoidance. The collective training methods in \cite{yahya2017collective} and \cite{sartoretti2019distributed} demonstrate how experience aggregation from multiple robots can speed up policy optimization. While not deep learning, Gaussian processes are another popular learning tool that have been used for various regression tasks with data collected online by multi-robot systems \cite{luo2018adaptive, habibi2021human}. These works all showcase applicability of collaborative learning models for multi-robot systems, but in general, aside from \cite{habibi2021human}, do not provide a distributed framework from which to perform this learning.
The problem of training neural networks in a distributed way using data aggregated from individual robots can be viewed as a specific instantiation of a more general class of problems referred to as distributed optimization problems. Distributed optimization is the study of algorithms for solving optimization problems where a sum of individual objective functions, which correspond in this case to the individual robots, is optimized using local computation and message passing. This formulation was first proposed in \cite{tsitsiklis1984problems}, and has been of renewed interest since the seminal work \cite{nedic2009distributed} which presented distributed subgradient descent for convex distributed optimization problems. Subsequent research has focused on improving convergence rates \cite{shi2015extra} and extending analysis to a broader range of problems including time-varying communication graphs \cite{nedic2014distributed}, and online or streaming convex objectives \cite{hosseini2016online}. For an overview of the broader distributed optimization literature we direct the reader to the surveys \cite{halsted2021survey, nedic2018network, yang2019survey}.
Our algorithm is designed for networked robots collaboratively optimizing a neural network model using data local to each robot. Specifically, this task requires distributed optimization of nonconvex deep learning loss functions in situations where the communication graph can be time-varying, and where data may be streaming as it is collected by the robots. While, to our knowledge, no existing works formally address all of these requirements, there are some works in the distributed optimization literature that address general nonconvex distributed optimization objectives, and some use simple distributed neural network training problems as motivating examples.
In \cite{lian2017can} the distributed subgradient descent algorithm is extended to stochastic gradients as the distributed stochastic gradient descent (DSGD) algorithm, and uses training of a CIFAR-10 classification model as a benchmark problem. One approach to improving convergence rates in distributed optimization is to introduce an auxiliary variable that estimates the global gradient. Several works make use of this mechanism, and extend it to the domain of nonconvex optimization with stochastic gradients \cite{pu2021distributed, lu2019gnsd}. The Choco-SGD algorithm for distributed deep learning \cite{koloskova2019decentralized} is another algorithm similar to DSGD with the variations that it uses a gossip mechanism for improved consensus, and incorporates a quantization step for reducing communication bandwidth. The authors of \cite{di2016parallel} propose using local convex approximations, based on global gradient estimates found through gradient tracking, for distributed neural network optimization and show basic results on small networks.
The edge consensus learning algorithm proposed in \cite{edge_consensus} is similar to our approach in that it is derived from ADMM, but instead of addressing the nonconvex primal update directly it uses a linearization similar to that proposed in \cite{ling2015dlm}, which results in a gradient descent like update. While still technically a primal-dual method, the update equations do not include a local optimization procedure, and are more similar to primal domain methods like DSGD (see \cite{ling2015dlm}, Remark 1). A number of other nonconvex distributed optimization methods are discussed in the survey \cite{chang2020distributed}.
Our proposed algorithm for distributed multi-robot deep learning takes full advantage of existing deep learning tools and optimizers, and we demonstrate superior performance compared to benchmarks on robotics related deep learning tasks such as neural implicit mapping and deep multi-agent reinforcement learning.
\section{Problem Formulation}\label{Problem Formulation}
We consider deep learning problems where portions of a data set, $\mathcal{D}$, are sent to, or collected by, $N$ robots that operate in a connected communication graph $\mathcal{G} = (\mathcal{V}, \mathcal{E})$. Let $\mathcal{D}_i$ be the portion of local data that belongs to robot $i \in \mathcal{V}$ where the union of all the local data sets, $\mathcal{D}_i$, is the joint data set, $\mathcal{D}$. In some cases $\mathcal{D}_i$ can represent access to a time-varying data set gathered from an incoming private data-stream (as in Section \ref{ex:implicit}).
The model we would like to optimize has the form $y = f(x; \: \theta)$. Specifically we consider $f$ to be a deep neural network that implements a continuous function $f(x) : \mathbb{R}^{n} \rightarrow \mathbb{R}^{m}$ to give a map from inputs $x \in \mathbb{R}^n$ to outputs $y \in \mathbb{R}^m$. The neural network is parameterized by network weights $\theta \in \mathbb{R}^d$. We make no special assumptions about the architecture (e.g. feed-forward, convolutional, residual, etc.). We can then formalize our distributed learning optimization problem as
\begin{align}
\underset{\theta \in \mathbf{R}^d}{\text{minimize}} \quad \sum_{i \in \mathcal{V}} \ell(\theta; \mathcal{D}_i) \label{eq:joint_loss}
\end{align}
where $\ell(\cdot)$ is the objective function (loss function) which is generally nonconvex and often nonsmooth (due to ReLU activation). Common deep learning tasks such as classification, regression, and unsupervised learning have different objective functions and a distributed deep learning optimizer should be general enough to achieve good performance across all of these problems.
Suppose that the decision variable, $\theta$, is separated such that each robot maintains their own instance of it, $\theta_i \in \mathbb{R}^d$. This yields the equivalent optimization problem
\begin{subequations}
\begin{align}
\underset{\theta \in \mathbf{R}^d}{\text{minimize}}& \quad \sum_{i \in \mathcal{V}} \ell(\theta_i; \mathcal{D}_i) \\
\text{subject to}& \quad \theta_i = \theta_j \quad \forall (i, j) \in \mathcal{E}. \label{eq:consensus}
\end{align}
\label{eq:main}
\end{subequations}
This optimization problem is amenable to a distributed solution in which robots minimize local objective functions, and take additional steps to come to agreement (consensus) on the value of the decision variable. Replacing the data defined loss functions in (\ref{eq:main}) with arbitrary objective functions yields the general formulation of a distributed optimization problem. Though we consider distributed deep learning which is typically unconstrained, a constrained formulation of (\ref{eq:main}) covers many other robotics problems including distributed target tracking, coordinated package delivery, and cooperative multi-robot mapping \cite{halsted2021survey}.
\section{Distributed Training}\label{Distributed Training}
A standard method for solving convex distributed optimization problems is the consensus alternating direction method of multipliers (CADMM). CADMM is an ADMM-based optimization method where compute nodes (robots) alternate between updating their primal and dual variables and communicating with neighboring nodes. To achieve a distributed primal-dual update, CADMM introduces auxiliary primal variables (i.e. $\theta_i = z_{ij}$ and $\theta_j = z_{ij}$ instead of $\theta_{i} = \theta_{j}$). CADMM works by first optimizing the auxiliary primal variables, followed by the original primal variables, then the dual variables, as in the original formulation of ADMM \cite{boyd2011distributed}. Implementations of CADMM then perform minimization with respect to the primal variables and gradient ascent with respect to the dual on an augmented Lagrangian that is fully distributed among the robots:
\begin{align}
\mathcal{L}_a = \sum_{i \in \mathcal{V}} \ell(\theta_i) + p_i^{\top}\theta_i + \frac{\rho}{2} \sum_{j \in \mathcal{N}_i} \vert \vert \theta_i - z_{ij} \vert \vert _2 ^2
\end{align}
where $p_i$ represents the dual variable that enforces agreement between node $i$ and its communication neighbors, and $\mathcal{N}_i$ is the set of indices for neighboring nodes of $i$. The parameter $\rho$ that weights the quadratic terms in $\mathcal{L}_a$ is also the step size in the gradient ascent of the dual variable. Furthermore, the algorithm can be simplified by noting that the auxiliary primal variable update can be performed implicitly ($z_{ij} = \frac{1}{2}(\theta_i + \theta_j)$). Initializing the dual variables at zero then yields the following distributed update equations for CADMM:
\begin{subequations}
\begin{align}
p_i^{k + 1} &= p_i^{k} + \rho \sum_{j \in \mathcal{N}_i} (\theta_i^{k} - \theta_j^{k}) \label{eq:dual}\\
\theta_i^{k + 1} &= \underset{\theta}{\text{argmin}} \: \: \ell (\theta; \mathcal{D}_i) + \theta^{\top}p_i^{k+1} \label{eq:primal}\\
& \qquad \qquad + \rho \underset{j \in \mathcal{N}_i}{\sum}\norm{\theta - \frac{\theta_i^{k} + \theta_j^{k}}{2}}_2^2. \nonumber
\end{align}
\end{subequations}
Typically, the primal variables are initialized uniformly to an initial guess $\theta_i^0 = \theta_{\text{initial}}$. This derivation of CADMM is addressed in much finer detail in \cite{chang2014multi}.
In our multi-robot learning problem, the objective function for the primal update (\ref{eq:primal}) if performed by each robot using CADMM is composed of three terms: a neural network loss on the robot's local data, a linear term from the dual variable, and a regularization term. It is obvious that applying CADMM directly to the neural network training problem results in intractable primal updates due to the neural network loss component. The key insight, which we use in our algorithm DiNNO, is that this primal optimization can be performed approximately, stopping well before convergence to a local optimum. Formally, we propose replacing the exact minimization of the primal update, (\ref{eq:primal}), with an approximate solution found by taking a small number of steps, $B$ (typically between 2 and 10), of a stochastic mini-batch first order method (SFO) on the entire primal objective function. Our proposed algorithm is shown in Algorithm \ref{alg:ours} with the approximate primal update performed in lines 12 - 16. We replace the current primal iterate with $\psi$ in order to avoid including two iteration count super scripts, and let $G(\psi^\tau;\rho, p_i^{k + 1}, \theta_i^k, \{\theta_j^k\}_{j \in \mathcal{N}_i}, \mathcal{D}_i)$ represent the step taken by a SFO on the objective in the primal update. To be clear, $G$ computes a stochastic gradient from a mini-batch in $\mathcal{D}_i$ not a gradient on the entire local data set.
In some of our experiments we found it beneficial to also add a ``scheduled" increase (Algorithm \ref{alg:ours}, line 9) for the penalty parameter $\rho$ in similar fashion to the learning rate schedules used in deep learning. For notational simplicity, we overload the variable $\rho$ to also mean this schedule of parameter values, and make explicit note of all cases where one is used. Although generally we leave this term constant, it can be useful to gradually increase it when faster consensus is desired. This schedule can be provided to robots prior to optimization, and does not compromise the distributed nature of the DiNNO algorithm.
An added benefit of our approach for distributed deep learning is that it pairs well with existing deep learning libraries (e.g. PyTorch \cite{pytorch}) because the approximate primal minimization can be performed with minimal changes to the typical training loops used to optimize individual neural networks. We find that this is beneficial because automatic differentiation and state-of-the-art neural network optimizers, like Adam \cite{kingma2014adam}, can be used to perform the approximate primal update, and practitioner knowledge from experience training individual neural networks is transferable.
\begin{algorithm}
\caption{{\small Distributed Neural Network Optimization (DiNNO)}}
\label{alg:ours}
\begin{algorithmic}[1]
\State \textbf{Require:} $\ell(\cdot), \:\theta_{initial}, \: \mathcal{G}, \: \mathcal{D}, \: \rho$
\For{$i \in \mathcal{V}$} \Comment{Initialize the iterates}
\State $p_i^{0} = 0$ \Comment{Dual variable}
\State $\theta_i^{0} = \theta_{initial}$ \Comment{Primal variable}
\EndFor
\State
\For{$k \gets 0 \text{ to } K$} \Comment{Main optimization loop}
\State \textbf{Communicate:} send $\theta_i^{k}$ to neighbors $\mathcal{G}$
\For{$i \in \mathcal{V}$} \Comment{In parallel}
\State $p_i^{k + 1} = p_i^{k} + \rho \sum_{j \in \mathcal{N}_i} (\theta_i^{k} - \theta_j^{k})$
\State $\psi^{0} = \theta_i^k$
\For{$\tau \gets 0 \text{ to } B$} \Comment{Approximate primal}
\State $\psi^{\tau + 1} = \psi^{\tau} + G(\psi^{\tau};\rho, p_i^{k+1}, \theta_i^k, \{\theta_j^k\}_{j \in \mathcal{N}_i}, \mathcal{D}_i)$ \label{alg:line:primal}
\EndFor
\State $\theta_i^{k+1} = \psi^{B}$ \Comment{Update primal}
\EndFor
\EndFor
\State \Return{$\{\theta_i^{K}\}_{i \in \mathcal{V}}$}
\end{algorithmic}
\end{algorithm}
\subsection{Convergence Properties}
\begin{theorem}[Optimality of Algorithm \ref{alg:ours}]
Let each local objective function $l(\theta, \mathcal{D}_i)$ be strongly convex and $L$-smooth. Furthermore, let
\begin{align*}
G = -\frac{1}{L} \nabla_\theta \big(l(\theta, \mathcal{D}_i) + \theta^{\top}p_i^{k+1} + \rho \underset{j \in \mathcal{N}_i}{\sum}\norm{\theta - \frac{\theta_i^{k} + \theta_j^{k}}{2}}_2^2\big).
\end{align*}
Then Algorithm \ref{alg:ours} converges to the unique global solution with linear convergence rate.
\end{theorem}
\begin{proof}
Given strongly convex and $L$-smooth local objectives, each primal update (Algorithm \ref{alg:ours} line \ref{alg:line:primal}) converges to the global solution with a linear convergence rate as shown in \cite{gd_convergence}. Given globally optimal primal updates and the stated assumptions, Algorithm \ref{alg:ours} is a special case of the decentralized ADMM algorithm studied in \cite{convergence} where it was shown to have linear convergence to the global solution.
\end{proof}
Clearly, in deep learning problems global solutions and linear convergence rates are not ensured due to nonlinear neural networks creating nonconvex, and often nonsmooth, objective functions. Nevertheless, we find that in practice Algorithm \ref{alg:ours} performs well for solving distributed deep learning problems, and converges to solutions similar in quality to those found by centralized optimization.
\subsection{Baseline Algorithms}
In Section \ref{Examples} we show that DiNNO is an extremely effective method for distributed training of neural network models. We compare DiNNO against two other commonly referenced stochastic first order distributed optimization methods: distributed stochastic gradient descent (DSGD) \cite{lian2017can}, and distributed stochastic gradient tracking (DSGT) \cite{pu2021distributed}. Like DiNNO, both methods have each robot maintain a local copy of the optimization variable (neural network weights), and use message passing and locally computed stochastic gradients to collaboratively optimize the neural network. DSGD uses the following simple update equation
\begin{align}
\theta_i^{k + 1} = \underset{j \in \mathcal{V}}{\sum} w_{ij} \theta_j^{k} - \alpha^{k} g(\theta_i^{k}) \label{eq:dsgd}
\end{align}
where $w_{ij}$ is an element of a doubly stochastic matrix $W$ that has a sparsity pattern matching that of the graph Laplacian of $\mathcal{G}$, $\alpha^{k}$ is a decaying step size, and $g(\theta_i^{k})$ is a stochastic (or mini-batch) gradient of $\ell (\theta_i^k; \mathcal{D}_i)$. While (\ref{eq:dsgd}) may not at first appear to be a distributed algorithm, the sparsity pattern of $W$ means that each node only needs $\theta_j^k$ from its immediate neighbors to compute its update step.
The updates for DSGT are similar to those of DSGD, but an additional auxiliary variable is added to estimate the gradient of the joint loss:
\begin{align}
\theta_i^{k+1} &= \underset{j \in \mathcal{V}}{\sum} w_{ij} (\theta_j^k - \alpha y_j^k) \\
y_i^{k+1} &= \underset{j \in \mathcal{V}}{\sum} w_{ij} y_j^k + g(\theta_i^{k + 1}) - g(\theta_i^k).
\end{align}
An important point to note is that for DSGT the message size sent at each communication round is double that of both DSGD and DiNNO which only send $\theta_i^k$. For DSGT and DSGD we use the Metropolis-Hastings weights as $W$.
Alternative benchmark algorithms include (\cite{lu2019gnsd, koloskova2019decentralized, di2016parallel, edge_consensus, chang2020distributed}) but, in general, they share many core characteristics with the proposed baselines DSGT and DSGD.
\begin{figure*}[t]
\includegraphics[width=\textwidth]{figs/mnist_four.png}
\centering
\caption{Each plot shows the Top-1 accuracy of the neural network models on the validation set of the MNIST problem. For each algorithm we evaluate the local neural networks stored by each robot on the validation set. Solid lines show the average validation loss across all robots at the current communication round, and filled areas are upper and lower bounded by the best and worst performing networks for each particular algorithm. The four plots show algorithm performance on four different communication graphs (using the same hyperparameters across all instances). In all cases our method, DiNNO, converges to the same accuracy as the centralized solution, and outperforms both of the baseline methods.}
\label{fig:mnist}
\end{figure*}
\subsection{Data Distributions}
The way in which local data is partitioned between the robots strongly influences the convergence rate of distributed deep learning methods. For example, in classification, problems where each robot has access to a subset of examples from all classes are easier to solve with distributed optimization than problems in which each robot only has access to labelled data for a single class. We refer to these two data distributions as \textit{homogenous} and \textit{heterogenous} respectively. In homogeneous classification a robot which optimizes directly on its local data set without communication may be able to achieve a relatively high validation accuracy. Whereas a robot in the heterogeneous case is unlikely to achieve a high accuracy on any class other than what it observed.
\section{Experiments}\label{Examples}
In the following three examples we demonstrate that DiNNO can be applied to a wide range of multi-robot learning applications, and demonstrates a substantial improvement against baseline distributed optimization algorithms. In each example we compare with two other common distributed optimization methods: DSGD and DSGT. We implement DiNNO, DSGD, and DSGT in a general framework such that for each experiment the optimization algorithm is unchanged, but a different objective function and data set are provided. Hyperparameter values are reported in Section \ref{Appendix}.
\subsection{MNIST Classification} \label{ex:mnist}
To clearly illustrate the potential for Algorithm \ref{alg:ours} to train a shared neural network from disparate data observers we first consider the well known MNIST classification problem \cite{lecun1998mnist}. In this problem a neural network must learn to classify images of handwritten digits to their correct integer values. We train a network composed of a convolutional layer with three 5x5 filters followed by 2 hidden linear layers of width $576, 64$ with ReLU activation and an output layer with log-softmax activation. We use the negative log-likelihood loss function. Each robot only has access to labelled digits from a single class. In this experiment, we perform distributed training with this heterogeneous data distribution on four different communication topologies: a complete graph, a cycle graph, and two random graphs.
In Figure \ref{fig:mnist} we show the average, worst, and best Top-1 accuracy for each method on the distributed MNIST classification problem. Also included is the centralized result (98.5\% validation accuracy), and the individual results, which as expected have roughly 10\% validation accuracy. We observe that while DSGT quickly trains to good accuracy in these problems, DiNNO achieves much better final accuracy as training progresses with lower variance in later iterations. DSGD has relatively poor performance with high variance. The Fiedler value (algebraic connectivity) of each graph is reported to emphasize that DiNNO is capable of training to centralized accuracy with highly heterogeneous data distributions, and low graph connectivity.
\subsection{Neural Implicit Mapping} \label{ex:implicit}
In robotics and computer vision there is growing interest in using neural networks to represent functions which implicitly define the geometry and visual features of an environment \cite{nerf, imap}. In their basic form, implicit density field networks take as input an $(x,y,z)$ spatial coordinate and output a single density value between 0 and 1. Such networks are able to represent complicated 3D scenes in a single memory-efficient function. In this example we use DiNNO to learn the density field of a two dimensional environment where data collection and computation is distributed across multiple robots. The robots also have access to a global coordinate frame which enables cooperative mapping, but a future line of research would be to implement this same pipeline in conjunction with a distributed pose optimization algorithm.
The environment we seek to map is a 2D building floorplan environment from the CubiCasa5K data set \cite{kalervo2019cubicasa5k}. Seven robots are deployed, and each robot gathers data from the environment by collecting lidar scans as it traverses a closed loop, precomputed trajectory. To simulate data streaming the robots update their local networks at regular intervals from datasets of their last 400 collected lidar scans (an entire trajectory has 3000-4000 scans). Figure \ref{fig:true_map} shows the ground truth environment with seven robot paths and one lidar scan. There is some overlap in the locations traversed by each robot, but many locations, especially at the edges and corners of the map, are only viewed by a single robot.
\begin{figure}
\includegraphics[width=\linewidth]{figs/lidar_paperfig.png}
\centering
\caption{Ground truth map. Highlighted is a single robot's trajectory and a single lidar scan is shown with high (gold) and low (blue) density points.}
\label{fig:true_map}
\end{figure}
We train a feedforward network with four hidden layers of size $256, 64, 64, 64$ where the first hidden layer has sinusoidal activation, the remaining hidden layers have ReLU activation, and the output layer has sigmoid activation to restrict our density estimates to $(0,1)$. The sinusoidal activation of the first hidden layer is common in implicit mapping networks and inspired by Fourier Feature Networks \cite{tancik2020fourier}. For a loss function we use the binary cross entropy between the sampled and predicted density.
Our validation set is composed of novel lidar scans from uniformly sampled locations across the entire map, and this ensures that the validation loss reflects loss only on areas where the robots have been able to gather data (e.g. not inside walls). For the communication graph at each round an edge between two robots exists if their pairwise distance is below a certain threshold (1500 in this experiment). The constant motion of the robots results in a communication graph that is dynamic (in terms of edges), but always connected.
Figure \ref{fig:mapping_loss} shows the validation loss for our method as well as DSGD and DSGT. Of the tested methods DiNNO best minimizes the validation loss, once again approaching the performance of centralized training. DSGD and DSGT train less effectively, and converge to a poor quality solution.
\begin{figure}
\includegraphics[width=\linewidth]{figs/odense_vloss.png}
\centering
\caption{Validation loss versus communication iteration for the neural implicit mapping experiment. Both baseline algorithms DSGT and DSGD appear to converge to a poor quality minima while DiNNO (ours) converges to a model with validation loss matching that of the centralized solution.}
\label{fig:mapping_loss}
\end{figure}
Figure \ref{fig:reconstruction} shows the map learned by each method as well as learned maps from individual robots training on only their own data. Each of the robots when using DiNNO is able to provide a faithful reconstruction of the ground truth environment while never having traversed its entirety or having received any raw data from other robots. When tested with DSGD and DSGT robots converge to similar local minima which result in incoherent maps.
To verify the performances of DSGT and DSGD we reran this experiment several times, and both methods always converged to poor performing local minima. Additionally, we emphasize that the simulation code for these two methods is unchanged between this experiment and the MNIST one above where both methods are able to learn acceptable classifiers. We speculate that this is a challenging problem where only a small amount of suboptimality is allowable to achieve a useful representation, and DSGT and DSGD may be unable to either fine tune their neural network weights, escape poor local minima, or handle streaming data.
\begin{figure*}
\includegraphics[width=\textwidth]{figs/odense_allalg_mesh.png}
\centering
\caption{The left most plot shows the ground truth density map, and moving right the next three plots are the reconstructions from the neural implicit maps found by the three tested distributed algorithms. Here DiNNO is the only method that is able to learn a coherent map. The reconstructions were produced by querying the optimized (and agreed upon) networks on a grid mesh of points on the map. The last three plots show reconstructions produced from three of the seven robots when communication is not used (training exclusively on local data with Adam for 10 epochs). Since these robots do not have information from other areas on the map they are only able to reconstruct regions which those robots have traversed.}
\label{fig:reconstruction}
\end{figure*}
\subsection{Multi-Agent Reinforcement Learning} \label{ex:marl}
For the final example we show that our algorithm can be used for deep multi-agent reinforcement learning (deep MARL). Specifically we use DiNNO for distributed learning of a decentralized policy applied to a standard continuous state and action, multi-robot, predator-prey problem that was first introduced in \cite{mpe}. MARL is known to be an especially hard learning task due to the inherent \textit{nonstationarity} of the environment. That is, the environment changes during learning because the other learning agents also have evolving policies. For background on MARL and a recent survey of deep MARL algorithms see \cite{param_sharing} and \cite{deep_marl}.
In our learning environment three robots must work together to pursue a faster evader robot in the presence of stationary randomly placed obstacles, as shown in Figure \ref{fig:tag}. Implemented in PettingZoo \cite{pettingzoo}, the environment operates according to the Actor Environment Cycle (AEC) Game model in which pursuers make observations, take actions, and receive rewards sequentially before the environment as a whole is updated. The pursuers are homogeneous with actions $a = $ \texttt{[none, right, left, up, down]} $\in \mathbb{R}^5 : \mathcal{A}$ and observations $o = $\texttt{[self\_vel, self\_pos, other\_pursuers\_rel\_pos, evader\_rel\_pos, evader\_rel\_vel]} $\in \mathbb{R}^{12} : \mathcal{O}$. Actions are clipped to be on the interval $[0,1]$. The evader obeys a heuristic policy, moving in the direction opposite of the position of the nearest pursuer. However, to prevent unfair evasion, the evader cannot propel itself outside a square of radius $1.2$. The reward function penalizes pursuing robots based on their distance from the evader, and pursuers receive a large positive reward for tagging (capturing) the evader.
\begin{figure}[ht!]
\includegraphics[width=\linewidth]{figs/ghost_traj.png}
\centering
\caption{A decentralized policy rollout in the predator-prey environment. Pursuers (red), using policies learned with DiNNO applied to PPO, attempt to capture a faster evader (green) in the presence of obstacles (black).}
\label{fig:tag}
\end{figure}
To solve this problem we extend the PPO algorithm \cite{ppo} with DiNNO to train a shared, decentralized policy. PPO uses an actor-critic scheme, and with DiNNO the policy (composed of two networks) can be optimized in a distributed way. At consensus the robots all converge to the same policy in accordance with a parameter sharing approach which has been shown to be effective for many MARL problems \cite{gupta_2017, param_sharing}. Typically the policies for parameter sharing are trained by some centralized compute node that aggregates the experiences of each of the robots. Applying DiNNO to PPO results in a relatively unexplored paradigm for MARL where both training and execution are fully distributed.
In this example the actor and critic networks are feedforward ReLU networks with 3 hidden layers of 64 neurons each. The robots simulate communication through a fully connected graph, and robots update their policies using individually collected data every 10 episodes. Results from this experiment are shown in Figure \ref{fig:RL_res}. For each training scenario (DiNNO, DSGD, DSGT, centralized) we show the mean of the average episodic reward achieved by the multi-robot predator team as training progresses. To verify training quality of each algorithm, we run the training scenario five times for each algorithm to generate the shown statistics.
As it does in previous experiments DiNNO achieves the same average episodic reward as a policy trained using PPO with experiences aggregated from all three of the robots. Both DSGD and DSGT seem unable to learn a policy that results in positive episodic reward.
\begin{figure}[ht!]
\includegraphics[width=\linewidth]{figs/RL_reward.png}
\centering
\caption{Episodic reward (averaged across 10 episodes per network update) vs environment time steps (summed across all episodes) for DiNNO, DSGD, DSGT, and centralized. Shown results are averaged across 5 training runs to show training robustness. DiNNO is the only algorithm to achieve good performance, matching centralized performance after 10 million time steps.}
\label{fig:RL_res}
\end{figure}
\section{Conclusion}\label{Conclusion}
We presented the DiNNO algorithm that enables high performance distributed training of deep neural networks, and showcase its versatility on three diverse multi-robot learning tasks. In comparisons to existing distributed learning methods our algorithm consistently achieves better validation performance and converges to performance of centrally trained models. Directions for future work include learning neural implicit density functions from real 3D depth data, and exploring the capabilities of DiNNO for more complex distributed reinforcement learning tasks.
\section*{Appendix}\label{Appendix}
\subsection{MNIST Experiments} \label{app:mnist}
Hyperparameters used across all four graphs were the same. DiNNO uses $B = 2$, $\rho_0 = 0.5$ increasing 0.3\% per communication round, and Adam as its primal optimizer with a log learning rate schedule (0.005 - 0.0005) for the primal update. DSGT uses $\alpha = 0.005$. DSGD uses a decaying stepsize following $\alpha^{k+1} = \alpha^{k} (1 - \mu \alpha^k)$ where $\alpha^0 = 0.005$ and $\mu = 0.001$. All methods use batch size 64.
\subsection{Neural Implicit Mapping Experiment}\label{app:implicit}
DiNNO uses $B = 5$, $\rho^0 = 0.1$ increasing 0.3\% per communication round, batch size of 10,000, and Adam with a log learning rate schedule of (0.001 - 0.0001). DSGT uses $\alpha = 0.001$, and a batch size of 20,000. DSGD uses $\alpha^0 = 0.001$, $\mu = 0.001$, and a batch size of 20,000.
\subsection{Multi-agent Reinforcement Learning}\label{app:marl}
For each algorithm we use the following hyperparameters: 200 steps per episode, 2000 steps between actor/critic network updates, reward discount factor $\gamma=0.99$, and PPO clipping parameter $0.2$. We allow each algorithm 5 gradient steps ($B=5$) per batch of data to update actor and critic networks. The actor learning rates for DiNNO, DSGD, and DSGT are $0.0003$, $0.001$, and $0.01$, respectively. Only DSGT has a separate critic learning rate, $0.00001$, due to exploding gradients otherwise. For DiNNO we set a constant $\rho = 1.0$.
\bibliographystyle{./IEEEtran}
| {'timestamp': '2021-09-20T02:22:00', 'yymm': '2109', 'arxiv_id': '2109.08665', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08665'} | arxiv |
\section{Introduction}
Unmanned Aerial Vehicle (UAV) development has shown valuable potential in the delivery market. The companies like Amazon and Alibaba develop a considerable interest in drones delivery and have started competing about testing drones to deliver packages \cite{r1}. Various UAVs have different purposes including transportation of food, medical supplies, and packages. A key aspect of drones delivery is autonomous landing. Recently, researchers have shown an increased interest in autonomous UAV landing using fiducial markers. The purpose of using fiducial markers is to estimate the pose of the vehicle by obtaining the six-degrees of freedom \cite{r2}. A number of techniques, such as Apriltag \cite{r2} and ARTtag \cite{r5}, have been developed to adapt and explore autonomous landing.
In the situation that two different UAVs can not communicate and share information, that is having no vehicle safety communication (VSC) \cite{r4}, there is an urgent need to address the safety problems caused by the collision during autonomous landing.
\begin{figure}[htbp]
\centerline{\includegraphics[scale=.3]{collision_avoidance.png}}
\caption{Diagram of proposed framework}
\label{fig}
\end{figure} Due to the complexity of the business model UAVs, the conflict of “Free Flight” \cite{r3} is possible to occur and yields the dangerous movement. For the large-scale UAV, one of the greatest challenges is to estimate the spatial relation with another close UAV so that it can archive a safe landing path. Depending on the functionality of UAVs, the different priority of vehicles needs to be assigned if they are landing closely and recently.
In this research, we purpose a strategy to resolve the risk of collision when two different levels of UAV landing on close paths. The Apriltags are used for navigation and estimating position due to its efficiency, less false positive rate, and robustness \cite{r2}. The two different levels of UAV are categorized into Level I and II UAV and they are landing on close platforms. To clarify the problem of having no VSC \cite{r4}, the vision-based collision avoidance method is introduced. An inexpensive detection algorithm is implemented to archive real-time decision-making. Moreover, the YoloV4 \cite{r7} deep learning approach is adopted on Level II UAV to obtain further in-depth information on object detection. The Non-Maximum Suppression (NMS) \cite{r8,r11} is utilized to avoid multiple bounding boxes so that it raises detection accuracy. The Level I UAV is labeled by the bounding box on the view of Level II UAV. The path of the bounding box can be understood by Level II UAV to determine if Level I UAV has finished landing. The Level II UAV will safely move to its landing zone after it determines the landing of Level I UAV.
\section{Proposed Method}
\subsection{Estimation of position}
The recent Apritag detection has been improved on detection speed and localization accuracy by implementing the continuous boundary segmentation algorithm \cite{r2}. To estimate its 3D coordinate in the world coordinate system, the tag position is required to be obtained first. In the situation that the Level II UAV always sees the Apriltags, the 3D reference points of each Apriltag 4-corners and their 2D projection need to be resolved, which is considered as “Perspective-n-Point problem” (PnP). The solving PnP method is based on the calibrated camera, so it demands for the camera intrinsic matrix $A$ after the camera calibration. The closed-form solution is used to gain the intrinsic parameters of $A$ in camera calibration \cite{r6}. A primary concern of solving the PnP problem is coordinate transformation. The system consists of the pixel, image, camera, and world coordinate system. To solve the PnP problem and regulate different coordinate systems, the relative method \cite{r9} is used \begin{equation} s\: p = A \: [R \: |\: t ]\: P_w \end{equation}
where $A$ is a $3\times3$ camera intrinsic matrix. The join matrix $[R | t]$ consists of rotation $R$ and translation $t$, which is obtained from Apriltag's coordinates and orientation. $P_w$ represents the 3D point with respect to world coordinate system. The corresponding 2D pixel with respect to image coordinate system denotes as $p$ and $s$ is the scaling factor \cite{r9}.
\subsection{YoloV4 dataset cloud training}
\begin{figure}[htbp]
\centerline{\includegraphics[scale=.25]{labeling2.jpg}}
\caption{Example of labeling}
\label{fig}
\end{figure}
One of the concern about real-time detectors is the tradeoff between Graphics Processing Units(GPU) usage and detection accuracy. The improved pipeline computation implemented in YoloV4 produces high-quality object detection in real-time \cite{r7}. Therefore, YoloV4 is applied for our collision avoidance strategy to compensate for the massive memory usage during the real flight time. The advantage of YoloV4 provides faster FPS and a more accurate Average Precision detector \cite{r7}.
Figure 2 shows the example of labeling Level I UAV in the training dataset. The output images will be cropped into the customized size that matches your detector algorithm. Cloud dataset training is an innovative and convenient training method. It does not require sophisticated configuration with hardware since the environment has been built up in the cloud server. The Google Colab Pro \cite{r10} was recently introduced by Google that connects with the super engine at the backend Google cloud server and extremely increases the training process.
\subsection{Collision avoidance}
The Level I UAV has no awareness of Level II UAV. It will perform the automatic landing on the Apriltag that is placed on the ground. To gain the path of Level I UAV’s landing path on Level II’s onboard camera, we calculate the gap of the previous and current bounding box with respect to image coordinate system. The procedure of collision avoidance requires the detection of Level I complete landing.
\begin{figure}[htbp]
\centerline{\includegraphics[scale=.38]{Diagram8.jpg}}
\caption{Illustration of image coordinate system}
\label{fig}
\end{figure}
Figure 3 shows the 2D image coordinate system where the top left corner is the origin. The iterative image will be processed into a 4-dimensional blob after the detection. The blob is denoted as $[x , y, w, h]$. The $x, y$ are the coordinates of the center of bounding boxes. The $w, h$ are the width and height of bounding boxes. One blog is considered as the collection of images with the same width, height, and depth.
To increase detection accuracy during real flight time, we use Non-Maximum Suppression to filter out some of the bounding boxes that have poor accuracy. The filter consists of two parts. In order to minimize the candidates of filtering. First, simply select the confidence score that is higher than 0.5 in the set of predictions, which yields a new set. Let $P$ represents the set of all possible prediction, and $P’$ be the new filtered set.
$P' = \{p \in P \mid c\_score(p) > 0.5\} $
\begin{figure}[htbp]
\centerline{\includegraphics[scale=.22]{bounding_box.jpg}}
\caption{Intersection area between bounding box 1 and 2}
\label{fig}
\end{figure}
The highest confidence score from $P'$ will be selected and then calculate the Intersection over Union (IoU) value with all other elements from $P’$. The IoU value is the intersection area between the highest confidence score and one of the selected bounding boxes in $P’$ divided by the union areas. The Figure 4 shows the grey area as the intersection area of bounding boxes. If the IoU exceeds the IoU threshold that we define, then the selected bounding box will be removed from $P’$. Repeat the process until there is no prediction left in $P’$. The IoU threshold is $0.4$ in our experiment.
\begin{figure}[ht]
\subfloat[Bounding boxes without NMS]{
\begin{minipage}[c][0.9\width]{
0.23\textwidth}
\centering
\includegraphics[width=1\textwidth]{NMS2.jpg}
\end{minipage}} \subfloat[Bouding box with NMS]{
\begin{minipage}[c][0.9\width]{
0.23\textwidth}
\centering
\includegraphics[width=1\textwidth]{NMS1.jpg}
\end{minipage}}
\caption{Difference between absence or presence of using NMS}
\end{figure}
Figure 5(a) shows the multiple bounding boxes with various confidence scores before NMS filtering. Figure 5(b) shows the result after the NMS filtering.
The bounding box coordinate in real time is represented by ${(x_t, y_t) } $. The function $f(t)$ is the distance difference of current and previous bounding box
\begin{equation}
f(t) = \sqrt{(x_{t+\Delta t} - x_t)^2 + (y_{t+\Delta t} - y_t)^2} \end{equation} where $(x_t,y_t)$ is the current bounding box coordinate and $(x_{t+\Delta t},y_{t+\Delta t})$ is the previous bounding box coordinate. The change with respect to image coordinate in x-axis might be slightly since the landing mostly affects the bounding box in y-axis. The sampling time of vehicle is represented as $\Delta t$. The landing threshold is denoted as $\sigma$ which demonstrates the minimum transition of Level I UAV landing on Level II UAV image plane. If $f(t) > \sigma$, the Level II UAV determines that Level I UAV has completed landing.
\begin{figure}[htbp]
\centerline{\includegraphics[scale=.4]{Diagram.jpg}}
\caption{Proposed procedure of autonomous landing collision avoidance}
\label{fig}
\end{figure}
Figure 6 shows the procedure of Level II UAV autonomous landing collision avoidance. If Level II UAV detects the existence of Level I UAV, it will hover until the Level I UAV concludes landing. Otherwise, it keeps tracking the iterative images and moves to the landing zone.
\section{Experiment}
Level I UAV is presented by Qdrone from Quanser which has Omnivision OV7251 as the down camera. It is considered a heavy-duty UAV that has higher priority due to its payload and heavyweights. Level II UAV is presented by DJI Tello which has the front camera with 720HD transmission. It is considered an agile UAV with lower priority and needs to wait for Level I UAV’s landing. Since both Level I and II UAV’s landing zone are close, the autonomous system is controlled by the pre-trained dataset and machine learning algorithms. The pose estimation and automatic landing are based on fiducial markers.
In the experiment, there are 6 Apriltag used for level II UAV pose estimation, whose family is 36h11 and 0-5 id. There is a total of 24 n points from Apriltags. The 3D points of Apriltag with respect to world coordinate origin needs to be assigned first. For Level I UAV autonomous landing, it will capture the Apriltag (id:6) by its down camera within the limited range, and land on the Apriltag (id:6).
\begin{figure}[htbp]
\subfloat[State 1: Waiting]{
\begin{minipage}[c][1\width]{
0.25\textwidth}
\centering
\includegraphics[width=1\textwidth]{frontcamera.jpg}
\end{minipage}} \subfloat[State 2: Moving]{
\begin{minipage}[c][1\width]{
0.25\textwidth}
\centering
\includegraphics[width=0.9\textwidth]{landing.jpg}
\end{minipage}}
\caption{2 States of Level II UAV}
\end{figure}
Figure 7 shows 2 different states of Level II UAV. It switches from normal flight to State 1 if it is seeing Level I UAV. This will forward 0 cm/s velocities to the remote control of the motors, which means hovering and waiting. If $f(t)$ in Equation (2) exceeds landing threshold $\sigma$, it will consider that the Level I UAV accomplishes landing and switch to State 2. The landing threshold of the experiment $\sigma$ is 150 in pixels. State 2 is showing in Figure 7(b).
\begin{figure}[htbp]
\centering
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=1\linewidth]{matlab_x_v.jpg}
\label{fig:Ng1}
\end{subfigure}
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=1\linewidth]{matlab_y_v.jpg}
\label{fig:Ng2}
\end{subfigure}
\caption{Level II UAV x,y-velocity}
\end{figure}
Figure 8 shows the x,y-velocity with respect to world coordinate in cm/s. The positive y-direction is toward the Apriltags and the positive x-direction is to the right when the Level II UAV front camera is facing the Apriltags. The value of velocity is proportional to the difference between current and expected position. So it will become slower when it is approaching the expected landing zone as the difference is decreasing. When the Level II UAV is taking off, it is moving to expected landing zone by forwarding x,y-velocity to remote control. After 11 seconds, the bounding box of Level I UAV has been generated by object detection. It forwards 0 cm/s velocity to all the motors as it is waiting for Level I UAV. After 37th second, it detects the Level I UAV complete landing, so it moves to the landing zone and land. To compensate for the latency of implementing deep learning object detection, there is a time delay of one second after sending the velocity to remote control. The video of our experiment is shown here \url{https://youtu.be/AtY4MuwV8tM}.
\section{Conclusion}
This project was undertaken to evaluate the risk of collision under multiple UAVs which are having no vehicle safety communication (VSC) \cite{r4} and design a vision-based collision avoidance method during the autonomous landing of 2 different levels of UAV. The present study lays the groundwork for future research into the real-time decision-making of collision avoidance using the object detection bounding boxes. Further studies need to be carried out in order to validate the prediction of object movement. It will adapt more complex trajectories and compensate the bounding boxes that contain low confidence scores.
\bibliographystyle{IEEEtran}
| {'timestamp': '2021-09-20T02:20:33', 'yymm': '2109', 'arxiv_id': '2109.08628', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08628'} | arxiv |
\section*{Acknowledgements}
\section{TODO -- Remaining Items}
\noindent{\textbf{To be shared}}
\begin{itemize}
\item \answerYES{Model checkpoints at \url{/export/share/syavuz/projects/rng-kbqa22}}
\item \answerYES{Other materials (slides, figures, model outputs, etc.) in Shared Google Drive}
\end{itemize}
\noindent{\textbf{Experiments/Analysis}}
\begin{itemize}
\item \answerYES{Results after handling no-entity cases with our Ranker -- pushed to the codebase and submitted a new result to leaderboard!}
\item \answerTODO{Update Figure-3 and other applicable results to be broken down by categories (iid, composition, etc.)}
\item \answerTODO{Add Generation Quality -- Executability table -- analysis}
\item \answerTODO{[If time allows] Handling no-entity case in more holistic way -- still with rank-and-generate approach}
\end{itemize}
\noindent{\textbf{Figures}}
\begin{itemize}
\item \answerTODO{Add Figure-1: Model figure}
\end{itemize}
\noindent{\textbf{Writing}}
\begin{itemize}
\item \answerTODO{Complete the Analysis section}
\item \answerTODO{Rel-Work}
\item \answerTODO{Conclusion}
\end{itemize}
\section{Generation Augmented KBQA}
\subsection{Preliminaries}
A knowledge base collects knowledge data stored in the form of subject-relation-object triple ${(s,r,o)}$, where $s$ is an entity, $r$ is a binary relation, and $o$ can be entities or literals (e.g., date time, integer values, etc.).
Let the question be $x$, our task is to obtain a logical form $y$ that can be executed over the knowledge base to yield the final answer.
Following \citet{grail}, we use \emph{s-expressions} to represent queries over knowledge base. S-expression (examples in Figure~\ref{fig:framework}) uses functions (e.g., \texttt{\small JOIN}) operating on set-based semantics and eliminates variable usages as in lambda DCS \cite{Liang2013LambdaDC}. This makes s-expression a suitable representation for the task of KBQA because it balances readability and compactness \cite{grail}.
\paragraph{Enumeration of Candidates}
Recall that our approach is a two-stage method that first uses a ranker model to score a list of candidate logical forms $C=\{c_i\}_{i=1}^m$ obtained via enumeration.
We'll first introduce how to enumerate the candidates before delving into the details of our ranking and generation models.
We start from every entity detected in the question and query the knowledge base for paths reachable within two hops. Next, we write down an s-expression corresponding to each of the paths, which constitutes a set of candidates. We note that our procedure does not exhaust all the possible compositions when enumerating (e.g., we do not include comparative operations and argmin/max operations), and hence does not guarantee to cover the target s-expression. A more comprehensive enumeration method covering a broader range of s-expressions is possible but will introduce a prohibitively large number (greater than 2,000,000 for some queries) of candidates. Therefore, it's impractical to cover every possible logical form when enumerating, and we seek to tackle this issue via our tailored generation model.
\subsection{Logical Form Ranking}
\begin{figure}[t]
\centering
\includegraphics[width=\linewidth,trim=330 300 330 300,clip]{img/ranker_model.pdf}
\caption{The ranker that learns from the contrast between the ground truth and negative candidates.}
\label{fig:ranking_model}
\end{figure}
\label{sec:ranking}
Our ranker model learns to score each candidate logical form by maximizing the similarity between question and ground truth logical form while minimizing the similarities between the question and the negative logical forms (Figure~\ref{fig:ranking_model}). Specifically, given the question $x$ and a logical form candidate $c$, we use a BERT-based encoder that takes as input the concatenation of the question and the logical form and outputs a logit representing the similarity between them formulated as follows:
\begin{align*}
s(x,y)=\textsc{Linear}(\textsc{BertCls}([x;y]))
\end{align*}
where $\textsc{BertCls}$ denotes the [CLS] representation of the concatenated input; $\textsc{Linear}$ is a projection layer reducing the representation to a scalar similarity score.
The ranker is then optimized to minimize the following loss function:
\begin{equation}
\label{eq:obj_ranker}\mathcal{L}_{\text{ranker}}=-\frac{e^{s(x,y)}}{e^{s(x,y)} + \sum_{c\in C \land c\neq y} e^{s(x,c)}}
\end{equation}
where the idea is to promote the ground truth logical form while penalizing the negative ones via a contrastive objective.
In contrast, the ranker employed in past work \cite{grail}, a seq-to-seq model, aims to directly map the question to target logical form, only leveraging supervision from the ground truth. Consequently, our ranker is more effective in distinguishing the correct logical forms from \emph{spurious ones} (similar but not equal to the ground truth ones).
\paragraph{Bootstrapping Negative Samples in Training}
Due to the large number of candidates and limited GPU memory, it is impractical to feed all the candidates $c\in C$ as in Eq~(\ref{eq:obj_ranker}) when training the ranker. Therefore, we need to sample a subset of negatives logical forms $C'\subset C$ at each batch in the training phase. A naive way for sampling negative logical forms is to draw random samples. However, because the number of candidates is often relatively large compared to the allowed size of negative samples in each batch, it may not be possible to cover spurious logical forms within the randomly selected samples.
We propose to sample negative logical forms by bootstrapping, inspired by the negative sampling methods used in \citet{densepr}. That is, we first train the ranker using random samples for several epochs to warm start it, and then choose the spurious logical forms that are confusing to the model as the negative samples for further training the model.
We find the ranker can benefit from this advanced negative sampling strategy and perform better compared to using random negative samples.
\subsection{Target Logical Form Generation}
\begin{figure}[t]
\centering
\includegraphics[width=\linewidth,trim=330 330 330 330,clip]{img/gen_model.pdf}
\caption{The generation model conditioned on question and top-ranked candidates returned by the ranker.}
\label{fig:gen_model}
\end{figure}
Having a ranked list of candidates, we introduce a generation model to compose the final logical form conditioned on the question and the top-k logical forms returned by our ranker.
Our generator is a transformer-based seq-to-seq model \cite{vaswani2017transformer} instantiated from \citet{2020t5}, as it demonstrates strong performance in generation-related tasks.
As shown in Figure~\ref{fig:gen_model}, we construct the inputs by concatenating the question and the top-k candidates returned by the ranker separated by semi-colon (i.e., $[x ; c_{t_1} ; ... ; c_{t_k}]$).
We train the model to generate the ground truth logical form token by token with cross-entropy objective using teacher forcing.
In the inference, we use beam-search to autoregressively decode top-k target logical forms.
To construct the top-k logical form candidates needed for training the generator we first train the ranker, and then use the rankings it produces on the training data.
Since the generation model can now leverage both the question and KB schema information (contained in the candidates), the context is much more specified as compared to only conditioning on the question. This enables our generator to leverage the training data more efficiently by focusing only on correcting or supplementing existing logical forms instead of learning both the generation rule and correctness of logical forms.
\paragraph{Execution-Augmented Inference}
We use a vanilla T5 generation model without syntactic constraints, which does not guarantee the syntactic correctness nor executability of the produced logical forms. Therefore, we use an execution-augmented inference procedure, which is commonly used in prior semantic parsing related work \cite{robustfill,deepsketch}. We first decode top-k logical forms using beam search and then execute each logical form until we find one that yields a valid (non-empty) answer. In case that none of the top-k logical forms is valid, we return the top-ranked candidate obtained using the ranker as the final logical form, which is guaranteed to be executable. This inference schema can ensure finding one valid logical form for each problem. It is possible to incorporate a more complex mechanism to control the syntactic correctness in decoding (e.g., using grammar-based decoder \cite{asn} or dynamical beam pruning techniques \cite{structregex}).
We leave such extension aside since we find that executability of produced logical forms is not the bottleneck (see Section~\ref{sec:analysis} in experiments).
\subsection{Extension: Entity Disambiguation as Ranking}
\label{sec:disamb}
\begin{figure}[t]
\centering
\includegraphics[width=\linewidth,trim=330 230 330 230,clip]{img/disamb_exs.pdf}
\caption{Illustrative example of running entity disambiguation as ranking. A confusing entity (red) and the correct entity (green) both match the surface form of the mention in the question. To distinguish them, we train an entity disambiguation model following the same architecture as in logical form ranking but construct inputs by concatenating the question and relations.}
\label{fig:entity_disamb}
\end{figure}
Our ranking model is mainly proposed for the task of ranking candidate logical forms. Here, we introduce a simple way to adapt our ranking model for the task of entity disambiguation. A common paradigm of finding KB entities referred in a question is to first detect the entity mentions with an NER system and then run fuzzy matching based on the surface forms. This paradigm has been employed in various methods \cite{stagg,pullnet,retrack,grail}. One problem with this paradigm lies in entity disambiguation: a mention usually matches surface forms of more than one entities in the KB.
A commonly used way to disambiguate the matched entities is to choose the most popular one according to the popularity score provided by FACC1 project \cite{retrack,grail}, which can be imprecise in some cases. We show an example in Figure~\ref{fig:entity_disamb}. Consider the question ``the music video stronger was directed by whom?'' taken from \textsc{GrailQA}{}, where the most popular matched entity is ``Stronger'' ( \texttt{\small m.02rhrjd}, song by Kanye West)'' and the second is also ``Stronger'' (\texttt{\small m.0mxqqt24}, music video by Britney Spears). The surface form matching and popularity scores do not provide sufficient information needed for disambiguation.
However, it is possible to leverage the relation information linked with an entity to further help assess if it matches a mention in the question. By querying relations over KB,
we see there is a relation about mv director \texttt{\small mv.directed\_by} linking to
\texttt{\small m.0mxqqt24}, but there are no such kind of relations connected with \texttt{\small m.02rhrjd}. We therefore cast the disambiguation problem to an entity ranking problem, and adapt the ranking model used before to tackle this problem. Given a mention, we concatenate the question with the relations for each entity candidate matching the mention.
We reuse the same model architecture and loss function as in Section~\ref{sec:ranking} to train another entity disambiguation model to further improve the ranking of the target entity. We apply our entity disambiguation model on \textsc{GrailQA}{}, and achieve substantial improvements in terms of entity linking.
\section{Conclusion}
We have presented \textsc{RnG-KBQA}{} for question answering over knowledge base. \textsc{RnG-KBQA}{} consists of a ranking step and a generation step. Our ranker trained with iterative bootstrapping strategy can better distinguish correct logical forms from spurious ones than prior seq-to-seq ranker. Our generator can further remedy uncovered operations or implicitly mentioned constraints in the top-ranked logical forms. The experimental results on two datasets, \textsc{GrailQA}{} and \textsc{WebQSP}{}, suggest the strong performance of our approach: \textsc{RnG-KBQA}{} achieves new state-of-the-art performance on both datasets, and particularly outperforms prior methods in generalization setting by a large margin.
\section{Related Work}
Question answering over knowledge base is a promising technique for users to efficiently query over large KB, which has been extensively studied over the last decade. Past work has collected a series of datasets \cite{webqsp, simpleq,metaq,graphq, grail} as well as proposed a diversity of approaches for this task.
One line of KBQA approaches tackles the problem by first constructing a query-specific subgraph with information retrieved from the knowledge base and then ranking entity nodes to select top entities as the answer \cite{graftnet,pullnet,saxena,refinedqa,transfernet}. The subgraph can either be retrieved in one-shot using heuristic rules \cite{graftnet}, or iteratively built using learned models \cite{pullnet, transfernet, refinedqa, saxena}. Later, a neural model operating over subgraph is employed to determine the answer nodes \cite{graftnet, pullnet, transfernet}. Such information retrieval based approaches are usually less interpretable as they do not produce the inference path reaching the answer, whereas our approach is more transparent since we are able to produce logical forms.
More closely related to our approach, another line answers a question over KB by parsing it into an executable logical form in various representations, including lambda-DCS \cite{Liang2013LambdaDC,berant2013freebase}, sparql query \cite{casebase}, graph query \cite{stagg,graphq,qgg}, and s-expression \cite{grail}. Past work has attempted to generate logical forms using a grammar-based bottom-up parser \cite{berant2013freebase} or seq-to-seq parsers \cite{zhang2019-complex}. There has also been an alternative way that first enumerates a list of logical form candidates and then choose one that best matches the intents in the question \cite{qgg,luo-etal-2018-knowledge,stagg,yavuz-etal-2016-improving,yavuz-etal-2017-recovering,reddy-etal-2017-universal,SunZ0Q20}. Our approach differs in that we further employ a generation stage to remedy the coverage issue which these approaches often suffer from.
\section{Introduction}
\begin{figure}[t]
\centering
\includegraphics[width=\linewidth,trim=370 420 370 420,clip]{img/framework.pdf}
\caption{Overview of our rank-and-generate approach. Given a question, we first rank logical form candidates obtained by searching over the KB based on predefined rules. Here, the ground truth logical form is not in the top-ranked candidates as it is not covered by the rules. We solve this problem using another generation step that produces the correct logical form based on top-ranked candidates. The final logical form is executed over the KB to yield the answer.}
\label{fig:framework}
\end{figure}
Modern knowledge bases (KB) are reliable sources of a huge amount of world knowledge but can be difficult to interact with since they are extremely large in scale and require specific query languages (e.g., Sparql) to access. Question Answering over Knowledge Base (KBQA) serves as a user-friendly way to query over KBs and has garnered increasing attention \cite{berant2013freebase,cai2013large}. Recent research has attempted to build systems achieving strong results on several public benchmarks that contain i.i.d. train and test distribution such as {\sc SimpleQ} \cite{simpleq} and {\sc WebQSP} \cite{webqsp}. However, users often want to ask questions involving unseen compositions or KB schema items (see Figure~\ref{fig:grail_exs} for examples),s which still remains a challenge. Generation-based approaches (e.g., a seq-to-seq parser) are not effective enough to handle such practical generalization scenarios due to the difficulty of generating unseen KB schema items. Ranking-based approaches, which first generate a set of candidate logical forms using predefined rules and then select the best-scored one according to the question, have shown some success \cite{grail}. However, it suffers from the coverage problem, because it is often impractical to exhaust all the rules to cover the desired logical form due to the scale of the KB.
We propose \textsc{RnG-KBQA}{}, a new framework targeted at generalization problems in the task of KBQA. Our approach combines a ranker with a generator, which addresses the coverage issue in ranking-only based approaches while still benefiting from their generalization power.
As shown in Figure~\ref{fig:framework}, we first employ a ranker to select a set of related logical forms from a pool of candidate logical forms obtained by searching over the graph.
The selected logical forms are not required to cover the correct one, but are semantically coherent and aligned with the underlying intents in the question. Next, we introduce a generator that consumes both the question and the top-k ranked candidates to compose the final logical form. The core idea of our approach is the interplay between the ranker and the generator: the ranker provides essential ingredients of KB schema items to the generator, which then further refines the top-candidates by complementing missing constructions or constraints, and hence allows covering a broader range of logical form space.
We base both our ranker and generator on pretrained language models for better generalization capability.
Unlike prior systems which rank candidates using a grammar-based parser \cite{berant2013freebase} or a seq-to-seq parser \cite{grail}, our ranker is a BERT-based \cite{bert} bi-encoder (taking as input question-candidate pair) trained to maximize the scores of ground truth logical forms while minimizing the scores of incorrect candidates. Such training schema allows learning from the contrast between the candidates in the entire territory, whereas prior parsing-based ranker \cite{berant2013freebase,grail} only learns to encourage the likelihood of the ground truth logical forms. We further develop an iterative-bootstrap-based training curriculum for efficiently training the ranker to distinguish spurious candidates (Section~\ref{sec:ranking}).
In addition, we extend the proposed logical form ranker, keeping the architecture and logic the same, for the task of entity disambiguation, and show its effectiveness as a second-stage entity ranker.
Our generator is a T5-based \cite{2020t5} seq-to-seq model that fuses semantic and structural ingredients found in top-k candidates to compose the final logical form. To achieve this, we feed the generator with the question followed by a linearized sequence of the top-k candidates, which allows it to distill a refined logical form that will fully reflect the question intent by complementing the missing pieces or discarding the irrelevant parts without having to learn the low-level dynamics.
We test \textsc{RnG-KBQA}{} on two datasets, \textsc{GrailQA}{} and \textsc{WebQSP}{}, and compare against an array of strong baselines. On \textsc{GrailQA}{}, a challenging dataset focused on generalization in KBQA, our approach sets the new state-of-the-art performance of 67.7 exact match 73.2 F1 score, surpassing prior SOTA (58.1 exact match and 65.3 F1 score) by a large margin. On the popular \textsc{WebQSP}{} dataset, \textsc{RnG-KBQA}{} also outperforms the best prior approach (QGG \cite{qgg}) and achieves a new SOTA performance of 75.7 F1 score. The results demonstrate the effectiveness of our approach across all settings and especially in compositional generalization and zero-shot generalization.
\section{Experiments}
\label{sec:exp}
We mainly test our approach on \textsc{GrailQA}{} \cite{grail}, a recently published KBQA dataset focused on evaluating the generalization capabilities. We also experiment on \textsc{WebQSP}{} and compare against a number of prior approaches to demonstrate the general applicability of our approach.
\begin{figure}[t]
\centering
\includegraphics[width=\linewidth,trim=370 220 370 220,clip]{img/gen_example.pdf}
\caption{Examples of compositional generalization to new composition of schema items seen in the training data (green) and zero-shot generalization to unseen schema items (red).}
\label{fig:grail_exs}
\end{figure}
\subsection{Experiment: \textsc{GrailQA}{}}
\begin{table*}[t]
\centering
\begin{tabular}{lcccccccc}
\toprule
& \multicolumn{2}{c}{Overall} & \multicolumn{2}{c}{I.I.D.} & \multicolumn{2}{c}{Compositional} & \multicolumn{2}{c}{Zero-Shot} \\\cmidrule{2-3} \cmidrule{4-5} \cmidrule{6-7} \cmidrule{8-9}
& EM & F1 & EM & F1 & EM & F1 & EM & F1 \\
\midrule
QGG \cite{qgg} & $-$ & 36.7 & $-$ & 40.5 & $-$ & 33.0 & $-$ & 36.6 \\
\midrule
Bert Transduction \cite{grail} & 33.3 & 36.8& 51.8& 53.9& 31.0& 36.0& 25.7& 29.3 \\
Bert Ranking \cite{grail} & 50.6 & 58.0 & 59.9 & 67.0 & 45.5 & 53.9 & 48.6 & 55.7 \\
\midrule
ArcaneQA (Anonymous) & 56.4 & 63.5 & 76.5 & 79.5 & 56.4 & 63.5 & 50.0 & 58.8 \\
ReTrack \cite{retrack} & 58.1 & 65.3 & 84.4 & 87.5 & 61.5 & 70.9 & 44.6 & 52.5 \\
S2QL (Anonymous) & 57.5 & 66.2 & 65.1 & 72.9 & 54.7 & 64.7 &55.1 & 63.6\\
\midrule
RnG-KBQA (Ours) & \bf 68.8 & \bf 74.4 & \bf 86.2& \bf 89.0 & \bf 63.8 & \bf 71.2 & \bf 63.0 & \bf 69.2 \\
\quad w/o Entity Disambiguation & 61.4 & 67.4 & 78.0 & 81.8& 55.0& 63.2& 56.7& 63.0\\
\bottomrule
\end{tabular}
\caption{Exact match (EM) and F1 scores on the test split of \textsc{GrailQA}{}. The numbers of other approaches are taken from the leaderboard. \textsc{RnG-KBQA}{} substantially outperforms prior methods by a large margin.}
\label{tab:grail_main}
\end{table*}
\textsc{GrailQA}{} is the first dataset that evaluates the zero-shot generalization. Specifically, \textsc{GrailQA}{} contains 64,331 questions in total and carefully splits the data so as to evaluate three levels of generalization in the task of KBQA, including \emph{i.i.d.} setting, \emph{compositional} setting (generalizing to unseen composition), and \emph{zero-shot} setting (generalizing to unseen KB schema). We show examples of compositional generalization and zero-shot generalization in Figure~\ref{fig:grail_exs}. The fraction of each setting in the test set is 25\%, 25\%, and 50\% , respectively. Aside from the generalization challenge, \textsc{GrailQA}{} also presents additional difficulty in terms of the large number of involved entities/relations, complex compositionality in the logical forms (up to 4 hops), and noisiness of the entities mentioned in questions \cite{grail}.
\paragraph{Implementation Detail}
We link an entity mention to an entity node in KB using our approach described in Section~\ref{sec:disamb}. We first use a \textsc{BERT-NER} systems provided by the authors of \textsc{GrailQA}{} to detect mention spans in the question. For each mention span, we match the span with surface forms in FACC1 project \cite{facc1}, rank the matched entities using popularity score, and retain the top-5 entity candidates. Lastly, we use the disambiguation model trained on \textsc{GrailQA}{} to select only one entity for each mention. Our entity ambulation model is initiated from BERT-base-uncased model provided by huggingface library \cite{huggingface}, and finetuned for 3 epochs with a learning rate of 1e-5 and a batch size of 8.
When training the ranker, we sample 96 negative candidates using the strategy described in Section~\ref{sec:ranking}. Our ranker is finetuned from BERT-base-uncased for 3 epochs using a learning rate of 1e-5 and a batch size of 8. We do bootstrapping after every epoch. It is also noteworthy that we perform teacher-forcing when training the ranker, i.e., we use ground truth entity linking for enumerating training candidates.
We base our generation model on T5-base \cite{2020t5}. We use top-5 candidates returned by the ranker and finetune the T5 generation model for 10 epochs using a learning rate of 3e-5 and a batch size of 8.
\paragraph{Metrics} For \textsc{GrailQA}{}, we use exact match (EX) and F1 score (F1) as the metrics, all of which are computed using official evaluation script.
\paragraph{Results} Table~\ref{tab:grail_main} summarizes the results on the \textsc{GrailQA}{} dataset. The results of other approaches are directly taken from the leaderboard.\footnote{Accessed on 09/15/2021.} Overall, our approach sets the new state-of-the-art performance on \textsc{GrailQA}{} dataset, achieving 68.8 EM score and 74.4 F1 score in aggregation. This exhibits a large margin over the other approaches: our approach outperforms ReTrack \cite{retrack} by 10.7 EM and 8.2 F1.
Furthermore, \textsc{RnG-KBQA}{} performs generally well for all three levels of generalization and is particularly strong in zero-shot setting. Our approach is slightly better than ReTrack and substantially better than all the other approaches in i.i.d. setting and compositional setting. However, ReTrack fails in generalizing to unseen KB Schema items and only achieves poor performance in zero-shot setting, whereas our approach is generalizable and beats ReTrack with a margin of 16.1 F1 score.
To directly compare the effectiveness of our rank-and-generate framework against rank-only baseline (BERT Ranking), we also provide the performance of a variant of \textsc{RnG-KBQA}{} without the entity-disambiguation model. In this variant we directly use the entity linking results provided by the authors of \citet{grail}. Under the same entity linking performance, our ranking-and-generation framework is able to improve the performance by 9.7\% EM and 8.2 F1. Furthermore, even without the entity-disambiguation module, our model still substantially outperforms all other approaches, even when some of them (e.g., ReTrack) use a better entity linking system \cite{retrack}.
\subsection{Experiment: \textsc{WebQSP}{}}
\begin{table}[t]
\centering
\footnotesize
\begin{tabular}{lccc}
\toprule
& F1 & EM & Hits\textsuperscript{@1} \\
\midrule
PullNet* \cite{pullnet} & 62.8 & $-$ & 67.8 \\
GraftNet* \cite{graftnet} & $-$ & $-$ & 68.1 \\
Bert Ranking* \cite{grail} & 67.0 & $-$ & $-$\\
EmbedQA* \cite{saxena} & $-$ & $-$ & 72.5 \\
ReTrack* \cite{retrack} & 74.7 & $-$ & 74.6 \\
\midrule
Topic Units \cite{lan-2019-topic} & 67.9 & $-$ & 68.2 \\
UHop \cite{chen-etal-2019-uhop} & 68.5 & $-$ & $-$ \\
NSM \cite{liang-etal-2017-neural} & 69.0 & $-$ & $-$ \\
ReTrack \cite{retrack} & 71.0 & $-$ & 71.6\\
STAGG \cite{stagg} & 71.7 & 63.9 & $-$ \\
CBR \cite{casebase} & 72.8 & 70.0 & $-$ \\
QGG \cite{qgg} & 74.0 & $-$ & $-$ \\
\midrule
\textsc{RnG-KBQA}{} \textbf{(Ours)} & \bf 75.6 & \bf 71.1 & $-$\\
\bottomrule
\end{tabular}
\caption{Results of \textsc{RnG-KBQA}{} and baselines on \textsc{WebQSP}{}. * (approach in the top section) denotes using oracle entity linking annotations provided by the dataset. Our approach achieves the new state-of-the-art performance (75.6 F1) with a discernible margin over the performance of best prior method (74.0 F1 obtained by QGG). Our approach even outperforms a number of prior work using oracle entity linking annotations.}
\label{tab:webqsp_main}
\end{table}
\textsc{WebQSP}{} is a popular dataset which evaluates KBQA approaches in i.i.d. setting. It contains 4,937 question in total and requires reasoning chains with up to 2 hops. Since there is no official development split for this dataset, we randomly sample 200 examples from the training set for validation.
\paragraph{Implementation Detail}
For experiments on \textsc{WebQSP}{}, we use ELQ \cite{li2020efficient} as the entity linker, which is trained on \textsc{WebQSP}{} dataset to perform entity detection and entity linking, since it produces more precise entity linking results and hence leads to less number of candidate logical forms for each question. Because ELQ always links a mention to only one entity, we do not need an entity-disambiguation step for \textsc{WebQSP}{} dataset. Similarly, we initiate the logical form ranker using BERT-base-uncased, and the generator using T5-base. We also sample 96 negative candidates for each question, and feed the top-5 candidates to the generation model. The ranker is trained for 10 epochs and we run bootstrapping every 2 epochs; the generator is trained for 20 epochs.
\paragraph{Metrics}
F1 score is used as the main evaluation metric. In addition, for approaches that are able to select entity sets as answers, we report the exact match (EM) numbers used in the official evaluation. For information retrieval based approaches that can only predict a single entity, we report Hits\textsuperscript{@1} (if the predicted entity is in the ground truth entity set), which is considered as a loose approximation of exact match.
\paragraph{Results} For baseline approaches, we directly take the results reported in corresponding original paper. As shown in Table~\ref{tab:grail_main}, \textsc{RnG-KBQA}{} achieves 75.6 F1, surpassing the prior state-of-the-art (QGG) by 1.6. Our approach also achieves the best EM score of 71.1, surpassing CBR \cite{casebase}. The performance of our approach obtained using ELQ-predicted entity linking outperforms all the prior methods, even if they are allowed to use oracle entity linking annotations (denoted as * in the top section). It is also noteworthy that both CBR and QGG, the two methods achieving strong performance closest to ours, use an entity linker with equal or better performance compared to ours. In particular, CBR also uses ELQ for entity linking. QGG uses an entity linker achieving 85.2 entity linking F1 (calculated using public available code) which is slightly better than ours achieving 84.8 entity linking F1. To summarize, the results on \textsc{WebQSP}{} suggest that, in addition to outstanding generalization capability, our approach is also as strong in solving simpler questions in i.i.d. setting.
\subsection{Analysis}
\label{sec:analysis}
\begin{table}[t]
\centering
\small
\begin{tabular}{lcc}
\toprule
& \textsc{GrailQA}{} & \textsc{WebQSP}{} \\
\midrule
Full Model & 75.1 & 75.6 \\
\midrule
Gen Only (Rand Rank) & 47.6 & 69.9 \\
\midrule
Rank Only & 69.8 & 72.7 \\
Rank Only (w/o Bootstrap) & 68.6 & 71.3 \\
\bottomrule
\end{tabular}
\caption{F1 scores on \textsc{GrailQA}{} (dev set) and \textsc{WebQSP}{} of three ablations, including a generation-only variant (Gen Only, which uses randomly selected logical form candidates), a variant ranking-only variant (Rank Only), and a ranking-only variant without using bootstrap training strategy (w/o Bootstrap). Removing either components will lead to a substantial drop in performance.}
\label{tab:ablation}
\end{table}
\paragraph{Ablation Study}
We first compare the performance of our full model against incomplete ablations in Table~\ref{tab:ablation}. We derive a generation-only (Gen Only) model from our base model by replacing the trained ranker with a random ranker, which leads to a performance drop of 27.5 and 5.7 on \textsc{GrailQA}{} and \textsc{WebQSP}{}, respectively. The performance deterioration is especially sharp on \textsc{GrailQA}{} as it requires generalizing to unseen KB schema items, for which the generator typically needs to be based on a good set of candidates to be effective.
To test the effects of our generation step, we compare the performance of a ranking-only variant (directly using the top-ranked candidate) against the performance of the full model. As shown in Table~\ref{tab:ablation}, the generation model is able to remedy some cases not addressable by the ranking model alone, which boosts the performance by 5.3 on \textsc{GrailQA}{} and 2.9 on \textsc{WebQSP}{}.
We additionally evaluate the performance of a ranking model trained without bootstrapping strategy introduced in Section~\ref{sec:ranking}. The performance of this variant lags its counterpart by 1.2 and 1.4 on \textsc{GrailQA}{} and \textsc{WebQSP}{}, respectively. The bootstrapping strategy is indeed helpful for training the ranker to better distinguish spurious candidates.
\begin{figure}[t]
\centering
\includegraphics[width=\linewidth,trim=260 60 260 75,clip]{img/comp_matrix.pdf}
\caption{Comparison between the ranker's top predictions and the generator's top predictions. Generation model mostly keeps or improves the prediction while occasionally introducing errors.}
\label{fig:comp_matrices}
\end{figure}
\begin{figure*}[t]
\centering
\small
\begin{tabularx}{\linewidth}{|r X|}
\hline
\multicolumn{2}{|c|}{\bf Generation Better Than Ranking} \\
\hline
(a)\; Q & \textit{what is the shortest recording by samuel ramey?}\\
R & \texttt{\small (AND music.recording (JOIN recording.artist ramey))} \\
G & \texttt{\small (ARGMIN (AND music.recording (JOIN recording.artist ramey)) recording.length)}\\
\hline
(b)\; Q & \textit{where did kevin love go to college?}\\
R & \texttt{\small (JOIN education.institution (JOIN person.education love))}\\
G & \texttt{\small (AND (JOIN topic.notable\_types college) (JOIN edu.institution (JOIN person.education love)))} \\
\hline
\multicolumn{2}{|c|}{\bf Ranking Better Than Generation} \\
\hline
(c)\; Q & what song for tv or television did benny davis compose? \\
R & \texttt{\small (AND tv.tv\_song (JOIN composition.lyricist davis)) } \\
G & \texttt{\small (AND tv.tv\_song (JOIN composition.song (JOIN composition.composer davis))) } \\
\hline
(d)\; Q & what team does heskey play for? \\
R & \texttt{\small (JOIN sports\_team\_roster.team (JOIN pro\_athlete.teams heskey)) } \\
G & \texttt{\small (JOIN sports\_team\_roster.team (AND (JOIN sports\_team\_roster.from 2015) (JOIN pro\_athlete.teams heskey))) } \\
\hline
\end{tabularx}
\caption{Examples of outputs from the generator (G) and ranker (R). A generation step is able to compensate some missing operators not supported in the enumeration (a), or patch some implicit clue (b). However, generator does introduce errors if it produces another prediction when there is inherent ambiguity in the question and the top-ranked one is indeed correct (c). Generator also adds unnecessary constraint sometimes (d).}
\label{fig:gen_exs}
\end{figure*}
\paragraph{Comparing Outputs of Ranking Model and Generation Model}
We have demonstrated the benefit of adding a generation stage on top of the ranking step on previous result sections. Here, we present a more detailed comparison between the outputs of ranking model and generation model.
Figure~\ref{fig:comp_matrices} presents the ``comparison matrices'' showing the fractions of questions where
$\circ$ top left: the top ranking prediction and top generation prediction achieves equal F1 (must be greater than 0),
$\circ$ top right: the top generation prediction is better,
$\circ$ bottom left: the top ranking prediction is better,
$\circ$ bottom right: they both fail (achieving a 0 F1).
The generator retains the ranking predictions without any modifications for most of the time. For 4.7\% and 8.9\% of the questions from \textsc{GrailQA}{} and \textsc{WebQSP}{}, respectively, the generator is able to fix the top-ranked candidates and improves the performance.
Although generator can make mistakes in non-negligible fraction of examples on \textsc{WebQSP}{}, it is mostly caused by introducing false constraints (e.g., Figure~\ref{fig:gen_exs} (d)). Thanks to our execution-guided inference procedure, we can still turn back to ranker-predicted results when the generator makes mistakes, which allows tolerating generation errors to some extent.
We also show the break down by types of generalization on \textsc{GrailQA}{} (bottom row in Figure~\ref{fig:comp_matrices}). Generation stage is more helpful in i.i.d. and compositional setting, but less effective in zero-shot setting, as it involves unseen relations that are usually hard to generate.
\begin{table}[t]
\centering
\begin{tabular}{l c c c c}
\toprule
\multirow{2}{*}{} & \multicolumn{2}{c}{\textsc{GrailQA}{}} & \multicolumn{2}{c}{\textsc{WebQSP}{}} \\
& EXEC & VALID & EXEC & VALID \\
\midrule
Top-1 & 99.7 & 88.1 & 98.7 & 91.1 \\
Top-3 & 99.7 & 89.4 & 99.5 & 94.5 \\
Top-5 & 99.7 & 89.8 & 99.5 & 94.6 \\
Top-10 & 99.7 & 90.4& 99.5 & 95.4 \\
\bottomrule
\end{tabular}
\caption{The chances of finding an executable (EXEC) and a valid (VALID) logical form among the top-k generated. logical forms.}
\label{tab:exec_rate}
\end{table}
\paragraph{Executability of Generated Logical Forms}
We use executability to further measure the quality of generated outputs. Table~\ref{tab:exec_rate} shows executable rate (producing an executable logical forms) and valid rate (producing a logical form that yields non-empty answer) among the top-k decoded list. Nearly all the top-1 generated logical forms are executable. This suggests that the generation model can indeed produce high-quality predictions in terms of syntactic correctness and consistency with KB. As the beam size increases, more valid logical forms can be found in the top-k list, which our inference procedure can benefit from.
\paragraph{Output Examples of Ranking Model and Generation Model} For more intuitive understanding of how the generator works, we attach several concrete examples (Figure~\ref{fig:gen_exs}) . As suggested by example (a), the generation model can truly remedy some missing operations (\textit{\small ARGMIN}) not supported when enumerating. In addition, it is capable of patching the top-ranked candidate with implicit constraints: the \texttt{\small (JOIN topic.notable\_types college)} in (b) is not explicitly stated, and our NER system fails to recognize \emph{college} as an entity.
As in example (c), the generation model makes a worse prediction sometimes because it prefers another prediction in the top-ranked list due to inherent ambiguity in the question. It can also fail when falsely adding a constraint which results in empty answer (d).
\section{Full results}
Example appendix section. | {'timestamp': '2021-09-20T02:22:10', 'yymm': '2109', 'arxiv_id': '2109.08678', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08678'} | arxiv |
\section*{Materials and Methods}
Our computational framework consists of two components: a detailed database of the town of New Rochelle, NY, and a high-resolution ABM that reproduces the spread of COVID-19 at a one-to-one granularity level that includes mobility patterns among households, schools, workplaces, and non-essential locations (including leisure locations).
The database of the town contains geographical coordinates of every building, residential and public. Public buildings include governmental institutions and private companies of any kind, open to the general population ---the public. The database includes any workplace and non-essential locations, identified using SafeGraph\cite{safegraph}, explicitly distinguishing schools, retirement homes, and hospitals. Town population is recreated using U.S. Census data on residents age, household and family structure, education, and employment characteristics. Residents can work and gather in New Rochelle, and in its vicinity, including New York City. They commute to work via common means such as public transit, cars, or carpools, and visit each other in private.
Each resident of New Rochelle is mapped into an agent in the ABM, resulting into 79,205 agents. In the ABM, agents are characterized by a health state that can change according to a disease progression model detailed in the following, and they can take two types of tests --- safe, contact-less car tests, and more risky ones performed in a hospital. If infected, agents may undergo three types of treatment --- home isolation, routine hospitalization, and hospitalization in intensive care unit (ICU). The ABM was originally proposed in Truszkowska et al.~\cite{truszkowska2021covid}, while a later extension of the work incorporated a simplified version of the vaccination campaign~\cite{truszkowska2021designing}.
For this projective study, we tailored the ABM to capture the scenario as of fall 2021, thereby introducing realistic and time-dependent vaccination effects, booster shots, increased mobility of fully vaccinated agents, and CDC-compliant contact-tracing measures\cite{cdc2021ctracing,NYSCT,NRCT}. In the following, we detail these new features. For details on the other features of the model, the reader should refer to our previous publications\cite{truszkowska2021covid,truszkowska2021designing}. Figure~\ref{fig:abm} schematically illustrates major components of our computational framework.
\begin{figure}
\centering
\includegraphics[width=.7\textwidth]{Fig1.eps}
\caption{{\bf Schematic outline of the ABM computational framework.} The database of New Rochelle, NY, includes geographical information of every residential and public building in the town. It also incorporates workplaces and non-essential venues in the area as many town residents work outside of town and some frequent non-essential locations locations in its vicinity. Each resident is represented as an agent. The population faithfully mirrors the sociodemographic profile of the actual one. The top-right panel shows the age distribution of agents, as registered in the U.S. Census data. The pie chart represents the percentage of households with the indicated size, also in close agreement with the Census (values omitted for clarity). COVID-19 spreads through contacts at different locations associated with the agents, and infected agents can be tested and treated. Positive test result triggers contact tracing, resulting in CDC-compliant home-isolation of potentially exposed individuals. Finally, the platform models imperfect, realistic vaccines, which grant a number of benefits, and wane with time. After eight months, vaccinated agents become eligible for an additional vaccine dose, the booster shot.}
\label{fig:abm}
\end{figure}
\subsection*{COVID-19 progression model}
In our model, all the agents who are not infected, with exception of those recently recovered, are susceptible to COVID-19. Once infected, agents can undergo testing and treatment. Agents who are not symptomatic can get vaccinated, and anyone can be contact-traced and home-isolated.
The progression model is shown in Fig~\ref{fig:prog}. A susceptible agent ($S$) can be vaccinated ($S_v$), may be home isolated, irrespective of their vaccination status, as a result of a home-isolation order due to a contact with an agent with a confirmed COVID-19 infection ($I_{CT}$). Isolation may also be triggered if a susceptible agent has COVID-19-like symptoms due to some other disease, such as seasonal influenza ($I_{Hm}$). Agents can be tested, via one of the two available testing types, in a car ($T_c$) or in a hospital ($T_{Hs}$). The former type is considered contact-less and safe, while the latter carries infection risks. Complete details on testing procedures and the corresponding parameters are outlined in our two previous works\cite{truszkowska2021covid,truszkowska2021designing}.
Susceptible individuals may become infected upon interactions with infectious individuals who are in the same building. The same building may have a role in multiple spreading pathways; for instance, a school provides pathways of infection between students, and students and teachers, but it is also the workplace for its teachers. Infections occur according to a probabilistic mechanism that accounts for differences in infection probability with respect to the characteristics of the location and the number, role, and symptomatic state of infectious individuals in the location, as detailed in Truszkowska et al.\cite{truszkowska2021covid,truszkowska2021designing}. Specifically, inspired to Ferguson et al.\cite{ferguson2020impact}, we assumed that symptomatic individuals are twice as much likely to transmit the disease than asymptomatic and pre-symptomatic individuals. For non-essential locations, like leisure ones, we neglect spreading between employees and visitors, while retaining spreading within the two groups. This choice was motivated by the enforced use of personal protective equipment and social distancing toward minimizing contagions between employees and customers.
Upon infection, a susceptible agent becomes exposed ($E$), not showing symptoms of the disease. The exposed agent can also get vaccinated ($E_v$) as long as their infection status is not known. Even without any symptom, exposed agents can be tested and home isolated. Agents can either recover after being asymptomatic ($R$), or develop symptoms after the latency period and transition to the symptomatic state ($Sy$). Symptomatic agents cannot get vaccinated, which is also the case for agents with symptoms similar to COVID-19 due to another disease. However, vaccinated agents can become symptomatic as a result of an infection ($Sy_v$), potentially leading to milder symptoms.
Agents with symptoms can test and subsequently receive treatment through home isolation ($I_{Hm}$), normal hospitalization ($H_N$), or hospitalization in an intensive care unit, ICU ($H_{ICU}$). Agents can either recover or die ($D$). Symptomatic and exposed agents can also get contact traced, and home isolated on that account. A contact-traced symptomatic agent will undergo treatment regardless of their testing status. Recovered agents are temporarily immune to COVID-19 and, after a certain period of time, they can also be vaccinated. Once their natural immunity is lost, these agents transition to the vaccinated susceptible category ($S_v$). Recovered agents who do not receive the vaccine spontaneously lose natural immunity after a fixed period of time. Based on some (possibly conservative) estimations\cite{Gudbjartsson2020immunity,Dan2021immunity,baraniuk2021long,Lavine2021}, in our simulations we fixed such a period to six months. Additional simulations to assess the robustness of our findings with respect to different duration of natural immunity (loss of natural immunity after four or eight months) are reported in Figure~\ref{S6_Figure} and Figure~\ref{S7_Figure}.
Contact-traced agents cannot be vaccinated, and even if susceptible; they become vaccine-eligible only after some period of time. These restrictions hold for the booster shots as well.
All the parameters that characterize the transitions in the COVID-19 progression model are listed in Table~\ref{S1_Table}. An explicit expression of the contagion probability for each agent $i$, $p_i(t)$, depending on the agent's characteristics (including lifestyle, workplace or school, household in which they live) can be found in Truszkowska et al.\cite{truszkowska2021designing}. The main elements of novelty of the present modeling extension include realistic treatments of the effect of vaccination and contact tracing and are detailed in the following.
\begin{figure}
\centering
\includegraphics[width=0.7\textwidth]{Fig2.eps}
\caption{{\bf Diagram of the COVID-19 epidemic progression.} Agents' health states are susceptible ($S$), exposed ($E$), and symptomatic ($Sy$). Since a vaccination does not grant 100\% immunity, and exposed agents can be vaccinated, the progression distinguishes those three health states in their vaccination version, $S_v$, $E_v$, and $Sy_v$. Susceptible and exposed agents can be tested and home isolated ($I_{Hm}$). Testing can take place in a contact-less form in a car ($T_c$) or in a hospital ($T_{Hs}$). All the agents can be subject to contact tracing and subsequent home-isolation ($I_{CT}$). Exposed agent may recover without ever developing symptoms ($R$), or become symptomatic after a latency period. Symptomatic agents can undergo testing and subsequent treatment through home isolation ($I_{Hm}$), normal hospitalization ($H_N$), or hospitalization in an intensive care unit, ICU ($H_{ICU}$). They can either recover or die ($D$). A recovered agent, if not already vaccinated, can vaccinate as well ($R_v$). Recovered agents are temporarily immune to the disease and after some period of time they become susceptible again, regardless of their vaccination status.}
\label{fig:prog}
\end{figure}
\subsection*{Vaccinations}
An agent can get vaccinated with one of the three vaccine types distributed in the area according to their availability. We considered one vaccine mirroring the one-dose Johnson\&Johnson (abbreviated as $J$), and two vaccines with the characteristics of the two-dose Pfizer and Moderna vaccines (abbreviated as $P$ and $M$, respectively). The probability of being administered a given vaccine type was computed based on data collected manually on actual vaccine offer in the town, as of late July 2021, see Table~\ref{S2_Table}\cite{vacFinder}.
Once agent $i$ is vaccinated, five of the model parameters related to the individual are modified accordingly. Specifically, four quantities decrease upon vaccination: (1) the probability of being infected by SARS-CoV-2, (2) the transmission rate if infected, (3) the probability of requiring hospitalization, and (4) of dying if infected. Conversely, (5) the probability of being asymptomatic when infected increases upon vaccination.
To model such a temporal effect, for each vaccine $\alpha=J,P,M$ and for each model parameter $k=1,\dots,5$, we introduce a function $\gamma_{\alpha,k}(s)$, which models the effect of vaccine $\alpha$ on parameter $k$ as a multiplicative coefficient, $s$ days after vaccine administration. As an example, the probability of COVID-19 infection $p_i^v\left(t\right)$ for agent $i$ vaccinated with vaccine $\alpha$ at time $t_i$ is reduced compared to the original probability in the absence of vaccination $p_i\left(t\right)$ to
\begin{equation}
p_i^v(t):= \gamma_{\alpha,1}\left(t-t_i\right)p_i\left(t\right).
\label{eq:pii}
\end{equation}
Similar expressions can be written for the other four properties (see \nameref{S3_Appendix} for more details).
The shape of these functions is estimated from efficacy data on vaccines. Specifically, they are all defined as piece-wise linear functions. For the one-dose vaccine, they increase up to their most favorable values two weeks after the shot (smaller than one for property $k=1,\dots,4$ and greater than $1$ for property $5$). In case of two-dose vaccines, the functions linearly interpolate efficacy values collected at the time of the first shot, of the second one, and at the attainment of full immunity. The second dose is always contemplated in the model, following local vaccination campaign that sets the appointment for the second shot at the time the first shot is administered, one month later\cite{NYSSecondDose}. The peak benefits for all three vaccine types last for an eight-month period following recent studies on the humoral and cellular immune responses\cite{Collier2021duration,Barouch2021duration}. In this period, the functions have a constant value.
The scientific community has not yet reached consensus on the duration of such period. Studies by Barouch et al. \cite{Barouch2021duration} and Colliet et al. \cite{Collier2021duration} provide only a lower-bound on it, whereas some preliminary analyses based on epidemic data collected over summer 2021 in countries with fast vaccination campaigns (for instance, Israel and Qatar) suggest shorter duration of peak-level immunity\cite{Chemaitelly2021qatar,Goldberg2021israel}. To strengthen the robustness of our claims, a parametric study encompassing different timings of the waning vaccine immunity (six and 10 months) is considered and discussed in Figs.~\ref{S4_Figure} and~\ref{S5_Figure}.
Once the peak-benefit period is over, benefits start to gradually wane, yielding a gradual loss of immunity. Here, we assume that such an immunity is totally lost over the course of the following six months. This is modeled by letting the functions $\gamma_{\alpha,k}$ linearly approach $1$, over a period of six months.
Following the original CDC guidelines, we assume that people are eligible for booster shots starting from eight months after their second vaccine dose\cite{cdc2021booster}. We hypothesize that the booster shot restores peak vaccination benefits in one day after its administration and beneficial effects remain constant for a period that is longer than the simulation horizon (that is, six months). The exact expressions of all the mathematical functions modeling such a phenomenon and details on their estimations are reported in \nameref{S3_Appendix}.
Agents 12 years and older can vaccinate. We model local vaccine hesitancy using an upper bound on the vaccination coverage in the town. Specifically, no more than 64,364 people are considered as eligible for vaccination (approximately the 81\% of the population), computed as a projection based on the temporal evolution of the number of new vaccinations in New York State\cite{Mathieu2021database,NYSTVac}, re-scaled to the population of New Rochelle. An agent is considered fully vaccinated two weeks after their shot of a one-dose vaccine, or two weeks after the second shot of a two-dose vaccine. A fully vaccinated agent is more socially active, and is more likely to visit other agents or non-essential venues, as detailed in Table~\ref{S1_Table}.
\subsection*{Contact tracing}
Contact tracing is implemented in the model by complying with local guidelines\cite{cdc2021ctracing,NYSCT,NRCT}, in accordance to their stricter version issued in winter 2021. When an agent is tested positive to COVID-19 (we contemplated a realistic quota of false positives corresponding to 5\% of the tests\cite{truszkowska2021covid,truszkowska2021designing}), their household members and all the agents with whom they carpool, in case this is their transit mode to work, are immediately home-isolated.
Moreover, a predetermined number of coworkers is home-isolated. To account for realistic implementation of contact tracing, we bound the maximum number of home-isolated coworkers to a given value of 10 and the same upper bound is used throughout for schools and residents. In particular, contact tracing of a retirement home employee results in home-isolating 10 residents in addition to coworkers. Conversely, a confirmed positive resident leads to home-isolating 10 other residents and employees. With respect to schools, the granularity of our model was set to the single school. Hence, contact tracing of a student who tested positive is modeled by home-isolating 10 students of the same age from that agent's school, plus one teacher. The same logic applies also upon tracing a teacher, with a random choice of 10 same-aged students to be home-isolated.
Finally, since agents visit each other in private, we model contact tracing imposing home-isolation to the entire households visited by a COVID-19 positive agent during the course of 14 days preceding the time the agent was determined positive, according to local policies. Due to the limited supervision on restrictions to private visits, we accounted for reduced compliance, estimating such a parameter from the literature, see Table~\ref{S1_Table}.
In the model, home-isolation is implemented by placing the agent in home isolation for a period of 10 days. Afterwards, the agent continues to monitor themselves for COVID-19 symptoms for a duration of 4 days, reflecting the guidelines. If during this two-week period the agent develops COVID-19 symptoms, they are assigned to an adequate treatment, regardless their testing status. Finally, following the guidelines, fully vaccinated agents still have to home-isolate, and negative test results do not shorten the home-isolation duration.
\subsection*{Simulation setup}
Simulations are initialized with a predetermined number of COVID-19 infected agents in the two phases of the disease, that is, exposed or symptomatic, to mimic real conditions in the town. These initial cases can be in different testing stages and undergo treatment. An initial number of vaccinated agents is also contemplated, based on the data collected from the vaccination campaign put in place between January 2021 and the start of the simulation. We assume that each of the 51,342 individuals already vaccinated at the beginning of the simulations has received their first shot in a randomly chosen day between the beginning of the vaccination campaign in January 2021 and September 7\textsuperscript{th} 2021 (see \nameref{S3_Appendix} for the distribution of first shots), resulting in different level of immunity at the beginning of the simulations for these vaccinated agents.
Model parameters related to vaccinations and contact tracing are based on the literature and official releases from the CDC\cite{CDCCovid}, as detailed in the above. The characteristics of different vaccine types are based on official CDC and Food and Drug Administration (FDA) releases\cite{cdcJJ, cdcPfizer, cdcModerna, fdaJJ,fdaPfizer,fdaModerna} and are outlined in detail in \nameref{S3_Appendix}. As indicated therein, in the absence of confirmed values, we either interpolated between the known benefit levels, or we used them for scaling. The parameters used in our contact tracing practices are also listed in Table~\ref{S1_Table}, where our assumptions on the number of contacts each agent has in their workplaces, schools, and other visited locations, are detailed. The complete parameter set and all the modeling assumptions are detailed in Table~\ref{S1_Table}.
Simulations are performed with a time-resolution of six hours. The complete computational framework, including code needed to reproduce the study is available through our GitHub repository. The database is accessible through \url{https://github.com/Dynamical-Systems-Laboratory/NR-population-revac} and the agent-based model through \url{https://github.com/Dynamical-Systems-Laboratory/ABM-COVID-revac}.
\section*{Results}
Our simulations projected COVID-19 spreading over a time span of six months starting from September 7\textsuperscript{th} 2021. At this time, most of the town residents eligible for a vaccine had received their vaccination earlier in the year. Specifically, 51,342 residents were vaccinated with at least one dose as of September 7\textsuperscript{th} 2021\cite{NYSTVac}. As the first dose was administered in January 2021, during the six-month simulation window many of the vaccinated residents would lose their immunity (see Fig.~\ref{fig:day_wane}). The types of the vaccines and their effects mirrored those that were distributed in the area and included the two double-dose vaccines (Moderna and Pfizer) and one single-dose vaccine (Johnson\&Johnson), see Table~\ref{S2_Table}. Per the original, August 2021 CDC guidelines, an agent was set to start losing their immunity at approximately eight months after they become fully vaccinated\cite{cdc2021booster}. At this time, they become eligible for a booster shot, which would restore their peak resistance to the virus, thereby immunizing again the population at the rate set by the administration. Booster shots in the model are distributed alongside regular vaccination doses. In every simulation, only a fixed number of agents can be administered with vaccination each day, in the form of booster or first shots, with no particular prioritization. For example, a rate of twenty vaccines per day implies that twenty randomly chosen, eligible agents will receive their vaccine dose that day, either their first or their booster shot, according to their vaccination status.
\subsection*{Curbing an upcoming wave requires a vaccination rate at least equal to the rate in spring 2021}
To quantify the impact of the vaccination rate on the spread of COVID-19, we performed simulations with two different rates: 0.58\% and 0.11\% of the total population per day. These two values correspond to the maximum first-dose vaccination rate attained at the beginning of April 2021 and the rate registered in early September 2021, respectively\cite{NYSTVac}. The former represents an optimal scenario, which can be achieved only if local authorities implement large, temporary vaccination centers or other viable alternatives; the latter could be considered as a worst case scenario of low vaccination rate.
In our simulations, whose outcome is illustrated in Fig.~\ref{fig:6month}, we assumed that highly effective testing practices were enacted during the entire period. In particular, we hypothesized that each symptomatic agent was tested with probability equal to $80\%$, while such a probability was reduced to $40\%$ for asymptomatic agents. These parameters are representative of optimal testing practices\cite{Pullano2021}, and they are used to illustrate that, even under optimistic assumptions on the efficacy of testing practices, low vaccination rates may lead to tremendous increases in infections and death toll.
\begin{figure}
\centering
\includegraphics[width=.85\textwidth]{Fig3.eps}
\caption{{\bf COVID-19 spreading over six months from September 7\textsuperscript{th} 2021, amid two different vaccination campaigns.} Active cases, total number of infections, and total deaths for the next six months at either peak vaccination rate of 0.58\% population/day (green) or present vaccination rate of 0.11\% population/day (red). For each scenario, $100$ independent realizations are shown and their average is highlighted. The vertical lines denote the date at which the entire non-hesitant eligible population is expected to be vaccinated with at least one shot. }
\label{fig:6month}
\end{figure}
We compared the number of infections and death toll for the two vaccination rates for six months starting from September 7\textsuperscript{th}, 2021. Results from Fig.~\ref{fig:6month} show that, for the higher vaccination rate (green curves), the number of active cases should start decreasing from mid-October. The average peak of active cases should exceed 400 active cases per day, and then it should quickly drop in few weeks, potentially reaching the end of the outbreak at the beginning of 2022. On the contrary, the current vaccination rate (red curves) would lead to a 50\% increase in number of cases per day during fall 2021. Even more alarming is the projection that it would not be sufficient to eradicate the disease, leading to a possible slow rise in number of cases during winter 2022, and potentially a resurgent wave in spring 2022. These results indicate the need to maintain a fast pace during the booster campaign toward curbing potential upcoming waves and quickly eradicating the disease.
In all the simulations, we observed an initial phase in which the number of cases steadily increases. We believe that such an increase could be caused by an underestimation of the initial number of infected individuals, due to under-detection in the officially reported data used to initialize the simulations. However, such an initial increase does not impact our insights into the effects of waning immunity, as more than 88\% of the individuals vaccinated during spring and summer 2021 has still full immunity at the end of October 2021 (see Fig.~\ref{fig:day_wane}).
\subsection*{Testing is still needed, even with high vaccination rates}
We also investigated the role of testing and contact tracing implemented during the booster shot campaign, toward elucidating the impact of these practices, their interplay with the vaccination rate, and, ultimately, to understand whether massive testing campaigns are still needed in this phase.
We conducted a parametric study by varying the vaccination rate and the overall efficacy of testing practices over a two-dimensional grid. Specifically, we considered re-vaccination rates ranging between 0.01--5\% of the population per day. These two extreme values represent scenarios in which the entire re-vaccination campaign would last more than 20 years or just 20 days. For context, the first-dose peak vaccination rate was 0.58\% during April 2021 and the lowest rate was 0.027\% in mid-summer 2021\cite{NYSTVac}. The efficacy of the testing practices was encapsulated by a global parameter, termed ``testing efficacy,'' which measures the probability that a symptomatic agent is tested. In the simulations, we varied such a parameter from 10\% to 100\%, representing scattered to ideal testing.
We performed these parametric studies within three different detection scenarios, according to the ability of detecting pre-symptomatic and asymptomatic agents (hereby, referred to as exposed): high detection (in which exposed agents are tested with the same probability of symptomatic ones), medium detection (in which the probability for an exposed individual to be tested is reduced by 50\% with respect to the one of a symptomatic agent), and low detection (in which exposed agents reduce the probability of being tested to 10\% of the one of symptomatic agents). While high detection of exposed is ideal ---but likely unrealistic, since asymptomatic infections are more difficult to be detected without a massive implementation of testing practices and contact tracing--- medium detection could be a realistic proxy of testing practices seen since the onset of the pandemic\cite{Pullano2021}, and low detection could potentially represent a scenario in which most routine testing practices are disbanded.
Our results, shown in Fig~\ref{fig:heat}, highlight the need to continue testing during the upcoming booster shot campaign. In particular, for all the examined detection scenarios, testing less than 20--30\% of symptomatic agents always resulted in a dramatic increase of infections and deaths. To overcome the ensuing surge it would necessary to apply unprecedentedly high vaccination rates of 1--5\% of the total population per day, likely beyond the capacity of the healthcare system that we have seen in spring 2021.
\begin{figure
\centering
\includegraphics[width=\textwidth]{Fig4.eps}
\caption{{\bf Interplay between re-vaccination rates and testing efficacy.} Two-dimensional heat-maps showing the combined effect of vaccination rate and testing efficacy on the total number of infected and deaths over a period of six months starting from September 7\textsuperscript{th} 2021. Three different detection levels of exposed agents capture a range of contact tracing efforts.
}
\label{fig:heat}
\end{figure}
Our results also emphasize that detecting pre-symptomatic and asymptomatic agents is a critical issue. In fact, for all combinations of re-vaccination rate and testing efficacy, reduced detection of such agents results in a many-fold increase of total number of infections and deaths. For example, with low detection of exposed agents (third scenario, in blue in Fig.~\ref{fig:heat}), the number of deaths may exceed over 600 (that is, approximately 0.8\% of the population of the town), reaching peaks of more than 1,000 deaths in the worst case scenarios of both low testing efficacy and low re-vaccination rates.
\section*{Discussion}
The chief goal of this work was to systematically analyze the spread of COVID-19 in the upcoming 2021 fall/winter season, as immunity gained due to vaccination wanes over the year and testing practices change. Toward this aim, we extended a mathematical model designed in our previous efforts \cite{truszkowska2021covid,truszkowska2021designing}, a high-resolution ABM of a medium-sized U.S. town faithfully reproducing spatial layout, demographics, and lifestyles of urban areas, to quantify the effects of a range of vaccination and testing efforts. As in our previous studies, we focused on the town of New Rochelle, NY, which was the location of one of the first COVID-19 outbreaks in the U.S.. New Rochelle is representative of many towns in the country and is characterized by high levels of diversity and potential inequalities\cite{USSmallTowns,dataUSA}.
Complementing our earlier efforts, we enhanced the capabilities of the computational framework along three main directions. First, we considered realistic types and administration of vaccines, as well as time-varying vaccination benefits, including waning immunity after a tunable period\cite{Barouch2021duration,Collier2021duration,Chemaitelly2021qatar,Goldberg2021israel} and administration of a booster shot\cite{cdc2021booster}. Second, natural immunity achieved through recovery was also considered to be no longer permanent\cite{Gudbjartsson2020immunity,Dan2021immunity}. Third, we modeled contact tracing, consistent with the CDC and local health department guidelines \cite{cdc2021ctracing,NYSCT,NRCT}. Overall, the current model is a highly realistic and detailed digital representation of the town and its residents, with the resolution of a single individual, thus allowing for reliable ``what-if'' analyses of the epidemic during the upcoming fall/winter season. Equipped with a new parameter set tuned on the now-dominant Delta variant, we studied the local outcome of the interplay between the rate of vaccination and efficacy of testing practices.
Predictably, we found that low testing efficacy may lead to a disastrous increase in both infections and deaths, irrespective of vaccination efforts of any intensity. In fact, low testing efficacy seems to hamper any benefits that would be offered by realistic re-vaccination campaigns. The final count of cases and casualties would be substantially independent of vaccination rates, unless booster shots were administered to more than 1\% population per day (an unrealistic scenario, since it exceeds the peak vaccination rate during spring 2021). For low-to-moderate testing efficacy, vaccination rates below 0.5\% consistently lead to a case and death toll comparable with those experienced during the first wave \cite{truszkowska2021covid}.
These results, in agreement with other studies on testing practices during previous phases of the COVID-19 pandemic\cite{aleta2020modeling, Quilty2021}, highlight the central role of testing, contact tracing, and home-isolation in the fight against COVID-19 and echo the ``Path out of the Pandemic," presented by the U.S. Government on September 10\textsuperscript{th}, 2021, as part of ``President Biden's COVID-19 Plan"~\cite{WhiteHousePlan}.
To contain COVID-19 mortality below the level of the first wave, we predict that at least 0.5\% of population per day should be immunized/re-immunized, as testing and contact tracing are carried out with moderate efficacy. Such a 0.5\% vaccination rate is not unreasonable, as it is comparable to the average vaccination rate during the peak of the spring 2021 vaccination campaign\cite{NYSTVac}. However, such a peak vaccination rate was accompanied by large, temporary vaccination centers that no longer exist. Hence, local authorities might need to restore these temporary vaccination centers or provide viable alternatives, to keep the administration of boosters at the desired rate. On the contrary, vaccination rates below 0.5\% might lead to scenarios that are worse than those recorded in spring 2020\cite{OWD_us}. In particular, using a vaccination rate equal to that adopted in September 2021 would lead to a potentially disastrous rise in the number of infections around the beginning of 2022. While the number of deaths projected in this scenario are still lower than those occurred in the first wave, likely due to reduced mortality rates of vaccinated individuals, the steep increase portends that this number would ultimately overcome first wave figures.
These projections emphasize the importance for a booster shot, in line with the ``President Biden's COVID-19 Plan"~\cite{WhiteHousePlan} that highlights the need of ``further protecting the vaccinated'' (with the booster shot). To efficiently combat the spread, the booster shot campaign should be conducted on a scale close to the one implemented during the peak immunization efforts in spring 2021. Similar conclusions have been drawn by other authors. For example, Layton et al.\cite{layton2021understanding} report doubling of deaths by late December 2021 in Ontario, Canada, as a consequence of reducing the baseline vaccination rate by 20\%. Sandmann et al.\cite{sandmann2021potential} predict the occurrence of up to two annual COVID-19 waves in the UK, whose magnitudes are strictly tied to vaccine efficacy and active NPIs. In the worst case scenario, it is expected that there will be a new wave this fall, with a magnitude comparable, or even higher, than the one observed during 2020. Similarly, Song et al.\cite{song2021vaccination} indicate reoccurring new surges in the worst cases of vaccination efficacy and immunity duration, and a constant, but non-zero COVID-19 incidence in the best scenarios, starting from mid-2021.
Testing of symptomatic individuals plays a key role in controlling the spread, especially when it is accompanied by moderate contact tracing efforts. Seen from another perspective, testing a mere 40\% of the symptomatic individuals with moderate contact tracing efforts should avoid exceeding mortality rates of the first wave. Beyond a 60\% testing efficacy, the effect of increased testing is diluted and higher vaccination rates are needed to bring` down mortality rates. While testing levels of 40\% or above are achievable\cite{TestsJH}, as they are comparable with the estimates for the late summer 2020 in France\cite{Pullano2021} they are still challenging to attain. Reducing delays in testing and contact tracing could offer a pathway to mitigate difficulties in reaching high testing levels \cite{Kretzschmar2020,Quilty2021}.
Likewise, the detection of asymptomatic individuals is of paramount importance to combat the spreading. In particular, going from high- to low-detection of such individuals more than doubles the number of cases and deaths. This finding is consistent with the literature, whereby efficacious tracking of the asymptomatic individuals has been shown to arrest the progression of the spread of the virus\cite{reynalara2020virus, kretzschmar2021isolation}. High detection rates can be realized with aggressive contact tracing strategies that can identify stranger contacts in addition to close contacts \cite{rodriguez2021population}. At the same time, while it is reasonable that most people who develop symptoms or are informed of exposure to an infected individual will isolate, and possibly test, detecting asymptomatic individuals could become progressively more difficult, especially with general decline in social distancing practices and lifting of mandatory testing by many employers and institutions\cite{cdc2021higheredtesting}.
While insightful, our results are not free from limitations. Though calibrated in real data, the high granularity of our model comes at a cost of a series of assumptions. Importantly, immunity due to vaccination was modeled based on educated guesses due to limited data availability. Except for waning immunity benefits from vaccination, all the parameters in our simulations were time-invariant; in real settings factors such as NPIs or testing coverage are likely to change in response to emerging situations\cite{NYSClusters, NYSMasksNew} and, likewise, vaccination rates to dynamically change. Moreover, we tested the general, uninfected population in a non-random fashion, and contact tracing guidelines within our model were more conservative than those currently in-place.
Concerning the timing and profile of waning immunity, in our study we made several assumptions based on the knowledge available at the time of writing the paper. We acknowledge that the scientific community has yet to reach complete consensus, even at the time of the revision of the manuscript. Specifically, we set immunity benefits from vaccination to start to gradually wane after a period of eight months from peak-level immunity. This is in accordance with recent studies on the humoral and cellular immune responses, which indicates eight-months as a lower-bound on this period \cite{Barouch2021duration,Collier2021duration}. However, other studies suggest different, and potentially shorter, timings\cite{Chemaitelly2021qatar,Goldberg2021israel}, thereby conclusive evidence is yet to be established\cite{Scott2021wane}. Similar uncertainty seems to be present on the duration of natural immunity~\cite{Gudbjartsson2020immunity,Dan2021immunity,baraniuk2021long,Lavine2021}, which, in this work, was chosen to last for six months. To partially address these uncertainties, we performed the parametric study in Figure~\ref{S4_Figure}, Figure~\ref{S5_Figure}, Figure~\ref{S6_Figure}, and Figure~\ref{S7_Figure}, which ensure that our qualitative findings and observations are robust to changes in the timing and profile of the waning immunity.
The study design was based on information about the pandemic gathered during summer 2021. In particular, in the original (August 2021) schedule, booster shots were planned to be available to all the adults in the U.S. eight months after they took their second vaccine dose\cite{cdc2021booster}. This schedule has changed between the time of the submission and its revision (October 2021), as currently COVID-19 vaccine booster shots are available for some categories of Pfizer-BioNTech vaccine recipients who completed their initial series at least six months ago\cite{cdc_booster_october}. New changes to such a plan are expected in the next few weeks, as the FDA has approved booster shots for Moderna and Johnson\&Johnson on October 20\textsuperscript{th}\cite{fda_booster}, and the ``President Biden's COVID-19 Plan" suggests ``to quickly get booster shots into the arms of eligible Americans once approved"\cite{WhiteHousePlan}. As scenarios are rapidly changing, we have opted to adhere to the original CDC guidelines for our simulations. We believe that the additional simulations in Figure~\ref{S4_Figure} and Figure~\ref{S5_Figure} provide some insights into this issue, suggesting that the rate of vaccination is more important than its actual timing, to avoid potential, resurgent outbreaks in late winter/spring 2022.
The need to administer booster shots must also be put in context with respect to medical, social, and moral concerns \cite{mahase2021covid, schaefer2021making}. First, the waning of immunity is still not confirmed with certainty\cite{Scott2021wane}, and the health effects of an additional dose remain, to some extent, unexplored\cite{mahase2021covid}. It cannot be excluded that an additional dose may only selectively boost the efficacy for individuals who are immunocompromised or whose initial vaccination had low efficacy \cite{krause2021considerations}. Also, any adverse effects of the booster dose may have a negative impact to the vaccine acceptance\cite{krause2021considerations}. Second, with less than 5\% of the populations in low income countries being fully vaccinated, the World Health Organization has deemed every booster shot as ``ethically questionable'' and warned that unmitigated COVID-19 pandemic in those areas will continue yielding new variants\cite{schaefer2021making, who2021booster}.
Despite these concerns, countries have already started their booster shot campaigns in an attempt to curb the risk of new surges and restrictions \cite{wadman2021israel}. These decisions are likely driven by the Delta variant, which dilutes the herd-immunity thresholds estimated for the wild-type strain\cite{randolph2020herd,kwok2020herd,kadkhoda2021herd,macintyre2021modelling}.
\section*{Acknowledgments}
We would like to acknowledge Maya Fayed and Sihan (Silvia) Wei for updating the town database, identifying part of the new model parameters, and introducing the code for the out-of-town non-essential locations. The work of AT and MP was partially supported by National Science Foundation (CMMI-1561134 and CMMI-2027990). The work of EC, ZPJ, and AR was partially supported by National Science Foundation (CMMI-2027990). The work of SB was partially supported by National Science Foundation (CMMI-2027988). The work of AR was partially supported by Compagnia di San Paolo. The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.
\section*{Authors contribution}
Conceptualization---AT, LZ, SB, AR, MP;
data curation---AT;
methodology---AT, LZ, SB, AR, MP;
software---AT, SB;
validation---AT;
formal analysis---all the authors;
investigation---all the authors;
resources---MP;
writing—original draft preparation---AT, LZ, SB, AR, MP;
writing—review and editing---EC, ZPJ;
visualization---AT;
supervision---SB, EC, ZPJ, AR, MP;
project administration---MP;
funding acquisition---SB, ZPJ,AR, MP.
| {'timestamp': '2021-10-25T02:20:14', 'yymm': '2109', 'arxiv_id': '2109.08660', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08660'} | arxiv |
\section{Introduction}
Hypothesis testing aims at detecting the distribution of sources observed at sensors in networks such as the
Internet of Things (IoT). In a distributed setting, the sensors observe source sequences and send compressed versions of these observations over the network to a decision center where the underlying distribution of the sources should be detected.
The simplest case of a hypothesis testing setup consists of a sensor which itself should decide on the hypothesis. Assume that there are two hypotheses $\mathcal{H}=0$ (null hypothesis) and $\mathcal{H}=1$ (alternative hypothesis). Under the null and alternative hypotheses, the source $X$ is distributed according to given pmfs $P_X$ and $Q_X$, respectively. The performance of this system is characterized by two types of error probabilities. The type-I error probability (resp. type-II error probability) is the probability of deciding on $\mathcal{H}=1$ (resp. $\mathcal{H}=0$) when the original hypothesis is $\mathcal{H}=0$ (resp. $\mathcal{H}=1$).
There are two well-known approaches to the hypothesis testing setup. In one approach, the number of observed samples at the sensors is fixed and bounded by $n$ which tends to infinity. This setup is commonly referred to as \emph{fixed-length testing}. In another approach, the sensors are allowed to get a random number of samples whose expectation is fixed and bounded by $n$. This setup is referred to as \emph{sequential testing} due to \cite{Wald}.
The trade-off between type-I and type-II error probabilities is considered in some previous works \cite{Ahlswede, Han, Wald, Vincent-sequential, Tara, Yury-paper, Michele, Michele2, Gunduz, Vincent, TianChen, Tuncel, SW18, W18, related-work, HA-survey}. When both error probabilities are required to decrease exponentially, the Neyman-Pearson test \cite[Thm 11.7.1]{cover} is shown to be optimal for a fixed-length test. There is a trade-off between the exponents of type-I and type-II error probabilities such that with an increase in one of the exponents, there is a decrease in the other exponent. Using sequential testing \cite{Wald}, one can resolve this trade-off and simultaneously achieve the exponents $D(Q_X\|P_X)$ and $D(P_X\|Q_X)$ for type-I and type-II error probabilities, respectively. Another regime of interest is when the type-I error probability is restricted to be smaller than some $\epsilon\in (0,1)$. In this case, Chernoff-Stein's lemma \cite[Thm 11.8.3]{cover} shows that the maximum exponent of type-II error probability is $D(P_X\|Q_X)$ which is achievable in both fixed-length and sequential testing setups.
\begin{figure}[t]
\centering
\includegraphics[scale=0.4]{fig-eps-converted-to.pdf}
\caption{Distributed sequential hypothesis testing with zero-rate compression.}
\label{fig1}
\end{figure}
In this paper, we consider sequential testing over a simple network with a sensor and a decision center. At each time $t$, the sensor gets $k$ samples ($k>0$) of a source denoted by $X$. It then describes its observations until time $t$ over a zero-rate noiseless link to a decision center which also has access to the samples of a source denoted by $Y$. Under the null and alternative hypotheses, each sample of the pair $(X,Y)$ is distributed according to given pmfs $P_{XY}$ and $Q_{XY}$, respectively. The decision center based on all received messages (the previous and current messages) and its observed source samples tries to decide on the hypothesis. If it makes a decision, it sends a single bit of feedback to the sensor to stop transmission which is called as \emph{stop-feedback}. However, if it needs more samples to make a decision, it sends a single bit of feedback to the sensor to request for another $k$ samples for compression and testing. The transmission continues until the decision center can finally declare a hypothesis. We are interested to find the maximum exponent of the type-II error probability under the constraint that type-I error probability does not exceed some positive $\epsilon\in (0,1)$ and when the expectation of the number of requests from the sensor does not exceed some large $n$.
The optimal exponent of fixed-length testing over a single-sensor, single-decision center setup with a zero-rate link has been established in \cite{ShalabyPapamarcou}. Interestingly, we show that the optimal exponent of the proposed sequential testing setup coincides with that of \cite{ShalabyPapamarcou}. The proof of achievability is straightforward since the decision center can send its transmission request to the sensor $n $ times and the compression/testing scheme of \cite{ShalabyPapamarcou} can be employed. The main technical contribution of this paper is the proof of the strong converse which shows that this scheme is indeed optimal for sequential testing. The proof uses Marton's blowing up lemma \cite{MartonBU}.
\section{System Model}\label{sec:model}
Let $\set{X}$ and $\set{Y}$ be arbitrary finite alphabets and $n$ and $k$ be positive integers. Consider the distributed sequential hypothesis testing as in Fig.~\ref{fig1}. At each time $t\in\mathbb{Z}^+$ , the sensor gets $k$ samples $X_{(t-1)k+1}^{tk}\eqdef(X_{(t-1)k+1}, \ldots, X_{tk})\in \set{X}^{ k}$ and encodes this sequence to a zero-rate message $M_t\in \mathcal{M}_t^{(k)}\triangleq \{0,1,\ldots,|\mathcal{M}_t^{(k)}|\}$ using the function $f_t^{(k)}:\mathcal{X}^{tk}\to \mathcal{M}_t^{(k)}$ such that $M_t=f_t^{(k)}(X^{tk})$.
The sensor sends the message $M_t$ over a noiseless zero-rate link to the decision center which also has access to side information $Y^{tk}\in\mathcal{Y}^{tk}$. Under the null hypothesis
\begin{align}
\mathcal{H}=0\colon \quad (X,Y)\sim \; P_{XY}, \label{eqn:null}
\end{align}
whereas under the alternative hypothesis
\begin{align}
\mathcal{H}=1\colon \quad (X,Y)\sim \; Q_{XY},\label{eqn:alt}
\end{align}
for two given pmfs $P_{XY}$ and $Q_{XY}$ where we assume the positivity constraint $Q_{XY}>0$.
At each time $t$, the decision center uses the messages $(M_1,\ldots,M_t)\in \mathcal{M}_1^{(k)}\times \ldots\times \mathcal{M}_t^{(k)}$ and the side information $Y^{tk}$ to produce an estimate of the hypothesis $\hat{\mathcal{H}}_t\in\{0,1,\star\}$ using the function \begin{align}g_t^{(k)}\colon \mathcal{M}_1^{(k)}\times\ldots \mathcal{M}_t^{(k)}\times \mathcal{Y}^{tk}\to \{0,1,\star\},\end{align} such that $\hat{\mathcal{H}}_t=g_t^{(k)}(M_1,\ldots,M_t,Y^{tk})$.
If $\hat{\mathcal{H}}_t\in\{0,1\}$, it sends a single bit of feedback $B_{t+1}=0$ to the sensor to stop transmission. If $\hat{\mathcal{H}}_t=\star$, it sends the bit $B_{t+1}=1$ to the sensor to request for more samples of the source sequence. Define $T$ to be the stopping time of the transmission:
\begin{IEEEeqnarray}{rCl}
T\triangleq \min\{ t\colon B_t=0 \}.
\end{IEEEeqnarray}
Notice that $B_{t+1}$ is a function of both $X^{tk}$ and $Y^{tk}$ in which case $T$ is stopping time with respect to the filtration $\{\sigma(X^{tk},Y^{tk})\}_{t=1}^{\infty}$. Let $\mathcal{F}_T$ be the $\sigma$-algebra generated by the random variables $\{ (X^{Tk} , Y^{Tk})\}$.
The final decision function is $g_{T}^{(k)}\colon \mathcal{M}_1^{(k)}\times\ldots \mathcal{M}_T^{(k)}\times \mathcal{Y}^{T k}\to \{0,1\},$ such that $\hat{\mathcal{H}}_{T}=g_{T}^{(k)}(m_1,\ldots,m_{T},y^{T k})$.
We define an acceptance region $\mathcal{A}_{T}\in\mathcal{F}_T$ such that:
\begin{align}
&\mathcal{A}_{T} \eqdef \Big\{(x^{Tk},y^{T k})\colon \nonumber\\&\hspace{1.1cm} g_{T}^{(k)}(f_1^{(k)}(x^k),\ldots, f_T^{(k)}(x^{Tk}),y^{T k})=0 \Big\},
\end{align}
and a rejection region $\set{R}_{T}\in\mathcal{F}_T$ as the following:
\begin{align}
&\mathcal{R}_{T} \eqdef \Big\{(x^{Tk},y^{T k})\colon \nonumber\\&\hspace{1.1cm} g_{T}^{(k)}(f_1^{(k)}(x^k),\ldots, f_T^{(k)}(x_{(T-1)k+1}^{Tk}),y^{T k})=1 \Big\}.
\end{align}
Notice that $\mathcal{F}_T= \mathcal{A}_{T}\cup \mathcal{R}_{T}$.
\begin{definition}\label{def} For a given $\epsilon\in (0,1)$, we say that a type-II exponent $\theta\in \Reals_+$ is $\epsilon$-achievable
if there exists a sequence of encoding and decision functions such that the corresponding sequences of type-I and type-II error probabilities at the decision center are respectively defined as
\begin{align}\alpha_n\eqdef P^{Tk}_{XY}(\set{R}_{T})\quad\mbox{and}\quad\beta_n\eqdef Q_{XY}^{Tk}(\set{A}_{T}),\end{align}
and they satisfy
\begin{align}
\alpha_n\leq \epsilon \quad,\quad \liminf_{k\to\infty}\liminf_{n\to\infty}\frac{1}{nk}\log\frac{1}{\beta_n}\geq \theta,\label{def-exponent}
\end{align}
and the stopping time satisfies:
\begin{equation}
\max\{\mathbb{E}_P[T],\mathbb{E}_Q[T]\}\leq n.\label{def-time}
\end{equation}
We assume zero-rate compression in this paper, which means
\begin{IEEEeqnarray}{rCl}
\lim_{k\to\infty} \frac{1}{k}\log|\mathcal{M}_t^{(k)}|=0,\qquad t \in \mathbb{Z}^+.\label{zero-rate-cons}
\end{IEEEeqnarray}
The {\em optimal $\epsilon$-exponent} $\theta^*(\epsilon)$ is the supremum of all $\epsilon$-achievable exponents $\theta\in \Reals_+$.
\end{definition}
\begin{remark} We remark that the order of limits in \eqref{def-exponent} is important. First, we fix the number of samples $k \in \mathbb{Z}^+$ of the source $X$ and side information $Y$. Then, we consider the sequence of functions (decoders) $g_t^{ (k) }$ under the constraint that the stopping time satisfies \eqref{def-time}. This corresponds to a sequence of subblocks $\{(X_{(t-1)k+1}^{tk} \}_{t=1}^\infty$ of size $k$ that allow for us to make a decision confidently. Then, we take $k$ to be large and, in particular, satisfies the zero rate constraint in \eqref{zero-rate-cons}. In the traditional setup, the roles of $n$ and $k$ are merged. However, here, we separate the size $k$ of the submessages $M_t$ and the number of such submessages to make a decision.
\end{remark}
\section{Main Result}
The following theorem establishes the optimal exponent of the above setup. Interestingly, this exponent coincides with that of \cite{ShalabyPapamarcou} for the fixed-length testing. This implies that there is no improvement in the performance of sequential testing comparing to fixed-length setup.
\begin{theorem}\label{main-thm} Assuming that $\min_{x,y}Q_{XY}(x,y)>0$, the optimal $\epsilon$-exponent of the distributed sequential HT with zero-rate compression for all $0<\epsilon<1$ is given by
\begin{IEEEeqnarray}{rCl}
\theta^*(\epsilon) &= & \min_{\substack{\tilde{P}_{XY}:\\\tilde{P}_X=P_X\\\tilde{P}_Y=P_Y}}D(\tilde{P}_{XY}\|Q_{XY}).
\end{IEEEeqnarray}
\end{theorem}
\begin{IEEEproof} The achievability follows from the fixed-length testing scheme of \cite{ShalabyPapamarcou}. Notice the fact that any achievable exponent for fixed-length testing is also achievable for the sequential setup since we can always take a fixed number of samples from source sequences but this may be suboptimal for sequential testing. However, as it is proved in the following Section~\ref{sec-proof}, this strategy is indeed optimal for the proposed distributed testing setup.
\end{IEEEproof}\medskip
\subsection{Proof of Converse for Theorem~\ref{main-thm}}\label{sec-proof} \medskip
Before starting the proof, we present a useful lemma which will be used later.
\begin{lemma}\label{lem-main} Let $T$ be a random variable and for each $T=t$, let $P^t$ and $Q^{t}$ be arbitrary product distributions over a set $\mathcal{Z}^t$ where $Q>0$ and $\mathcal{A}^t$ be a subset of $\mathcal{Z}^t$. Then,
\begin{IEEEeqnarray}{rCl}
-\mathbb{E}\left[P^T(\mathcal{A}^T)\log Q^T(\mathcal{A}^T)\right]\leq \mathbb{E}[T]D(P\|Q)+1.
\end{IEEEeqnarray}
\end{lemma}
\begin{IEEEproof} See Section~\ref{lem-proof-sec}.
\end{IEEEproof}
Now, we state the proof. Fix $\epsilon \in (0,1)$ and an achievable exponent $\theta<\theta^*(\epsilon)$, a sequence of encoding and decision functions, a filtration, stopping time, acceptance and rejection regions $\mathcal{A}_{T}$, $\mathcal{R}_{T}$ such that \eqref{def-exponent}, \eqref{def-time} and \eqref{zero-rate-cons} are satisfied. Further fix a large blocklength $n$. Let $d$ be a positive integer such that \begin{align}d>\frac{\epsilon}{1-\epsilon},\label{d-const}\end{align}
and define
\begin{align}\tau\triangleq n\cdot (1+d).\label{tau-def}\end{align}
Moreover, we define a new acceptance region $\mathcal{A}^{\text{new}}\subseteq \mathcal{A}_{T}$ such that
\begin{IEEEeqnarray}{rCl}
\mathcal{A}^{\text{new}} &\triangleq &\{ (x^{Tk},y^{Tk})\in\mathcal{X}^{Tk}\times \mathcal{Y}^{Tk}\colon\nonumber\\&&\hspace{3cm} (x^{Tk},y^{Tk})\in\mathcal{A}_{T},\;\; T\leq \tau \}.\nonumber\\
\end{IEEEeqnarray}
Now, consider the following sets of inequalities:
\begin{IEEEeqnarray}{rCl}
1-\epsilon&\leq& P_{XY}^{Tk}(\mathcal{A}_{T})\\
&=& \Pr[T\leq \tau]\cdot P_{XY}^{Tk}(\mathcal{A}_{T}|T\leq \tau)\nonumber\\
&&\hspace{0.3cm} +\Pr[T> \tau]\cdot P_{XY}^{Tk}(\mathcal{A}_{T}|T> \tau)\\
&\leq& P_{XY}^{Tk}(\mathcal{A}^{\text{new}})+\frac{\mathbb{E}[T]}{\tau} \\
&\leq& P_{XY}^{Tk}(\mathcal{A}^{\text{new}})+\frac{1}{1+d}.\label{step1}
\end{IEEEeqnarray}
Define
\begin{IEEEeqnarray}{rCl}\phi\triangleq 1-\epsilon-\frac{1}{1+d},\label{eps-def}\end{IEEEeqnarray}
and notice that $0<\phi<1$ from \eqref{d-const} and by~\eqref{step1}, we have:
\begin{IEEEeqnarray}{rCl}
\phi \leq P_{XY}^{Tk}(\mathcal{A}^{\text{new}}).\label{step2}
\end{IEEEeqnarray}
Now, for $\mathsf{m}^T\eqdef (m_1,\ldots,m_T)\in\mathcal{M}_1^{(k)}\times\ldots\times\mathcal{M}_T^{(k)}
$, we define the following sets
\begin{IEEEeqnarray}{rCl}
C_{\mathsf{m}^T}&\triangleq & \nonumber\\&&\hspace{-0.5cm}\{ x^{Tk}\in\mathcal{X}^{Tk}\colon (f_1^{(k)}(x^k),\ldots,f_T^{(k)}(x^{Tk}))=\mathsf{m}^{T} \},\nonumber\\\\
F_{\mathsf{m}^T}&\triangleq & \{ y^{Tk}\in\mathcal{Y}^{Tk}\colon g_T^{(k)}(\mathsf{m}^T,y^{Tk})=0 \}.
\end{IEEEeqnarray}
The sets $C_{\mathsf{m}^T}$ (and $F_{\mathsf{m}^T}$) for different $\mathsf{m}^T$ are disjoint. That is, for each two message sequences $\mathsf{m}^T$, $\mathsf{m}'^T$ such that $\mathsf{m}^T\neq \mathsf{m}'^T$, we have:
\begin{IEEEeqnarray}{rCl}
C_{\mathsf{m}^T}\cap C_{\mathsf{m}'^T}=\emptyset,\qquad F_{\mathsf{m}^T}\cap F_{\mathsf{m}'^T}=\emptyset.
\end{IEEEeqnarray}
Given the above sets, we can write
\begin{IEEEeqnarray}{rCl}
\mathcal{A}^{\text{new}} &=& \bigcup_{\mathsf{m}^T}C_{\mathsf{m}^T}\times F_{\mathsf{m}^T}, \qquad T\leq \tau.\label{step3}
\end{IEEEeqnarray}
Considering \eqref{step2} and \eqref{step3}, there exists a message $\mathsf{m}^*$ such that
\begin{IEEEeqnarray}{rCl}
P_{XY}^{Tk}(C_{\mathsf{m}^*}\times F_{\mathsf{m}^*})\geq \frac{\phi}{\prod_{t=1}^T|\mathcal{M}_t^{(k)}|}.\label{step4}
\end{IEEEeqnarray}
Let $C\triangleq C_{\mathsf{m}^*}$, $F\triangleq F_{\mathsf{m}^*}$ and
\begin{IEEEeqnarray}{rCl}
\delta_{k,\tau }&\triangleq &-\frac{1}{\tau k}\log \phi+\frac{1}{\tau k}\sum_{t=1}^T\log |\mathcal{M}_t^{(k)}|,
\end{IEEEeqnarray}
where $\delta_{k,\tau}\to 0$ as $k,\tau\to\infty$ by \eqref{zero-rate-cons}, \eqref{tau-def}, \eqref{eps-def} and considering the fact that $T\leq \tau$.
Thus, we can re-write \eqref{step4} as follows:
\begin{IEEEeqnarray}{rCl}
P_{XY}^{Tk}(C\times F)\geq 2^{-\tau k\delta_{k,\tau }}.\label{step5}
\end{IEEEeqnarray}
We define $\mathcal{A}\triangleq C\times F$ and the above inequality can be equivalently written as
\begin{IEEEeqnarray}{rCl}
P_{XY}^{Tk}(\mathcal{A})\geq 2^{-\tau k\delta_{k,\tau }}.
\end{IEEEeqnarray}
We then expand the region $\mathcal{A}$ to a subset of $\mathcal{X}^{\tau k}\times \mathcal{Y}^{\tau k}$ so that all sequences to be of the same length $\tau $:
\begin{IEEEeqnarray}{rCl}
\mathcal{A}^{\text{exp}}&\eqdef& \{ (x^{\tau k},y^{\tau k})\colon \nonumber\\&&\hspace{0.5cm}\exists (\tilde{x}^{T k},\tilde{y}^{T k})\in \mathcal{A}\;\text{and}\;(\bar{x}^{(\tau-T)k},\bar{y}^{(\tau-T)k})\colon \nonumber\\&&\hspace{0.5cm}(x^{\tau k },y^{\tau k})=(\tilde{x}^{Tk},\bar{x}^{(\tau-T)k},\tilde{y}^{Tk},\bar{y}^{(\tau-T)k}) \}.\nonumber\\
\end{IEEEeqnarray}
Notice that
\begin{IEEEeqnarray}{rCl}
P_{XY}^{\tau k}(\mathcal{A}^{\text{exp}})=P_{XY}^{Tk}(\mathcal{A})\geq 2^{-\tau k \delta_{k,\tau}}.
\end{IEEEeqnarray}
We decompose the set $\mathcal{A}^{\text{exp}}$ into two sets $C^{\text{exp}}\subseteq\mathcal{X}^{\tau k}$ and $F^{\text{exp}}\subseteq\mathcal{Y}^{\tau k }$ such that $\mathcal{A}^{\text{exp}}=C^{\text{exp}}\times F^{\text{exp}}$.
The above inequality implies that
\begin{IEEEeqnarray}{rCl}
P_{X}^{\tau k}(C^{\text{exp}})\geq 2^{-\tau k \delta_{k,\tau }},\qquad P_{Y}^{\tau k}( F^{\text{exp}})\geq 2^{-\tau k \delta_{k,\tau }}.\label{step7}
\end{IEEEeqnarray}
Now, define \begin{align}\nu\eqdef \tau k,\end{align}
and let $\{\ell_{\nu} \}$ be any sequence that satisfies
\begin{IEEEeqnarray}{rCl}
&& \lim_{\nu \to\infty}\frac{\ell_{\nu}}{\sqrt{\nu\log \nu}}=\infty,\\
&& \lim_{\nu\to\infty}\frac{\ell_{\nu}}{\nu}=0
\end{IEEEeqnarray}
Using the blowing-up lemma \cite[Remark on p. 446]{MartonBU}, we get:
\begin{IEEEeqnarray}{rCl}
P_{X}^{\nu }(C^{\text{exp-bl},\ell_{\nu}})\geq 1-\xi_{\nu},\;\;\; P_{Y}^{\nu }(F^{\text{exp-bl},\ell_{\nu}})\geq 1-\xi_{\nu},\label{blowup-con}
\end{IEEEeqnarray}
where we define $\ell_{\nu}$-blown up sets of $C^{\text{exp}}$ and $F^{\text{exp}}$ as follows:
\begin{IEEEeqnarray}{rCl}
C^{\text{exp-bl},\ell_{\nu}}&\triangleq & \{\tilde{x}^{\nu }\colon \exists x^{\nu }\in C^{\text{exp}}\;\text{s.t.}\; d_{\text{H}}(\tilde{x}^{\nu },x^{\nu })\leq \ell_{\nu} \},\\
F^{\text{exp-bl},\ell_{\nu}}&\triangleq & \{\tilde{y}^{\nu}\colon \exists y^{\nu }\in F^{\text{exp}}\;\text{s.t.}\; d_{\text{H}}(\tilde{y}^{\nu},y^{\nu })\leq \ell_{\nu} \},
\end{IEEEeqnarray}
and $\xi_{\nu}\triangleq \frac{\sqrt{ \nu\log \nu}}{\ell_{\nu}}$.
Next, we introduce a distribution $\tilde{P}_{XY}$ that satisifes the marginal constraints
\begin{IEEEeqnarray}{rCl}
\tilde{P}_X=P_X,\qquad \tilde{P}_Y=P_Y. \label{marginals}
\end{IEEEeqnarray}
For this distribution, we have:
\begin{IEEEeqnarray}{rCl}
\tilde{P}_{XY}^{\nu }(C^{\text{exp-bl},\ell_{\nu}}\times F^{\text{exp-bl},\ell_{\nu}}) &\geq & \tilde{P}_{X}^{\nu }(C^{\text{exp-bl},\ell_{\nu}}) + \tilde{P}_{Y}^{\nu }( F^{\text{exp-bl},\ell_{\nu}}) \nonumber\\&&\hspace{0.5cm}-1\\
&\geq & 1-2\xi_{\nu},\label{step10}
\end{IEEEeqnarray}
where the first inequality follows from the property $\Pr(A\cap B)\geq \Pr(A)+\Pr(B)-1$ and the second inequality follows from~\eqref{blowup-con}.
We define $\mathcal{A}^{\text{exp-bl},2\ell_{\nu}}\triangleq C^{\text{exp-bl},\ell_{\nu}}\times F^{\text{exp-bl},\ell_{\nu}}$ and observe that it is the $2\ell_{\nu}$-blown-up of the set $\mathcal{A}^{\text{exp}}$. It is also the expanded region of the $2\ell_{\nu}$-blown up of the set $\mathcal{A}$ which we denote by $\mathcal{A}^{\text{bl},2\ell_{\nu}}$.
Thus we have:
\begin{IEEEeqnarray}{rCl}
\tilde{P}_{XY}^{Tk}(\mathcal{A}^{\text{bl},2\ell_{\nu}})&=&\tilde{P}_{XY}^{\nu }(\mathcal{A}^{\text{exp-bl},2\ell_{\nu}})\\&=&\tilde{P}_{XY}^{\nu }(C^{\text{exp-bl},\ell_{\nu}}\times F^{\text{exp-bl},\ell_{\nu}}) \\
&\geq &1-2\xi_{\nu},\label{step18}
\end{IEEEeqnarray}
where the last inequality follows from \eqref{step10}.
Now, we consider the following sets of inequalities:
\begin{IEEEeqnarray}{rCl}
Q_{XY}^{Tk}(\mathcal{A}^{\text{bl},2\ell_{\nu}}) &\leq & Q_{XY}^{Tk}(\mathcal{A})\cdot K_{\nu}^{\ell_{\nu}}\label{step9}\\
&\leq & \beta_n\cdot K_{\nu}^{\ell_{\nu}},\label{step8}
\end{IEEEeqnarray}
where
\begin{IEEEeqnarray}{rCl}
K_{\nu} \triangleq \frac{\nu }{q^2\ell_{\nu}}|\mathcal{X}||\mathcal{Y}|,
\end{IEEEeqnarray}
and
\begin{IEEEeqnarray}{rCl}
q\eqdef \min_{x\in\mathcal{X},\;y\in\mathcal{Y}} \;Q_{XY}(x,y).
\end{IEEEeqnarray}
Here, \eqref{step9} follows from \cite[proof of Lemma 5.1]{Csiszarbook}, and \eqref{step8} follows because $\mathcal{A}\subseteq \mathcal{A}_{T}$. Here is where we use the fact that $q>0$ so $K_{\nu}$ is finite.
Now, notice that the second inequality of \eqref{def-exponent} together with \eqref{step8} yields the following:
\begin{IEEEeqnarray}{rCl}
\theta
&\leq &-\frac{1}{nk}\log \beta_n+\psi_{n,k}\nonumber\\&\leq& -\frac{1}{nk}\log Q_{XY}^{Tk}(\mathcal{A}^{\text{bl},2\ell_{\nu}})+\frac{\ell_{\nu}}{kn}\log K_{\nu}+\psi_{n,k},
\end{IEEEeqnarray}
where $\psi_{n,k}\to 0$ as $n$ and $k$ tend to infinity.
The above inequality holds for any realization of $T$ so it is also satisfied when averaged over $T$. Thus, we get the following:
\begin{IEEEeqnarray}{rCl} \theta&\leq& -\frac{1}{nk}\mathbb{E}\left[\log Q_{XY}^{Tk}(\mathcal{A}^{\text{bl},2\ell_{\nu}})\right]+\frac{\ell_{\nu}}{kn}\log K_{\nu}+\psi_{n,k}.
\end{IEEEeqnarray}
Thus, the constraint is also satisfied when averaged over $T$. We continue with the following set of inequalities:
\begin{IEEEeqnarray}{rCl}
&& \hspace{-0.7cm}-\frac{1}{nk}\mathbb{E}\left[\log Q_{XY}^{Tk}(\mathcal{A}^{\text{bl},2\ell_{\nu}})\right]\\[1ex]
&\leq& -\frac{1}{nk(1-2\xi_{\nu})}\mathbb{E}\left[\tilde{P}_{XY}^{Tk}(\mathcal{A}^{\text{bl},2\ell_{\nu}})\log Q_{XY}^{Tk}(\mathcal{A}^{\text{bl},2\ell_{\nu}})\right]\label{step17}\\[1ex]
&=& \frac{1}{nk(1-2\xi_{\nu})}(\mathbb{E}[T] D(\tilde{P}_{XY}\|Q_{XY})+1)\label{step12}\\[1ex]
&\leq & \frac{1}{nk(1-2\xi_{\nu})}(nD(\tilde{P}_{XY}\|Q_{XY})+1),\label{step13}
\end{IEEEeqnarray}
where \eqref{step17} follows from inequality \eqref{step18}, \eqref{step12} follows from Lemma~\ref{lem-main} and \eqref{step13} follows from~\eqref{def-time}. \medskip
Finally, letting $n,k\to \infty$, we have $\psi_{n,k}\to 0$, $\xi_{\nu}\to 0$ and $\frac{\ell_{\nu}}{kn}\log K_{\nu}\to 0$. Also, recall that distribution $\tilde{P}_{XY}$ satisfies the marginal constraints in~\eqref{marginals}. Thus, we get:
\begin{IEEEeqnarray}{rCl}
\lim_{k\to\infty}\liminf_{n\to\infty}\;-\frac{1}{nk}\log \beta_n\leq \min_{\substack{\tilde{P}_{XY}:\\\tilde{P}_X=P_X\\\tilde{P}_Y=P_Y}}D(\tilde{P}_{XY}\|Q_{XY}).\nonumber\\
\end{IEEEeqnarray}
This completes the proof.
\section{Proof of Lemma~\ref{lem-main}}\label{lem-proof-sec}
First, we show that
\begin{IEEEeqnarray}{rCl}
\mathbb{E}\left[D(P^T\|Q^T)\right] &=& \mathbb{E}[T] D(P\|Q).\label{step14}
\end{IEEEeqnarray}
We follow similar steps to \cite[Proof on pp. 171]{Yury-book} where we introduce the following random variable:
\begin{IEEEeqnarray}{rCl}
S_t \eqdef \sum_{i=1}^t D(P_i\|Q_i)-tD(P\|Q),
\end{IEEEeqnarray}
for $t\geq 1$ and $S_0=0$.
Clearly, $S_t$ is a martingale w.r.t. $\mathcal{F}_t$. Thus, $\tilde{S}_t\eqdef S_{\min(T,t)}$ is also a martingale. Therefore, we have:
\begin{IEEEeqnarray}{rCl}
\mathbb{E}[\tilde{S}_t]=\mathbb{E}[\tilde{S}_0]=0.
\end{IEEEeqnarray}
This yields:
\begin{IEEEeqnarray}{rCl}
\mathbb{E}\left[\sum_{i=1}^{\min(T,t)} D(P_i\|Q_i)\right]=\mathbb{E}[\min(T,t)]D(P\|Q).
\end{IEEEeqnarray}
Since we have assumed that $Q>0$, then $\sum_{i=1}^tD(P_i\|Q_i)\leq t c$ for some positive $c$. Thus, $\sum_{i=1}^{\min(T,t)}D(P_i\|Q_i)\leq t c$ which implies that the following collection \begin{IEEEeqnarray}{rCl}\left\{\sum_{i=1}^{\min(T,t)}D(P_i\|Q_i),\;\;t\geq 0\right\}\end{IEEEeqnarray} is uniformly integrable.
Therefore, we can take $t\to\infty$ and interchange the limit and expectation to get to~\eqref{step14}.
Next, consider the following set of inequalities:
\begin{IEEEeqnarray}{rCl}
&&\hspace{-1cm}\mathbb{E}[T]D(P\|Q)\nonumber\\ &=& \mathbb{E}\left[D(P^T\|Q^T)\right]\\
&\geq & \sum_t P_T(t)\Bigg[P^t(\mathcal{A}^t)\log \frac{P^t(\mathcal{A}^t)}{Q^t(\mathcal{A}^t)}\nonumber\\
&&\hspace{1.3cm}+(1-P^t(\mathcal{A}^t))\log \frac{(1-P^t(\mathcal{A}^t))}{(1-Q^t(\mathcal{A}^t))}\Bigg]\nonumber\\\label{step15}\\
&=& \sum_t P_T(t)\Bigg[-H_{\text{b}}(P^t(\mathcal{A}^t))\nonumber\\&&\hspace{1.5cm}-P^t(\mathcal{A}^t)\log Q^t(\mathcal{A}^t)\nonumber\\&&\hspace{1.5cm}-(1-P^t(\mathcal{A}^t))\log (1-Q^t(\mathcal{A}^t))\Bigg]\nonumber\\\\
&\geq & -1-\mathbb{E}\left[P^T(\mathcal{A}^T)\log Q^T(\mathcal{A}^T)\right], \label{step16}
\end{IEEEeqnarray}
where~\eqref{step15} follows from the data processing inequality for KL-divergence; \eqref{step16} follows from upper bounding $H_{\text{b}}(P^t(\mathcal{A}^t))$ by $1$ and $(1-P^t(\mathcal{A}^t))\log (1-Q^t(\mathcal{A}^t))$ by $0$. Finally, rearranging terms in \eqref{step16} yields the desired inequality.
\section{Conclusion}
In this paper, we considered sequential testing over a single-sensor, a single-decision center setup which communicate over a zero-rate noiseless link. We established the optimal exponent of type-II error probability under a constrained type-I error probability and when the expected number of transmission times is smaller than $n$ which tends to infinity. Interestingly, this exponent coincides with that of fixed-length testing in \cite{ShalabyPapamarcou}.
\section{Acknowledgements}
The authors would like to thank Prof. Mich\`ele Wigger for her comments.
V.~Y.~F.~Tan is supported by a Singapore National Research Foundation (NRF) Fellowship under grant number R-263-000-D02-281.
\bibliographystyle{IEEEtran}
| {'timestamp': '2021-09-20T02:19:55', 'yymm': '2109', 'arxiv_id': '2109.08614', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08614'} | arxiv |
\section{Introduction}
\subfile{text_sections/introduction}
\section{Search Space and Search Method}
\label{sect:methods}
\subfile{text_sections/methods}
\section{Primer\xspace}
\label{sect:primer_model}
\subfile{text_sections/results}
\section{Conclusion}
\subfile{text_sections/conclusion}
\section*{Acknowledgements}
\subfile{text_sections/acknowledgements}
\bibliographystyle{unsrt}
\section{Results}
\label{sec:results}
In our experiments, we compare Primer\xspace against three Transformer variants:
\begin{itemize}[leftmargin=*]
\item \textit{Vanilla Transformer}: The original Transformer~\cite{Vaswani2017AttentionIA} with ReLU activations and layer normalization~\cite{Ba2016LayerN} outside of the residual path.
\item \textit{Transformer+GELU}: A commonly used variant of the vanilla Transformer that uses a GELU~\cite{Hendrycks2016BridgingNA} approximation activation function~\cite{devlin2018bert, brown2020language}.
\item \textit{Transformer++}: A Transformer with the following enhancements: RMS normalization~\cite{Zhang2019RootMS}, Swish activation~\cite{Ramachandran2018SearchingFA} and a GLU multiplicative branch~\cite{dauphin2017language} in the feed forward inverted bottleneck (SwiGLU)~\cite{shazeer2020glu}.
These modifications were benchmarked and shown to be effective in T5~\cite{narang2021}.
\end{itemize}
We conduct our comparisons across three different codebases: Tensor2Tensor (T2T)~\cite{tensor2tensor}, T5~\cite{2020t5}, and Lingvo~\cite{Shen2019LingvoAM}. Tensor2Tensor is the codebase we use for searching and so a majority of our side-by-sides are done in T5 and Lingvo to prove transferability. In all cases, we use the default Transformer hyperparameters for each codebase, with regularization disabled. See Appendix~\ref{sect:app_full_training_details} for more hyperparameter details.\looseness=-1
In the following sections, we will present our results in four main experiments on auto-regressive language modeling. First, we will show that Primer\xspace outperforms the baseline models on the search task. Next, we will show that the relationship between Primer\xspace's compute savings over Transformers and model quality follow a power law at optimal model sizes. These savings also transfer across datasets and codebases. Then, we will study Primer\xspace's gains in an established training regime and show that it enables 4.2X compute savings at a 500M parameter size using full compute T5 training. Finally, we will demonstrate that these gains transfer to the pretraining and one-shot downstream task setup established by GPT-3~\cite{brown2020language}.\looseness=-1
\subsection{Search Task Comparison}
\label{sect:search_task_comparison}
We first analyze Primer\xspace's performance on the search task: LM1B language modeling with sequence length 64, $\sim$35M model parameters, batches of 4096 tokens and 24 hours of training. We compare against the baseline models in both Tensor2Tensor (T2T)~\cite{tensor2tensor} and T5~\cite{2020t5} and on TPUv2s and V100 GPUs. We grade each model's performance according to how much faster it reaches the vanilla Transformer's final quality, which we will refer to as its \textit{speedup factor}. Figure~\ref{fig:search_task_bars} shows that Primer\xspace provides a speedup factor of 1.7X or more over Transformer in all cases. Figure~\ref{fig:search_task_bars} also shows that both Primer\xspace and Primer-EZ\xspace generalize to other hardware platforms and codebases.\looseness=-1
\begin{figure}[h!]
\centering
\begin{minipage}{0.32\linewidth}
\centering
\includegraphics[width=0.9\linewidth]{images/t2t_lm1b_tpu.pdf}
\end{minipage}
\begin{minipage}{0.32\linewidth}
\centering
\includegraphics[width=0.75\linewidth]{images/t2t_lm1b_v100_gpu.pdf}
\end{minipage}
\begin{minipage}{0.32\linewidth}
\centering
\includegraphics[width=0.75\linewidth]{images/t5_lm1b_tpu.pdf}
\end{minipage}
\caption{Comparison on the LM1B search task using 35M parameter models. ``Speedup Factor'' refers to the fraction of compute each model needs to reach quality parity with the vanilla Transformer trained for 24 hours. Primer\xspace and Primer-EZ\xspace both achieve over 1.7X speedup in all cases. Note that results transfer across codebases and different hardware.}
\label{fig:search_task_bars}
\end{figure}
\begin{figure}[h!]
\centering
\begin{minipage}{0.45\linewidth}
\centering
\includegraphics[width=0.7\linewidth]{images/power_law_solo.pdf}
\end{minipage}
\begin{minipage}{0.45\linewidth}
\centering
\includegraphics[width=0.7\linewidth]{images/power_law_comparison.pdf}
\end{minipage}
\caption{Left: When sweeping over optimal model sizes, the relationship between Transformer language model quality and training compute roughly obeys a power law~\cite{Kaplan2020ScalingLF}. Right: Comparison of these power law lines for varying Transformer modifications, fit with smoothed MSE loss. That the model lines are parallel to one another implies that compute savings by using superior modeling also scales as a power law with quality. Spacings between vertical dotted lines represent 2X differences in compute. Note that the x and y-axes in both plots are in $\log$.
}
\label{fig:power_law_comparison}
\end{figure}
\begin{wrapfigure}{R}{0.32\linewidth}
\centering
\includegraphics[width=0.97\linewidth]{images/pareto_optimal_inference.pdf}
\caption{Pareto optimal inference comparison on LM1B. Primer\xspace~demonstrates improved inference at a majority of target qualities. We observe these models have a 0.97 correlation between their train step and inference times.}
\label{fig:pareto_inference}
\end{wrapfigure}
Next we study the scaling laws of Primer\xspace. Here we compare Primer\xspace to our baselines over many sizes by training each model using every permutation of $L \in \{6, 9, 12\}$ layers, $d_{model}\in \{384, 512, 1024\}$ initial embedding size, and $p \in \{4, 8, 12\}$ feed forward upwards projection ratio, creating a parameter range from 23M to 385M. The results, shown in Figure~\ref{fig:power_law_comparison}, corroborate previous claims that, at optimal parameters sizes, the relationship between compute and language model quality roughly follows a power law~\cite{Kaplan2020ScalingLF}. That is, the relationship between validation loss, $l$, and training compute, $c$, follows the relationship $l=ac^{-k}$, for empirical constants $a$ and $k$. This is represented as a line in double log space (Figure~\ref{fig:power_law_comparison}): $\log l = -k\log c + \log a$. However, these lines are not the same for each architecture. The lines are roughly parallel but shifted up and down. In Appendix~\ref{sect:app_power_law_derivations} we show that, given a vertical spacing of $\log b^k$, parallel lines such as these indicate compute savings, $s$, for superior modeling also follow a power law of the form $l = a_1(1 - 1/b)^ks^{-k}$. The intuition behind this is that ${b}$ is a constant compute reduction factor for all $l$ and thus a power law investment of training compute with relation to $l$ results in a power law savings with relation to $l$ as well (see Appendix~\ref{sect:app_power_law_derivations}).
Primer\xspace also has the capacity to improve inference, despite our search focusing on training compute. Figure~\ref{fig:pareto_inference} shows a Pareto front comparison of quality vs. inference, when using feed forward pass timing as a proxy for inference. We use forward pass timing as a proxy for inference because there are multiple ways to decode a language model, each with varying compute costs. A more in depth study could be conducted analyzing Primer\xspace's inference performance across different decoding methods, serving platforms, datasets, etc., but that is beyond the scope of this work.
\subsection{Primer\xspace Transferability to Other Codebases, Datasets, and Model Types}
\label{sect:t5_medium_experiments}
We now study Primer\xspace's ability to transfer to larger datasets, PG19 and C4, in another codebase, T5. We additionally scale up to a higher compute regime that has been used as a proxy for large scale training by previous studies~\cite{narang2021, 2020t5}; the batches are increased to 65K tokens, the sequence lengths are a longer 512, each decoder is 110M parameters ($d_{model}=768$, $d_{ff}=3072$, $L=12$) and each model is trained to $\sim$525K steps on 4 TPUv3 chips. We also continue training each model to 1M steps to study the effect of larger compute budgets on Primer\xspace savings. The results, shown in Figure~\ref{fig:robustness}, indicate that the Primer\xspace models are as strong in larger data, higher compute regimes, as they are in the smaller LM1B regime. Compared to the vanilla baseline, Primer\xspace and Primer-EZ\xspace are at least 1.8X more efficient at the end of training on both PG19 and C4.\looseness=-1
\begin{figure}[h!]
\centering
\begin{minipage}{0.9\linewidth}
\centering
\includegraphics[width=0.85\linewidth]{images/t5_multi_speedup.pdf}
\end{minipage}
\caption{Comparison transferring Primer\xspace to larger datasets (C4 and PG19) and different model families (Switch Transformer and Synthesizer) in a different codebase (T5) with an order of magnitude more compute than the search task. Compared to the vanilla baseline, Primer\xspace and Primer-EZ\xspace are at least 1.8X more efficient at the end of training on both PG19 and C4. In all cases, the fraction of Primer\xspace compute savings increases as more compute is invested. Primer-EZ\xspace modifications also improve Switch Transformer (550M params) and Synthesizer (145M params), showing that it is compatible with other efficient methods. Compute budgets are selected according to how long it takes each baseline to train for 525K and 1M steps. See Appendix~\ref{sect:app_t5_medium_numbers} for exact numbers.}
\label{fig:robustness}
\end{figure}
Figure~\ref{fig:robustness} also shows that the Primer\xspace modifications are compatible with other efficient model families, such as large sparse mixture-of-experts like Switch Transformer~\cite{Fedus2021SwitchTS} and efficient Transformer approximations like Synthesizer~\cite{tay2020synthesizer}. For these experiments, we use the T5 implementations provided by Narang et al.~\cite{narang2021}. The Primer-EZ\xspace techniques of added depthwise convolutions and squared ReLUs reduce Switch Transformer's compute cost by a factor of 1.5X; this translates to a 0.6 perplexity improvement when controlling for compute (see Appendix~\ref{sect:app_t5_medium_numbers}). Adding squared ReLUs to Synthesizer reduces training costs by a factor of 2.0X and improves perplexity by 0.7 when fully trained.\looseness=-1
\subsection{Large Scale T5 Auto-Regressive Language Model Training}
\label{sect:t5_large_experiments}
\begin{wraptable}{R}{0.45\linewidth}
\begin{tabular}{@{}l|ccc@{}}
\toprule
Model & Steps & TPUv3 Hours & PPLX \\ \midrule
Original T5 & 1M & 15.7K & 13.25 \\
T5++ & 251K & 4.6K & 13.25 \\
Primer\xspace & 207K & \textbf{3.8K} & 13.25 \\ \midrule
T5++ & 1M & 16.5K & 12.69 \\
Primer\xspace & 480K & \textbf{8.3K} & 12.69 \\ \midrule
Primer\xspace & 1M & 17.3K & 12.35 \\ \midrule
\end{tabular}
\caption{Comparison in compute usage to reach target qualities on C4 LM at 537M parameters using the full T5 compute scale. Target qualities are selected according to the final performances of the baseline models. Primer\xspace achieves the same quality as the original T5 architecture using 4.2X less compute.
}
\label{tab:large_t5}
\end{wraptable}
In large scale compute configurations, the Primer\xspace compute savings ratios are even \textit{higher}. To demonstrate Primer\xspace's savings in an established high compute training setup, we scale up to the full T5 compute regime, copying Raffel et al. exactly~\cite{2020t5}. This is the same as the C4 configuration in the previous section, but uses batches of $\sim$1M tokens, 64 TPUv3 chips and 537M parameters ($d_{model}=1024$, $d_{ff}=8192$, $L=24$). Primer\xspace is 4.2X more compute efficient than the original T5 model and 2X more efficient than our strengthened Transformer++ baseline (Table~\ref{tab:large_t5}).\looseness=-1
The reason why savings are even better here is because, at fixed sizes, more compute invested yields higher Primer\xspace compute savings. Figure~\ref{fig:compute_savings_over_time} shows how the fraction of compute Primer\xspace needs to achieve parity with the original T5 architecture shrinks as the models are trained for longer; this is due to the asymptotic nature of both the control and variable perplexity training curves.
This differs from the power law savings described in Section~\ref{sect:app_lm1b_t2t}. There, we use the optimal number of parameters for each compute budget, and so the compute saving factor, $b$, remains constant. For fixed model sizes, the compute saving factor grows as more compute is invested, meaning that compute savings can exceed the power law estimation. Note, this means that comparisons such as the ones given here can be ``gamed'' by investing more compute than is necessary for baseline models. It is for this reason that we use an exact replica of Raffel et al.'s~\cite{2020t5} training regime: to demonstrate Primer's savings in an already published training configuration.
\begin{figure}[h!]
\centering
\includegraphics[width=0.7\linewidth]{images/t5_large_compute_savings.pdf}
\caption{Compute savings of Primer\xspace~ vs. the original T5 architecture on C4 LM over time. The more compute invested in training, the higher the savings due to the asymptotic nature of both perplexity curves. Primer\xspace achieves the same performance as the original T5 architecture with 4.2X less compute.}
\label{fig:compute_savings_over_time}
\end{figure}
\subsection{Primer\xspace Transferability to Downstream One-Shot Tasks}
\label{sect:one_shot}
In our final comparison, we demonstrate Primer's improvements also hold in the \textit{pretraining} and \textit{one-shot downstream} task transfer regime. Recent trends in language modeling have moved towards training large models on large datasets, which is referred to as ``pretraining.'' These models are then transferred to unseen datasets and tasks, and, without much or any additional training, demonstrate the capacity to perform well on those ``downstream'' tasks~\cite{devlin2018bert, Dai2015SemisupervisedSL}. In the decoder-only auto-regressive language modeling configuration we study here, the most impressive results have been achieved by GPT-3~\cite{brown2020language}, which showed that large language models can exhibit strong performance on unseen tasks given only one example -- referred to as ``one-shot'' learning. In this section, we demonstrate that Primer\xspace's training compute savings stretch beyond reaching a target pretraining perplexity and indeed transfer to downstream one-shot task performance.
To do this, we replicate the GPT-3 pretraining and one-shot evaluation setup.\footlabel{ft:proprietary}{The development of the training dataset and evaluation pipeline used in this section is its own standalone work. Full details of such work will soon be released in a separate technical report.} This replication is not exactly the same as the one used for GPT-3 because GPT-3 was not open sourced. Thus, these experiments are not meant to compare directly to GPT-3, as there are configuration differences. Instead, these experiments are used as a controlled comparison of the Transformer and Primer\xspace architectures. We conduct these experiments in the Lingvo codebase using a proprietary pretraining dataset. The downstream tasks are configured in the same one-shot way described by Brown et al.~\cite{brown2020language}, with single prefix examples fed into each model with each task's inputs. We compare (1) a baseline 1.9B parameter Transformer ($d_{model}=2048$, $d_{ff}=12288$, $L=24$) with GELU activations, meant to approximate the GPT-3 XL architecture, and (2) a full Primer\xspace without shared QK representations, which only hurt performance according to Appendix~\ref{sec:ablation_and_insertion}. Each model is trained using batches of $\sim$2M tokens using 512 TPUv4 chips for $\sim$140 hours ($\sim$71.8K total accelerator hours or $\sim$1M train steps). We once again use the T5 training hyperparemeters without any additional tuning.
\begin{figure}[h!]
\centering
\begin{minipage}{0.24\linewidth}
\includegraphics[width=0.98\linewidth]{images/one_shot_comparison.pdf}
\end{minipage}
\begin{minipage}{0.02\linewidth}
\includegraphics[width=0.98\linewidth]{images/white.pdf}
\end{minipage}
\begin{minipage}{0.72\linewidth}
\includegraphics[width=1.0\linewidth]{images/one_shot_aggregates.pdf}
\end{minipage}
\caption{Comparison between Transformer+GELU and Primer\xspace at 1.9B parameters and varying training compute budgets on downstream one-shot tasks, similar to GPT-3. Primer\xspace achieves slightly better performance than Transformer when given 3X less pretraining compute and substantially better performance when given the same pretraining compute. Here we stop at 72K TPUv4 hours to roughly match the quality of GPT-3 XL, but the compute savings of Primer\xspace would be larger if we let the two models run longer (see Figure~\ref{fig:compute_savings_over_time}). Note, this is a crude comparison that uses averaged scores from the 27 one-shot tasks we evaluate. See Appendix~\ref{sect:individual_one_shot} (Table~\ref{table:one_shot_scores} and Figure~\ref{fig:one_shot_bars}) for the exact scores on each individual task.}
\label{fig:one_shot_aggregates}
\end{figure}
Figure~\ref{fig:one_shot_aggregates} shows that Primer\xspace achieves the same pretraining perplexity and one-shot downstream performance as Transformer+GELU while using 3X less compute. Table~\ref{table:one_shot_scores} in the Appendix gives the exact performance numbers for each of the 27 evaluated downstream tasks. Primer\xspace, despite using 3X less compute, outperforms Transfomer+GELU on 5 tasks, does worse on 1 task, and performs equivalently on the remaining 21 tasks. The same table shows that when given equivalent compute, Primer\xspace outperforms Transformer+GELU on 15 tasks, does worse on 2 tasks, and performs equivalently on the remaining 10 tasks. This result shows that not only can Primer\xspace improve language modeling perplexity, but the improvements also transfer to downstream NLP tasks.
\paragraph{Primer\xspace's Return on Investment:} The compute savings in this large-scale experiment demonstrate the return on investment for the Primer\xspace search. The search for Primer itself cost $\sim$2.14E+21 FLOPs. Training Transformer for this experiment cost $\sim$2.96E+22 FLOPs, which means the compute saved by Primer\xspace to reach the same performance is $\sim$1.98E+22 FLOPs.
Thus, for this single training, the return on investment for the architecture search is roughly 9.24X. Note that the search cost is a one-time cost, and Primer can be reused in future trainings to save more compute. More details on energy cost and carbon emission estimates can be found in Appendix~\ref{sect:app_carbon_estimates}.
\subsection{TensorFlow Primitives Vocabulary}
\label{sect:app_tf_vocab}
\begin{table}[h!]
\begin{tabular}{@{}c|c|cccc@{}}
\multirow{2}{*}{Name} &
\multirow{2}{*}{TF Function} &
\multicolumn{4}{c}{\textit{Argument Mapping}}\\ \cmidrule(lr){3-6}
& & Input 1 & Input 2 & Constant & \begin{tabular}[c]{@{}c@{}}Dim\\ Size\end{tabular} \\ \midrule
ADD & tf.math.add & x & y & - & -\\
DIFFERENCE & tf.math.subtract & x & y & - & -\\
DIVIDE & tf.math.divide & x & y & - & -\\
MULTIPLY & tf.math.multiply & x & y & - & -\\
ABS ROOT & tf.math.sqrt(tf.abs(x)) & x & - & - & -\\
SQUARE & tf.math.square & x & - & - & -\\
EXP & tf.exp & x & - & - & -\\
LOG & tf.log(tf.abs(x)) & x & - & - & -\\
C MUL & tf.math.multiply & x & - & y & -\\
ABS & tf.abs & x & - & - & -\\
RECIP & tf.math.reciprocal\_no\_nan & x & - & - & -\\
SIGN & tf.sign & x & - & - & -\\
COS & tf.cos & x & - & - & -\\
SIN & tf.sin & x & - & - & -\\
TANH & tf.tanh & x & - & - & -\\
MAX & tf.math.maximum & x & - & y & -\\
MIN & tf.math.minimum & x & - & y & -\\
SCALE & x+tf.Variable() & x & - & - & -\\
SHIFT & x*tf.Variable() & x & - & - & -\\
SIGMOID & tf.sigmoid & x & - & - & -\\
MASK & tf.linalg.band\_part & input & - & - & -\\
CUM PROD & tf.math.cumprod & x & - & & -\\
CUM SUM & tf.math.cumsum & x & - & - & -\\
RED MEAN & tf.reduce\_mean & input\_tensor & - & - & -\\
RED SUM & tf.reduce\_sum & input\_tensor & - & - & -\\
RED MIN & tf.reduce\_min & input\_tensor & - & - & -\\
RED MAX & tf.reduce\_max & input\_tensor & - & - & -\\
RED PROD & tf.reduce\_prod & input\_tensor & - & - & -\\
MAT MUL & tf.matmul & a & b & - & -\\
T-MAT MUL & tf.matmul(transpose\_b=True) & a & b & - & -\\
CONV 1X1 & tf.layers.dense & inputs & - & - & units \\
CONV 3X1 & tf.nn.conv1d & input & - & - & filters\\
CONV 7X1 & tf.nn.conv1d & input & - & - & filters\\
CONV 15X1 & tf.nn.conv1d & input & - & - & filters\\
CONV 31X1 & tf.nn.conv1d & input & - & - & filters\\
DCONV 3X1 & tf.nn.depthwise\_conv2d & input & - & - & filters\\
DCONV 7X1 & tf.nn.depthwise\_conv2d & input & - & - & filters\\
DCONV 15X1 & tf.nn.depthwise\_conv2d & input & - & - & filters\\
DCONV 31X1 & tf.nn.depthwise\_conv2d & input & - & - & filters
\\\hline
\end{tabular}
\caption{\label{tab:tf-primitives-vocab}TensorFlow (TF) Primitives Vocabulary. ``Name'' is the name of the operation in our search space. ``TF Function'' is the TensorFlow function that the name is mapped to when a DNA instruction is being converted to a line of TensorFlow code. ``Argument Mapping'' describes how the values in a DNA's argument set are mapped to the corresponding TensorFlow function arguments. This vocabulary is largely constructed from the lowest level TF operations needed to create Transformers (see Appendix \ref{sect:app_search_model_subprograms}). We additionally extend those operations to include adjacent operations; for example, we extend \textsc{max} to also include \textsc{min}, extend \textsc{red sum} to include \textsc{red product}, and extend \textsc{conv 1x1} to include \textsc{conv 3x1}. We also add commonly used math primitives such as \textsc{sin} and \textsc{abs}.}
\end{table}
\subsection{Constructing TensorFlow Graphs}
\label{sect:app_tf_graphs}
TensorFlow graphs are built from DNA programs as described in Section~\ref{sect:methods} of the main text. Here we provide additional implementation details.
\paragraph{Relative Dimensions:} We use relative dimensions~\cite{so2019evolved} instead of absolute dimensions for each instruction's ``dimension size'' argument. This allows us to resize the models to fit within our parameter limits (32M to 38M parameters). The vocabulary for these relative dimensions is [1, 2, 4, 8, 12, 16, 24, 32, 48, 64]. This vocabulary was not tuned.
\paragraph{Values Bank:} For ``constant'' and ``dimension size'' argument fields, we create a shared bank of values that each instruction references. The constants bank holds 2 values and the dimension sizes bank holds 6 values; these numbers were not tuned. Instead of each instruction possessing their own individual values for these arguments, they instead hold an index to these shared banks. This allows multiple instructions to share the same value and to change simultaneously when that value is changed. For example, each of the individual attention multi-head projections for $Q$, $K$ and $V$ start off sharing the same output dimension size so that they all change simultaneously if that value changes. See~\ref{sect:app_evolution_details} for an example of how these bank values are mutated.
\paragraph{Causal Masking:} An important part of teacher-forced language model training is that positions cannot ``see'' the token they are trying to predict. Each position should only get information from previous positions, otherwise the model will be degenerate when the targets are not provided. To enforce this causal constraint we add additional overhead to operations that move information spatially to mask out any information from future positions. For example, when applying convolutions we follow the standard practice of shifting the inputs spatially by (\textsc{kernel width} $-$ 1) so that each position only receives information from previous positions.
\paragraph{Branching: } To enable multi-head capabilities for the Transformer search seed, we add a meta argument to our instructions called ``branching.'' This argument can take any value in [1, 2, 4, 8, 16] and determines how many times that instruction is executed in parallel, with the resulting tensors being concatenated together along their embedding axes. Branching can be used with any of the TensorFlow primitives as well as with any of a DNA's subprograms. This allows us to initialize the search with multi-head self-attention by branching \textsc{subprogram 1} (self-attention) 8 times (see Appendix \ref{sect:app_search_model_subprograms} for subprogram implementations). Primer\xspace does not utilize this branching capability in any meaningful way, beyond using the initialized multi-head attention.
\paragraph{Resolving Dimension Mismatches: } We do not constrain how tensor dimensions can be mutated and so programs may be invalid because they perform binary operations on tensors with incompatible sizes. For example, a program may describe adding together two tensors with differing embedding sizes. To resolve these dimension mismatch issues we deterministically pseudorandomly set one of the tensor dimensions to match the other.
\subsection{Halving Hurdles}
\label{sect:app_halving_hurdles}
We configure our hurdles~\cite{so2019evolved} such that the top 50\% of individuals passes each hurdle, according to fitness. We space the hurdles in such a way that the expected amount of compute devoted to training each hurdle band is roughly equal at the end of the search. That is, given that our maximum amount of training compute for an individual is 7 hours or 25,200 seconds (s), we construct hurdles at the 812.9s, 2438.7s, 5690.3s, and 12,193.5s marks. Thus, 1/5 of the compute budget is devoted to training every individual up to the first hurdle (812.9s), 1/5 of the compute budget is devoted to training the $\sim$50\% of individuals that are trained from the first to the second hurdle (2438.7s $-$ 812.9s = 1625.8s), 1/5 of the compute budget is devoted to training the $\sim$25\% of individuals that are trained from the second to the third hurdle (5690.3s $-$ 2438.7s = 3251.6s), etc. This configuration strategy, which we refer to as ``halving hurdles,'' requires setting only one hyperparameter, the number of hurdles, and removes the need to set hurdle threshold values and comparison steps, as has been previously done~\cite{so2019evolved, Real2020AutoMLZeroEM}. We choose four hurdles because five hurdles would require the first hurdle to be anchored at less than ten minutes of training, which we find empirically to be too noisy of a signal. Using hurdles in this way decreases the average train time per model to 4064s or about 1 hour and 8 minutes, reducing the compute cost by a factor of $\sim$6.2X.
This strategy is not unlike bandit algorithms such as Successive Halving\cite{pmlr-v28-karnin13} and Hyperband\cite{JMLR:v18:16-558}, however we do not use a static population of individuals created a priori, but integrate our halving with the changing evolutionary population.
\begin{figure}[h!]
\centering
\begin{minipage}{0.45\linewidth}
\raggedleft
\includegraphics[width=5cm]{images/main_hurdles.pdf}
\end{minipage}
\caption{Halving hurdles from our Primer\xspace search. Each dot represents the final fitness of an individual generated by evolution. Different ``bands'' form because each hurdle has a different training allowance. All bands see improvement over time, meaning that the median fitness improves for all compute allowances. This correlation between a model's performances at different training budgets allows us to reduce our total search cost by roughly a factor of 6.2X.}
\label{fig:hurdles}
\end{figure}
\subsection{Evolution Search Details}
We use Regularized Evolution~\cite{Real2019RegularizedEF} with a population size of 100 and a tournament selection size of 10. These values were not tuned. The mutations we use are as follows.
\label{sect:app_evolution_details}
\paragraph{Mutations:} To create new candidates in our search, we uniform randomly select a \textit{parent} from our search population and apply a single \textit{mutation} to it. We employ five different mutation types (selections and decisions are performed uniform randomly unless specified otherwise):
\begin{itemize}
\item \textit{Delete}: Remove an instruction from a subprogram.
\item \textit{Insert}: Create an instruction and insert it into a subprogram.
\item \textit{Delete and Insert}: Perform a delete mutation followed by an insert mutation~\cite{Helmuth2018ProgramSU}.
\item \textit{Mutate Field}: Select a field from an instruction and change its value.
\item \textit{Swap}: Swap the position of two instructions in a randomly selected subprogram. The input tensors for each instruction are also swapped so that the net effect is switching the positions of the instructions in the compute graph.
\item \textit{Mutate Bank Value}: Change the value of a relative tensor dimension or constant in the corresponding bank. The values for relative tensor dimensions are selected from their vocabulary (see Appendix~\ref{sect:app_tf_graphs}). The values for constants are changed according to\newline $c_{new} := c_{prev} \cdot 10^{X} + Y$ for previous value $c_{prev}$, new value $c_{new}$ and random variables $X, Y\sim N(0, 1)$.
\end{itemize}
After a mutation is applied, we run a light check to see if the resulting candidate's compute graph is exactly equivalent to the parent's compute graph. If it is, we perform another mutation.
\subsection{Transformer and Primer\xspace Program Comparisons}
\label{sect:app_search_model_subprograms}
Here we present the programs for both the Transformer seed and the discovered Primer\xspace model. Table~\ref{tab:primitives-graphing-symbols} is a key that maps operation names to graph symbols for subsequent graphs. Figures~\ref{fig:subprogram0_diff} to~\ref{fig:subprogram9_diff} depict the subprograms for each model with the Primer\xspace changes highlighted in orange. Figure~\ref{fig:primer_and_transformer_full} depicts the full compute graphs for each model, with all subprograms resolved to their constituent primitives. Figures~\ref{fig:transformer-program} and~\ref{fig:primer-program} depict the DNA programs for Transformer and Primer\xspace with all subprograms resolved and all instruction bank values plugged in.
\begin{table}[h!]
\begin{tabular}{@{}lc@{}}
\toprule
\multirow{2}{*}{Name} & \multirow{2}{*}{Graphing symbol} \\
& \\ \midrule
ADD & + \\
DIFFERENCE & $-$ \\
DIVIDE & $\div$ \\
MULTIPLY & $\times$ \\
ABS ROOT & $\sqrt{}$ \\
SQUARE & $x^2$ \\
EXP & $e^x$ \\
LOG & Log \\
C MUL & $\times C$ \\
ABS & $\mid x \mid$ \\
RECIP & Recip \\
SIGN & Sign \\
COS & Cos \\
SIN & Sin \\
TANH & Tanh \\
MAX & Max \\
MIN & Min \\
SCALE & Scale \\
SHIFT & Shift \\
SIGMOID & Sigm \\
MASK & Mask \\
CUM PROD & \begin{tabular}[c]{@{}c@{}}Cum Prod\end{tabular} \\
CUM SUM & \begin{tabular}[c]{@{}c@{}}Cum Sum\end{tabular} \\
RED MEAN & \begin{tabular}[c]{@{}c@{}}Reduce Mean\end{tabular} \\
RED SUM & \begin{tabular}[c]{@{}c@{}}Reduce Sum\end{tabular} \\
RED MIN & \begin{tabular}[c]{@{}c@{}}Reduce Min\end{tabular} \\
RED MAX & \begin{tabular}[c]{@{}c@{}}Reduce Max\end{tabular} \\
RED PROD & \begin{tabular}[c]{@{}c@{}}Reduce Prod\end{tabular} \\
MAT MUL & $M \times N$ \\
T-MAT MUL & $M \times N^T$ \\
CONV 1X1 & \begin{tabular}[c]{@{}c@{}}Conv 1x1\end{tabular} \\
CONV 3X1 & \begin{tabular}[c]{@{}c@{}}Conv 3x1\end{tabular} \\
CONV 7X1 & \begin{tabular}[c]{@{}c@{}}Conv 7x1\end{tabular} \\
CONV 15X1 & \begin{tabular}[c]{@{}c@{}}Conv 15x1\end{tabular} \\
CONV 31X1 & \begin{tabular}[c]{@{}c@{}}Conv 31x1\end{tabular} \\
DCONV 3X1 & \begin{tabular}[c]{@{}c@{}}D-wise 3x1\end{tabular} \\
DCONV 7X1 & \begin{tabular}[c]{@{}c@{}}D-wise 7x1\end{tabular} \\
DCONV 15X1 & \begin{tabular}[c]{@{}c@{}}D-wise 15x1\end{tabular} \\
DCONV 31X1 & \begin{tabular}[c]{@{}c@{}}D-wise 31x1\end{tabular} \\
\hline
\end{tabular}
\caption{\label{tab:primitives-graphing-symbols}Key for primitives mapped to corresponding symbols used in the following graphs.}
\end{table}
\begin{figure}[h!]
\centering
\includegraphics[height=13cm]{images/subprograms/sub0.pdf}
\caption{Main subprograms. Changes are highlighted in orange.}
\label{fig:subprogram0_diff}
\end{figure}
\begin{figure}[h!]
\centering
\includegraphics[height=11.48cm]{images/subprograms/sub1.pdf}
\caption{Attention subprograms. Changes are highlighted in orange.}
\label{fig:subprogram1_diff}
\end{figure}
\begin{figure}[h!]
\centering
\includegraphics[height=10.2cm]{images/subprograms/sub2.pdf}
\caption{Feed forward subprograms. Changes are highlighted in orange.}
\label{fig:subprogram2_diff}
\end{figure}
\begin{figure}[h!]
\centering
\includegraphics[height=7.4cm]{images/subprograms/sub3.pdf}
\caption{Multi-head projection subprograms. Changes are highlighted in orange.}
\label{fig:subprogram3_diff}
\end{figure}
\begin{figure}[h!]
\centering
\includegraphics[height=10.39cm]{images/subprograms/sub4.pdf}
\caption{Softmax subprograms. Changes are highlighted in orange.}
\label{fig:subprogram4_diff}
\end{figure}
\begin{figure}[h!]
\centering
\includegraphics[height=6cm]{images/subprograms/sub5.pdf}
\caption{Normalization subprograms. Changes to this subprogram are realized in downstream changes to S6.}
\label{fig:subprogram5_diff}
\end{figure}
\begin{figure}[h!]
\centering
\includegraphics[height=11.6cm]{images/subprograms/sub6.pdf}
\caption{Z-score normalization subprograms. Changes are highlighted in orange.}
\label{fig:subprogram6_diff}
\end{figure}
\begin{figure}[h!]
\centering
\includegraphics[height=6cm]{images/subprograms/sub7.pdf}
\caption{Scale-shift subprograms. No changes here.}
\label{fig:subprogram7_diff}
\end{figure}
\begin{figure}[h!]
\centering
\includegraphics[height=6cm]{images/subprograms/sub8.pdf}
\caption{Residual connection subprograms. This change is essentially a functional no-op.}
\label{fig:subprogram8_diff}
\end{figure}
\begin{figure}[h!]
\centering
\includegraphics[height=6cm]{images/subprograms/sub9.pdf}
\caption{Activation function subprograms. Changes are highlighted in orange.}
\label{fig:subprogram9_diff}
\end{figure}
\begin{figure}[h!]
\centering
\begin{minipage}{0.45\linewidth}
\raggedleft
\includegraphics[height=21cm]{images/transformer_full-crop.pdf}
\end{minipage}
\hspace{1.2cm}
\begin{minipage}{0.45\linewidth}
\raggedright
\includegraphics[height=21cm]{images/primer_full-crop.pdf}
\end{minipage}
\caption{Comparison of Transformer (Left) and Primer\xspace (Right) programs, with all subprograms resolved to their constituent primitives. Primer\xspace differences are highlighted in orange.}
\label{fig:primer_and_transformer_full}
\end{figure}
\begin{figure}[h!]
\begin{verbatim}
TRANSFORMER
(0) INPUT
(1) INPUT
(2) REDUCE_MEAN In0: 0 In1: 0 Dim: 128 C: 0.00
(3) DIFFERENCE In0: 0 In1: 2 Dim: 128 C: 0.00
(4) MULTIPLY In0: 3 In1: 3 Dim: 128 C: 0.00
(5) REDUCE_MEAN In0: 4 In1: 4 Dim: 128 C: 0.00
(6) ABS_SQUARE_ROOT In0: 5 In1: 5 Dim: 128 C: 0.00
(7) DIVIDE In0: 3 In1: 6 Dim: 128 C: 0.00
(8) SCALE In0: 7 In1: 7 Dim: 128 C: 0.00
(9) SHIFT In0: 8 In1: 8 Dim: 128 C: 0.00
(10) BRANCH_8_INPUT_1 In0: 9 In1: 9 Dim: 128 C: 0.00
(11) BRANCH_8_INPUT_2 In0: 9 In1: 9 Dim: 128 C: 0.00
(12) DENSE In0: 10 In1: 10 Dim: 64 C: 0.00
(13) DENSE In0: 10 In1: 10 Dim: 64 C: 0.00
(14) CONSTANT_MUL In0: 13 In1: 13 Dim: 128 C: 0.12
(15) DENSE In0: 10 In1: 10 Dim: 64 C: 0.00
(16) TRANSPOSE_MAT_MUL In0: 14 In1: 12 Dim: 128 C: 0.00
(17) EXP In0: 16 In1: 16 Dim: 128 C: 0.00
(18) EMBEDDING_MASK In0: 17 In1: 17 Dim: 128 C: 0.00
(19) REDUCE_SUM In0: 18 In1: 18 Dim: 128 C: 0.00
(20) DIVIDE In0: 18 In1: 19 Dim: 128 C: 0.00
(21) MAT_MUL In0: 20 In1: 15 Dim: 128 C: 0.00
(22) BRANCH_MERGE In0: 21 In1: 21 Dim: 512 C: 0.00
(23) DENSE In0: 22 In1: 22 Dim: 512 C: 0.00
(24) ADD In0: 0 In1: 23 Dim: 128 C: 0.00
(25) REDUCE_MEAN In0: 24 In1: 24 Dim: 128 C: 0.00
(26) DIFFERENCE In0: 24 In1: 25 Dim: 128 C: 0.00
(27) MULTIPLY In0: 26 In1: 26 Dim: 128 C: 0.00
(28) REDUCE_MEAN In0: 27 In1: 27 Dim: 128 C: 0.00
(29) ABS_SQUARE_ROOT In0: 28 In1: 28 Dim: 128 C: 0.00
(30) DIVIDE In0: 26 In1: 29 Dim: 128 C: 0.00
(31) SCALE In0: 30 In1: 30 Dim: 128 C: 0.00
(32) SHIFT In0: 31 In1: 31 Dim: 128 C: 0.00
(33) DENSE In0: 32 In1: 32 Dim: 2048 C: 0.00
(34) SHIFT In0: 33 In1: 33 Dim: 128 C: 0.00
(35) MAX In0: 34 In1: 34 Dim: 128 C: 0.00
(36) DENSE In0: 35 In1: 35 Dim: 512 C: 0.00
(37) SHIFT In0: 36 In1: 36 Dim: 128 C: 0.00
(38) ADD In0: 24 In1: 37 Dim: 128 C: 0.00
\end{verbatim}
\caption{List of instructions for Transformer program, with all subprograms resolved to their constituent primitives.}
\label{fig:transformer-program}
\end{figure}
\begin{figure}[h!]
\begin{verbatim}
PRIMER
(0) INPUT
(1) INPUT
(2) REDUCE_MEAN In0: 0 In1: 0 Dim: 768 C: -1.12
(3) DIFFERENCE In0: 0 In1: 2 Dim: 768 C: -1.12
(4) MULTIPLY In0: 3 In1: 0 Dim: 768 C: -1.12
(5) REDUCE_MEAN In0: 4 In1: 4 Dim: 768 C: -1.12
(6) ABS_SQUARE_ROOT In0: 5 In1: 5 Dim: 768 C: -1.12
(7) DIVIDE In0: 3 In1: 6 Dim: 768 C: -1.12
(8) SCALE In0: 7 In1: 7 Dim: 768 C: -1.12
(9) SHIFT In0: 8 In1: 8 Dim: 384 C: -0.57
(10) BRANCH_8_INPUT_1 In0: 9 In1: 9 Dim: 768 C: -1.12
(11) BRANCH_8_INPUT_2 In0: 9 In1: 9 Dim: 768 C: -1.12
(12) MAX In0: 10 In1: 10 Dim: 768 C: -0.57
(13) DENSE In0: 10 In1: 10 Dim: 48 C: -1.12
(14) DEPTHWISE_CONV_3X1 In0: 13 In1: 10 Dim: 384 C: -1.12
(15) CONSTANT_MUL In0: 14 In1: 14 Dim: 384 C: -1.12
(16) MAX In0: 11 In1: 11 Dim: 768 C: -0.57
(17) DENSE In0: 10 In1: 10 Dim: 48 C: -1.12
(18) DEPTHWISE_CONV_3X1 In0: 17 In1: 10 Dim: 384 C: -1.12
(19) CONSTANT_MUL In0: 18 In1: 18 Dim: 384 C: -1.12
(20) DENSE In0: 19 In1: 11 Dim: 48 C: -1.12
(21) MAX In0: 10 In1: 10 Dim: 768 C: -0.57
(22) DENSE In0: 10 In1: 10 Dim: 48 C: -1.12
(23) DEPTHWISE_CONV_3X1 In0: 22 In1: 10 Dim: 384 C: -1.12
(24) CONSTANT_MUL In0: 23 In1: 23 Dim: 384 C: -1.12
(25) TRANSPOSE_MAT_MUL In0: 20 In1: 19 Dim: 768 C: -1.12
(26) EXP In0: 25 In1: 25 Dim: 768 C: -1.12
(27) EMBEDDING_MASK In0: 26 In1: 26 Dim: 768 C: -1.12
(28) REDUCE_SUM In0: 27 In1: 27 Dim: 768 C: -1.12
(29) DIVIDE In0: 27 In1: 28 Dim: 768 C: -1.12
(30) TANH In0: 29 In1: 25 Dim: 384 C: -1.12
(31) SCALE In0: 30 In1: 19 Dim: 384 C: -1.12
(32) MAT_MUL In0: 31 In1: 24 Dim: 768 C: -1.12
(33) BRANCH_MERGE In0: 32 In1: 32 Dim: 384 C: -1.12
(34) DENSE In0: 33 In1: 33 Dim: 384 C: -1.12
(35) ADD In0: 0 In1: 34 Dim: 768 C: -1.12
(36) ADD In0: 35 In1: 34 Dim: 768 C: -1.12
(37) BRANCH_2_INPUT_1 In0: 36 In1: 36 Dim: 2304 C: -1.12
(38) BRANCH_2_INPUT_2 In0: 36 In1: 36 Dim: 2304 C: -1.12
(39) DENSE In0: 37 In1: 38 Dim: 2304 C: -1.12
(40) BRANCH_MERGE In0: 39 In1: 39 Dim: 4608 C: -1.12
(41) SHIFT In0: 40 In1: 40 Dim: 768 C: -1.12
(42) MAX In0: 41 In1: 41 Dim: 768 C: -0.57
(43) SQUARE In0: 42 In1: 41 Dim: 768 C: -1.12
(44) DENSE In0: 43 In1: 43 Dim: 384 C: -1.12
(45) REDUCE_MEAN In0: 44 In1: 44 Dim: 768 C: -1.12
(46) DIFFERENCE In0: 44 In1: 45 Dim: 768 C: -1.12
(47) MULTIPLY In0: 46 In1: 44 Dim: 768 C: -1.12
(48) REDUCE_MEAN In0: 47 In1: 47 Dim: 768 C: -1.12
(49) ABS_SQUARE_ROOT In0: 48 In1: 48 Dim: 768 C: -1.12
(50) DIVIDE In0: 46 In1: 49 Dim: 768 C: -1.12
(51) SCALE In0: 50 In1: 50 Dim: 768 C: -1.12
(52) SHIFT In0: 51 In1: 51 Dim: 384 C: -0.57
(53) ADD In0: 36 In1: 52 Dim: 768 C: -1.12
(54) ADD In0: 53 In1: 52 Dim: 768 C: -1.12
\end{verbatim}
\caption{List of instructions for Primer\xspace program, with all subprograms resolved to their constituent primitives.}
\label{fig:primer-program}
\end{figure}
\clearpage
\subsection{Exact LM1B Numbers}
\label{sect:app_lm1b_t2t}
\begin{table}[h!]
\caption{Comparison on the search task, auto-regressive language modeling on LM1B, across two different hardware platforms (TPUv2s and V100 GPUs) and two different libraries (Tensor2Tensor and T5), using those libraries' default hyperparameters. This table contains the precise numbers for Figure~\ref{fig:search_task_bars}. ``Speedup'' describes the fraction of compute used by each model to achieve the same results as the vanilla Transformer baseline trained with the full compute budget. Even though Primer\xspace was developed in Tensor2Tensor using TPUv2s, it shows strong performance on GPU and in T5. Perplexity is reported with respect to each library's default tokenization.}
\label{table:lm1b}
\begin{tabular}{@{}l|ccccc@{}}
\toprule
\multirow{2}{*}{\textbf{Model}} & \textbf{Params} & \textbf{Train Steps} & \textbf{Step/Sec} & \textbf{PPLX} & \textbf{Speedup} \\ \cmidrule(l){2-6}
& \multicolumn{5}{c|}{\textit{Tensor2Tensor, TPUv2}} \\ \midrule
Vanilla Transformer & 35M & 1.9M & 22.4 & 35.44 +/- 0.30 & - \\
Transformer+GELU & 35M & 1.9M & 22.4 & 35.00 +/- 0.12 & 1.23 +/- 0.07 \\
Transformer++ & 35M & 1.9M & 22.0 & 34.87 +/- 0.46 & 1.37 +/- 0.24 \\
Primer & 34M & 1.9M & 21.7 & 33.77 +/- 0.15 & 2.12 +/- 0.09 \\
Primer-EZ & 35M & 1.8M & 21.0 & \textbf{33.53 +/- 0.09} & \textbf{2.34 +/- 0.04} \\
\\
Transformer+MDHA & 35M & 1.8M & 21.0 & 34.26 +/- 0.12 & 1.76 +/- 0.06 \\
Transformer+Sep Conv & 35M & 1.8M & 21.0 & 34.34 +/- 0.10 & 1.54 +/- 0.05 \\\midrule
& \multicolumn{5}{c|}{\textit{Tensor2Tensor, V100}} \\ \midrule
Vanilla Transformer & 35M & 1.3M & 15.4 & 37.19 +/- 0.07 & - \\
Transformer+GELU & 35M & 1.2M & 14.1 & 37.11 +/- 0.02 & 1.05 +/- 0.02 \\
Transformer++ & 35M & 1.3M & 14.7 & 36.23 +/- 0.11 & 1.54 +/- 0.05 \\
Primer & 34M & 1.2M & 13.8 & \textbf{35.06 +/- 0.15} & \textbf{2.13 +/- 0.11} \\
Primer-EZ & 35M & 1.1M & 13.3 & 35.16 +/- 0.13 & 2.03 +/- 0.09 \\ \midrule & \multicolumn{5}{c|}{\textit{T5, TPUv2}} \\ \midrule
Vanilla Transformer & 35M & 2.1M & 23.9 & \multicolumn{1}{l}{23.30 +/- 0.02} & - \\
Transformer+GELU & 35M & 2.1M & 23.8 & 23.39 +/- 0.02 & 0.97 +/- 0.03 \\
Transformer++ & 35M & 2.1M & 24.2 & 23.04 +/- 0.02 & 1.33 +/- 0.05 \\
Evolved Transformer & 38M & 1.6M & 18.7 & 23.08 +/- 0.02 & 1.23 +/- 0.02 \\
Primer & 36M & 2.0M & 22.9 & 22.71 +/- 0.03 & 1.72 +/- 0.01 \\
Primer-EZ & 36M & 2.0M & 22.5 & \textbf{22.62 +/- 0.02} & \textbf{1.75 +/- 0.03} \\ \bottomrule
\end{tabular}
\end{table}
\subsection{Ablation and Insertion Studies}
\label{sec:ablation_and_insertion}
One of the core motivations of this work is to develop simple and robust Transformer modifications. To that end, we study the individual effectiveness of each Primer\xspace modification, described in Section~\ref{sect:primer_model} of the main text. We measure this effectiveness using insertion and ablation studies. In the insertion studies we add each modification in isolation to a vanilla Transformer. In the ablation studies we remove each modification from Primer\xspace one at a time. We are interested in how these modifications affect performance not just in our search library, Tensor2Tensor, but also in other libraries. Thus, we perform these insertion and ablation studies in a different library, T5, as a well, and use modification transferability as the key guiding metric for our modeling recommendations.\looseness=-1
\begin{figure}[h!]
\centering
\begin{minipage}{0.45\linewidth}
\centering
\includegraphics[width=0.8\linewidth]{images/insertion_study.pdf}
\end{minipage}
\begin{minipage}{0.45\linewidth}
\centering
\includegraphics[width=0.8\linewidth]{images/ablation_study.pdf}
\end{minipage}
\caption{Investigation into transferability of Primer\xspace modifications on LM1B at $\sim$35M parameters. In the ``Insertion Study'' we insert each of the modifications into a vanilla Transformer. In the ``Ablation Study,'' we remove each modification from Primer\xspace. ``Normalized PPLX Delta'' indicates the degree to which the treated models are affected by these modifications; values are normalized to be comparable across code bases and so that positive values indicate beneficial techniques in both studies. Likewise, negative values indicate harmful techniques in both studies.}
\label{fig:ablation_study}
\end{figure}
The results of these studies are shown in Figure~\ref{fig:ablation_study}. ``Normalized PPLX Delta'' describes the degree to which a modification helps or hurts performance. For baseline perplexity, $P_b$, and modification perplexity, $P_m$, ``Normalized PPLX Delta'' is defined as $\frac{P_b - P_m}{P_b}$ in the insertion study and $\frac{P_m - P_b}{P_b}$ for the ablation study. These definitions differ so that a positive value always indicates that the modification is good and a negative value always indicates that the modification is bad. Three techniques are beneficial in all scenarios. The first is ``12X proj,'' which increases the size of the Transformer feed forward upwards projection while controlling for parameters. We find this works well for smaller models but is not useful at larger sizes. The second two, MDHA and squared ReLUs, are the defining modifications of Primer-EZ\xspace, a simpler model that captures much of the gains of the full Primer\xspace.
\subsection{Full Training Details}
\label{sect:app_full_training_details}
In all experiments, we use previously published hyperparameter settings that were tuned for Transformer, with regularization disabled and no additional tuning for Primer\xspace. In Tensor2Tensor (T2T) these are the \textsc{transformer\_tpu} hyperparameters and in T5 and Lingvo these are the open-sourced parameters used in previous T5 studies~\cite{2020t5, narang2021}. They both specify an Adafactor optimizer~\cite{Shazeer2018AdafactorAL}, with 10K warmup steps at a learning rate of 0.01, followed by reciprocal square root learning rate decay. T2T uses positional embeddings and subword tokenization, while T5 and Lingvo use relative attention~\cite{Shaw2018SelfAttentionWR} and SentencePieces~\cite{Kudo2018SentencePieceAS}.
For LM1B, we use the T2T default settings of max sequence length of 64 and batches of 4096 tokens; this is appropriate because LM1B has an average sequence length of roughly 32. For C4 and PG19, we use the T5 default of a max sequence length of 512. For one-shot pretraining, we use a max sequence length of 1024. In Section~\ref{sect:t5_medium_experiments} we use batches of 65K tokens, in Section~\ref{sect:t5_large_experiments} we use batches of 1M tokens, and in Section~\ref{sect:one_shot} we uses batches of 2M tokens.
\subsection{Power Law Compute Savings Derivations}
\label{sect:app_power_law_derivations}
In Section~\ref{sect:search_task_comparison} of the main text, we reproduce the results of Kaplan et al.~\cite{Kaplan2020ScalingLF} and show that, at optimal parameter sizing, the relationship between language model quality and training compute follows a power law: $l = ac^{-k}$, where $l$ is validation loss, $c$ is training compute, and $a$ and $k$ are empirical constants. This is represented as a line in double log space (Figure~\ref{fig:power_law_comparison}): $\log l = -k\log c + \log a$. However, these lines are not the same for each architecture we compare. The lines are roughly parallel but shifted up and down. Thus, defining the shift between two architectures' lines as $\log b^{k}$, we can derive the relationship of their training costs as:
\begin{gather*}
-k\log c_{0} + \log a_{0} = -k\log c_{1} + \log a_{0} + \log b^{k} \\
-k\log c_{0} = -k\log c_{1} + \log b^{k} \\
c_{0}^{-k} = {b}^{k} c_{1} ^ {-k} \\
c_{0} = c_{1}/b \\
\end{gather*}
where $b$ is a consistent reduction factor regardless of $l$. Compute savings, $s$, for using a superior architecture can now be calculated as:
\begin{gather*}
s = c_{1} - c_{0} \\
s = c_{1} - c_{1}/b = c_{1} (1 - 1/b) \\
\text{or} \\
c_{1} = \frac{s}{1 - 1/b} \\
\end{gather*}
Plugging this into the original power law relationship for $c_{1}$ we get:
\begin{gather*}
l = a_1 \left( \frac{s}{1 - 1/b} \right)^{-k} \\
l = a_1(1 - 1/b)^ks^{-k} \\
\end{gather*}
Thus, the relationship between quality and compute savings yielded by an improved architecture also follows a power law with coefficient $a_1(1 - 1/b)^k$. This relationship is intuitive when recognizing that the compute reduction factor ${b}$ is consistent for all values of $l$ and thus a power law investment of training compute with relation to $l$ results in a power law savings with relation to $l$ as well.
\subsection{Exact T5 Numbers for Medium Sized Experiments}
\label{sect:app_t5_medium_numbers}
\begin{table}[h]
\caption{Language modeling comparison on larger datasets, transferring Primer\xspace to the T5 codebase. In this transferred regime, Primer\xspace improves upon all baselines. Furthermore, Primer-EZ\xspace not only reaches parity with Primer\xspace, but in some cases, surpasses it. Switch Transformer and Synthesizer also benefit from the Primer-EZ\xspace modifications. Compute budget comparison points are chosen according to how long it takes vanilla baselines to reach 525K and 1M training steps. Perplexities are given with respect to SentencePieces. This table has the precise numbers for Figure~\ref{fig:robustness}.}
\label{table:medium_t2t}
\begin{tabular}{@{}lc|ccc|ccc@{}}
& \multicolumn{1}{l|}{} & \multicolumn{3}{c|}{\textit{Baseline Compute @525K}} & \multicolumn{3}{c}{\textit{Baseline Compute @1M}} \\
& \multicolumn{1}{l|}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l|}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} \\
\multicolumn{1}{l|}{\multirow{2}{*}{Model}} & Params & Steps & PPLX & \multicolumn{1}{l|}{Speedup} & Steps & PPLX & \multicolumn{1}{l}{Speedup} \\ \cmidrule(l){2-8}
\multicolumn{1}{l|}{} & \multicolumn{7}{c|}{\textit{C4}} \\ \midrule
\multicolumn{1}{l|}{Vanilla Transformer} & 110M & 525K & 20.61 & - & 1M & 19.82 & - \\
\multicolumn{1}{l|}{Transformer+GELU} & 110M & 524K & 20.34 & 1.20 & 998K & 19.58 & 1.26 \\
\multicolumn{1}{l|}{Transformer++} & 110M & 524K & 20.03 & 1.52 & 998K & 19.28 & 1.64 \\
\multicolumn{1}{l|}{Evolved Transformer} & 110M & 351K & 20.79 & 0.89 & 668K & 19.84 & 0.98 \\
\multicolumn{1}{l|}{Primer} & 110M & 483K & \textbf{19.82} & 1.68 & 920K & \textbf{19.07} & \textbf{1.91} \\
\multicolumn{1}{l|}{Primer-EZ} & 110M & 471K & 19.83 & \textbf{1.71} & 896K & \textbf{19.07} & 1.90 \\ \midrule
\multicolumn{1}{l|}{Switch Transformer} & 550M & 525K & 17.16 & - & 1M & 16.32 & - \\
\multicolumn{1}{l|}{Switch Primer} & 550M & 474K & \textbf{16.56} & \textbf{1.45} & 900K & \textbf{15.82} & \textbf{1.56} \\ \midrule
\multicolumn{1}{l|}{Synthesizer} & 145M & 525K & 20.35 & - & 1M & 19.57 & - \\
\multicolumn{1}{l|}{\hspace{0.4cm}+ Squared ReLU} & 145M & 523K & \textbf{19.55} & \textbf{1.74} & 996K & \textbf{18.83} & \textbf{1.96} \\ \midrule
\multicolumn{1}{l|}{} & \multicolumn{7}{c|}{\textit{PG19}} \\ \midrule
\multicolumn{1}{l|}{Vanilla Transformer} & 110M & 525K & 16.39 & - & 1M & 15.83 & - \\
\multicolumn{1}{l|}{Transformer+GELU} & 110M & 524K & 16.35 & 1.01 & 998K & 15.84 & 0.95 \\
\multicolumn{1}{l|}{Transformer++} & 110M & 524K & 16.15 & 1.18 & 998K & 15.64 & 1.20 \\
\multicolumn{1}{l|}{Primer} & 110M & 483K & 15.96 & 1.68 & 920K & \textbf{15.31} & 1.81 \\
\multicolumn{1}{l|}{Primer-EZ} & 110M & 471K & \textbf{15.84} & \textbf{1.74} & 896K & 15.37 & \textbf{1.98} \\ \bottomrule
\end{tabular}
\end{table}
\subsection{Performance on Individual One-Shot Tasks}
\label{sect:individual_one_shot}
\begin{table}[H]
\begin{tabular}{@{}ccccccc@{}}
\textbf{Task} & \textbf{Metric} & \textbf{\begin{tabular}[c]{@{}c@{}}Transf.\\ 1/3\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}Transf.\\ Full\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}Primer\\ 1/3\end{tabular}} & \multicolumn{1}{c|}{\textbf{\begin{tabular}[c]{@{}c@{}}Primer\\ Full\end{tabular}}} & \textbf{\begin{tabular}[c]{@{}c@{}}GPT-3\\ XL\end{tabular}} \\ \midrule
Pretraining & pplx & 15.3 & 14.3 & 14.3 & \multicolumn{1}{c|}{13.5} & - \\
\multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l|}{} & \multicolumn{1}{l}{} \\ \midrule
\multicolumn{7}{c}{\textit{Question Answering Tasks}}\\ \midrule
TriviaQA & acc & \cellcolor[HTML]{C0C0C0}$22.5 \pm 0.4$ & $26.8 \pm 0.5$ & $27.5 \pm 0.4$ & \multicolumn{1}{c|}{$\mathbf{32.2 \pm 0.5}$} & 26.5 \\
WebQs & acc & $9.1 \pm 0.5$ & $9.6 \pm 0.4$ & $9.8 \pm 0.8$ & \multicolumn{1}{c|}{$10.4 \pm 0.3$} & 9.2 \\
NQs & acc & \cellcolor[HTML]{C0C0C0}$5.8 \pm 0.2$ & $6.7 \pm 0.2$ & $\mathbf{7.8 \pm 0.5}$ & \multicolumn{1}{c|}{$\mathbf{9.1 \pm 0.3}$} & 5.4 \\
\multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l|}{} & \multicolumn{1}{l}{} \\
SQuADv2 & f1 & \cellcolor[HTML]{C0C0C0}$54.2 \pm 2.4$ & $65.4 \pm 2.9$ & $64.2 \pm 3.7$ & \multicolumn{1}{c|}{$67.8 \pm 1.2$} & 54 \\
CoQa & f1 & \cellcolor[HTML]{C0C0C0}$52.5 \pm 1.1$ & $57.7 \pm 1.2$ & $59.1 \pm 0.9$ & \multicolumn{1}{c|}{$\mathbf{61.2 \pm 0.7}$} & 66.1 \\
DROP & f1 & \cellcolor[HTML]{C0C0C0}$21.5 \pm 0.4$ & $23.4 \pm 0.2$ & $\mathbf{24.8 \pm 0.5}$ & \multicolumn{1}{c|}{$\mathbf{26.5 \pm 0.2}$} & 23 \\
Quac & f1 & $30.1 \pm 0.5$ & $30.9 \pm 0.7$ & $28.9 \pm 0.9$ & \multicolumn{1}{c|}{$30.2 \pm 0.7$} & 32.3 \\
\multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l|}{} & \multicolumn{1}{l}{} \\
LAMBADA & acc & \cellcolor[HTML]{C0C0C0}$51.5 \pm 0.9$ & $55.2 \pm 1.3$ & $54.5 \pm 1.1$ & \multicolumn{1}{c|}{$56.8 \pm 0.9$} & 58.3 \\
\multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l|}{} & \multicolumn{1}{l}{} \\
QA Average & avg & 30.9 & 34.5 & 34.6 & \multicolumn{1}{c|}{36.8} & 34.3 \\
\midrule
\multicolumn{7}{c}{\textit{Multi-Choice Schema Tasks}}\\ \midrule
HellaSwag & acc & \cellcolor[HTML]{C0C0C0}$55.7 \pm 0.3$ & $59.5 \pm 0.2$ & $\mathbf{60.2 \pm 0.3}$ & \multicolumn{1}{c|}{$\mathbf{63.3 \pm 0.2}$} & 53.5 \\
StoryCloze & acc & $75.2 \pm 0.3$ & $75.9 \pm 0.4$ & $\mathbf{76.9 \pm 0.2}$ & \multicolumn{1}{c|}{$\mathbf{77.5 \pm 0.3}$} & 74.2 \\
\multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l|}{} & \multicolumn{1}{l}{} \\
Winogrande & acc & \cellcolor[HTML]{C0C0C0}$55.4 \pm 0.3$ & $58.4 \pm 0.4$ & $58.8 \pm 0.3$ & \multicolumn{1}{c|}{$\mathbf{60.4 \pm 0.2}$} & 59.1 \\
\multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l|}{} & \multicolumn{1}{l}{} \\
PIQA & acc & $72.6 \pm 0.5$ & $72.6 \pm 0.3$ & $73.7 \pm 0.5$ & \multicolumn{1}{c|}{$\mathbf{75.0 \pm 0.4}$} & 74.4 \\
ARC (Challenge) & acc & \cellcolor[HTML]{C0C0C0}$32.7 \pm 0.4$ & $34.4 \pm 0.3$ & $35.6 \pm 0.9$ & \multicolumn{1}{c|}{$\mathbf{37.4 \pm 0.4}$} & 36.4 \\
ARC (Easy) & acc & $64.5 \pm 0.5$ & $64.9 \pm 0.5$ & $65.6 \pm 0.6$ & \multicolumn{1}{c|}{$\mathbf{67.5 \pm 0.5}$} & 55.9 \\
OpenBookQA & acc & $45.3 \pm 0.9$ & $46.8 \pm 0.8$ & $47.9 \pm 0.4$ & \multicolumn{1}{c|}{$\mathbf{49.3 \pm 0.5}$} & 46.4 \\
\multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l|}{} & \multicolumn{1}{l}{} \\
ANLI R1 & acc & $33.9 \pm 1.2$ & $35.5 \pm 0.2$ & $35.5 \pm 0.4$ & \multicolumn{1}{c|}{\cellcolor[HTML]{C0C0C0}$34.8 \pm 0.3$} & 34.6 \\
ANLI R2 & acc & $33.5 \pm 0.7$ & $33.4 \pm 0.5$ & $34.5 \pm 0.6$ & \multicolumn{1}{c|}{$33.5 \pm 0.4$} & 32.7 \\
ANLI R3 & acc & $34.5 \pm 0.7$ & $35.2 \pm 0.1$ & \cellcolor[HTML]{C0C0C0}$33.0 \pm 0.3$ & \multicolumn{1}{c|}{\cellcolor[HTML]{C0C0C0}$33.8 \pm 0.5$} & 33.9 \\
\multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l|}{} & \multicolumn{1}{l}{} \\
ReCoRD & acc & \cellcolor[HTML]{C0C0C0}$84.8 \pm 0.1$ & $86.3 \pm 0.2$ & $85.8 \pm 0.3$ & \multicolumn{1}{c|}{$\mathbf{86.7 \pm 0.0}$} & 83 \\
WSC & acc & $67.4 \pm 0.8$ & $66.8 \pm 1.2$ & $69.3 \pm 1.3$ & \multicolumn{1}{c|}{$68.9 \pm 1.2$} & 62.5 \\
BoolQ & acc & \cellcolor[HTML]{C0C0C0}$58.9 \pm 1.1$ & $63.6 \pm 2.1$ & $60.7 \pm 0.8$ & \multicolumn{1}{c|}{$64.7 \pm 2.0$} & 63.7 \\
CB & acc & $56.3 \pm 2.5$ & $53.0 \pm 2.7$ & $55.4 \pm 3.3$ & \multicolumn{1}{c|}{$56.6 \pm 9.6$} & 48.2 \\
RTE & acc & \cellcolor[HTML]{C0C0C0}$48.4 \pm 1.2$ & $53.6 \pm 2.5$ & $54.3 \pm 1.5$ & \multicolumn{1}{c|}{$52.9 \pm 2.8$} & 49.5 \\
COPA & acc & \cellcolor[HTML]{C0C0C0}$80.2 \pm 3.2$ & $87.2 \pm 1.2$ & $84.8 \pm 1.5$ & \multicolumn{1}{c|}{$87.5 \pm 1.1$} & 74 \\
WiC & acc & $51.6 \pm 0.2$ & $51.0 \pm 0.5$ & $\mathbf{51.7 \pm 0.1}$ & \multicolumn{1}{c|}{$\mathbf{51.8 \pm 0.1}$} & 49.2 \\
\multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l|}{} & \multicolumn{1}{l}{} \\
RACE-h & acc & \cellcolor[HTML]{C0C0C0}$39.4 \pm 0.4$ & $40.8 \pm 0.4$ & $40.4 \pm 0.4$ & \multicolumn{1}{c|}{$\mathbf{43.7 \pm 0.3}$} & 42 \\
RACE-m & acc & \cellcolor[HTML]{C0C0C0}$50.0 \pm 1.0$ & $52.6 \pm 0.4$ & $51.8 \pm 0.8$ & \multicolumn{1}{c|}{$\mathbf{54.0 \pm 0.4}$} & 55.2 \\
\multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l|}{} & \multicolumn{1}{l}{} \\
Multi-Choice Average & avg & 53.1 & 54.7 & 55 & \multicolumn{1}{c|}{56.2} & 54.1 \\
\bottomrule
\end{tabular}
\caption{Comparison between Transformer+GELU and Primer\xspace at 1.9B parameters on downstream one-shot tasks at 1/3 and full pretraining compute budgets. One-shot sample means and standard deviations are computed using the evaluated performance of 5 weight checkpoints. \textbf{Bold numbers} denote improved one-shot performance and \hl{shaded numbers} denote worse one-shot performance compared to Transformer with full compute that is statistically significant under an independent t-test with p-value threshold 0.05. Primer\xspace achieves the same performance as Transformer when given 1/3 the training compute and stronger performance on a majority of tasks when given the same training compute. GPT-3 XL~\cite{brown2020language} scores are provided as a grounding reference point; they should not be closely compared to our results as the models have different pretraining configurations.}
\label{table:one_shot_scores}
\end{table}
\begin{figure}[H]
\centering
\includegraphics[width=0.9\linewidth]{images/one_shot_bars.pdf}
\caption{Comparison between Transformer+GELU and Primer\xspace at 1.9B parameters on downstream one-shot tasks at 1/3 and full pretraining compute budgets. 95\% confidence intervals are provided according to an independent t-test, using a sample of 5 pretraining weight checkpoints. Primer\xspace achieves roughly the same performance as Transformer when given 1/3 the pretraining compute and stronger performance on a majority of tasks when given the same pretraining compute. Exact numbers are presented in Table~\ref{table:one_shot_scores}.}
\label{fig:one_shot_bars}
\end{figure}
\subsection{Masked Language Modeling}
\label{sect:app_masked_language_modeling}
Encoder-decoder style masked language modeling (MLM) is not the focus of this work. However, because it was the focus of the original T5 project, we include MLM comparisons here for completeness (Table~\ref{}). Specifically, we use the exact comparison configuration used by Narang et al.\cite{narang2021}, who benchmarked several Transformer variants; the one difference is that we only run model training one time, since this regime is not the focus of our study. For ``Primer-EZ\xspace Decoder'' we use a Transformer++ encoder and a Primer-EZ\xspace decoder. Our treatments demonstrate that the Primer-EZ\xspace modifications have the capacity to improve encoder-decoder MLM models, but perhaps to a lesser degree, when compared to Transformer++. We believe this indicates that decoder-only LM and encoder-decoder MLM benefit from different modeling decisions -- something that could be studied in future works. We also believe that running our search on encoder-decoder MLM directly could yield modifications that are more beneficial for this task.
\begin{table}[H]
\begin{tabular}{@{}lccccc@{}}
\toprule
\textbf{Model} & \textbf{Params} & \textbf{Pretraining Log PPLX} & \textbf{SGLUE} & \textbf{XSum} & \textbf{WebQ} \\ \midrule
Vanilla Transformer* & 223M & 1.838 & 70.97 & 17.78 & 23.02 \\
Transformer+GeLU* & 223M & 1.838 & 73.67 & 17.86 & 25.13 \\
Transformer++ & 224M & 1.792 & 75.65 & \textbf{17.90} & \textbf{25.92} \\
Primer-EZ Decoder & 224M & \textbf{1.787} & \textbf{76.69} & 17.87 & 24.87 \\ \bottomrule
\end{tabular}
\caption{Masked language modeling comparison on C4 in T5 with encoder-decoder style models. These results are run in the exact same configuration as Narang et al.~\cite{narang2021}, although we only run our models once, as MLM is not the focus of our work. * indicates rows that are taken from that study.}
\label{}
\end{table}
\subsection{Carbon Emission Estimates}
\label{sect:app_carbon_estimates}
Following the recommendations of Patterson et al.~\cite{Patterson2021CarbonEA}, we release the carbon emission estimates for our largest experiments.
To estimate the carbon emissions\footlabel{ft:co2e_accounting_methodology}{Our CO\textsubscript{2}e accounting methodology for data center net carbon intensity does not currently fit the Greenhouse Gas (GHG) protocol for emissions reporting (Scope 2 and 3 for electricity). This deviation is due to a change in methodology where Google uses hourly life cycle emission factors, while the GHG Protocol generally relies on annual operating emission factor data. Google chooses to share these modified metrics as part of our 24/7 carbon-free energy (CFE) program, focused on our goal of achieving 100\% 24/7 local CFE by 2030. Google’s target for 2030 goes beyond the traditional Scope 2 rules to restrict both the location and the accounting period. This means that, instead of anywhere in a continent, the CFE purchase should be on the same geographically local grid; and instead of the accounting period being one year, the accounting should be within the same hour.}$^{,}$\footlabel{ft:co2e_strategies}{While electricity consumption is relatively straightforward, strategies to reduce greenhouse gas emissions are not. For details on the distinction between conventional carbon offsets, Google’s goal for 2030 of 24/7 CFE for its global data centers and campuses, and what it is doing now to set the groundwork for 2030, please see Appendix B of Patterson et al.~\cite{Patterson2021CarbonEA}.} for our architecture search, we build off of the measurements taken by Patterson et al. Their emissions estimate for architecture search is 3.2 MTCO\textsubscript{2}e for 1360 days of TPUv2 usage~\cite{Patterson2021CarbonEA}. Here, we use 1145.8 days of TPUv2 compute for our search. Additionally, the PUE for our data center\footlabel{ft:soco_grid}{Each data center is located within a Regional Grid, which is the geographic basis for Google’s 24/7 CFE goals. For our data center in Georgia, the Regional Grid is the Southern Company balancing authority.} at the time of our search was 1.08 instead of 1.10, and its net carbon intensity average was 0.336 MTCO\textsubscript{2}e/MWh instead of 0.431 MTCO\textsubscript{2}e/MWh.\footlabel{ft:co2e_intensity}{The net carbon intensity at a particular data center is based on accounting for hourly emission reductions via real time, local carbon-free energy purchases. This is calculated using the 24/7 carbon-free energy methodology, which can be reviewed in greater depth in ``24/7 Carbon-Free Energy: Methodologies and Metrics''~\cite{googlecarbon}.}$^{,}$\footlabel{ft:co2e_2020}{The carbon intensity values utilized in this paper are at the annual 2020 grid level for each data center in which the models were run.} Thus, the proportional emissions estimate for our architecture search experiments is 3.2 MTCO\textsubscript{2}e $* \frac{1145.8}{1360} * \frac{1.08}{1.10} * \frac{336}{431} =$ 2.06 MTCO\textsubscript{2}e. For comparison, a round trip plane ticket from San Francisco to New York for a single passenger is $\sim$1.2 MTCO\textsubscript{2}e~\cite{Patterson2021CarbonEA} and so our search costs roughly 1.72 such plane tickets.
We follow the same process of building off of the Patterson et al. measurements to estimate emissions for our large scale T5 experiments. The Patterson et al. emissions estimate for 11B parameter T5 is 46.7 tCO\textsubscript{2}e for 10,249 days of TPUv3 usage. Our T5 models are smaller, and so only require 687.5 TPUv3 days to train on average. We run 3 trainings (Primer\xspace, original T5 and T5++) to show Primer\xspace's improvements over baselines, yielding a total of 2062.5 TPUv3 days. When we ran our experiments, the data center\footlabel{ft:tpe_grid}{For our data center in Taipei, for purposes of Google's 24/7 CFE accounting, the Regional Grid is Taiwan.} PUE was 1.10 instead of 1.12 and its net carbon intensity average was 0.540 MTCO\textsubscript{2}e/MWh instead of 0.545 MTCO\textsubscript{2}e/MWh. Thus, the proportional total estimate for these T5 model trainings is 46.7 MTCO\textsubscript{2}e $* \frac{2062.5}{10,249} * \frac{1.10}{1.12} * \frac{540}{545} =$ 8.54 MTCO\textsubscript{2}e.
To estimate the emissions of our one-shot pretrainings in Lingvo, we measure system average power in the same manner as Patterson et al.~\cite{Patterson2021CarbonEA}. Including memory, network interface, fans, and host CPU, the average power per TPUv4 chip is 343W. We use the same equation as Patterson et al. to calculate CO\textsubscript{2}e for our 2 large scale pretrainings: 2 $*$ 343W $*$ 71,800h $*$ 1.08(PUE) $*$ 0.055 MTCO\textsubscript{2}e/MWh $=$ 29.26 MTCO\textsubscript{2}e.\footlabel{ft:spp_grid}{For our data center in Oklahoma, for purposes of Google's 24/7 CFE accounting, the Regional Grid is the Southwest Power Pool (SPP) Independent System Operator.}
The emission cost for our large scale T5 and one-shot comparisons are higher than the cost of the architecture search itself. We invest in these large scale comparisons to demonstrate the potential savings of our efficient modifications. For instance, the savings for using Primer\xspace over Transformer described in Section~\ref{sect:one_shot} of the main text equates to 9.75 MTCO\textsubscript{2}e, which alone is $\sim$4.7X the cost of the architecture search. Note, differences in hardware setups affect these savings. For example, the one-shot models were trained in Oklahoma, which has favorable MTCO\textsubscript{2}e/MWh when compared to Georgia, where the Primer\xspace search was conducted. Viewing compute in terms of FLOPs, to remove these hardware-specific factors, Primer\xspace's savings in the one-shot experiments are 9.24X the cost of the search itself, as described in Section~\ref{sect:one_shot} of the main text. Thus, the architecture search yields returns on investment, even at our relatively small comparison sizes, which are roughly 100X smaller than the full scale GPT-3~\cite{brown2020language}.
\subsection{Comparison to Evolved Transformer}
\label{sect:app_evolved_transformer}
\begin{table}[h]
\begin{tabular}{@{}l|cc|cc@{}}
& \multicolumn{2}{c|}{\multirow{2}{*}{\textit{LM1B}}} & \multicolumn{2}{c}{\multirow{2}{*}{\textit{C4}}} \\
\multicolumn{1}{c|}{\multirow{2}{*}{Model}} & \multicolumn{2}{c|}{} & \multicolumn{2}{c}{} \\ \cmidrule(l){2-5}
\multicolumn{1}{c|}{} & Params & PPLX @ 1.5M Steps & Params & PPLX @ 1M Steps \\ \midrule
Vanilla Transformer & 35M & 23.45 & 110M & 19.82 \\
Transformer+GELU & 35M & 23.68 & 110M & 19.58 \\
Transformer++ & 35M & 23.35 & 110M & 19.29 \\
Evolved Transformer & 38M & 23.11 & 110M & 19.37 \\
Primer & 36M & 22.97 & 110M & 18.99 \\
Primer-EZ & 36M & \textbf{22.89} & 110M & \textbf{18.93} \\ \bottomrule
\end{tabular}
\caption{Auto-regressive language modeling comparison between Primer\xspace and various baselines, including the Evolved Transformer, controlling for training steps in T5. These are the same experiments featured in Tables~\ref{table:lm1b} and~\ref{table:medium_t2t}, but with the data presented to compare sample efficiency instead of training compute efficiency.}
\label{table:sample_efficiency}
\end{table}
This work builds off of the Evolved Transformer~\cite{so2019evolved}, which also sought to discover improved sequence models using architecture search. Compute efficiency comparisons to the Evolved Transformer architecture are provided in T5 on LM1B in Table~\ref{table:lm1b} and on C4 in Table~\ref{table:medium_t2t}. Sample efficiency comparisons to the Evolved Transformer architecture are offered in Table~\ref{table:sample_efficiency} on those same experiments. In this section we discuss these comparisons and how they highlight the improvements of our Primer\xspace search over the Evolved Transformer search.
Firstly, our Primer\xspace search aims to improve training compute efficiency, which yields more practical results than the sample efficiency objective of So et al.~\cite{so2019evolved}, who controlled for number of train steps when evaluating models. Evolved Transformer is effective in this controlled-train-step regime when comparing to other baselines, as shown in Table~\ref{table:sample_efficiency}. When controlling for number of training steps in this way, Evolved Transformer is roughly on par with Transformer++ on C4 and is better than Transformer++ on LM1B. However, Evolved Transformer is substantially slower than all other models (see Tables~\ref{table:lm1b} and~\ref{table:medium_t2t}) because it is deeper; we follow the same scaling policy as So et al. of adding additional layers to control for parameters, given that an Evolved Transformer layer has significantly less parameters than a standard Transformer layer. Evolved Transformer’s slowness counteracts its sample efficiency and for this reason its speedup factor is diminished on LM1B and less than 1.0 (indicating a slowdown over vanilla Transformer) on C4 (see Tables~\ref{table:lm1b} and~\ref{table:medium_t2t}). This limits Evolved Transformer's practicality. In contrast, Primer\xspace is designed to specifically address this shortcoming and thus delivers the practical result of substantial compute savings.
The open-ended nature of the Primer\xspace search also allows for effective modifications that were not available to the Evolved Transformer search. In fact, \textit{none} of the Primer\xspace modifications (see Section~\ref{sect:primer_model}) can be represented in the Evolved Transformer search space, aside from resizing hidden dimension sizes. This is because the Evolved Transformer search space followed a rigid ordering of components and used a vocabulary of unalterable high level building blocks. For example, normalization always preceded weighted transformations and, although there were different weighted transformations to choose from such as self-attention and GLU, those transformations could not be modified by the search. In contrast, the Primer search space allows for the modification of all initialized modules -- such as weighted transformations, activation functions and normalization functions -- as well as allows for macro-level reordering, such as moving normalization after weighted transformations. We believe that this difference in openness is what allowed Primer to develop definitively superior modifications, as demonstrated not only by improved compute efficiency, but also by improved sample efficiency (Table~\ref{table:sample_efficiency}), which is what Evolved Transformer was meant to optimize.
| {'timestamp': '2021-09-20T02:22:04', 'yymm': '2109', 'arxiv_id': '2109.08668', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08668'} | arxiv |
\section{Failure is at the Origin of Computer Science}
At the beginning of the twentieth century and through the end of the Second World War, computers were human, not electronic. The work of a computer consisted in solving tedious arithmetical operations with paper and pencil. This was looked upon as work of an inferior order.
At an international mathematics conference in 1928, David Hilbert and Wilhelm Ackermann suggested the possibility that a mechanical process could be devised that would be capable of proving all mathematical assertions without need of human intervention, given the tedious and almost mundane nature of such a step-by-step undertaking without much human creativity involved.
This proposition is referred to as \textit{Entscheidungsproblem} in German, or `the decision problem' in English. If a human computer did no more than execute a mechanical process, it was not difficult to imagine that arithmetic would be amenable to a similar sort of mechanisation. The origin of Entscheidungsproblem dates back to Gottfried Leibniz, who having (around 1672) succeeded in building a machine based on the ideas of Blaise Pascal that was capable of performing arithmetical operations (named Staffelwalze or the Step Reckoner), imagined a machine of the same kind that would be capable of manipulating symbols to determine the truth value of mathematical principles. To this end
Leibniz devoted himself to conceiving a formal universal language, which he designated characteristica universalis, a language that would encompass, among other things, binary language and the definition of binary arithmetic.
In 1931, Kurt G\"odel~\cite{godel} concluded that Hilbert's intention (also referred to as `Hilbert's programme') of proving all theorems by mechanising mathematics was impossibe to realise -except in the case of trivial, constrained versions of mathematical frameworks since the body of
mathematics needed to contain basic axioms such as those in arithmetic or set theory. G\"odel advanced formulas that codified arithmetical truths in arithmetical terms that could not be proved without arriving at a contradiction. Even worse, his formulas
implied that there was no set of axioms that contained arithmetic free of unprovable true formulae,
and that any extension to axioms
would only lead to the same inconclusive statements in the theory.
In 1944, Emil Post, another key figure in the development of the concepts of
computation and computability (focusing especially on the limits of computation) found~\cite{post} that this problem was intimately related to one of the twenty-three problems (the tenth) that Hilbert, speaking at the Sorbonne in Paris, had declared the most important challenges for twentieth century mathematics.
Usually, Hilbert's programme is considered a failure, but not only it saved human creativity from full mechanisation but led to computation as a science by own virtue, perhaps even more than others that can be translated to finite or purely mechanistic procedures. Even though G\"odel debunked~\cite{godel} the notion that what was true could be proved, presenting a negative solution to the `decision problem' (Hilbert's tenth problem), followed by negative results based on G\"odel's~\cite{davis,robinson,matiyasevich}.
\subsection{All for one machine, and one machine for all}
Not long after G\"odel, Alan M. Turing made his appearance. Turing contemplated the problem of decision in much cruder terms. If the act of performing arithmetical operations is mechanical, why not substitute a mechanical device for the human computer? Turing's work represented the first abstract description of the digital general-purpose computer as we know it today. Turing defined what in his article he termed an `a' computer (for `automatic'), now known as a Turing machine.
A Turing machine is an abstract device which reads or writes symbols on a tape one at a time, and can change its operation according to what it reads, and move forwards or backwards through the tape. The machine stops when it reaches a certain configuration (a combination of what it reads and its internal state). It is said that a Turing machine produces an output if the Turing machine halts, while the locations on the tape the machine has visited represent the output produced.
The most remarkable idea advanced by Turing is his demonstration that there is an `a' machine that is able to read other `a' machines and behave as they would for an input s. In other words, Turing proved that it was not necessary to build a new machine for each different task; a single machine that could be reprogrammed sufficed. This erases the distinction between program and data, as well as between software and hardware, as one can always codify data as a program to be executed by another Turing machine and vice versa, just as one can always build a \textit{universal machine} to execute any program and vice versa.
Turing also proved that there are Turing machines that never halt, and if a Turing machine is to be \textit{universal}, and hence able to simulate any other Turing machine or computer program, it is actually imperative that it never halt
for an infinite number of inputs of a certain type (while halting for an infinite number of inputs of some other type). Indeed this is what Turing would have been led to expect, given G\"odel's results and what he wanted to demonstrate: that Hilbert's mechanisation of mathematics was impossible. This result is known as the undecidability of the halting problem.
In his seminal article Turing defined not only the basis of what we today know as digital general-purpose computers, but also software, programming and subroutines. And thus without a doubt it represents the best answer to date that we have to the question `What is an algorithm?'
In fact in Alan Turing's work on his universal machine, he even introduced the concept of a subroutine that helped him in his machine construction. These notions are today the cornerstone of the field that Turing, more than anyone else, helped establish, viz. Computer Science.
\section{A Slice of the Uncomputable Universe}
Once we approach the problem of defining what an algorithm is and arrive at the
concept of \textit{universality} that Turing advanced, the question to be considered in greater detail concerns the nature of algorithms. Given that one now has a working definition of the algorithm, one can begin to think about classifying problems, algorithms and computer programs by, for example, the time they take or the storage memory they may require to be executed. One may assume that the time required for an algorithm to run would depend on the type of machine, given that running a computer program on a Pentium PC is very different from executing it on a state-of-the-art super computer. This is why the concept of the Turing machine
is so important---because any answers to questions about problems and algorithmic resources will only make sense if the computing device is always the same. And that device is none other than the universal Turing machine. So for example, every step that a Turing machine performs while reading its tape is counted as a time step.
Many algorithms can arrive at the same conclusion by different paths, but some may be faster than others. This is now a matter that's carefully considered when fixing the framework for Turing's model of computation: one asks whether there is an algorithm that surpasses all others in economy as regards the resources required, when using exactly the same computing
device. These are the questions that opened up an entire new field in the wake of Turing's work, the development of which Turing would certainly have been delighted to witness. This field is today referred to as the theory of Computational Complexity, which would not have been possible without a concept such as that of the universal Turing machine. The theory of Computational Complexity focuses on classifying problems and algorithms according to the time they take to compute when larger inputs are considered, and on how size of input and execution time are related to each other. This is all connected to two basic resources needed in
any computation: space (storage) and time. For example, one obvious observation relating to this theory is that no algorithm will need more space than time to perform a computation. One
can then quickly proceed to ask more difficult but also more interesting questions, such as whether a machine can execute a program faster if it is allowed to behave probabilistically instead of deterministically. What happens if one adds more than one tape to a universal Turing machine operation? Would that amount to implementing an algorithm to solve a problem much faster? Or one may even ask whether there is always an efficient alternative to every inefficient algorithm, a question that may lead us to a fascinating topic connecting computers and physics.
\begin{figure}[ht]
\centering
\includegraphics[width=11cm]{uncomputableart.png}
\caption{\label{uncomputableart1} Visualising the Computational Universe: Runtime Space in a Peano Curve''~\cite{zenilruntimes} by this author. 1st. prize in the Computational Imagery category of the ``2011 Kroto Institute Scientific Image Competition'' held in the UK.}
\end{figure}
A full technical explanation of figure ~\ref{uncomputableart2} is provided in~\cite{zenilruntimes}. My results were later used to validate and produce some other results, such as XXX these papers (that have cited mine! including Calude's!).
Each pixel represents a computer program with empty input running on an abstract computer (a Turing machine). The colour indicates the runtime of the program upon completion of its computation. The darker a pixel the longer the program took to produce its output. White pixels are computer programs that do not produce any output because they never halt (just as happens when your computer stalls forever, sometimes prompting you to reboot).
Red pixels are the computer programs that take the longest time relative to other programs of the same size before finishing (they are also called Busy Beavers). I call this colour type coding the computability spectrum. Programs were sorted by size from smallest to largest (in terms of number of instructions) in such a way that one could be certain that any program would eventually be reached (including versions of MS Windows and Angry Birds that can be encoded as one-run computer programs).
Because there is no upper limit to the size of programs, the space of all computer programs is infinite but discrete, perhaps mirroring our own world. Because an enumeration of computer programs is linear (you start with program 1, then proceed to program 2, and so on), pixels depicted in this 2-dimensional figure are distributed along a ``space-filling'' Peano curve. This is a curve that guarantees that 2 contiguous elements in the enumeration remain as close as possible to each other in the 2D configuration.
The picture has the striking particularity that it is ultimately uncomputable. Imagine you point a telescope and take a picture of an object in the computational universe for which some pixel values cannot be determined, not only in practice but in principle-- that is, no matter how good your camera, or how many 'terapixels' some future version of it may have. This slide of the computational universe was only possible because it is a tiny region of small computer programs for which all pixels can be determined by zooming in deep enough.
However, G\"odel and Turing proved that if you zoomed out to a larger view of the computational universe, the picture would begin to look completely blurry because pixel colours would not be determinable. In other words this picture is the inverse equivalent of Hubble's Deep Field space--the larger the space field, the blurrier.
Just as our access to the visible universe is determined by the speed of light, due to similar limitations we can only see a small part of the computational universe, limitations both physical and computational (it seems we cannot build more powerful computers than the ones we already have to overcome these limitations). Hence, most of the computational space will remain unknowable, not only due to a limitation of resources but due to a fundamental barrier originating
in the digital world and extending into our own reality.
Only incremental improvements to this picture are possible. While the picture is ultimately uncomputable and unattainable, one can make an informed guess as to what it would look like if we zoomed out. Theory predicts the average colour of the picture at a greater scale, the theory in question being the theory of algorithmic probability, closely related to what is known as the Chaitin $\Omega$ number, or the halting probability. It turns out that the picture will be mostly white, as in an ever-expanding universe finding computer programs that halt and produce something will be increasingly harder. Indeed, most programs will never halt, and those that do will do so relatively quickly in proportion to their size.
\begin{figure}[ht]
\centering
\includegraphics[width=11cm]{uncomputableart2.png}
\caption{\label{uncomputableart2} Runtime deep field of a segment of runtimes from 7\,529\,536 Turing machines
in (3,2). The (3, 2) Busy Beavers are barely visible as isolated red points (online and colour printed versions only).}
\end{figure}
\section{How to Navigate in Software Space}
In his seminal book~\cite{wolfram}, Wolfram introduced the concept of the software space int he context of mining it to find explanations of the physical world. The software space is, however, infinite, unreachable and full of landmines, because of uncomputability and irreducibility~\cite{empirical}, and any attempt to traverse it will hugely depend on the enumeration chosen leading to biases in its exploration some of which, for example, can be seen in figures~\ref{uncomputableart1}, and ~\ref{uncomputableart2} where some regions share more levels of grey compared to others.
First, it is important to recognise that a positive result of Turing universality is that there is only, and one only, software space, but many ways to generate it and navigate it. Indeed, to generate software space is to navigate it and the other way around and it all depends on the computing model and the enumeration of the computer programs that populate the universe, that is the order in which they are generated and navigated. Because of Turing universality, we know that no matter how we generate or navigate the space, the same programs will be found in any simulated space, and each space is just a different representation or simulation of another one and the same. However, this does not mean that one can generate and explore programs of interest at the same rate. In some models, this can be slower than others by a simple enumeration reshuffling. Functional programming languages, for example, will tend to generate recursive functions, the type of functions that have some preference in mathematics and produce regular algorithmic or statistical patterns, more often and quicker than say, an enumeration based on rule-states (like Turing machines) where, for example, states that are not used, or rules from the product of machine symbols and states, will dominate certain local regions which if were not interesting will remain non-interesting and the other way around.
So, how to navigate the space to find anything interesting in the sense of matching data and model to solve inverse problems? And why would we wish to navigate the space in the first place? Along the lines of Wolfram~\cite{wolfram}, software space is an opportunity because computer programs in software space have the opportunity to represent an explanation of computable phenomena. This is not necessarily something completely new, in fact, all human scientific exploration so far has been based on the idea of finding computable explanations that we write down in the form of computable formulae or in computable simulations running on Turing-equivalent computers. What is new and introduced by Wolfram is its systematic exploration as an opportunity, and the discovery of its richness given that, under some strong but reasonable assumptions, such as the (physical version of the) Church-Turing thesis, one can expect to find many models~\cite{smalldata}, if not all, to any piece of empirical data. So, actually finding these small models offers an opportunity to look for discrete models of real-world phenomena to solve inverse problems. What had not been attempted and framed were strategies to navigate in such space to reduce the exploration, quantify, and reuse the findings in a clever way, given the (infinite) computational resources needed to computably approximate the uncomputable.
In~\cite{mutations}, for example, we have found, an exploration that explains some aspects of biological evolution, including modularisation (e.g. genes), production of high-level structure, and pathways of mutation (e.g.leading to cancer). Other applications of ours have ranged from thermodynamics~\cite{thermo}, to finance~\cite{finance}, cognitive sciences~\cite{ploscompbio}, molecular biology~\cite{nar}, and agriculture~\cite{gaucherel}; but a long list of uses from independent groups has also been recorded, ranging from psychometrics to chemistry, and cancer research.
\subsection{The beautiful theory of Algorithmic Probability}
Algorithmic probability tells us that most programs will produce an output following exponential decay ($- \log_2$ $Pr(s)$). Hence most of them will produce the same strings and a very few will produce algorithmically random digital sequences. In other words, among the computer programs that do produce an output, most will be highly ordered, as if they were creating a structured digital universe of highly ordered patterns out of nothing (just like ours). Some of these programs that produce the same output may do so faster than others, but precisely how much faster a program can be is another open foundational question, and one of the greatest challenges in mathematics and computer science. If it were possible to find a program considerably faster than any other, then everything could be computed in `reasonable' time, regardless of the apparent difficulty of the computation.
In a later follow-up piece~\cite{naturalcomputing}, a connection between Turing machines and Turing patterns is made, explaining how symmetry-breaking creates structure---as opposed to randomness---out of nothing, with only computability being assumed.
At the centre of my ideas for guiding searches of interesting regions and programs as models in the computational universe, in this deep field view of the software space, are some methods I have introduced based on or inspired by the seminal concept of Algorithmic Probability, itself introduced by Solomonoff~\cite{solomonoff} and Levin~\cite{levin} and having affinities with Chaitin's $\Omega$ number or halting probability~\cite{chaitin}. This concept of algorithmic probability is formally defined as follows,
$$AP(s) = \sum_{p:U(p) = s} 1/2^{|p|} $$
That is, the sum over all the programs $p$ for which a universal Turing machine $U$ outputs $s$ and halts.
The notion behind $AP$ is very intuitive. If one wished to produce the digits of $\pi$ randomly, one would have to try time after time until one managed to hit upon the first numbers corresponding to an initial segment of the decimal expansion of $\pi$. The probability of success is extremely small: $1/10$ digits multiplied by the desired quantity of digits. For example, $1/10^{2400}$ for a segment of 2400 digits of $\pi$. But if instead of shooting out random numbers one were to
shoot out computer programs to be run on a digital computer, the result would be very different.
A program that produces the digits of $\pi$ would have a higher probability of being produced by a computer. Concise and known formulas for $\pi$ could be implemented as short computer programs that would generate any arbitrary number of digits of $\pi$.
\subsection{Simplicity is likeliness and likeliness simplicity}
The length of the shortest program that produces a string is today the mathematical definition of randomness, as introduced by Kolmogorov~\cite{kolmo}, Chaitin~\cite{chaitin}, and Solomonoff~\cite{solomonoff}, and later expanded by Levin~\cite{levin} and also called Kolmogorov-Chaitin complexity.
The idea is relatively simple. If a string $s$ of length $|s|$ cannot be produced by a program $|p|$ shorter than $|s|$ in bits, then the string $s$ is random because it cannot be effectively described in a shorter way than by $s$ itself, there being no program $p$ that generates $s$ whose length is shorter than $s$. Formally,
$$C_U(s) = \min\{|p|:U(p)=s\}$$
\noindent where $U$ is a universal optimal Turing machine. The invariance theorem~\cite{kolmo,chaitin,solomonoff} guarantees that such an optimal universal Turing machine exists for which the value of $C$ nuder different Turing-complete language implementations over the same object is bounded by a `small' constant. Formally, if $U_1$ and $U_2$ are such implementations and $C_{U_1}(s)$ and $C_{U_2}(s)$ are the values of algorithmic complexity of $s$ for $U_1$ and $U_2$ respectively, there exists an optimal $U$ and constant $c$ such that
$$|C_{U_1}(s) - C_{U_2}(s)| < c$$
Clearly, the longer the string, the less relevant is $c$, and the more stable the algorithmic complexity values.
One of the disadvantages is that, given the halting problem for Turing machines, $C$ is not computable, which is to say that given a string, there is no algorithm that returns the length of the shortest computer program that produces it. Efforts have been taken before to approximate it through statistical compression algorithms~\cite{zenilreview} but these fail at characterising algorithmic complexity in full and are rather implementations of variations of Shannon entropy~\cite{zkpaper,zenilreview2}.
Algorithmic probability and algorithmic complexity $K$ are inversely proportional, as established by the so-called algorithmic Coding theorem~\cite{cover,calude}:
$$|-\log_2 AP(s) - C(s)| < c $$
\noindent where $c$ is a constant independent of $s$. The Coding theorem implies that the algorithmic complexity can be estimated from the frequency of a string. In other words, complexity is in inverse relation to algorithmic probability.
To illustrate the above, let us consider $\pi$. Under the assumption of Borel's absolute normality of $\pi$, whose digits appear randomly distributed, and with no knowledge of the deterministic source and nature of $\pi$ as produced by short mathematical formulae, we ask how an entropy versus an algorithmic metric performs. First, the Shannon entropy rate (thus assuming the uniform distribution along all integer sequences of $N$ digits) of the first $gN$ digits of $\pi$, in any base, would suggest maximum randomness at the limit. However, without access to or without making assumptions as regards the probability distribution, approximations to algorithmic probability would assign $\pi$ high probability, and thus the lowest complexity, by the Coding theorem, as has been done in~\cite{d4,d5,kolmo2d,bdmpaper}.
Just as with $\pi$ but in application to graphs and networks, it has been proven how certain graphs can be artificially constructed to target any level of Shannon entropy~\cite{zkpaper,morzy}, preserving low algorithmic randomness.
But how relevant is the algorithmic Coding theorem in explaining, e.g., natural phenomena, if it only applies to Turing-universal systems? We know that the natural world allows and can carry out Turing-universal computation because we have been able to build computers that take elements from nature and make them perform as general-purpose computers. However, we don't know how much of the natural world is Turing-computable or how physical laws may naturally implement any form of computation.
So, in~\cite{liliana} we showed that up to 60\% of the bias found in the output of systems that are not Turing universal may be explained by the algorithmic Coding theorem. This means that this theorem is far more relevant than expected, as it not only explains the way data and patterns distribute for a very particular computational model, but does so, to a considerable extent, for basically any computing model. It is not difficult to imagine that nature operates at some of these levels, perhaps not even on a fixed one but at multiple scales, with the algorithmic Coding theorem being relevant to all of them.
\subsection{My own navigation through software space}
The work of Greg Chaitin has been at the centre of my interests. Not only was he one of the examiners for my PhD in computer science in 2011, but my work would have not been possible without some of his theoretical work. I met Greg in 2006, having been invited to his home and to his office at IBM's legendary Thomas J. Watson Research Center (see figure ~\ref{medal}), both in Yorktown Heights, NY, U.S. His house was typical of an intellectual, full of objects and books piled one on top of the other. But Greg also had exotic pieces of sculpture scattered around, and an over-representation of Leibniz- and G\"odel-related books, the two major influences on his work and thinking.
\begin{figure}[ht!]
\centering
\includegraphics[width=6cm]{chaitinwatson.png}\\
\bigskip
\includegraphics[width=3.8cm]{ChaitinMedalside.png}\hspace{.7cm}\includegraphics[width=4.05cm]{LeibnizMedalside.png}\\
\caption{(Top) A picture of Greg Chaitin I took outside his longtime office at IBM Research headquarters, the Thomas J. Watson Research Center. (Bottom) The two sides of the medal I helped Wolfram design, featuring material relating to Chaitin's life achievements on the obverse and Leibniz' own medal celebrating binary arithmetic on the reverse.}
\label{medal}
\end{figure}
In 2008, I organised a two-part panel discussion (figure~\ref{panels}) during the Wolfram Science conference at the University of Vermont in Burlington, an event that, together with a second meeting that I organised (with Adrian German) in 2008 at Indiana University Bloomington, will, I believe, come to be regarded as events of significant historical importance in the discussion of the ideas of the late 20th and early 21st centuries around questions of the analogue and the digital. The first part of the panel discussion addressed the question ``Is the Universe random?" Participating were Cris Calude, John Casti, Greg Chaitin, Paul Davies, Karl Svozil and Stephen Wolfram. The second part addressed the question ``What is computation and how does nature compute?". The participants were Ed Fredkin, Greg Chaitin, Tony Legett, Cris Calude, Rob de Ruyter, Tom Toffoli, and Stephen Wolfram, with George Johnson, Gerardo Ortiz and myself serving as moderators. Transcriptions of both parts were published in my volume~\cite{randomness} and ~\cite{computableuniverse}.
In 2007, I helped Stephen Wolfram design a commemorative medal to celebrate Gregory Chitin's 60th birthday, which also involved minting for the first time a 300 year old medal originally designed by Gottfried Leibniz to celebrate the invention or discovery of binary arithmetic (see figure ~\ref{medal}). I published a blog post soon after we came up with the idea for the medal, explaining the pre- and
post-minting story of the medal~\cite{blogpost}.
\begin{figure}[h!]
\centering
\includegraphics[width=8cm]{panel1.jpg}\\
Panel Part I: Is the universe random?\\
\bigskip
\includegraphics[width=8cm]{panel2.jpg}\\
Panel Part II: What is computation and How does nature compute?\\
\caption{Part I and Part II panel discussion pictures. (Top) From left to right: Hector Zenil, Stephen Wolfram, Paul Davies, Ugo Pagallo, Greg Chaitin, Cris Calude, Karl Svozil, Gordana Dodig Crnkovic, and John Casti. (Bottom) From left to right: Hector Zenil, Greg Chaitin, Ed Fredkin, Rob de Ruyter, Tony Legett, Cris Calude, Tom Toffoli, and Stephen Wolfram. Transcriptions in ~\cite{randomness} and ~\cite{computableuniverse}.}
\label{panels}
\end{figure}
At the centre of my research is Greg Chaitin's work on what is known as algorithmic probability, which in turn is related to Chaitin's Omega ($\Omega$) number, also called the halting probability. My very first research paper~\cite{zenilcalude} was published in Chaitin's 60th birthday festchrift~\cite{calude}. This paper provided the first numerical evidence of a bias present in nature, a claim that I later advanced in a contribution that won an FQXi prize~\cite{zenilessay} in a competition on the subject of the digital or analogue nature of the universe. Such claims have more recently been picked up and expanded upon~\cite{kamal}--efforts in which my own methods have again played an important role--and have also been further explored by myself in the context of scientific discovery~\cite{maininfo,nar,nmi}.
\subsection{The Coding Theorem Method (CTM)}
The algorithmic \textit{Coding Theorem Method} (CTM)~\cite{d4,d5} provides the means for approximation via the frequency of a string. Now, why is this so? The underlying mathematics originates in the relation specified by algorithmic probability between frequency of production of a string from a random program and its algorithmic complexity. It is also therefore designated the algorithmic \textit{Coding theorem}, in contrast to another well known coding theorem in classical information theory. Essentially, the numerical approximation hinges on the fact that the more frequently a string (or object) occurs, the lower its algorithmic complexity. Conversely, strings with a lower frequency have higher algorithmic complexity. Otherwise stated,
$$CTM(s) = - \log_2 AP(s) + c$$
The way to implement a compression algorithm at the level of Turing machines, unlike popular compression algorithms which are heavily based on Shannon entropy, is to go through all possible compression schemes. This is equivalent to traversing all possible programs that are a compressed version of a piece of data, which is exactly what the CTM algorithm does.
\subsection{The Block Decomposition Method (BDM)}
Our approach to Chaitin's halting probability and Solomonoff-Levin's algorithmic probability consists in asking after the probability of a matrix being generated by a random Turing machine on a 2-dimensional array, also called a \textit{termite} or \textit{Langton's ant}~\cite{langton}. Hence an accounting procedure is performed using Turing machines that aims to approximate the algorithmic complexity of the structures identified. This technique is referred to as the \textit{Block Decomposition Method} (BDM), as introduced in~\cite{bdmpaper}. The BDM technique requires a partition of the adjacency matrix corresponding to the graph into smaller matrices. With these building blocks at hand we numerically calculate the corresponding algorithmic probability by running a large set of small 2-dimensional deterministic Turing machines, and then--by applying the algorithmic Coding theorem, as discussed above--its algorithmic complexity.
Following such a divide-and-conquer approach we can then approximate the overall complexity of the original adjacency matrix by the sum of the complexity of its parts. Note that we have to take into account a logarithmic penalisation for repetition, given that $n$ repetitions of the same object only add $\log n$ to its overall complexity, as one can simply describe a repetition in terms of the multiplicity of the first occurrence. Technically, this translates into the algorithmic complexity of a labelled graph $G$ by means of $BDM$ which is defined as follows:
\begin{equation}
\label{newecaeq}
BDM(G,d) = \sum_{(r_u,n_u)\in A(G)_{d\times d}} \log_2(n_u)+K_m(r_u)
\end{equation}
where $K_m(r_u)$ is the approximation of the algorithmic complexity of the sub-arrays $r_u$ arrived at by using the algorithmic Coding theorem, while $A(G)_{d\times d}$ represents the set with elements $(r_u,n_u)$, obtained by decomposing the adjacency matrix of $G$ into non-overlapping squares, i.e. the block matrix, of size $d$ by $d$. In each $(r_u,n_u)$ pair, $r_u$ is one such square and $n_u$ its multiplicity (number of occurrences). From now on $BDM(G,d=4)$ will be denoted only by $BDM(G)$, but it should be taken as an approximation to $C(G)$ unless otherwise stated (e.g. when taking the theoretical true $C(G)$ value). Once CTM is calculated, BDM can be implemented as a look-up table, and hence runs efficiently in linear time for non-overlapping fixed size submatrices.
\section{Algorithmic Information Dynamics, a software calculus}
Unlike most complexity measures
~\cite{zenilreview} that are designed for static objects, except those related to dynamical systems (e.g. inverse problems with differential equations, Lyapunov exponents, etc), the measure of algorithmic complexity we introduced before can be adapted to characterise how dynamical systems move in software space by looking at the rate of change of algorithmic complexity of an object evolving over time. This measure is universal in the sense that it can deal with any computable feature that a system may display over time, either spontaneously or as a result of an external perturbation/intervention/interaction. Indeed, Algorithmic Information Dynamics is the combination of algorithmic probability and perturbation analysis in software space.
At the core of Algorithmic Information Dynamics~\cite{maininfo,crc}, the algorithmic causal calculus that we have introduced is the quantification of the change of complexity of a system under natural or induced perturbations, particularly the direction (sign) and magnitude of the difference of algorithmic information approximations denoted by $C$ between an object $G$, such as a cellular automaton or a graph, and its mutated version $G^\prime$, e.g. the flip of a cell bit (or a set of bits) or the removal of an edge $e$ from $G$ (denoted by $G\backslash e= G^\prime$). The difference $| C(G) - C(G\backslash e) |$ is an estimation of the shared algorithmic mutual information of $G$ and $G\backslash e$. If $e$ does not contribute to the description of $G$, then $| C(G) - C(G\backslash e) | \leq \log_2|G|$, where $|G|$ is the uncompressed size of $G$, i.e. the difference will be very small and at most a function of the graph size, and thus $C(G)$ and $C(G\backslash e)$ have almost the same complexity. If, however, $| C(G) - C(G\backslash e) | \leq \log_2|G|$ bits, then $G$ and $G\backslash e$ share at least $n$ bits of algorithmic information in element $e$, and the removal of $e$ results in a loss of information. In contrast, if $C(G) - C(G\backslash e) > n$, then $e$ cannot be explained by $G$ alone, nor is it algorithmically not contained/derived from $G$, and it is therefore a fundamental part of the description of $G$, with $e$ as a generative causal mechanism in $G$, or else it is not part of $G$ but has to be explained independently, e.g. as noise. Whether it is noise or part of the generating mechanism of G depends on the relative magnitude of n with respect to $C(G)$ and to the original causal content of $G$ itself. If $G$ is random, then the effect of $e$ will be small in either case, but if $G$ is richly causal and has a very small generating program, then $e$ as noise will have a greater impact on $G$ than would removing $e$ from an already short description of $G$. However, if $| C(G) - C(G\backslash e) | \leq \log_2 |G|$, where $|G|$ is, e.g., the vertex count of a graph, or the runtime of a cellular automaton, $G$, then $e$ is contained in the algorithmic description of $G$ and can be recovered from $G$ itself (e.g. by running the program from a previous step until it produces $G$ with $e$ from $G\backslash e$).
We have shown, for example, how we can infer and reconstruct space-time evolutions via quantification of the disruption of a perturbation~\cite{maininfo} and even de novo~\cite{frontiers}, including initial conditions. From there, it can then be extracted a generating mechanism from the ordered time indices, from least to most disruptive, and produce candidate generating models. Simpler rules have simpler hypotheses, with an almost perfect correspondence in row order. Some systems may appear more disordered than others, but locally the relationship between single rows is for the most part preserved (indicating local reversibility).
We have also shown that the later in time a perturbation is injected into a dynamical system, the less it contributes to the algorithmic information content of the overall space-time evolution~\cite{maininfo}. We then move from discrete 2D systems to the reconstruction of phase spaces and space-time evolutions of $N$-dimensional, continuous, chaotic, incomplete and even noisy dynamical systems.
Algorithmic Information Dynamics suggests that by performing perturbations to data and systems and quantifying the changes that these produces on the data models in software space, we can navigate software space to better understand a system or data in physical space.
\subsection{What the Universe may be made of}
Could it be that the physical universe is made or comes from a computational process and is therefore within software space? This would make our work even more relevant if computable model-driven explanations are approachable with the methods we have advanced allowing some degree of navigation in the boundless infinite software space. Among the many interesting questions is how common computation universality is in software space, if it is very common one can expect both forward and inverse problems more difficult than expected. First, because the forward problem means that a universal model would be capable of arbitrary output making thus initial configurations and interactions with other systems more important. For the inverse problem, that also means that matching model to data is more difficult because the relationship is between even larger sets than possibly imagined, as many more models will be able to match many more data, again making specific parameters all the more important.
What we have found~\cite{riedelzenil}, is that indeed, universality seems to be quite common. For this, we came up with an approach~\cite{dynamic} able to produce statistical evidence towards universality which is rather strong, to some extent even stronger than simple computation universality, a stronger version called intrinsic universality consisting on not only being able to emulate any computable function but also any computable function of the type and scale of the emulator itself. And this is what we found, that most computer programs were capable of emulating both quantitatively and qualitatively most, or all, other computer programs in their own model space. We did this by looking at the set of ever growing compilers (computable translations), that coupled with the original computer program would allow the program to compute quantitatively and qualitatively any other computer program in its own rule space and thus beyond its rule space assuming such evidence amounted to intrinsic universality.
Our compilers (and compilers in general) are nothing but small finite computer programs that cannot be themselves universal because only operate once a computation has started and do not interact with the computation itself,
A positive result (if pervasive universality is read as a negative one, depending on the angle), is that we found also the a counter balance in the equation. Not all compilers where easily found for all rules to be equally versatile, there was a strong inequality indicating that some programs are more naturally programmable than others, thus reintroducing an asymmetry compatible with other measures of complexity, namely resource (time) complexity. Pervasive universality also means that software space is richer than possibly first imagined and may indicate that the real-world is equally rich (and thus, difficult to match) but also fascinating and with the possibility to explain the universe itself~\cite{comprehension,wpp}.
The methods and framework that we have introduced, Algorithmic Information Dynamics (AID)~\cite{scholarpedia}, provides tools to attempt to find those matches~\cite{nmi,maininfo,riedelzenil2}, even between sets of data and sets of models, together with a ranking rule to gauge such models based on algorithmic likeliness. For this reason, we believe AID is a first step in the right direction.
| {'timestamp': '2021-09-20T02:16:42', 'yymm': '2109', 'arxiv_id': '2109.08523', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08523'} | arxiv |
\section{Introduction}
By recognizing revisited places when traveling, place recognition is a key enabler to mobile autonomy and plays essential roles in a wide range of downstream tasks such as scene understanding, loop closure detection, localization, etc.
Visual place recognition develops with the prevalence of commercial RGB cameras, which involves handcrafted features\cite{cumminsFABMAPProbabilisticLocalization2008, milfordSeqSLAMVisualRoutebased2012} and deep learning-based ones\cite{sunderhaufPerformanceConvNetFeatures2015,arandjelovicNetVLADCNNArchitecture2016,zhuAttentionbasedPyramidAggregation2018}. On the other hand, a LiDAR sensor is usually adopted as an alternative optical sensor for place recognition due to its better robustness in dim and dark environments. While place recognition approaches based on these optical sensors have made considerable progress in the past decade\cite{arandjelovicNetVLADCNNArchitecture2016, zhuAttentionbasedPyramidAggregation2018, heM2DPNovel3D2016, uyPointNetVLADDeepPoint2018, komorowskiMinkLoc3DPointCloud2020}, they still fall short under visual degradation common on the roads (e.g., rain, snow, dust, fog, and direct sunlight). An example is shown in Fig. \ref{openfig}, where the state-of-the-art RGB camera-based place recognition failed to retrieve the correct candidate due to raindrops blocking the camera.
Unlike the above optical sensors operating in the visible spectrum, radar operates in a millimeter-wave frequency band, lending itself a modality robust to scene illumination and airborne obstacles\cite{luMilliEgoSinglechipMmWave2020}. By taking input as the dense radar spectra/images, recent works\cite{saftescuKidnappedRadarTopological2020,barnesRadarLearningPredict2020} have shown the feasibility of place recognition based on \emph{mechanically spinning radar} (e.g., CTS-350X). Despite the impressive performance achieved, spinning radar is known to be bulky and costly\cite{schumann2021radarscenes} and require to be mounted on the roof of the vehicle, nor able to provide the Doppler information. In contrast, \emph{automotive radar} (aka. single-chip millimeter-wave radar) emerge as a low-cost and lightweight alternative that is pervasively embraced
by major vehicle manufacturers (e.g., Audi, Ford and Bosch\cite{audi, bosch, ford}). As it adopts wave beamforming rather than mechanical spinning to scan the environment\cite{luSeeSmokeRobust2020}, an automotive radar can measure the point's radial velocity through the Doppler effect as well as fine-grained Radar Cross Section (RCS).
These unique characteristics make automotive radar an attractive sensor for autonomous driving. While prior works use them to estimate the vehicle's (ego-)motion\cite{kungNormalDistributionTransformBased2021,kramer2020radar,linDepthEstimationMonocular2020}, realizing robust place recognition by automotive radar has never been explored and features different challenges. Compared with the output of a spinning radar, the automotive radar point clouds are much noisier and sparser due to the multi-path effects and the fundamental millimeter-wave diffraction effects\cite{luMilliEgoSinglechipMmWave2020}. Consequently, the low-quality and potentially 'misleading' radar data could confuse the process of place recognition that largely depends on global descriptors.
\begin{figure}[t]
\centering
\includegraphics[width=3.45in]{openfig.pdf}
\caption{Place recognition using the single-chip automotive radar: given a query (marked in \textcolor{QueryColor}{purple}) acquired from the same place on a rainy day,
the state-of-the-art RGB camera-based place recognition \cite{arandjelovicNetVLADCNNArchitecture2016} failed to retrieve the correct candidate due to raindrops blocking the camera, while the proposed \texttt{AutoPlace}\xspace successfully retrived the correct one.
}
\label{openfig}
\vspace{-0.5cm}
\end{figure}
In this work, we exploit the unique characteristics of automotive radar and propose a robust \underline{auto}motive radar \underline{place} recognition approach dubbed \texttt{AutoPlace}\xspace to address the above challenges.
Specifically, our contributions are:
\begin{itemize}
\item This paper is the first work that validates the capability of single-chip automotive radar for place recognition.
\item We propose a novel place recognition method by fully utilizing the radial velocity and RCS measurement and effectively modeling the spatial and temporal radar points with a compact deep neural network.
\item The proposed \texttt{AutoPlace}\xspace consistently outperforms a variety of competing approaches on the public nuScenes dataset \cite{caesarNuScenesMultimodalDataset2020}, with code avaliable at: \url{https://github.com/ramdrop/AutoPlace}.
\end{itemize}
\begin{figure}[t]
\vspace{0.15cm}
\centering
\includegraphics[width=3.4in]{pipeline.pdf}
\caption{Overview of \texttt{AutoPlace}\xspace: radial velocity, point cloud and RCS measurement of a radar scan are utilized by the proposed \textit{Dynamic Points Removal} method, \textit{Deep Spatial-Temporal Encoder} and \textit{RCS Histogram Re-ranking} method, respectively.}
\label{pipeline}
\vspace{-0.5cm}
\end{figure}
\section{Related Work}
Place recognition with cameras is an established topic due to the sensor ubiquity, rich information and cost-effectiveness. Early works use handcrafted features and heuristic sequence matching methods\cite{cumminsFABMAPProbabilisticLocalization2008, milfordSeqSLAMVisualRoutebased2012}, while Convolution Neural Networks (CNNs) and attention mechanisms\cite{arandjelovicNetVLADCNNArchitecture2016, zhuAttentionbasedPyramidAggregation2018} are recently explored. Unlike cameras, LiDAR sensors measure objects with explicit scales. LiDAR place recognition approaches include spatial segments methods\cite{heM2DPNovel3D2016, kimScanContextEgocentric2018}, point-wise neural networks\cite{uyPointNetVLADDeepPoint2018} and 3D convolution networks\cite{komorowskiMinkLoc3DPointCloud2020}.
Once as a common sensor used on ships \cite{RadarRobotCarDatasetICRA2020}, mechanically spinning radar has recently been utilized for vehicle place recognition. UnderTheRadar\cite{barnes2020under} uses intermediate features as global decsriptor for place recognition. RadarSLAM\cite{hongRadarSLAMRadarBased2020} uses M2DP\cite{heM2DPNovel3D2016} to generate compact descriptors for radar point clouds. KidnappedRadar\cite{saftescuKidnappedRadarTopological2020} exploits a variant of NetVLAD\cite{arandjelovicNetVLADCNNArchitecture2016} as the feature extractor with sophisticated modification to improve rotational invariance.
The closest work to ours is LookAroundYou\cite{gaddLookYouSequencebased2020}, which improves KidnappedRadar\cite{saftescuKidnappedRadarTopological2020} by using the off-the-shelf sequence matching mechanism from SeqSLAM\cite{milfordSeqSLAMVisualRoutebased2012} . However, LookAroundYou\cite{gaddLookYouSequencebased2020} inevitably inherits the limitations of SeqSLAM\cite{milfordSeqSLAMVisualRoutebased2012} in the following aspects\cite{chancanDeepSeqSLAMTrainableCNN2020}: (1) It requires at least two complete trajectories - query trajectory and database trajectory, and they should be aligned with the same number of samples, while our method can work with the queries and databases of any size, and has no dependency on fine-grained sequence alignments. (2) It requires the whole trajectory to be spatially continuous for performing the local contrast enhancement\cite{milfordSeqSLAMVisualRoutebased2012}, while our method only requires a locally continuous sequence. (3) It heuristically matches sequences, while our method end-to-end trains a sequential matching network. More importantly, rather than uses the bulky spinning radar, our work goes for lightweight automotive radar, by which richer measurements are provided and used for more robust place recognition.
\section{Methods}
Fig. \ref{pipeline} illustrates the pipeline of the proposed \texttt{AutoPlace}\xspace. An automotive radar scan provides a set of measurements, including the \emph{point cloud}
$\mathcal{P}=\{ (x_i, y_i)|i=1,2,..,N\}$, \emph{radial velocity} $\mathcal{V}=\{ v_i|i=1,2,..,N\}$ and \emph{RCS} $\mathcal{R}=\{ r_i|i=1,2,..,N\}$, where $N$ is the number of observed points at a scanning instant. When receiving this input, our proposed Dynamic Points Removal (DPR) module first exploits $\mathcal{V}$ to identify and remove dynamic points in $\mathcal{P}$ and $\mathcal{R}$, and produces the refined $\mathcal{P^\prime}$ and $\mathcal{R^\prime}$. Then a Deep Spatial-Temporal Encoder extracts a discriminative feature vector from $\mathcal{P^\prime}$. Finally, during the inference phase, our proposed RCS Histogram Re-ranking (RCSHR) module re-ranks the list of best matching candidates. We now detail the design of each module in what follows.
\subsection{Dynamic Points Removal}
\label{ssub:dpr}
It is common that dynamic and stationary objects coexist on a road, such as vehicles, pedestrians, traffic cones and building walls. While static objects are temporally consistent, dynamic ones are not: a moving vehicle may disappear when the vehicle revisits the same place. Consequently, dynamic objects could mislead the place recognition due to landmark inconsistency. To address this challenge, we propose a novel \emph{Dynamic Point Removal} method to generate a dynamic points mask $\mathcal{M}$ considering the two
motion status of the ego-vehicle (i.e., the status of the radar sensor):
\subsubsection{Moving Ego-vehicle}
\label{DTR_RANSAC}
Intuitively, when an ego-vehicle moves, the stationary objects move towards the opposite direction in ego-vehicle's field of view. In this case, the identification of these moving objects should be straightforward by using automotive radar because objects' velocities can be directly measured and returned from such sensors. Nevertheless, automotive radar can only provide the radial velocity for an observed object rather than the full velocity. The measured velocity from the radar can thus be "zero" when an object moves tangentially to the radar. To address this ambiguity of velocity measurement, we propose to distinguish the dynamic points based on radial velocities of all points in a scan rather than that of a single point.
Formally, the points' radial velocity for stationary objects has a sinusoidal function as follows:
\begin{equation}
\label{v_profile}
v_{r,i} = -v_s\cos{(\alpha-\theta_{i})}, i=1,2,...,N
\end{equation}
where $v_s$ is the radar velocity, $\alpha$ heading direction, $N$ the number of points, $v_{r,i}$ and $\theta_{i}$ the radial velocity and azimuth angle of the $i^{th}$ point. Recall that point's radial velocity for moving object does not depend on the ego-vehicle motion and can be arbitrary, which means it does not necessarily fit the Eq. (\ref{v_profile}) and thus is a outlier. Following \cite{kellnerInstantaneousEgomotionEstimation2013}, we use the Least Square approach and the Random Sample Consensus (RANSAC)\cite{fischler1981random} algorithm to solve $v_s$ and $\alpha$ and identify outliers, by which the moving points are found.
\subsubsection{Static Ego-vehicle}
One limitation of the above dynamic points removal approach is that it works on the assumption that the ego-vehicle is moving such that
the Eq.(\ref{v_profile}) can be utilized to identify outliers.
However, such an assumption does not hold when the ego-vehicle is static. To address this problem, we propose a simple yet effective method to identify dynamic points when the ego-vehicle is static. The key intuition behind our method is: at a scanning instant, if most points have zero radial velocities, then the ego-vehicle is very likely to be static. Furthermore, as a nonzero radial velocity can only result from a nonzero velocity, it is reasonable to regard points with nonzero radial velocity as moving points. The implementation flow of our method is described in Algorithm \ref{ag_dpr}.
Fig. \ref{DTR} shows an example of points' radial velocity distribution, the corresponding bird view radar point cloud, and the identified dynamic points using the proposed DPR method\footnote{More illustrative examples are available in our supplementary video.}.
\begin{figure}[t]
\centering
\includegraphics[width=3.5in]{DTR.pdf}
\setlength{\abovecaptionskip}{-0.6cm}
\caption{Remove dynamic points based on radial velocity: the left figure shows the points' radial velocity distribution measured by the front radar in a single radar scan, and the right is the front-view images from the front camera, the bird view radar point cloud from the front radar, respectively. The two dynamic points (the moving cars) are successfully identified by the proposed DPR method and marked in \textcolor{red}{red}.}
\label{DTR}
\vspace{-0.1cm}
\end{figure}
\setlength{\textfloatsep}{5pt}
\begin{algorithm}[h]
\LinesNotNumbered
\label{ag_dpr}
\SetKwInOut{Input}{Input}\SetKwInOut{Output}{Output}
\caption{Dynamic Points Removal.}
\Input{radial velocity \( \mathcal{V}=\{ v_{r,i}, \theta _i | i=1,2..,N)\} \)\\veolcity fitting threshold \(\tau\)
\\static velocity threshold \(v_r^{\tau}\)
\\percentage of static points threshold \(p^\tau\)}
\Output{dynamic points mask \(\mathcal{M} =\{d_i|d_i\in\{0,1\}, i =1,2,..,N\}\) (value $0$ means dynamic points)}
\BlankLine
Initialization: $p \leftarrow 0$, \lForEach(){$d_i$}{$d_i \leftarrow 1$}
\BlankLine
\For{i =1 \KwTo N}{
\lIf(){\(v_{r,i} < v_r^{\tau}\)}{\(p \leftarrow p + \frac{1}{N}\)}
\lElse{\(d_i \leftarrow 0 \)}
}
\texttt{/* static ego-vehicle */}
\lIf(){\(p > p^\tau\)}{output $\mathcal{M}$ }
\texttt{/* moving ego-vehicle */}
\Else{
\lForEach(){$d_i$}{$d_i \leftarrow 1$}
execute RANSAC and Least Square algorithms to find outliers indexed as $j_1, j_2,.., j_n$\;
\lForEach(){$j$ \rm in $\{j_1, j_2,.., j_n\}$}{$d_j \leftarrow 0$}
output $\mathcal{M}$\;
}
\end{algorithm}
\subsection{Deep Spatial-Temporal Encoder}
Once the dynamic points mask $\mathcal{M}$ is derived using the above DPR, refined $\mathcal{P^\prime}$ and $\mathcal{R^\prime}$ are then obtained by removing dynamic points in $\mathcal{P}$ and $\mathcal{R}$.
Next, we
introduce the \emph{Deep Spatial-Temporal Encoder} to encode radar point clouds spatial and temporal information for robust place recognition.
\label{network}
\begin{figure}[t]
\vspace{0.15cm}
\centering
\setlength{\abovecaptionskip}{0.cm}
\includegraphics[width=2.7in]{model.pdf}
\caption{Overview of the proposed deep spatial-temporal encoder: in the Spatial Encoder diagram, the block color reflects layer type while the block size indicates the layer's output size, which is annotated as channel@width$\times$height. }
\label{model}
\vspace{-0.1cm}
\end{figure}
As the automotive radar in this study provides 2D point clouds, we convert a radar point cloud to a \emph{radar image} by projecting all 2D points to the image panel with the occupied pixel assigned value $1$, and the pixels that are not occupied by any points are assigned value $0$.
\subsubsection{Spatial Encoder}
\label{ssub:se}
To encode the spatial information of a radar image, we propose a convolution-based \emph{spatial encoder} as shown in Fig. \ref{model}: all convolutional layers have the same kernel size $(3 \times 3)$ and stride $(1 \times 1)$, followed by a ReLU layer. Max-pooling layers are used to downsample feature map, and all have a kernel size $(2 \times 2)$ and stride $(2 \times 2)$, except the last one has a larger kernel size $(3 \times 3)$ and a stride $(3 \times 3)$. An L2-normalization layer is used at the end of the spatial encoder. The feature map of the last layer has a size of $C \times H \times W$, which can be regarded as $C$-dimensional features in $(H \times W)$ spatial locations.
\subsubsection{Temporal Encoder}
\label{ssub:te}
As point clouds given by automotive radar are noisy and sparse\cite{luMilliEgoSinglechipMmWave2020}, a measured object may come and go at random across consecutive radar images. Such inconsistency, however, makes it hard for the network to learn a consistent feature map even for the same place.
To address this, we propose to utilize the temporal information in a series of radar images. The underlying idea here is that the object's inconsistency between consecutive scans can be mitigated by sequential smoothing. Inspired by the recent success of recurrent neural networks in smoothing sequential data\cite{wang2019recurrent, luMilliEgoSinglechipMmWave2020, wang2018end}, we here adopt the single-layer LSTM\cite{hochreiter1997long} as the \emph{temporal encoder} subsequent to the aforementioned spatial encoder. Fig. \ref{model} illustrates the overall architecture of the proposed deep spatial-temporal encoder.
\subsubsection{Loss Function}
Similar to NetVLAD\cite{arandjelovicNetVLADCNNArchitecture2016}, the triplet margin loss is used to train the model, which is given by
\vspace{-0.15cm}
\begin{equation*}
L=\sum\limits_{k} \max\{ d_E(f(q), f(p)) - d_E(f(q), f(n^k))+m, 0\}
\vspace{-0.15cm}
\end{equation*}
where $f(\cdot)$ denotes the network mapping a radar image to a feature vector, $d_E(\cdot)$ Euclidean distance, $q$ the query sample, $p$ the best positive matching sample, $n^k$ the true negative samples, $m=0.1$ the predefined margin, and $k=10$ the number of negative samples. See NetVLAD\cite{arandjelovicNetVLADCNNArchitecture2016} for more details about the triplet loss function.
\subsection{RCS Histogram Re-ranking}
\label{subs:RCSHR}
\begin{figure}[t]
\centering
\includegraphics[width=3.3in]{RCSHR.pdf}
\setlength{\abovecaptionskip}{-0.3cm}
\caption{An example of RCSHR: The lower right figure is the RCS histograms of a query and two candidates, while others are their bird view radar images. Given a query, the retrieved top-1 candidate before RCSHR is a false positive; after performing RCSHR based on their RCS histograms, we identified the true positive candidate. (we use point size larger than $1$ pixel for better visualization) }
\label{RCSHR}
\vspace{-0.1cm}
\end{figure}
RCS values, as a type of radar output, are finally used in \texttt{AutoPlace}\xspace to refine the recognition accuracy.
RCS is a property of the object's reflectivity, mainly determined by the object's material, size and reflected angle. This measurement provides an additional feature for an object and has proven effective in assisting odometry task \cite{joseAugmentedStateSLAM2005,liMillimeterWaveRadarSLAM2020}. However, the question remains whether and how the RCS can contribute to a place recognition task. To answer this question, we propose a novel method, dubbed \emph{RCS Histogram Re-Ranking} to further improve place recognition accuracy. The intuition is that geometrically-close places should share similar RCS histograms regardless of weather and illumination variances.
Therefore, when measuring the similarity of two radar point clouds, we consider not only their feature distance but also RCS histogram distance. Concretely, the steps of deriving the RCS histogram distance are as follows:
For the RCS measurement $\mathcal{R^\prime}$,
we first normalize it to range $(0,1)$. To filter RCS of trivial objects, we only retain RCS within $(b_m, 1)$, where $b_m$ is the lower RCS bound and the bin width $b_w$ is empirically determined from a validation set.
Finally, by calculating counts in each bin, the RCS histogram is obtained.
For consistency across different scans, the histogram is normalized to have a unit sum over all bins.
Now the problem arises how to measure the similarity of two histograms. As a histogram is an empirical estimate of a probability distribution\cite{meshgi2015expanding}, we can use a wide range of similarity functions for comparing two distributions to measure the similarity of two histograms. In this work we use KL divergence as the similarity function since it is proven to be the an effective metric among a variety of similarity functions \cite{meshgi2015expanding}. By denoting RCS histogram distance of two RCS histograms $\widetilde{H}(\mathcal{R}^\prime_1)$ and $\widetilde{H}(\mathcal{R}^\prime_2)$ as $d_{R}$, we have:
\vspace{-0.15cm}
\begin{equation*}
\label{dr}
d_{R}(\widetilde{H}(\mathcal{R}^\prime_1;k), \widetilde{H}(\mathcal{R}^\prime_2;k)) = \sum\limits_{k}\widetilde{H}(\mathcal{R}^\prime_1;k)\log(\frac{\widetilde{H}(\mathcal{R}^\prime_1;k)}{\widetilde{H}(\mathcal{R}^\prime_2;k)})
\vspace{-0.15cm}
\end{equation*}
where $k$ is the bin index. Note that a more similar RCS histogram pair leads to a smaller RCS histogram distance $d_{R}$. Algorithm ~\ref{rcs_alg} summarises the above procedures. With the derived RCS histograms and top-$M$ candidates retrieved based on their feature distance, a re-rank is performed by holistically considering the combined total distance $d_{total}$:
\begin{equation*}
\label{d_total}
d_{total}(q,c) = \alpha \cdot d_{R}(\widetilde{H}(q),\widetilde{H}(c)) + (1-\alpha) \cdot d_E(f(q), f(c))
\vspace{-0.1cm}
\end{equation*}
where $\alpha$ is an adjustable parameter used to balance the two distances, $q$ and $c$ denotes the query sample and the candidate sample. And we empirically set $M$=100 in this study. An example of RCSHR is shown in Fig. \ref{RCSHR} where we can see that the retrieved top-1 candidate without using the RCSHR is only plausibly correct but not really close to the query. After the RCSHR re-rank is applied, the real match pops up as the new top-1 candidate due to their more similar RCS histograms, and consequently smaller $d_{R}$ over the others.
\setlength{\textfloatsep}{0pt}
\begin{algorithm}[t]
\label{rcs_alg}
\LinesNotNumbered
\SetKwInOut{Input}{Input}\SetKwInOut{Output}{Output}
\caption{Calculate RCS Histogram Distance
}
\Input{RCS measurements \( \mathcal{R}^\prime_1=\{r_{1,i}|i=1,2,...,N_1 \}\) \(\mathcal{R}^\prime_2=\{r_{2,i}|i=1,2,...,N_2 \}\), \(b_m\), \(b_w \)}
\Output{RCS histogram distance \( d_{R}\)}
\BlankLine
bin the range \((b_m, 1)\) with equal width \(b_w\)\;
\ForEach(){\(\mathcal{R^\prime}\) \rm in \( \{\mathcal{R}^\prime_1, \mathcal{R}^\prime_2 \}\)}{
\ForEach(){$r$ \rm in \(\mathcal{R^\prime}\)}{\(r \leftarrow \frac{r-\min{\mathcal{R^\prime}}}{\max{\mathcal{R^\prime}}-\min{\mathcal{R^\prime}}}\)}
calculate counts in each bin and we get \(H(\mathcal{R^\prime})=\{ c_k|k=1,2,..[{b_m}/{b_w}]\}\)\;
\( \widetilde{H}(\mathcal{R^\prime}) = \{\frac{c_k}{\sum\limits_{k}c_k}|k=1,2,..[{b_m}/{b_w}]\}\)\;
}
\BlankLine
\(d_{R} = \sum\limits_{k}\widetilde{H}(\mathcal{R}^\prime_1;k)\log(\frac{\widetilde{H}(\mathcal{R}^\prime_1;k)}{\widetilde{H}(\mathcal{R}^\prime_2;k)}) \)
\end{algorithm}
\section{Experimental Setup}
\subsection{nuScenes Dataset}
As automotive radar is relatively new,
the public dataset of this novel sensor is limited. The newly released nuScenes dataset\cite{caesarNuScenesMultimodalDataset2020} is the first and only one for large-scale environments with multi-modal sensors, including automotive radar.
Since no previous work has been done for place recognition on this dataset, we provide necessary information about the dataset and our data pre-processing pipelines.
There are five radar sensors installed at the front, left, right and back parts of the vehicle, covering a $\SI{360}{\degree}$ FOV. Each radar works at $\SI{77}{\GHz}$ with $\SI{250}{m}$ measurement range and $\SI{13}{\Hz}$ capture frequency. The final data is comprised of 1000 scenes of $\SI{20}{\s}$ duration from four locations, which is $\SI{15}{\hour}$ of driving data ($\SI{242}{\km}$ traveled at an average of $\SI{16}{\km\per\hour}$).
In order to train and evaluate place recognition methods, a large number of loop closures and diverse road situations are desired. Therefore, we choose to train and evaluate \texttt{AutoPlace}\xspace on the largest split, \textit{Boston} split, among all the four splits.
For the 550 scenes collected in Boston over 120 days, we take the data from the last 15
days as the \textit{validation query set} and the \textit{test query set}, while the rest as the \textit{training set}. The \textit{training set} is further divided into the \textit{database set} and the \textit{training query set}. Specifically,
\begin{itemize}
\item The \textit{database set} is created by taking as many places as possible from the \textit{training set}, until a newly added place is no $\SI{1}{\m}$ farther than any existing places in the \textit{database set}.
\item The \textit{training query set} is created by substracting the \textit{database set} from the \textit{training set}.
\item The \textit{validation query set} : the \textit{test query set}=1 : 4, and they are refined by removing places that have no ground truth true positives in the \textit{database set}.
\end{itemize}
The final \textit{database set}, \textit{training query set}, \textit{validation query set} and \textit{test query set} contains 6312, 7075, 924 and 3696 radar images, respectively.
\begin{figure}[t]
\centering
\includegraphics[width=2.5in]{PR-competing.pdf}
\setlength{\abovecaptionskip}{-0.2cm}
\caption{Precision-recall curve of SOTA methods on the nuScenes dataset.}
\label{pr-SOTA}
\vspace{0.2cm}
\end{figure}
\subsection{Implementation Details}
Since a single radar point cloud is too sparse to extract useful information due to the low sensing quality, we follow typical data pre-processing of \cite{liMillimeterWaveRadarSLAM2020,linDepthEstimationMonocular2020} and concatenate the nearest seven
radar point clouds to form a denser point cloud. Besides, as the far-range measurement is less accurate, we crop the radar measurements to retain the points within $\SI{100}{m}$ from the sensor. When projected to the image plane, each point occupies one pixel. Thus, the converted 2D bird view radar image has a size of $200 \times 200$.
After searching hyper-parameters on validation set, we set \(\tau=0.15, v_r^{\tau}=1, p^\tau=0.5\) for DPR, and \(b_m=0.02, b_w=0.04, \alpha=0.41 \) for RCSHR. For the network training, we use a batch size of 8 and SGD with an initial learning rate of $0.01$, momentum $0.9$ and weight decay $0.001$. We decay the learning rate by $0.5$ every $5$ epochs.
Following the scale of KidnappedRadar\cite{saftescuKidnappedRadarTopological2020} and PointNetVLAD\cite{uyPointNetVLADDeepPoint2018}, we regard places in database that are within the radius=$\SI{9}{\m}$ area to the query as true positives, while those are outside the radius=$\SI{18}{\m}$ area as true negatives.
\subsection{Evaluation Metrics}
We follow four standard metrics in place recognition tasks: recall@N\cite{arandjelovicNetVLADCNNArchitecture2016,zhuAttentionbasedPyramidAggregation2018}, precision-recall curve\cite{houEvaluationObjectProposals2018, chenLearningContextFlexible2018}, $\max F_1$\cite{saftescuKidnappedRadarTopological2020} and average precision (AP)\cite{houEvaluationObjectProposals2018}.
See \cite{houEvaluationObjectProposals2018} for details of generating precision-recall curve and AP.
\section{Results}
\subsection{Comparison with State-Of-The-Art Methods}
In what follows, we denote our proposed Spatial Encoder and Temporal Encoder as \textbf{\texttt{SE}} and \textbf{\texttt{TE}} for brevity. We compare our approach with the SOTA methods, including:
\begin{itemize}
\item Visual place recognition: \textbf{NetVLAD}\cite{arandjelovicNetVLADCNNArchitecture2016}, \textbf{SeqNet}\cite{gargSeqNetLearningDescriptors2021}.
We adapt the implementation of the above works to the settings of the nuScenes dataset. To fairly evaluate the effectiveness of our spatial encoder, we also investigated the performance of \textbf{NetVLAD}+\textbf{\texttt{TE}} by adding our \texttt{TE} to the original NetVLAD network.
\item LiDAR place recognition: \textbf{M2DP}\cite{heM2DPNovel3D2016}, \textbf{ScanContext}\cite{kimScanContextEgocentric2018} and \textbf{MinkLoc3D}\cite{komorowskiMinkLoc3DPointCloud2020}. We feed them the pseudo-3D point clouds by adding a pseudo axis $z=0$ and then normalize point clouds to range $(-1,1)$.
\item Spinning radar place recognition: \textbf{UnderTheRadar}\cite{barnesRadarLearningPredict2020} and \textbf{KidnappedRadar}\cite{saftescuKidnappedRadarTopological2020}. For KidnappedRadar, we convert the radar images from Cartesian coordinates to polar coordinates.
\end{itemize}
\begin{table}
\vspace{0.15cm}
\centering
\caption{Performance of SOTA methods on the nuScenes Dataset}
\label{recall-table-SOTA}
\begin{threeparttable}
\begin{tabular}{lccc}
\hline
Method & Recall@1/5/10 & $\max F_{1}$ & AP \\
\hline
MinkLoc3D\cite{komorowskiMinkLoc3DPointCloud2020} & 31.8/53.6/61.1 & 0.53 & 0.49 \\
M2DP\cite{heM2DPNovel3D2016} & 30.3/43.4/48.4 & 0.58 & 0.65 \\
ScanContext\cite{kimScanContextEgocentric2018} & 10.4/15.3/17.2 & 0.42 & 0.45 \\
\hline
UnderTheRadar\cite{barnesRadarLearningPredict2020} &38.5/53.8/59.1 & 0.67 & 0.75 \\
KidnappedRadar\cite{saftescuKidnappedRadarTopological2020} & 41.0/56.6/61.5 & 0.65 & 0.71 \\
\hline
NetVLAD\cite{arandjelovicNetVLADCNNArchitecture2016} & 73.1/80.5/82.4 & 0.92 & 0.96 \\
NetVLAD+\texttt{TE}*\tnote{1} & 70.8/79.5/81.2 & 0.90 & 0.95 \\
SeqNet\cite{gargSeqNetLearningDescriptors2021}* & 73.3/80.0/82.1 & 0.92 & 0.97 \\
\hline
Ours: \texttt{SE} & 73.3/80.0/81.9 & 0.89 & 0.96 \\
Ours: \texttt{SE+TE}* & 76.7/81.7/83.4 & 0.93 & 0.97 \\
Ours: \texttt{AutoPlace}\xspace*\tnote{2} & \textbf{78.9/83.1/84.3} & \textbf{0.94} & \textbf{0.98} \\
\hline
\end{tabular}
\begin{tablenotes}
\footnotesize
\item[1] * denotes using sequential frames for place recognition.
\item[2] i.e., \texttt{SE+TE+DPR+RCSHR}.
\end{tablenotes}
\end{threeparttable}
\end{table}
\label{experiments-sota}
\begin{table}
\centering
\caption{Ablation Study of \texttt{AutoPlace}\xspace}
\label{score-ablation-full}
\begin{tabular}
{cccc|ccc}
\hline
\begin{tabular}[c]{@{}c@{}}\texttt{SE}\end{tabular} &\texttt{TE} & \texttt{DPR} & \texttt{RCSHR} & Recall@1/5/10 & $\max F_{1}$ & AP \\
\hline
$\surd$ & & & & 73.3/80.0/81.9 & 0.89 & 0.96 \\
\hline
$\surd$ & $\surd$ & & & 76.7/81.7/83.4 & 0.93 & 0.97 \\
\hline
$\surd$ & & $\surd$ & & 75.3/81.4/83.0 & 0.91 & 0.96 \\
\hline
$\surd$ & & & $\surd$ & 73.4/80.3/82.2 & 0.89 & 0.96 \\
\hline
$\surd$ & & $\surd$ & $\surd$ & 75.8/82.1/83.8 & 0.91 & 0.96 \\
\hline
$\surd$ & $\surd$ & & $\surd$ & 77.7/82.1/83.4 & 0.93 & 0.98 \\
\hline
$\surd$ & $\surd$ & $\surd$ & & 77.8/82.3/83.7 & 0.94 & 0.98 \\
\hline
$\surd$ & $\surd$ & $\surd$ & $\surd$ & \textbf{78.9}/\textbf{83.1}/\textbf{84.3} & \textbf{0.94} & \textbf{0.98} \\
\hline
\end{tabular}
\end{table}
\begin{figure*}[htbp!]
\centering
\vspace{0.15cm}
\setlength{\abovecaptionskip}{0.cm}
\includegraphics[width=\textwidth]{qua-competing.pdf}
\caption{Qualitative analysis of SOTA methods. The first and second columns show the query radar images and ground truth radar images, and the other columns are the retrieved top 1 candidate via different methods. \textcolor{RightColor}{Green} means the retrived candidate is a true positive, while \textcolor{WrongColor}{red} denotes false positive.
}
\label{qua-SOTA}
\vspace{-0.5cm}
\end{figure*}
Table. \ref{recall-table-SOTA} presents the performance of SOTA methods and our methods. As expected
, brute-force applying the place recognition approaches of LiDAR sensors to automotive radar results in inferior performance: ScanContext, M2DP and MinkLoc3D only achieve 10.4\%, 30.3\% and 31.8\% recall@1, respectively.
Their failures can be attributed to the reasons that (1) automotive radar point clouds are much sparser than LiDAR point clouds\cite{linDepthEstimationMonocular2020}, and (2) pseudo 3D point clouds of the automotive radar lack valid information on $z$ axis. These factors make 3D point cloud-based methods ill-suited to automotive radar.
We can also observe from this table that spinning radar place recognition approaches perform slightly better than LiDAR-based methods: KidnappedRadar and UnderTheRadar achieve 41.0\% and 38.5\% recall@1, respectively, which are still far from being satisfactory. KidnappedRadar takes mechanically spinning radar's spectra as input and performs max-pooling upon the last feature map along the azimuth axis to achieve rotational invariance. However, since automotive radar point clouds are higher-level but less informative than spectra, max-pooling operation on automotive radar's feature map only makes things worse, preventing the network from producing a discriminative radar image descriptor.
Visual place recognition methods, NetVLAD and SeqNet, achieve 73.1\% and 73.3\% recall@1, respectively. We suppose their relatively good performance results from the strong feature representative capability of VGG16\cite{simonyan2014very}.
Our \texttt{SE} surpasses NetVLAD and achieves a comparable performance of the sequence-based method, SeqNet.
Notice that NetVLAD+\texttt{TE} performs even worse than NetVLAD, this is because NetVLAD is designed to produce high dimensional features (larger than 30k-dimensions in \cite{arandjelovicNetVLADCNNArchitecture2016}) while LSTM in \texttt{TE} works well when fed low dimensional data (less than 10k-dimensions in \cite{wangEndtoendSequencetosequenceProbabilistic2018, luMilliEgoSinglechipMmWave2020}), such a incompatibility results in its poor performance. In contrast, our \texttt{SE} produces compact features and works better with \texttt{TE} than NetVLAD.
By utilizing all information from automotive radar,
\texttt{AutoPlace}\xspace extends the gap to the runner-up to 5.6\%, 0.02 and 0.01 for recall@1, $\max F_1$ and AP.
A similar trend can also be observed in Fig. \ref{pr-SOTA} that LiDAR and spinning radar place recognition methods are outperformed by their visual counterparts, NetVLAD and SeqNet.
Still, \texttt{AutoPlace}\xspace exceeds the others by a significant margin.
We also provide qualitative analysis in Fig. \ref{qua-SOTA}. As we can see, when the queried scene structure is incomplete (first row) or the point cloud in a query is extremely sparse (second row), competing approaches struggle while \texttt{AutoPlace}\xspace can still retrieve the correct match.
In summary, the experimental results suggest:
(1) existing visual, LiDAR or spinning radar place recognition methods perform unsatisfactorily when being directly applied to automotive radar, and (2) by fully utilizing all the information provided by automotive radar, our \texttt{AutoPlace}\xspace is superior to all competing methods.
\subsection{Ablation Study}
We study each component of \texttt{AutoPlace}\xspace by evaluating different groups shown in Table. \ref{score-ablation-full}. It can be observed that
\begin{itemize}
\item \textbf{SE} (c.f. Sec.~\ref{ssub:se}) alone achieves recall@1=73.3\%, which is comparable with NetVLAD.
\item \textbf{TE} (c.f. Sec.~\ref{ssub:te}) boosts recall@1 by 3.4\% when added to \texttt{SE}, and decreases it by 3.1\% when removed from \texttt{AutoPlace}\xspace.
\item\textbf{DPR} (c.f. Sec.~\ref{ssub:dpr}) increases recall@1 by 2.0\% when added to \texttt{SE}, and decreases it by 1.2\% when removed from \texttt{AutoPlace}\xspace.
\item \textbf{RCSHR} (c.f. Sec. \ref{subs:RCSHR}) improves recall@1 by 0.1\%, 0.5\%, 1.0\% and 1.1\% when added to \texttt{SE}, \texttt{SE+DPR}, \texttt{SE+TE} and \texttt{SE+TE+DPR}, respectively. Improvements vary because \texttt{RCSHR} works as a refinement module, bringing more remarkable improvement when the descriptors themselves are more discriminative (i.e., \texttt{RCSHR} hardly changes candidates' order when mismatches have small feature distances). This is in accordance with our observation that more discriminative descriptors lead to fewer mismatches between geometrically-close places, and thus, \texttt{RCSHR} helps more in distinguishing these places
(more illustrative examples are available in our supplementary video).
\end{itemize}
The results indicate that each component is critical in improving the overall performance, of which the most significant benefit is from \texttt{TE}.
\section{Conclusion}
Observing that existing place recognition methods ill-suits the emerging automotive radar, we propose \texttt{AutoPlace}\xspace, a novel place recognition framework by fully exploiting automotive radar's rich measurements. Experimental results show remarkable performance gain of \texttt{AutoPlace}\xspace on the public nuScenes dataset. Future work will further investigate \texttt{AutoPlace}\xspace for simultaneous localization and mapping.
\bibliographystyle{IEEEtran}
| {'timestamp': '2021-09-20T02:21:22', 'yymm': '2109', 'arxiv_id': '2109.08652', 'language': 'en', 'url': 'https://arxiv.org/abs/2109.08652'} | arxiv |
\section{Introduction}
In many real-world applications, machine learning classification systems do not simply make predictions to minimize errors or to maximize likelihood. Instead, the decision threshold of a learned classifier is often adjusted after training to select a particular operating point on the precision-recall or ROC curve, reflecting how the classifier will be used. Automated email spam filters, for example, might operate with an increased threshold to achieve a high precision or low predicted positive rate. In medical diagnosis, the threshold may be decreased so that the classifier will make predictions with a high recall \cite{he2009learning}. When a particular operating point for the classifier is not known ahead of time, area under the precision-recall or ROC curve is often the metric used to compare models. In other cases, classifiers are adjusted to obey constraints on coverage or fairness (i.e. predicted positive rates on subsets of the training data) so that the system will not treat some demographics of users unfairly \cite{goh2016satisfying}.
In all of these cases, the most desirable binary classifier can be characterized as one which maximizes a quantity such as accuracy, precision, or recall, subject to a constraint. The constraint is usually an inequality on the predicted positive rate (coverage) or true/false positive/negative rate on some subset of the data. The most common practice to produce a classifier which satisfies a constraint is to train the classifier by maximum likelihood, then after training, adjust its threshold so that the constraint is satisfied.
Threshold adjustment enjoys a strong theoretical justification \cite{koyejo2014consistent}: for a large family of metrics, the Bayes optimal classifier makes predictions by thresholding the conditional class probability $P(y=1|x)$. The same result is known for binary cost-sensitive classification \cite{elkan2001foundations}. However, thresholding is not the end of the story because learning accurate (or calibrated) conditional probabilities is more challenging than learning loss-minimizing predictions \cite{joachims2005support, margineantu2002class}. This observation is a fundamental motivation for structured losses.
Accordingly, there have been several attempts to address constrained classification problems directly through the machinery of constrained optimization \cite{davenport2010tuning,goh2016satisfying,eban2017scalable}. Instead, we focus on eliminating the constraint by substitution. For constraints which can be expressed as a rate on the training dataset (e.g. predicted positive rate, the threshold of a classifier which satisfies the constraint can be expressed as a quantile of the classifier's scores. By incorporating an estimator of the quantile into the loss function, the constraint can be eliminated. For simplicity, we focus on binary classification and apply the quantile estimation approach to optimize precision at a fixed recall and precision@K.
In summary, our contribution is as follows. First, we show that a wide variety of machine learning problems with constraints can be recast as ordinary, unconstrained learning problems. Second, we show that the resulting unconstrained problems can be solved efficiently and generally; they are particularly amenable to gradient-based optimization, independent of what model is used. For linear models, we derive a convex upper bound on the loss, and also prove a uniform risk bound. Finally, in experiments across a variety of benchmarks, we demonstrate performance matching or outperforming state of the art methods.
\section{Related Work}
Many existing approaches aim to optimize for non-decomposable performance measures, enforce dataset constraints, or incorporate classifier score quantiles into the training procedure. Below, we summarize those most related to the proposed method.
Several attempts, most notably \cite{joachims2005support}, have used the framework of structured prediction \cite{taskar2004max, tsochantaridis2005large, koller2009probabilistic} to handle performance metrics beyond accuracy. The method, however, faces several problems. First, each iteration of the algorithm in \cite{joachims2005support} requires fully training an SVM over the entire dataset, which hinders scalability. Second, it is not clear how the methods extends to handle constraints which depend on the labels, which are not available at test time. For example, a constraint on the predicted positive rate is easily enforced at test time, while a constraint on the true positive rate is not.
The authors of \cite{kar2015surrogate} identify a third shortcoming: the structured SVM framework \cite{joachims2005support} assumes that the true labels are admissible under the constraint on the classifier. When optimizing Precision@K, the true labels are only admissible when the dataset contains exactly $K$ positives. This problem and the scalability issue are both addressed in \cite{kar2015surrogate}, but how to handle constraints which depend on the ground truth labels remains unclear.
For the specific case of a linear classifier, \cite{goh2016satisfying} approaches general dataset constraints by framing the problem as constrained optimization with the ramp loss and solving it with a majorization-minimization approach. However, their algorithm is not readily generalized to the nonlinear case.
The special case of minimizing the probability of false negatives subject to a constraint on the probability of false positives is known as Neyman-Pearson classification \cite{tong2016survey}. It is known that, with minor regularity assumptions, Neyman-Pearson classification can be accomplished by re-weighting the losses on the positives and negatives. Both \cite{davenport2010tuning} and \cite{eban2017scalable} seek to identify the appropriate re-weighting during the course of training, the former by direct search and the latter by saddle-point optimization with Lagrange multipliers. These methods apply to non-linear classifiers such as neural networks, and \cite{eban2017scalable} extends the idea to handle the $F_\beta$ meaure, ROC-AUC, and Precision-Recall AUC.
The saddle-point approach has an advantage when direct search is very expensive and it applies to a wider class of models, but there is no guarantee that the constraint will be satisfied unless the saddle point problem is solved to convergence. Unfortunately, this is incompatible with the ubiquitous practice of early stopping in neural networks. In addition, the convex relaxation of the constraint can result in loose bounds and oversatisfied constraints.
The idea of placing a quantile constraint on the classifier's scores was explored in \cite{boyd2012accuracy}, and produced impressive results relative to other approaches for optimizing ranking metrics such as precision@K. However, the method of \cite{boyd2012accuracy} requires learning a separate classifier for each datapoint in the training set, which is tractable only for very small datasets. In contrast, our approach is amenable to stochastic gradient methods and scales easily to datasets with millions of examples.
\section{Quantile Surrogate Losses}
In this section, we describe our approach in detail and focus on maximizing Precision@K and Precision at a fixed recall.
Let $X = \{x_1, \dots, x_n\}$ consist of the features in a training dataset, and let $Y = \{y_1, \dots, y_n\}$ denote the corresponding labels in $\{-1, 1\}$.
We consider a classifier to consist of a scoring function $f$ determined by learnable parameters $w$, and a threshold $\theta$.
The prediction $\hat{y}_i$ of the classifier on the $i$th example is made according to
\[
\hat{y}_i = \text{sign}(f(x_i; w) - \theta).
\]
\begin{definition}
Given a subset $A \subseteq X$, we define the \emph{predicted positive rate} for a classifier $(f, \theta)$ on $A$ to be the fraction of examples in $A$ predicted to be positives:
$$r_A(f, \theta) = \frac{|\{x_i \in A: f(x_i; w) - \theta > 0\}|}{|A|}.$$
A \emph{rate constraint} is a constraint which can be written in the form $r_A \gtrless c$
for some value of $c\in [0, 1]$.
\end{definition}
Note that $r_A(f, \theta)$ is piecewise constant, discontinuous, and monotone decreasing in $\theta$. Defining $f(A) = \{f(x): x \in A\}$, we see that $r_A(f, \min f(A)) = 1$ and $r_A(f, \max f(A)) = 0$. Therefore, inequality rate constraints can always be satisfied by setting $\theta$ to some value depending on $f$ and $c$.
The notion of predicted positive rate on a subset is general enough to represent many metrics of interest. Letting $X^+$ denote the positive examples in $X$, we see that the recall (or true positive rate) of a classifier $(f, \theta)$ is equal to $r_{X^+}(f, \theta)$. The typical notion of predicted positive rate coincides with $r_X(f, \theta)$, and false positive rate can be written as $r_{X^-}(f, \theta)$. Other examples are given in \cite{goh2016satisfying}: coverage, churn, and fairness can all be expressed in terms of predicted positive rates. Because the predicted positive and predicted negative rates must sum to one, we may consider predicted positive rate constraints without loss of generality.
Given some metric (or utility) $G$ that depends on the data $X, Y$ and the classifier $(f, \theta)$, we can define the problem of maximizing $G$ subject to the rate constraint $r_A(f, \theta) \geq c$ as
\begin{equation}\label{eq:constrained_optimization}
\max_{f, \theta} G(X, Y, f, \theta) \quad \text{subject to} \quad r_A(f, \theta) \geq c.
\end{equation}
Note that $G$ need not decompose across examples, as accuracy does. Due to the discontinuity of $r_A(f, \theta)$ and most metrics $G$, the problem is combinatorial and intractable to solve exactly. However, there are many cases in which we can characterize an optimizer $(f^*, \theta^*)$ in terms of the quantiles of $f^*(A)$.
\begin{definition}
For a set of real numbers $S = \{s_1, \ldots, s_N\}$ the quantile function is defined as
\begin{equation*}
\begin{split}
q(S, c) &= \sup \{t: |\{s_i \leq t\}|/N \leq c\} \\
&= \inf \ \{t: |\{s_i \leq t\}|/N \geq c\}.
\end{split}
\end{equation*}
\end{definition}
\begin{proposition}\label{prop:quantile}
Suppose $(f, \theta)$ is a feasible point for (\ref{eq:constrained_optimization}) and let
\[
\hat{\theta} = q(f(A), 1 - c).
\]
Then $(f, \hat{\theta})$ is also feasible. If $G(X, Y, f, \theta)$ is monotone increasing in $\theta$ over the range $[\theta, \hat{\theta}]$, then $G(X,Y,f,\hat{\theta}) \geq G(X,Y,f,\theta)$.
\end{proposition}
\begin{proof}
Because $r_A(f, \theta)$ is monotone decreasing in $\theta$, any admissible $\theta$ must satisfy
\begin{equation*}
\begin{split}
\theta &\leq \sup \{t: r_A(f^*, t) \geq c\} \\
&\leq \sup \{t: |\{x \in A : f^*(x) > t\}|/|A| \geq c\} \\
&\leq \sup \{t: 1 - |\{x \in A: f^*(x) \leq t\}|/|A| \geq c\} \\
&\leq \sup \{t: |\{x \in A: f^*(x) \leq t\}|/|A| \leq 1-c \}.
\end{split}
\end{equation*}
The supremum in the last line is exactly the quantile function, and so
$$\theta \leq q(f(A), 1 - c).$$
The claim follows from the fact that $G$ is monotone in $\theta$ and that $\hat{\theta} \geq \theta$.
\end{proof}
Applying the proposition to an optimizer $(f^*, \theta^*)$ shows that $(f^*, \hat{\theta})$ is also an optimizer. In particular, a scoring function $f$ which optimizes (\ref{eq:constrained_optimization}) is a minimizer of the loss
\begin{equation}\label{eq:unconstrained_optimization}
\min_f L(X, Y, f, q(f(A), 1-c))
\end{equation}
With $L = -G$. Conversely, optimizers of (\ref{eq:unconstrained_optimization}) are feasible and hence optimal for (\ref{eq:constrained_optimization}).
In practice, $G$ is usually a differentiable surrogate allowing for numerical optimization and the monotonicity assumption is easily verified. For inequality constraints of the form $r_A(f, \theta) \leq c$, $\theta^*$ is again given by the quantile function so long as $G$ is monotone decreasing in $\theta$.
Proceeding
farther depends on the choice of $G$ and the specific rate constraint, so we consider the task of maximizing precision subject to recall and predicted positive rate constraints. Afterward, we consider the estimation of the quantile function $q(f(A), c)$.
\subsection{Precision at a fixed recall}
The precision and recall of a classifier $(f, \theta)$ are defined as
\begin{equation*}
\begin{split}
P(f, \theta) &= \frac{TP(f, \theta)}{TP(f, \theta) + FP(f, \theta)} \\
R(f, \theta) &= \frac{TP(f, \theta)}{TP(f, \theta) + FN(f, \theta)} = \frac{TP(f, \theta)}{|X^+|},
\end{split}
\end{equation*}
where $TP$ and $FP$ denote the true positives and false positives, respectively:
\begin{equation*}
\begin{split}
TP(f, \theta) &= \sum_{i: y_i = 1} \mathbf{1}_{f(x_i; w) > \theta}\\
FP(f, \theta) &= \sum_{i: y_i = -1} \mathbf{1}_{f(x_i; w) > \theta}.
\end{split}
\end{equation*}
Thus, to optimize for the Precision@Recall objective (P@R), we wish to solve
\begin{equation}\label{eq:max_p_at_r}
\begin{split}
& \max_{f, \theta} \frac{TP(f, \theta)}{TP(f, \theta) + FP(f, \theta)} \\
& \text{subject to} \quad r_{X^+}(f, \theta) \geq c.
\end{split}
\end{equation}
We know the recall constraint $r_{X^+} \geq c$ will be active, because precision is trivially maximized by predicting few or no positives. This implies $r_{X^+} = \tilde{c}$, where $\tilde{c} = \min \{k/|X^+|: k/|X^+| \geq c\}$. Because $N^+ = |X^+|$ is fixed, we conclude that $TP(f, \theta) = \tilde{c} N^+.$ Substituting this value for $TP$ into the expression for precision gives
\[
P(f, \theta) = \frac{TP(f, \theta)}{TP(f, \theta) + FP(f, \theta)} = \frac{cN^+}{cN^+ + FP(f, \theta)}.
\]
Thus, solving
\begin{equation}\label{eq:p_at_r_lb}
\begin{split}
& \max_{f, \theta} \frac{\tilde{c} N^+}{\tilde{c} N^+ + FP(f, \theta)} \\
& \text{subject to} \quad r_{X^+}(f, \theta) \geq c
\end{split}
\end{equation}
gives the solution to (\ref{eq:max_p_at_r}). In addition, (\ref{eq:p_at_r_lb}) is equivalent to
\begin{equation}\label{eq:min_fp_at_r}
\min_{f, \theta} FP(f, \theta) \quad \text{subject to} \quad r_{X^+}(f, \theta) \geq c.
\end{equation}
With the objective in this form, $FP(f, \theta)$ can be upper bounded in the standard way by the logistic loss (or hinge loss), which we denote by $l$:
\begin{equation*}
\begin{split}
FP(f, \theta) &= \sum_{i: y_i = -1} 1_{f(x_i; w) - \theta > 0} \\
&\leq \sum_{i: y_i = -1} l(f(x_i; w) - \theta).
\end{split}
\end{equation*}
This leaves us with
\begin{equation}\label{eq:min_bound_at_r}
\begin{split}
& \min_{f, \theta} \sum_{i: y_i = -1} l(f(x_i; w) - \theta) \\
& \text{subject to} \quad r_{X^+}(f, \theta) \geq c.
\end{split}
\end{equation}
Because the loss is monotone decreasing in $\theta$, the monotonicity assumption of Proposition \ref{prop:quantile} is met and so $\theta = q(f(X^+), 1-c)$. This leads to the unconstrained objective for P@R:
\begin{equation}\label{eq:unconstrained_fp_at_r}
\min_f \sum_{i: y_i = -1} l(f(x_i; w) - q(f(X^+), 1-c)).
\end{equation}
In practice, the minimization is performed with respect to the parameters $w$ of the scoring function $f$, e.g. by stochastic gradient descent.
As pointed out in \cite{eban2017scalable}, the precision at recall objective can be used to target Precision-Recall AUC by approximating the area under the Precision-Recall curve as a Riemann sum.
\subsection{Precision a fixed predicted positive rate} \label{sec:ppr}
For a training dataset $X$ with $N$ points, the Precision@K metric is equivalent to precision at a predicted positive rate of $K/N$. Therefore, we consider the objective
\begin{equation} \label{eq:max_p_at_ppr}
\max_{f, \theta} P(f, \theta) \quad \text{subject to} \quad r_X(f, \theta) = c.
\end{equation}
Because $TP + FP$ is equal to the number of predicted positives, the constraint $r_X(f, \theta) = c$ implies that $TP + FP = cN$, and so (\ref{eq:max_p_at_ppr}) is equivalent to
\[
\max_{f, \theta} TP(f, \theta) \quad \text{subject to} \quad r_X(f, \theta) = c.
\]
Using $TP = cN - FP$, the objective can be rewritten as
\[
\min_{f, \theta} FP(f, \theta) \quad \text{subject to} \quad r_X(f, \theta) = c,
\]
which by the same logistic loss bound and application of Proposition \ref{prop:quantile} becomes
\begin{equation}\label{eq:unconstrained_fp_at_ppr}
\min_f \sum_{i: y_i = -1} l(f(x_i; w) - q(f(X), 1 - c)).
\end{equation}
Alternatively, because the loss on the positive examples can be used as a lower bound on the true positive rate \cite{eban2017scalable}, we can consider the objective
\begin{equation}\label{eq:unconstrained_tp_at_ppr}
\min_f \sum_{i: y_i = 1} l(-f(x_i; w) + q(f(X), 1 - c)).
\end{equation}
\section{Estimating the Quantile Function}
Even with the unconstrained losses (\ref{eq:unconstrained_fp_at_r}) and (\ref{eq:unconstrained_fp_at_ppr}) in hand, we are left with the question of how to estimate the quantile function
$$q(f(A), c).$$
Whatever estimator we choose is required to have explicit dependence on $w$, for the purposes of numerical optimization.
The simplest choice is to apply the definition of $q$ directly, which results in the point estimator
\[
\hat{q}_1(f(A), c) = f(\hat{x})
\]
where $\hat{x}$ is the datapoint which solves
\[
\hat{x} = \argmax_{x \in A} \left\{ f(x): \frac{|\{z \in A: f(z) \leq f(x)\}|}{|A|} \leq c \right\}.
\]
In other words, we take the scores $f(A) = \{f_1, \ldots, f_n\}$ sorted in ascending order and use $\hat{q}_1 = f_k$ for the largest integer $k$ such that $k/n \leq c$.
The concern with $\hat{q}_1$ is that the variance of this estimator and its gradient may be problematically large. For example, consider the case when the scoring function $f$ is linear:
$$f(x; w) = w^Tx,$$
where a bias term is unnecessary because it can be absorbed in to $\theta$. In this case, the loss for a rate constraint $r_A(f, \theta) \geq c$ is
\begin{equation}\label{eq:one_point_loss}
\begin{split}
L &= \sum_i l(f(x_i; w) - \hat{q}_1(f(A))) \\
&= \sum_i l(w^Tx_i - w^T\hat{x}),
\end{split}
\end{equation}
where $\hat{x} \in A$ is the datapoint such that $\hat{q}_1(f(A), c) = f(\hat{x}) = w^T \hat{x}$. Note that, due to the change in $\hat{x} = \hat{x}(w)$ as $w$ changes, the loss is not convex.
Letting $\sigma(x)$, the logistic sigmoid, denote the derivative of logloss, the gradient of $L$ (where it is defined) is
\begin{equation}
\begin{split}
\nabla_w L &= \sum_i \sigma(w^Tx_i - w^T\hat{x}) (x_i - \hat{x}) \\
&= \sum_i a_i x_i - \left(\sum_i a_i \right) \hat{x}
\end{split}
\end{equation}
where $a_i = \sigma(w^Tx_i - w^T\hat{x})$. From this expression, the excessive influence of $\hat{x}$ is clear. Variation in the classifier parameters or the data which causes only a small change in the quantile estimate may nonetheless cause a dramatic change in $\nabla_w L$; this gradient is discontinuous.
In \cite{boyd2012accuracy}, an objective similar to (\ref{eq:unconstrained_fp_at_ppr}) is considered in the presence of rate constraints. There, (\ref{eq:one_point_loss}) is minimized separately for each possible choice $\hat{x} \in X$ to yield a solution $w_k$ for each $k = 1, \ldots, |X|$. Of these $|X|$ solutions, the algorithm selects the one with the smallest value of $|r_A(f(\cdot; w_k), \theta) - c|$. While this approach elegantly handles the nondifferentiability and nonconvexity of $L$, it is unfortunately not feasible even for datasets of moderate size.
One alternative for estimating $q(f(A), c)$ would be to assume a flexible parametric form for the distribution of the scores $f(A)$, for which the quantile function is available in closed form (e.g. as a function of the maximum likelihood parameter estimates). While this approach might suffice for simple scoring functions, its utility is dubious in the context of complex scoring functions such as neural networks \cite{kull2017beta}.
\subsection{Kernel Quantile Estimators}
To achieve lower gradient variance than the point estimator without relying on parametric assumptions, we turn to \textit{kernel quantile estimators}. These are a subclass of $L$-estimators, computed as a weighted average of the order statistics of $f(A)$ \cite{sheather1990kernel, zielinski2004optimal}. These estimators are promising for our application because their gradients are far less sensitive to small parameter changes than the point estimator.
\begin{definition}
Let $S = \{s_1, \ldots, s_N\}$ be a set of real numbers, and let $s_{(i)}$ denote the $i$th order statistic of $S$ (i.e. $s_{(i)} = s_{\sigma(i)}$ where $\sigma$ is the permutation which sorts $S$ in ascending order).
Given a symmetric, normalized kernel $\phi$ and a nonnegative scale parameter $h$, the \textit{kernel quantile estimator} corresponding to $\phi$ and $h$ is defined \cite{sheather1990kernel}
\begin{equation}\label{eq:kernel-estimator}
\begin{split}
\hat{q}^h_\phi(S, c) = \frac{1}{N} \sum_{i=1}^N \phi_h(i^*/N - c) s_{(i)},
\end{split}
\end{equation}
where $\phi_h(x) = \frac{1}{h}\phi(x/h)$, $c$ is the quantile to be estimated, and the index $i^*$ is defined to break ties: $i^* = \max \{j: s_{(j)} = s_{(i)}\}$.
\end{definition}
The free parameter $h$ controls the scale of the kernel, and increasing it trades off variance for bias. There are many other $L$-estimators of the quantile function; see for example \cite{cheng1995bernstein, harrell1982new, kalgh1982generalized, pepelyshev2014estimation, zielinski2004optimal} and citations therein.
It is beyond the scope of this paper to consider all of them, so in all experiments we use the Gaussian kernel estimator
\[
\phi_h(x) = \frac{1}{h \sqrt{2 \pi}} e^{x^2 / 2 h^2}.
\]
Like the point quantile estimator, the kernel estimators lead to losses which are not convex.
We also consider an $L$-estimator which serves as a lower bound for the point estimator and results in convex loss.
Let
\begin{equation}
\label{eq:convex-estimator}
\begin{split}
\hat{q}_m(S, c) = \text{mean}_{x \in S} \left\{x: \frac{|\{z \in S: z \leq x\}|}{|S|} \leq c \right\}.
\end{split}
\end{equation}
From the definition of the point estimator, it is immediate that $q_1 \ge q_m$ as the \emph{max} is greater then the \emph{mean}.
In other words: rather than taking the $k$th largest score, where $k$ is the largest integer $k$ such that $k/N \leq c$, we take the mean of the bottom $k$ scores, which serves as a lower bound. In the case when $f$ is linear, this lower bound is concave because it is a pointwise minimum of affine functions \cite{boyd2004convex}.
Returning to the case of a rate-constrained precision loss (of which (\ref{eq:unconstrained_fp_at_r}) and (\ref{eq:unconstrained_fp_at_ppr}) are special cases), we see that because $\hat{q}_m \leq \hat{q}_1$ and logloss is nondecreasing,
\begin{equation} \label{eq:one_point_bound}
\begin{split}
& \sum_i l (f(x_i; w) - \hat{q}_1(f(A), c)) \\
\leq & \sum_i l (f(x_i; w) - \hat{q}_m(f(A), c))
\end{split}
\end{equation}
so that using the $\hat{q}_m$ estimator yields an upper bound on the loss with the point estimator $\hat{q}_1$. When $f$ is linear, repeated applications of the rules of convex function composition \cite{boyd2004convex} show that $\hat{q}_m(f(A), c)$ is convex and hence the entire upper bound is as well. The bound $\hat{q}_m$ enjoys a lower gradient variance than $\hat{q}_1$, and is tightest when $c$ is small, which occurs exactly when enforcing a constraint that the predicted positive rate on $A$ be high.
\subsection{Stochastic Gradient Descent with Quantile Estimators}
Losses of the form (\ref{eq:unconstrained_optimization}), regardless of the choice of quantile estimator or bound, are compatible with any scoring function and amenable to numerical optimization. For concreteness we consider stochastic gradient descent, described in Algorithm \ref{euclid}.
\begin{algorithm}
\caption{SGD for Quantile loss (\ref{eq:unconstrained_optimization})}\label{euclid}
\begin{algorithmic}[1]
\Require A dataset $(X, Y)$, desired rate constraint $r_A \geq c$ on a subset $A \subseteq X$, quantile estimator $\hat{q}$, scoring function $f(\cdot; w)$, and learning rate $\gamma$.
\While{not converged}
\State Gather a minibatch $(X_b, Y_b)$ from $(X, Y)$
\State Gather a minibatch $A_b$ from $A$ \label{alg:step2}
\State Update \linebreak $w \gets w - \gamma \nabla_w L(X_b, Y_b, f(\cdot; w), \hat{q}(f(A_b), 1-c))$
\EndWhile
\end{algorithmic}
\end{algorithm}
Step \ref{alg:step2} is beneficial when datapoints from $A$ are rare, but when $A$ is common or minibatches are large it will suffice to take $A_b = X_b \cap A$.
\section{Experiments}
\subsection{Precision@K}
In this section we consider the application of the quantile threshold framework to the target metric Precision@K. We compare the quantile loss with two state of the art algorithms: Accuracy at the top \cite{boyd2012accuracy} and the average surrogate loss $l^\text{avg}_{prec@k}$ from \cite{kar2015surrogate}. To target Precision@K, we follow \cite{boyd2012accuracy} and optimize for Precision at a predicted positive rate $\tau = K/N$, where $N$ is the number of datapoints. In all experiments, the Gaussian kernel quantile estimator was used.
\subsubsection{Ionosphere and Housing datasets}
We compare the results from \cite{boyd2012accuracy} to those obtained using the quantile loss surrogate, averaged across 100 random train/test splits of the data. The fraction of data used for training is 30\% for Ionosphere and 66\% for Housing; the rest is held out for testing. Tables \ref{tab:ionosphere} and \ref{tab:housing} show the Precision@$\tau$ of the methods, where $\tau$ is the classifier's predicted positive rate. The models trained with the quantile loss surrogate were evaluated at the same value of $\tau$ for which they were trained, and were optimized using gradient descent with momentum on the objective (\ref{eq:unconstrained_fp_at_ppr}) with weight decay.
The weight decay regularization coefficient and scale parameter $h$ of the kernel quantile estimator are the algorithm's only hyperparameters. For a fair comparison against Accuracy at the top, which has only one hyperparameter (the regularization coefficient), we fix $h=0.05$ on the Ionosphere data and $h = 0.08$ on the Housing data. As in \cite{boyd2012accuracy}, for each value of $\tau$ the regularization coefficient $C$ was chosen based on the largest average value of Precision@$\tau$.
Because the quantile surrogate loss is nonconvex, the quantile method may converge to a suboptimal local minimum. To mitigate this problem, we run the algorithm with multiple random initializations of $w$ and take the solution with the lowest loss on the training set. Results for one and three initializations are reported.
The quantile surrogate achieves results matching or beating Accuracy at the top, with the largest improvements occurring for small $\tau$. In addition, optimization of the quantile surrogate enjoys very favorable computational complexity relative to Accuracy at the top. Assuming the same number of iterations across all algorithms, logistic regression has an $O(N)$ cost. Accuracy at the top requires solving a separate logistic regression problem for each datapoint, for a total cost of $O(N^2)$. On the other hand, the only additional cost of the quantile method over logistic regression is a sorting operation per iteration, for a total cost of $O(N\log N)$.
\begin{table}[!htp]
\centering
\begin{adjustbox}{width=0.47\textwidth}
\begin{tabular}{|c|c|c|c|c|}\hline
$\tau$ (\%) & LR & AATP & Q1 & Q3 \\ \hline
1 & 0.52 $\pm$ 0.38 & 0.85 $\pm$ 0.24 & 0.87 $\pm$ 0.27 & \tb{0.98 $\pm$ 0.10} \\ \hline
5 & 0.76 $\pm$ 0.14 & 0.91 $\pm$ 0.14 & 0.93 $\pm$ 0.11 & \tb{0.98 $\pm$ 0.07} \\ \hline
9.5 & 0.83 $\pm$ 0.08 & 0.93 $\pm$ 0.06 & 0.91 $\pm$ 0.10 & \tb{0.96 $\pm$ 0.08} \\ \hline
14 & 0.87 $\pm$ 0.05 & 0.91 $\pm$ 0.05 & 0.90 $\pm$ 0.08 & \tb{0.92 $\pm$ 0.08} \\ \hline
19 & \tb{0.89 $\pm$ 0.04} & \tb{0.89 $\pm$ 0.04} & 0.88 $\pm$ 0.06 & 0.88 $\pm$ 0.05 \\ \hline
\end{tabular}
\end{adjustbox}
\caption{P@$\tau$ on the Ionosphere dataset. $\tau\in[0, 1]$ is the predicted positive rate. Results are expressed as mean $\pm$ standard deviation. The columns correspond to logistic regression, Accuracy at the top, the quantile method with one initialization, and the quantile method with three initializations, respectively.}
\label{tab:ionosphere}
\end{table}
\begin{table}[!htp]
\centering
\begin{adjustbox}{width=0.47\textwidth}
\begin{tabular}{|c|c|c|c|c|}\hline
$\tau$ (\%) & LR & AATP & Q1 & Q3 \\ \hline
1 & 0.26 $\pm$ 0.44 & 0.2 $\pm$ 0.27 & 0.4 $\pm$ 0.49 & \tb{0.43 $\pm$ 0.50} \\ \hline
2 & 0.12 $\pm$ 0.19 & 0.23 $\pm$ 0.10 & 0.23 $\pm$0.23 & \tb{0.28 $\pm$ 0.23} \\ \hline
3 & 0.09 $\pm$ 0.10 & 0.20 $\pm$ 0.12 & 0.18 $\pm$0.17 & \tb{0.25 $\pm$ 0.16} \\ \hline
4 & 0.09 $\pm$ 0.10 & 0.19 $\pm$ 0.13 & 0.16 $\pm$0.14 & \tb{0.23 $\pm$ 0.14} \\ \hline
5 & 0.11 $\pm$ 0.09 & 0.17 $\pm$ 0.07 & 0.14 $\pm$0.12 & \tb{0.21 $\pm$ 0.13} \\ \hline
6 & 0.11 $\pm$ 0.08 & 0.14 $\pm$ 0.05 & 0.13 $\pm$0.12 & \tb{0.18 $\pm$ 0.10} \\ \hline
\end{tabular}
\end{adjustbox}
\caption{P@$\tau$ on the Housing dataset. $\tau\in[0, 1]$ is the predicted positive rate. The columns correspond to logistic regression, Accuracy at the top, the quantile method with one initialization, and the quantile method with three initializations, respectively.}
\label{tab:housing}
\end{table}
\subsubsection{KDD Cup 2008}
SVMPerf \cite{joachims2005support} is a standard baseline for methods targeting Precision@K. We compare to the $l^\text{avg}_\text{prec@k}$ surrogate from \cite{kar2015surrogate}, which resolves theoretical issues which arise when applying the structured SVM method to Precision@K. Results are presented in terms of Precision@$\tau$. For this dataset, we consider the loss (\ref{eq:unconstrained_tp_at_ppr}).
Figure \ref{fig:kdd} shows results averaged across 100 random train/test splits of the dataset, with 70\% used for training and the rest reserved for testing. Models with the $l^\text{avg}_\text{prec@k}$ and quantile surrogate losses were evaluated at the same value of $\tau$ for which they were trained, and were learned on the full training set to give the strongest results. The model with the quantile surrogate was trained using stochastic gradient descent with momentum on minibatches of size 1000 for 3 epochs, with randomly initialized parameters.
\begin{figure}[ht]
\centering
{\includegraphics[width=80mm]{pat_kdd.pdf}}\\
\caption{P@$\tau$ on the KDD Cup 2008 dataset. Error bars denote 95\% confidence intervals.} \label{fig:kdd}
\end{figure}
\subsection{Precision at a fixed recall}
In this section, we evaluate the quantile framework on the target metric of precision at fixed recall for a range of recall values on a variety of datasets.
\subsubsection{Synthetic dataset}
To illustrate the benefits of minimizing the precision at recall quantile loss (\ref{eq:unconstrained_fp_at_r}) rather than maximizing likelihood and adjusting the decision threshold, we consider the synthetic dataset in Figure \ref{fig:synthetic}. The data consists of a mixture of isotropic Gaussians with a prior of $p(y=1) = 0.1$, and the objective is to maximize precision at a recall of 0.95. A similar synthetic dataset is considered in \cite{eban2017scalable}. We initialize the weights of a linear classifier randomly, and minimize (\ref{eq:unconstrained_fp_at_r}) using the Gaussian kernel quantile estimator with $h = 0.05$. For this simple problem, we were unable to find initializations that led to different results.
Adjusting the threshold learned by logistic regression to satisfy the recall constraint results in a classifier which misclassifies most negatives. In contrast, the linear classifier trained using the precision at recall loss performs nearly as well as possible. Threshold adjustment performs poorly in this case because the logistic regression classifier is poorly calibrated; the conditional class probability $p(y=1|x)$ is inaccurate.
\begin{figure}[ht]
\centering
{\includegraphics[width=80mm]{synthetic.pdf}}\\
\caption{Logistic (black) and quantile surrogate loss (magenta) classifiers on the synthetic dataset. The black line depicts the learned threshold of the logistic classifier, while the black-dashed line is the adjusted threshold to satisfy a $90\%$ recall constraint. The precision of the logistic classifier at recall 0.9 is 0.13, the QS loss classifiers achieves a precision of 0.37.} \label{fig:synthetic}
\end{figure}
\section{Generalization Bounds}
Consider an $L$-estimator which we call the \textit{interval quantile estimator}
\begin{equation}\label{eq:interval-estimator}
\hat{q}_I(S, c) = \left|\frac{1}{\floor*{N(k_2 - k_1)}} \sum_{i=\floor*{Nk_1}}^{\floor*{Nk_2}} s_{(i)}\right|,
\end{equation}
where $0 < k_1 < c < k_2$, and $0\leq s_1, \dots, \leq s_N$. This is a generalized version of the upper bound estimator in Eq.(\ref{eq:convex-estimator}), since instead of taking all scores lower than the quantile, we take the average on an arbitrary interval.
We prove a generalization bound for the quantile loss function where the quantile estimator is either the interval estimator or a kernel quantile estimator (Eq.\ref{eq:kernel-estimator}) where $\phi_h$ is bounded and Lipschitz. Moreover, the bound is uniform with respect to model parameters if the model is linear. The conclusion holds for quantile estimators on an arbitrary subset of the feature set $X$, and in particular includes the $P@R$ and $P@k$ case used in the experiments. The proof is similar to that in \cite{kar2015surrogate}, and follows mainly from repeated applications of Hoeffding's inequality (which also holds in the case of sampling without replacement \cite{bardenet2015concentration}).
All proofs are presented in the Appendix.
\begin{proposition}[Uniform Convergence]
\label{prop:unif-conv}
Let $Z = \{(x_1, y_1), \ldots, (x_N, y_N)\}$ be a set of feature-label pairs, $\hat{Z}$ be a sample of $b$ elements chosen from $Z$ (either i.i.d or without replacement), $A$ be some subset of $Z$, $\hat{A} = A \cap \hat{Z}$, and $f(x) = w^T x$ be a linear model with parameters $w$ satisfying $\|w\| \leq C$. Let $\hat{q}(f(A))$, $\hat{q}(f(\hat{A}))$ be either the kernel estimator (\ref{eq:kernel-estimator}) with $\phi$ bounded and Lipschitz, or the interval estimator (\ref{eq:interval-estimator}). Define $L(w;Z, A) = \sum_i (1-y_i) l(f(x_i) - \hat{q}(f(A)))$. Then with probability at least $1 - \delta$,
\begin{equation*}
\begin{split}
\left|L_q(w; Z, A) - L_q(w; \hat{Z}, \hat{A})\right|= O\left(\sqrt{\frac{1}{b} \log\frac{1}{\delta}}\right)
\end{split}
\end{equation*}
uniformly in $w$.
\end{proposition}
Proposition \ref{prop:unif-conv} gives a uniform bound on the population loss based on the sample loss. However, because the quantile surrogate does not decompose across datapoints, minibatches give biased estimates and the efficacy of stochastic gradient methods is not immediately clear. In the case when $q$ is the lower bound quantile estimator defined in Eq.\ref{eq:convex-estimator}, we have the following convergence bound for stochastic gradient descent on the quantile surrogate loss.
\begin{proposition}
Let $w^*$ be the parameters of a linear model learned by $T$ steps of stochastic gradient descent with batch size $b$ on the quantile loss $L_q$, where $q$ is the lower bound estimator defined in Eq.\ref{eq:convex-estimator}. Then for any parameters $w$, with probability at least $1 - \delta$
\begin{equation*}
\begin{split}
L_q(w^*; Z) \leq L_q(w; Z) + O\left(\sqrt{\frac{1}{b}\log\frac{T}{\delta}}\right) + O\left(\sqrt{\frac{1}{T}}\right).
\end{split}
\end{equation*}
\end{proposition}
The proof of Proposition \ref{prop:unif-conv} depends on the following concentration bounds for the kernel and interval quantile estimators.
\begin{lemma}\label{lemma:stability-kernel-estimators}
Let $F = \{f_1, \dots, f_N\}$ be real numbers sorted in ascending order, and $|f_i| \leq 1$. Let $\hat{F} = \{\hat{f}_1, \dots, \hat{f}_b\}$ be a sample (either i.i.d or without replacement) from the set $F$, also sorted in ascending order. Let $\hat{q}^h(F, c)$, $\hat{q}^h(\hat{F}, c)$ be the kernel quantile estimator defined in Eq.\ref{eq:kernel-estimator}, and assume the kernel function $\phi_h$ is bounded and Lipschitz continuous, then the following holds
\begin{equation*}
\begin{split}
&\left|\hat{q}^h(F, c) - \hat{q}^h(\hat{F}, c)\right| = O\left(\sqrt{\frac{1}{b} \log\frac{1}{\delta}}\right)
\end{split}
\end{equation*}
with probability at least $1 - \delta$.
\end{lemma}
\begin{lemma}\label{lemma:stability}
Let $F = \{f_1, \dots, f_N\}$ be real numbers sorted in ascending order, and $|f_i| \leq 1$. Let $\{\hat{f}_1, \dots, \hat{f}_b\}$ be a sample (either i.i.d or without replacement) from the set $F$, also sorted in ascending order. Let $0 < k_1< k_2 < 1$. Then the following holds with probability at least $1 - \delta$:
\begin{equation*}
\begin{split}
&\left|\frac{1}{\floor*{N(k_2 - k_1)}} \sum_{i=\floor*{Nk_1}}^{\floor*{Nk_2}} f_i - \frac{1}{\floor*{b(k_2 - k_1)}} \sum_{j=\floor*{bk_1}}^{\floor*{bk_2}} \hat{f}_j\right| \\
&= O\left(\sqrt{\frac{1}{b} \log\frac{1}{\delta}}\right).
\end{split}
\end{equation*}
\end{lemma}
\section{Conclusion}
A number of recent papers have demonstrated the value of constrained optimization for machine learning with non-accuracy objectives. We show that for a large class of these problems, the constraint can be eliminated by substitution using the quantile function, which can be effectively estimated in a way which is amenable to standard learning methods. The algorithm enjoys standard empirical risk bounds and strong performance relative to other methods and surrogates for enforcing constraints relevant to non-accuracy objectives.
While we have presented examples for Precision at a fixed recall and Precision at K, our main contribution -- the use of quantile function estimators in constrained machine learning problems -- is more general.
\section*{Acknowledgements}
The authors would like to thank Ofer Meshi for helpful discussions and insightful comments on the manuscript.
\section{Proofs}
\begin{proposition}[Uniform Convergence]
Let $Z = \{(x_1, y_1), \ldots, (x_N, y_N)\}$ be a set of feature-label pairs, $\hat{Z}$ be a sample of $b$ elements chosen from $Z$ (either i.i.d or without replacement), $A$ be some subset of $Z$, $\hat{A} = A \cap \hat{Z}$, and $f(x) = w^T x$ be a linear model with parameters $w$ satisfying $\|w\| \leq C$. Let $\hat{q}(f(A))$, $\hat{q}(f(\hat{A}))$ be either the kernel estimator (\ref{eq:kernel-estimator})
with $\phi$ bounded and Lipschitz, or the interval estimator (\ref{eq:interval-estimator}). Define $L(w;Z, A) = \sum_i (1-y_i) l(f(x_i) - \hat{q}(f(A)))$. Then with probability at least $1 - \delta$,
\begin{equation}\label{eq:generalization-bound-1}
\begin{split}
\left|L_q(w; Z, A) - L_q(w; \hat{Z}, \hat{A})\right|= O\left(\sqrt{\frac{1}{b} \log\frac{1}{\delta}}\right)
\end{split}
\end{equation}
uniformly in $w$.
\end{proposition}
\begin{proof}
We first show pointwise convergence with high probability. Let $\hat{\theta}_N:=\hat{q}(f(A))$, and $\hat{\theta}_b:=\hat{q}(f(\hat{A}))$. We split Eq.(\ref{eq:generalization-bound-1}) to two parts. Let $\mL(x):=l(x)$, we have
\begin{equation*}
\begin{split}
& |L_q(w; Z, A) - L_q(w; \hat{Z}, \hat{A})|\\
& \leq \left|\frac{1}{N}\sum_{i = 1}^N \mL(f(x_i) - \hat{\theta}_N)-\frac{1}{b}\sum_{i = 1}^b \mL(f(\hat{x}_i) - \hat{\theta}_N) \right| \quad \text{(A)}\\
& + \left| \frac{1}{b}\sum_{i = 1}^b \mL(f(x_i) - \hat{\theta}_N)
- \frac{1}{b}\sum_{i = 1}^b\mL(f(x_i) - \hat{\theta}_b)\right| \\
&\leq (A) + \left|\hat{\theta}_N - \hat{\theta}_b\right|
\end{split}
\end{equation*}
where the last line follows from the logloss being Lipschitz with constant $1$.
Since $w$ is bounded, the scores $f(x_i)$ are bounded and an application of Hoeffding's inequality gives $\text{(A)}=O\left(\frac{1}{b} \log\frac{1}{\delta}\right)$ w.h.p.
The bound for the term $|\hat{\theta}_N - \hat{\theta}_b| $ is proved in Lemma \ref{lemma:stability} and Lemma \ref{lemma:stability-kernel-estimators} by setting $f_{i'} = f(x_i), i\in A$, and scaling $f_i$ such that $|f_i| < 1$.
Because $f$ is linear, it can be shown that the bound is uniform with respect to $w$ by arguing along the lines of Theorem 12 in \cite{kar2015surrogate}. Namely, we first show that the quantile loss is Lipschitz with respect to model parameters $w$. Note that logloss is Lipschitz continuous with constant 1, and $\theta_N(w)$, $\theta_b(w)$ are Lipschitz with constant $\max_i\{\|x_i\|_\infty\}$. Since the quantile loss $L_q$ is a composition of logloss and the quantile estimator, $L_q$ is Lipschitz. Applying the $L_\infty$ covering number argument in \cite{zhang2002covering} for linear models, together with pointwise convergence, gives uniform convergence.
\end{proof}
\begin{proposition}
Let $w^*$ be the parameters of a linear model learned by $T$ steps of stochastic gradient descent with batch size $b$ on the quantile loss $L_q$, where $q$ is the lower bound estimator defined in Eq.\ref{eq:convex-estimator}. Then for any parameters $w$, with probability at least $1 - \delta$
\begin{equation}
\label{eq:data-stream}
\begin{split}
L_q(w^*; Z) \leq L_q(w; Z) + O\left(\sqrt{\frac{1}{b}\log\frac{T}{\delta}}\right) + O\left(\sqrt{\frac{1}{T}}\right).
\end{split}
\end{equation}
\end{proposition}
\begin{proof}
Since the quantile loss $L_q$ with the lower bound quantile estimator is convex, we can apply Theorem 6 from \cite{kar2014online} which states that any convex loss satisfying the uniform convergence property in Proposition \ref{prop:unif-conv} satisfies Eq.\ref{eq:data-stream}.
\end{proof}
\begin{lemma
Let $F = \{f_1, \dots, f_N\}$ be real numbers sorted in ascending order, and $|f_i| \leq 1$. Let $\hat{F} = \{\hat{f}_1, \dots, \hat{f}_b\}$ be a sample (either i.i.d or without replacement) from the set $F$, also sorted in ascending order. Let $\hat{q}^h(F, c)$, $\hat{q}^h(\hat{F}, c)$ be the kernel quantile estimator defined in Eq.\ref{eq:kernel-estimator}, and assume the kernel function $\phi_h$ is bounded and Lipschitz continuous, then the following holds
\begin{equation*}
\begin{split}
&\left|\hat{q}^h(F, c) - \hat{q}^h(\hat{F}, c)\right| = O\left(\sqrt{\frac{1}{b} \log\frac{1}{\delta}}\right)
\end{split}
\end{equation*}
with probability at least $1 - \delta$.
\end{lemma}
\begin{proof}
For simplicity, assume the numbers $f_i, i=1\dots N$ are distinct. Define $p(x):=\frac{|\{\hat{f_j} \leq x\}|}{b}$, and writing $p_k = p(f_k)$ for short, we have
\begin{equation}
\label{eq:lemma-kernel}
\begin{split}
&\hat{q}^h(\hat{F}, c) := \frac{1}{b} \sum_{i=1}^{b} \phi_h\left(\frac{i^*}{b} - c\right) \hat{f}_i\\
&= \frac{1}{b} \sum_{i=1}^{b} \phi_h\left(p(\hat{f}_i) - c \right) \hat{f}_i\\
&= \frac{1}{b} \sum_{k=1}^N \phi_h(p(f_k) - c) f_k \times |\{\hat{f}_i = f_k\}| \\
&= \frac{1}{b} \sum_{k=1}^N \phi_h(p(f_k) - c) f_k \times \left(|\{\hat{f}_i \leq f_k\}| - |\{\hat{f}_i \leq f_{k - 1}\}|\right)\\
&= \sum_{k=1}^{N} \phi_h\left(p_k - c\right) \left(p_k - p_{k-1}\right)f_k,
\end{split}
\end{equation}
with $p_0 :=0$. Since $|p_k - \frac{k}{N}| = |\frac{1}{b}\sum_{i=1}^b \mathbf{1}_{\hat{f}_i \leq f_k} - \mathbb{E}\mathbf{1}_{\hat{f}_i \leq f_k}|$, we have for all $k$, $|p_k - \frac{k}{N}| = O\left(\sqrt{\frac{1}{b} \log\frac{1}{\delta}}\right)$ w.h.p. by Hoeffding's inequality. Similarly, we also have $|p_k - p_{k-1} - \frac{1}{N}| = O\left(\sqrt{\frac{1}{b} \log\frac{1}{\delta}}\right).$ Let $|\phi_h|$ be bounded by $M$ with Lipschitz constant $K$. Then by Eq.\ref{eq:lemma-kernel},
\begin{equation*}
\begin{split}
&\hat{q}^h(\hat{F}, c) = \sum_{k=1}^{N} \phi_h(p_k - c) (p_k - p_{k-1})f_k \\
&= \sum_{k=1}^{N} \frac{1}{N}\phi_h\left(\frac{k}{N} - c\right) f_k + (K+M)O\left(\sqrt{\frac{1}{b} \log\frac{1}{\delta}}\right)\\
&= \hat{q}^h(F, c) + O\left(\sqrt{\frac{1}{b} \log\frac{1}{\delta}}\right)
\end{split}
\end{equation*}
holds w.h.p. The case where $f_i$ are not distinct could be proved similarly by considering a non-uniform draw from the set of unique elements in $\{f_i\}$.
\end{proof}
\begin{lemma
Let $F = \{f_1, \dots, f_N\}$ be real numbers sorted in ascending order, and $|f_i| \leq 1$. Let $\{\hat{f}_1, \dots, \hat{f}_b\}$ be a sample (either i.i.d or without replacement) from the set $F$, also sorted in ascending order. Let $0 < k_1< k_2 < 1$. Then the following holds with probability at least $1 - \delta$:
\begin{equation*}
\begin{split}
&\left|\frac{1}{\floor*{N(k_2 - k_1)}} \sum_{i=\floor*{Nk_1}}^{\floor*{Nk_2}} f_i - \frac{1}{\floor*{b(k_2 - k_1)}} \sum_{j=\floor*{bk_1}}^{\floor*{bk_2}} \hat{f}_j\right| \\
&= O\left(\sqrt{\frac{1}{b} \log\frac{1}{\delta}}\right).
\end{split}
\end{equation*}
\end{lemma}
\begin{proof}
For convenience, assume that $Nk_1$, $Nk_2$, $bk_1$, and $bk_2$ are all integers. Let $w_i = f_{\floor*{Nk_i}}$, $\hat{w}_i = \hat{f}_{\floor*{b k_i}}$ for $i = 1, 2$. Define $\mathbb{T}_1(f) = \mathbbm{1}_{f > w_1}$, $\mathbb{T}_2(f) = \mathbbm{1}_{f \leq w_2}$, and $\hat{\mathbb{T}}_1(f) = \mathbbm{1}_{f > \hat{w}_1}$, $\hat{\mathbb{T}}_2(f) = \mathbbm{1}_{f \leq \hat{w}_2}$. Letting $c = \frac{1}{k_2 - k_1}$, we have the following estimate:
\begin{equation*}
\begin{split}
&\left|\frac{1}{\floor*{N(k_2 - k_1)}} \sum_{i=\floor*{Nk_1+1}}^{\floor*{Nk_2}} f_i - \frac{1}{\floor*{b(k_2 - k_1)}} \sum_{j=\floor*{bk_1}+1}^{\floor*{bk_2}} \hat{f}_j\right|
\\&= c\left|\frac{1}{N}\sum_{i=1}^N\mathbb{T}_1(f_i)\mathbb{T}_2(f_i)f_i - \frac{1}{b}\sum_{i=1}^b\hat{\mathbb{T}}_1(\hat{f}_i)\hat{\mathbb{T}}_2(\hat{f}_i)\hat{f}_i \right| \\
&\leq c\left|\frac{1}{N}\sum_{i=1}^N\mathbb{T}_1(f_i)\mathbb{T}_2(f_i)f_i - \frac{1}{b}\sum_{i=1}^b\mathbb{T}_1(\hat{f}_i)\mathbb{T}_2(\hat{f}_i)\hat{f}_i \right| \text{(A)}\\
&+ c \left|\frac{1}{b}\sum_{i=1}^b\mathbb{T}_1(\hat{f}_i)\mathbb{T}_2(\hat{f}_i)\hat{f}_i - \frac{1}{b}\sum_{i=1}^b\hat{\mathbb{T}}_1(\hat{f}_i)\hat{\mathbb{T}}_2(\hat{f}_i)\hat{f}_i\right|. \text{\hspace{3pt}(B)}
\end{split}
\end{equation*}
(A) is $O\left(\sqrt{\frac{1}{b} \log\frac{1}{\delta}}\right)$ w.h.p. by Hoeffding's inequality (since $w_i$ is fixed with respect to the samples $\hat{f}_i$). For (B), we use the observation that
\[
\begin{split}
|&\mathbb{T}_1(x)\mathbb{T}_2(x) - \hat{\mathbb{T}}_1(x)\hat{\mathbb{T}}_2(x)| = |\mathbb{T}_1(x) - \hat{\mathbb{T}}_1(x) \\&+ \mathbb{T}_2(x) - \hat{\mathbb{T}}_2(x)|
\end{split}
\]
holds for all $w_i$, $\hat{w}_i$, and $x$, which can be verified by checking all cases. Using the equality above, we have
\begin{equation*}
\begin{split}
&\left|\frac{1}{b}\left(\sum_{i=1}^b\mathbb{T}_1(\hat{f}_i)\mathbb{T}_2(\hat{f}_i) - \sum_{i=1}^b\hat{\mathbb{T}}_1(\hat{f}_i)\hat{\mathbb{T}}_2(\hat{f}_i)\right)\hat{f}_i\right| \\
&\leq \left|\frac{1}{b}\left(\sum_{i=1}^b\mathbb{T}_1(\hat{f}_i)\mathbb{T}_2(\hat{f}_i) - \sum_{i=1}^b\hat{\mathbb{T}}_1(\hat{f}_i)\hat{\mathbb{T}}_2(\hat{f}_i)\right)\right|\\
&\leq \frac{1}{b}\sum_{i=1}^b\left|\left(\mathbb{T}_1(\hat{f}_i) - \hat{\mathbb{T}}_1(\hat{f}_i)\right) + \left(\mathbb{T}_2(\hat{f}_i) - \hat{\mathbb{T}}_2(\hat{f}_i)\right)\right| \\
&\leq \frac{1}{b}\sum_{i=1}^b\left|\left(\mathbb{T}_1(\hat{f}_i) - \hat{\mathbb{T}}_1(\hat{f}_i)\right) \right| +\frac{1}{b}\sum_{i=1}^b\left|\left(\mathbb{T}_2(\hat{f}_i) - \hat{\mathbb{T}}_2(\hat{f}_i)\right) \right|\\
&= \left|\frac{1}{b}\sum_{i=1}^b\left(\mathbb{T}_1(\hat{f}_i) - \hat{\mathbb{T}}_1(\hat{f}_i)\right) \right| +\left|\frac{1}{b}\sum_{i=1}^b\left(\mathbb{T}_2(\hat{f}_i) - \hat{\mathbb{T}}_2(\hat{f}_i)\right) \right|,
\end{split}
\end{equation*}
where the last line follows from the fact that the function $\mathbb{T}_i(x)- \hat{\mathbb{T}}_i(x)$ has a fixed sign for all $x$. Note that $$\left|\frac{1}{b}\sum_{i=1}^b\left(\mathbb{T}_1(\hat{v}_i) - \hat{\mathbb{T}}_1(\hat{f}_i)\right) \right| = \left|\frac{1}{ b}\sum_{i=1}^b\mathbb{T}_1(\hat{f}_i) - k_1\right|,$$ which is again bounded by $O\left(\sqrt{\frac{1}{b} \log\frac{1}{\delta}}\right)$ w.h.p. via Hoeffding's inequality. Arguing similarly for the other term with $\mathbb{T}_2$ and $\hat{\mathbb{T}}_2$, we conclude the proof of the lemma.
\end{proof}
\section{Introduction}
In many real-world applications, machine learning classification systems do not simply make predictions to minimize errors or to maximize likelihood. Instead, the decision threshold of a learned classifier is often adjusted after training to select a particular operating point on the precision-recall or ROC curve, reflecting how the classifier will be used. Automated email spam filters, for example, might operate with an increased threshold to achieve a high precision or low predicted positive rate. In medical diagnosis, the threshold may be decreased so that the classifier will make predictions with a high recall \cite{he2009learning}. When a particular operating point for the classifier is not known ahead of time, area under the precision-recall or ROC curve is often the metric used to compare models. In other cases, classifiers are adjusted to obey constraints on coverage or fairness (i.e. predicted positive rates on subsets of the training data) so that the system will not treat some demographics of users unfairly \cite{goh2016satisfying}.
In all of these cases, the most desirable binary classifier can be characterized as one which maximizes a quantity such as accuracy, precision, or recall, subject to a constraint. The constraint is usually an inequality on the predicted positive rate (coverage) or true/false positive/negative rate on some subset of the data. The most common practice to produce a classifier which satisfies a constraint is to train the classifier by maximum likelihood, then after training, adjust its threshold so that the constraint is satisfied.
Threshold adjustment enjoys a strong theoretical justification \cite{koyejo2014consistent}: for a large family of metrics, the Bayes optimal classifier makes predictions by thresholding the conditional class probability $P(y=1|x)$. The same result is known for binary cost-sensitive classification \cite{elkan2001foundations}. However, thresholding is not the end of the story because learning accurate (or calibrated) conditional probabilities is more challenging than learning loss-minimizing predictions \cite{joachims2005support, margineantu2002class}. This observation is a fundamental motivation for structured losses.
Accordingly, there have been several attempts to address constrained classification problems directly through the machinery of constrained optimization \cite{davenport2010tuning,goh2016satisfying,eban2017scalable}. Instead, we focus on eliminating the constraint by substitution. For constraints which can be expressed as a rate on the training dataset (e.g. predicted positive rate, the threshold of a classifier which satisfies the constraint can be expressed as a quantile of the classifier's scores. By incorporating an estimator of the quantile into the loss function, the constraint can be eliminated. For simplicity, we focus on binary classification and apply the quantile estimation approach to optimize precision at a fixed recall and precision@K.
In summary, our contribution is as follows. First, we show that a wide variety of machine learning problems with constraints can be recast as ordinary, unconstrained learning problems. Second, we show that the resulting unconstrained problems can be solved efficiently and generally; they are particularly amenable to gradient-based optimization, independent of what model is used. For linear models, we derive a convex upper bound on the loss, and also prove a uniform risk bound. Finally, in experiments across a variety of benchmarks, we demonstrate performance matching or outperforming state of the art methods.
\section{Related Work}
Many existing approaches aim to optimize for non-decomposable performance measures, enforce dataset constraints, or incorporate classifier score quantiles into the training procedure. Below, we summarize those most related to the proposed method.
Several attempts, most notably \cite{joachims2005support}, have used the framework of structured prediction \cite{taskar2004max, tsochantaridis2005large, koller2009probabilistic} to handle performance metrics beyond accuracy. The method, however, faces several problems. First, each iteration of the algorithm in \cite{joachims2005support} requires fully training an SVM over the entire dataset, which hinders scalability. Second, it is not clear how the methods extends to handle constraints which depend on the labels, which are not available at test time. For example, a constraint on the predicted positive rate is easily enforced at test time, while a constraint on the true positive rate is not.
The authors of \cite{kar2015surrogate} identify a third shortcoming: the structured SVM framework \cite{joachims2005support} assumes that the true labels are admissible under the constraint on the classifier. When optimizing Precision@K, the true labels are only admissible when the dataset contains exactly $K$ positives. This problem and the scalability issue are both addressed in \cite{kar2015surrogate}, but how to handle constraints which depend on the ground truth labels remains unclear.
For the specific case of a linear classifier, \cite{goh2016satisfying} approaches general dataset constraints by framing the problem as constrained optimization with the ramp loss and solving it with a majorization-minimization approach. However, their algorithm is not readily generalized to the nonlinear case.
The special case of minimizing the probability of false negatives subject to a constraint on the probability of false positives is known as Neyman-Pearson classification \cite{tong2016survey}. It is known that, with minor regularity assumptions, Neyman-Pearson classification can be accomplished by re-weighting the losses on the positives and negatives. Both \cite{davenport2010tuning} and \cite{eban2017scalable} seek to identify the appropriate re-weighting during the course of training, the former by direct search and the latter by saddle-point optimization with Lagrange multipliers. These methods apply to non-linear classifiers such as neural networks, and \cite{eban2017scalable} extends the idea to handle the $F_\beta$ meaure, ROC-AUC, and Precision-Recall AUC.
The saddle-point approach has an advantage when direct search is very expensive and it applies to a wider class of models, but there is no guarantee that the constraint will be satisfied unless the saddle point problem is solved to convergence. Unfortunately, this is incompatible with the ubiquitous practice of early stopping in neural networks. In addition, the convex relaxation of the constraint can result in loose bounds and oversatisfied constraints.
The idea of placing a quantile constraint on the classifier's scores was explored in \cite{boyd2012accuracy}, and produced impressive results relative to other approaches for optimizing ranking metrics such as precision@K. However, the method of \cite{boyd2012accuracy} requires learning a separate classifier for each datapoint in the training set, which is tractable only for very small datasets. In contrast, our approach is amenable to stochastic gradient methods and scales easily to datasets with millions of examples.
\section{Quantile Surrogate Losses}
In this section, we describe our approach in detail and focus on maximizing Precision@K and Precision at a fixed recall.
Let $X = \{x_1, \dots, x_n\}$ consist of the features in a training dataset, and let $Y = \{y_1, \dots, y_n\}$ denote the corresponding labels in $\{-1, 1\}$.
We consider a classifier to consist of a scoring function $f$ determined by learnable parameters $w$, and a threshold $\theta$.
The prediction $\hat{y}_i$ of the classifier on the $i$th example is made according to
\[
\hat{y}_i = \text{sign}(f(x_i; w) - \theta).
\]
\begin{definition}
Given a subset $A \subseteq X$, we define the \emph{predicted positive rate} for a classifier $(f, \theta)$ on $A$ to be the fraction of examples in $A$ predicted to be positives:
$$r_A(f, \theta) = \frac{|\{x_i \in A: f(x_i; w) - \theta > 0\}|}{|A|}.$$
A \emph{rate constraint} is a constraint which can be written in the form $r_A \gtrless c$
for some value of $c\in [0, 1]$.
\end{definition}
Note that $r_A(f, \theta)$ is piecewise constant, discontinuous, and monotone decreasing in $\theta$. Defining $f(A) = \{f(x): x \in A\}$, we see that $r_A(f, \min f(A)) = 1$ and $r_A(f, \max f(A)) = 0$. Therefore, inequality rate constraints can always be satisfied by setting $\theta$ to some value depending on $f$ and $c$.
The notion of predicted positive rate on a subset is general enough to represent many metrics of interest. Letting $X^+$ denote the positive examples in $X$, we see that the recall (or true positive rate) of a classifier $(f, \theta)$ is equal to $r_{X^+}(f, \theta)$. The typical notion of predicted positive rate coincides with $r_X(f, \theta)$, and false positive rate can be written as $r_{X^-}(f, \theta)$. Other examples are given in \cite{goh2016satisfying}: coverage, churn, and fairness can all be expressed in terms of predicted positive rates. Because the predicted positive and predicted negative rates must sum to one, we may consider predicted positive rate constraints without loss of generality.
Given some metric (or utility) $G$ that depends on the data $X, Y$ and the classifier $(f, \theta)$, we can define the problem of maximizing $G$ subject to the rate constraint $r_A(f, \theta) \geq c$ as
\begin{equation}\label{eq:constrained_optimization}
\max_{f, \theta} G(X, Y, f, \theta) \quad \text{subject to} \quad r_A(f, \theta) \geq c.
\end{equation}
Note that $G$ need not decompose across examples, as accuracy does. Due to the discontinuity of $r_A(f, \theta)$ and most metrics $G$, the problem is combinatorial and intractable to solve exactly. However, there are many cases in which we can characterize an optimizer $(f^*, \theta^*)$ in terms of the quantiles of $f^*(A)$.
\begin{definition}
For a set of real numbers $S = \{s_1, \ldots, s_N\}$ the quantile function is defined as
\begin{equation*}
\begin{split}
q(S, c) &= \sup \{t: |\{s_i \leq t\}|/N \leq c\} \\
&= \inf \ \{t: |\{s_i \leq t\}|/N \geq c\}.
\end{split}
\end{equation*}
\end{definition}
\begin{proposition}\label{prop:quantile}
Suppose $(f, \theta)$ is a feasible point for (\ref{eq:constrained_optimization}) and let
\[
\hat{\theta} = q(f(A), 1 - c).
\]
Then $(f, \hat{\theta})$ is also feasible. If $G(X, Y, f, \theta)$ is monotone increasing in $\theta$ over the range $[\theta, \hat{\theta}]$, then $G(X,Y,f,\hat{\theta}) \geq G(X,Y,f,\theta)$.
\end{proposition}
\begin{proof}
Because $r_A(f, \theta)$ is monotone decreasing in $\theta$, any admissible $\theta$ must satisfy
\begin{equation*}
\begin{split}
\theta &\leq \sup \{t: r_A(f^*, t) \geq c\} \\
&\leq \sup \{t: |\{x \in A : f^*(x) > t\}|/|A| \geq c\} \\
&\leq \sup \{t: 1 - |\{x \in A: f^*(x) \leq t\}|/|A| \geq c\} \\
&\leq \sup \{t: |\{x \in A: f^*(x) \leq t\}|/|A| \leq 1-c \}.
\end{split}
\end{equation*}
The supremum in the last line is exactly the quantile function, and so
$$\theta \leq q(f(A), 1 - c).$$
The claim follows from the fact that $G$ is monotone in $\theta$ and that $\hat{\theta} \geq \theta$.
\end{proof}
Applying the proposition to an optimizer $(f^*, \theta^*)$ shows that $(f^*, \hat{\theta})$ is also an optimizer. In particular, a scoring function $f$ which optimizes (\ref{eq:constrained_optimization}) is a minimizer of the loss
\begin{equation}\label{eq:unconstrained_optimization}
\min_f L(X, Y, f, q(f(A), 1-c))
\end{equation}
With $L = -G$. Conversely, optimizers of (\ref{eq:unconstrained_optimization}) are feasible and hence optimal for (\ref{eq:constrained_optimization}).
In practice, $G$ is usually a differentiable surrogate allowing for numerical optimization and the monotonicity assumption is easily verified. For inequality constraints of the form $r_A(f, \theta) \leq c$, $\theta^*$ is again given by the quantile function so long as $G$ is monotone decreasing in $\theta$.
Proceeding
farther depends on the choice of $G$ and the specific rate constraint, so we consider the task of maximizing precision subject to recall and predicted positive rate constraints. Afterward, we consider the estimation of the quantile function $q(f(A), c)$.
\subsection{Precision at a fixed recall}
The precision and recall of a classifier $(f, \theta)$ are defined as
\begin{equation*}
\begin{split}
P(f, \theta) &= \frac{TP(f, \theta)}{TP(f, \theta) + FP(f, \theta)} \\
R(f, \theta) &= \frac{TP(f, \theta)}{TP(f, \theta) + FN(f, \theta)} = \frac{TP(f, \theta)}{|X^+|},
\end{split}
\end{equation*}
where $TP$ and $FP$ denote the true positives and false positives, respectively:
\begin{equation*}
\begin{split}
TP(f, \theta) &= \sum_{i: y_i = 1} \mathbf{1}_{f(x_i; w) > \theta}\\
FP(f, \theta) &= \sum_{i: y_i = -1} \mathbf{1}_{f(x_i; w) > \theta}.
\end{split}
\end{equation*}
Thus, to optimize for the Precision@Recall objective (P@R), we wish to solve
\begin{equation}\label{eq:max_p_at_r}
\begin{split}
& \max_{f, \theta} \frac{TP(f, \theta)}{TP(f, \theta) + FP(f, \theta)} \\
& \text{subject to} \quad r_{X^+}(f, \theta) \geq c.
\end{split}
\end{equation}
We know the recall constraint $r_{X^+} \geq c$ will be active, because precision is trivially maximized by predicting few or no positives. This implies $r_{X^+} = \tilde{c}$, where $\tilde{c} = \min \{k/|X^+|: k/|X^+| \geq c\}$. Because $N^+ = |X^+|$ is fixed, we conclude that $TP(f, \theta) = \tilde{c} N^+.$ Substituting this value for $TP$ into the expression for precision gives
\[
P(f, \theta) = \frac{TP(f, \theta)}{TP(f, \theta) + FP(f, \theta)} = \frac{cN^+}{cN^+ + FP(f, \theta)}.
\]
Thus, solving
\begin{equation}\label{eq:p_at_r_lb}
\begin{split}
& \max_{f, \theta} \frac{\tilde{c} N^+}{\tilde{c} N^+ + FP(f, \theta)} \\
& \text{subject to} \quad r_{X^+}(f, \theta) \geq c
\end{split}
\end{equation}
gives the solution to (\ref{eq:max_p_at_r}). In addition, (\ref{eq:p_at_r_lb}) is equivalent to
\begin{equation}\label{eq:min_fp_at_r}
\min_{f, \theta} FP(f, \theta) \quad \text{subject to} \quad r_{X^+}(f, \theta) \geq c.
\end{equation}
With the objective in this form, $FP(f, \theta)$ can be upper bounded in the standard way by the logistic loss (or hinge loss), which we denote by $l$:
\begin{equation*}
\begin{split}
FP(f, \theta) &= \sum_{i: y_i = -1} 1_{f(x_i; w) - \theta > 0} \\
&\leq \sum_{i: y_i = -1} l(f(x_i; w) - \theta).
\end{split}
\end{equation*}
This leaves us with
\begin{equation}\label{eq:min_bound_at_r}
\begin{split}
& \min_{f, \theta} \sum_{i: y_i = -1} l(f(x_i; w) - \theta) \\
& \text{subject to} \quad r_{X^+}(f, \theta) \geq c.
\end{split}
\end{equation}
Because the loss is monotone decreasing in $\theta$, the monotonicity assumption of Proposition \ref{prop:quantile} is met and so $\theta = q(f(X^+), 1-c)$. This leads to the unconstrained objective for P@R:
\begin{equation}\label{eq:unconstrained_fp_at_r}
\min_f \sum_{i: y_i = -1} l(f(x_i; w) - q(f(X^+), 1-c)).
\end{equation}
In practice, the minimization is performed with respect to the parameters $w$ of the scoring function $f$, e.g. by stochastic gradient descent.
As pointed out in \cite{eban2017scalable}, the precision at recall objective can be used to target Precision-Recall AUC by approximating the area under the Precision-Recall curve as a Riemann sum.
\subsection{Precision a fixed predicted positive rate} \label{sec:ppr}
For a training dataset $X$ with $N$ points, the Precision@K metric is equivalent to precision at a predicted positive rate of $K/N$. Therefore, we consider the objective
\begin{equation} \label{eq:max_p_at_ppr}
\max_{f, \theta} P(f, \theta) \quad \text{subject to} \quad r_X(f, \theta) = c.
\end{equation}
Because $TP + FP$ is equal to the number of predicted positives, the constraint $r_X(f, \theta) = c$ implies that $TP + FP = cN$, and so (\ref{eq:max_p_at_ppr}) is equivalent to
\[
\max_{f, \theta} TP(f, \theta) \quad \text{subject to} \quad r_X(f, \theta) = c.
\]
Using $TP = cN - FP$, the objective can be rewritten as
\[
\min_{f, \theta} FP(f, \theta) \quad \text{subject to} \quad r_X(f, \theta) = c,
\]
which by the same logistic loss bound and application of Proposition \ref{prop:quantile} becomes
\begin{equation}\label{eq:unconstrained_fp_at_ppr}
\min_f \sum_{i: y_i = -1} l(f(x_i; w) - q(f(X), 1 - c)).
\end{equation}
Alternatively, because the loss on the positive examples can be used as a lower bound on the true positive rate \cite{eban2017scalable}, we can consider the objective
\begin{equation}\label{eq:unconstrained_tp_at_ppr}
\min_f \sum_{i: y_i = 1} l(-f(x_i; w) + q(f(X), 1 - c)).
\end{equation}
\section{Estimating the Quantile Function}
Even with the unconstrained losses (\ref{eq:unconstrained_fp_at_r}) and (\ref{eq:unconstrained_fp_at_ppr}) in hand, we are left with the question of how to estimate the quantile function
$$q(f(A), c).$$
Whatever estimator we choose is required to have explicit dependence on $w$, for the purposes of numerical optimization.
The simplest choice is to apply the definition of $q$ directly, which results in the point estimator
\[
\hat{q}_1(f(A), c) = f(\hat{x})
\]
where $\hat{x}$ is the datapoint which solves
\[
\hat{x} = \argmax_{x \in A} \left\{ f(x): \frac{|\{z \in A: f(z) \leq f(x)\}|}{|A|} \leq c \right\}.
\]
In other words, we take the scores $f(A) = \{f_1, \ldots, f_n\}$ sorted in ascending order and use $\hat{q}_1 = f_k$ for the largest integer $k$ such that $k/n \leq c$.
The concern with $\hat{q}_1$ is that the variance of this estimator and its gradient may be problematically large. For example, consider the case when the scoring function $f$ is linear:
$$f(x; w) = w^Tx,$$
where a bias term is unnecessary because it can be absorbed in to $\theta$. In this case, the loss for a rate constraint $r_A(f, \theta) \geq c$ is
\begin{equation}\label{eq:one_point_loss}
\begin{split}
L &= \sum_i l(f(x_i; w) - \hat{q}_1(f(A))) \\
&= \sum_i l(w^Tx_i - w^T\hat{x}),
\end{split}
\end{equation}
where $\hat{x} \in A$ is the datapoint such that $\hat{q}_1(f(A), c) = f(\hat{x}) = w^T \hat{x}$. Note that, due to the change in $\hat{x} = \hat{x}(w)$ as $w$ changes, the loss is not convex.
Letting $\sigma(x)$, the logistic sigmoid, denote the derivative of logloss, the gradient of $L$ (where it is defined) is
\begin{equation}
\begin{split}
\nabla_w L &= \sum_i \sigma(w^Tx_i - w^T\hat{x}) (x_i - \hat{x}) \\
&= \sum_i a_i x_i - \left(\sum_i a_i \right) \hat{x}
\end{split}
\end{equation}
where $a_i = \sigma(w^Tx_i - w^T\hat{x})$. From this expression, the excessive influence of $\hat{x}$ is clear. Variation in the classifier parameters or the data which causes only a small change in the quantile estimate may nonetheless cause a dramatic change in $\nabla_w L$; this gradient is discontinuous.
In \cite{boyd2012accuracy}, an objective similar to (\ref{eq:unconstrained_fp_at_ppr}) is considered in the presence of rate constraints. There, (\ref{eq:one_point_loss}) is minimized separately for each possible choice $\hat{x} \in X$ to yield a solution $w_k$ for each $k = 1, \ldots, |X|$. Of these $|X|$ solutions, the algorithm selects the one with the smallest value of $|r_A(f(\cdot; w_k), \theta) - c|$. While this approach elegantly handles the nondifferentiability and nonconvexity of $L$, it is unfortunately not feasible even for datasets of moderate size.
One alternative for estimating $q(f(A), c)$ would be to assume a flexible parametric form for the distribution of the scores $f(A)$, for which the quantile function is available in closed form (e.g. as a function of the maximum likelihood parameter estimates). While this approach might suffice for simple scoring functions, its utility is dubious in the context of complex scoring functions such as neural networks \cite{kull2017beta}.
\subsection{Kernel Quantile Estimators}
To achieve lower gradient variance than the point estimator without relying on parametric assumptions, we turn to \textit{kernel quantile estimators}. These are a subclass of $L$-estimators, computed as a weighted average of the order statistics of $f(A)$ \cite{sheather1990kernel, zielinski2004optimal}. These estimators are promising for our application because their gradients are far less sensitive to small parameter changes than the point estimator.
\begin{definition}
Let $S = \{s_1, \ldots, s_N\}$ be a set of real numbers, and let $s_{(i)}$ denote the $i$th order statistic of $S$ (i.e. $s_{(i)} = s_{\sigma(i)}$ where $\sigma$ is the permutation which sorts $S$ in ascending order).
Given a symmetric, normalized kernel $\phi$ and a nonnegative scale parameter $h$, the \textit{kernel quantile estimator} corresponding to $\phi$ and $h$ is defined \cite{sheather1990kernel}
\begin{equation}\label{eq:kernel-estimator}
\begin{split}
\hat{q}^h_\phi(S, c) = \frac{1}{N} \sum_{i=1}^N \phi_h(i^*/N - c) s_{(i)},
\end{split}
\end{equation}
where $\phi_h(x) = \frac{1}{h}\phi(x/h)$, $c$ is the quantile to be estimated, and the index $i^*$ is defined to break ties: $i^* = \max \{j: s_{(j)} = s_{(i)}\}$.
\end{definition}
The free parameter $h$ controls the scale of the kernel, and increasing it trades off variance for bias. There are many other $L$-estimators of the quantile function; see for example \cite{cheng1995bernstein, harrell1982new, kalgh1982generalized, pepelyshev2014estimation, zielinski2004optimal} and citations therein.
It is beyond the scope of this paper to consider all of them, so in all experiments we use the Gaussian kernel estimator
\[
\phi_h(x) = \frac{1}{h \sqrt{2 \pi}} e^{x^2 / 2 h^2}.
\]
Like the point quantile estimator, the kernel estimators lead to losses which are not convex.
We also consider an $L$-estimator which serves as a lower bound for the point estimator and results in convex loss.
Let
\begin{equation}
\label{eq:convex-estimator}
\begin{split}
\hat{q}_m(S, c) = \text{mean}_{x \in S} \left\{x: \frac{|\{z \in S: z \leq x\}|}{|S|} \leq c \right\}.
\end{split}
\end{equation}
From the definition of the point estimator, it is immediate that $q_1 \ge q_m$ as the \emph{max} is greater then the \emph{mean}.
In other words: rather than taking the $k$th largest score, where $k$ is the largest integer $k$ such that $k/N \leq c$, we take the mean of the bottom $k$ scores, which serves as a lower bound. In the case when $f$ is linear, this lower bound is concave because it is a pointwise minimum of affine functions \cite{boyd2004convex}.
Returning to the case of a rate-constrained precision loss (of which (\ref{eq:unconstrained_fp_at_r}) and (\ref{eq:unconstrained_fp_at_ppr}) are special cases), we see that because $\hat{q}_m \leq \hat{q}_1$ and logloss is nondecreasing,
\begin{equation} \label{eq:one_point_bound}
\begin{split}
& \sum_i l (f(x_i; w) - \hat{q}_1(f(A), c)) \\
\leq & \sum_i l (f(x_i; w) - \hat{q}_m(f(A), c))
\end{split}
\end{equation}
so that using the $\hat{q}_m$ estimator yields an upper bound on the loss with the point estimator $\hat{q}_1$. When $f$ is linear, repeated applications of the rules of convex function composition \cite{boyd2004convex} show that $\hat{q}_m(f(A), c)$ is convex and hence the entire upper bound is as well. The bound $\hat{q}_m$ enjoys a lower gradient variance than $\hat{q}_1$, and is tightest when $c$ is small, which occurs exactly when enforcing a constraint that the predicted positive rate on $A$ be high.
\subsection{Stochastic Gradient Descent with Quantile Estimators}
Losses of the form (\ref{eq:unconstrained_optimization}), regardless of the choice of quantile estimator or bound, are compatible with any scoring function and amenable to numerical optimization. For concreteness we consider stochastic gradient descent, described in Algorithm \ref{euclid}.
\begin{algorithm}
\caption{SGD for Quantile loss (\ref{eq:unconstrained_optimization})}\label{euclid}
\begin{algorithmic}[1]
\Require A dataset $(X, Y)$, desired rate constraint $r_A \geq c$ on a subset $A \subseteq X$, quantile estimator $\hat{q}$, scoring function $f(\cdot; w)$, and learning rate $\gamma$.
\While{not converged}
\State Gather a minibatch $(X_b, Y_b)$ from $(X, Y)$
\State Gather a minibatch $A_b$ from $A$ \label{alg:step2}
\State Update \linebreak $w \gets w - \gamma \nabla_w L(X_b, Y_b, f(\cdot; w), \hat{q}(f(A_b), 1-c))$
\EndWhile
\end{algorithmic}
\end{algorithm}
Step \ref{alg:step2} is beneficial when datapoints from $A$ are rare, but when $A$ is common or minibatches are large it will suffice to take $A_b = X_b \cap A$.
\section{Experiments}
\subsection{Precision@K}
In this section we consider the application of the quantile threshold framework to the target metric Precision@K. We compare the quantile loss with two state of the art algorithms: Accuracy at the top \cite{boyd2012accuracy} and the average surrogate loss $l^\text{avg}_{prec@k}$ from \cite{kar2015surrogate}. To target Precision@K, we follow \cite{boyd2012accuracy} and optimize for Precision at a predicted positive rate $\tau = K/N$, where $N$ is the number of datapoints. In all experiments, the Gaussian kernel quantile estimator was used.
\subsubsection{Ionosphere and Housing datasets}
We compare the results from \cite{boyd2012accuracy} to those obtained using the quantile loss surrogate, averaged across 100 random train/test splits of the data. The fraction of data used for training is 30\% for Ionosphere and 66\% for Housing; the rest is held out for testing. Tables \ref{tab:ionosphere} and \ref{tab:housing} show the Precision@$\tau$ of the methods, where $\tau$ is the classifier's predicted positive rate. The models trained with the quantile loss surrogate were evaluated at the same value of $\tau$ for which they were trained, and were optimized using gradient descent with momentum on the objective (\ref{eq:unconstrained_fp_at_ppr}) with weight decay.
The weight decay regularization coefficient and scale parameter $h$ of the kernel quantile estimator are the algorithm's only hyperparameters. For a fair comparison against Accuracy at the top, which has only one hyperparameter (the regularization coefficient), we fix $h=0.05$ on the Ionosphere data and $h = 0.08$ on the Housing data. As in \cite{boyd2012accuracy}, for each value of $\tau$ the regularization coefficient $C$ was chosen based on the largest average value of Precision@$\tau$.
Because the quantile surrogate loss is nonconvex, the quantile method may converge to a suboptimal local minimum. To mitigate this problem, we run the algorithm with multiple random initializations of $w$ and take the solution with the lowest loss on the training set. Results for one and three initializations are reported.
The quantile surrogate achieves results matching or beating Accuracy at the top, with the largest improvements occurring for small $\tau$. In addition, optimization of the quantile surrogate enjoys very favorable computational complexity relative to Accuracy at the top. Assuming the same number of iterations across all algorithms, logistic regression has an $O(N)$ cost. Accuracy at the top requires solving a separate logistic regression problem for each datapoint, for a total cost of $O(N^2)$. On the other hand, the only additional cost of the quantile method over logistic regression is a sorting operation per iteration, for a total cost of $O(N\log N)$.
\begin{table}[!htp]
\centering
\begin{adjustbox}{width=0.47\textwidth}
\begin{tabular}{|c|c|c|c|c|}\hline
$\tau$ (\%) & LR & AATP & Q1 & Q3 \\ \hline
1 & 0.52 $\pm$ 0.38 & 0.85 $\pm$ 0.24 & 0.87 $\pm$ 0.27 & \tb{0.98 $\pm$ 0.10} \\ \hline
5 & 0.76 $\pm$ 0.14 & 0.91 $\pm$ 0.14 & 0.93 $\pm$ 0.11 & \tb{0.98 $\pm$ 0.07} \\ \hline
9.5 & 0.83 $\pm$ 0.08 & 0.93 $\pm$ 0.06 & 0.91 $\pm$ 0.10 & \tb{0.96 $\pm$ 0.08} \\ \hline
14 & 0.87 $\pm$ 0.05 & 0.91 $\pm$ 0.05 & 0.90 $\pm$ 0.08 & \tb{0.92 $\pm$ 0.08} \\ \hline
19 & \tb{0.89 $\pm$ 0.04} & \tb{0.89 $\pm$ 0.04} & 0.88 $\pm$ 0.06 & 0.88 $\pm$ 0.05 \\ \hline
\end{tabular}
\end{adjustbox}
\caption{P@$\tau$ on the Ionosphere dataset. $\tau\in[0, 1]$ is the predicted positive rate. Results are expressed as mean $\pm$ standard deviation. The columns correspond to logistic regression, Accuracy at the top, the quantile method with one initialization, and the quantile method with three initializations, respectively.}
\label{tab:ionosphere}
\end{table}
\begin{table}[!htp]
\centering
\begin{adjustbox}{width=0.47\textwidth}
\begin{tabular}{|c|c|c|c|c|}\hline
$\tau$ (\%) & LR & AATP & Q1 & Q3 \\ \hline
1 & 0.26 $\pm$ 0.44 & 0.2 $\pm$ 0.27 & 0.4 $\pm$ 0.49 & \tb{0.43 $\pm$ 0.50} \\ \hline
2 & 0.12 $\pm$ 0.19 & 0.23 $\pm$ 0.10 & 0.23 $\pm$0.23 & \tb{0.28 $\pm$ 0.23} \\ \hline
3 & 0.09 $\pm$ 0.10 & 0.20 $\pm$ 0.12 & 0.18 $\pm$0.17 & \tb{0.25 $\pm$ 0.16} \\ \hline
4 & 0.09 $\pm$ 0.10 & 0.19 $\pm$ 0.13 & 0.16 $\pm$0.14 & \tb{0.23 $\pm$ 0.14} \\ \hline
5 & 0.11 $\pm$ 0.09 & 0.17 $\pm$ 0.07 & 0.14 $\pm$0.12 & \tb{0.21 $\pm$ 0.13} \\ \hline
6 & 0.11 $\pm$ 0.08 & 0.14 $\pm$ 0.05 & 0.13 $\pm$0.12 & \tb{0.18 $\pm$ 0.10} \\ \hline
\end{tabular}
\end{adjustbox}
\caption{P@$\tau$ on the Housing dataset. $\tau\in[0, 1]$ is the predicted positive rate. The columns correspond to logistic regression, Accuracy at the top, the quantile method with one initialization, and the quantile method with three initializations, respectively.}
\label{tab:housing}
\end{table}
\subsubsection{KDD Cup 2008}
SVMPerf \cite{joachims2005support} is a standard baseline for methods targeting Precision@K. We compare to the $l^\text{avg}_\text{prec@k}$ surrogate from \cite{kar2015surrogate}, which resolves theoretical issues which arise when applying the structured SVM method to Precision@K. Results are presented in terms of Precision@$\tau$. For this dataset, we consider the loss (\ref{eq:unconstrained_tp_at_ppr}).
Figure \ref{fig:kdd} shows results averaged across 100 random train/test splits of the dataset, with 70\% used for training and the rest reserved for testing. Models with the $l^\text{avg}_\text{prec@k}$ and quantile surrogate losses were evaluated at the same value of $\tau$ for which they were trained, and were learned on the full training set to give the strongest results. The model with the quantile surrogate was trained using stochastic gradient descent with momentum on minibatches of size 1000 for 3 epochs, with randomly initialized parameters.
\begin{figure}[ht]
\centering
{\includegraphics[width=80mm]{pat_kdd.pdf}}\\
\caption{P@$\tau$ on the KDD Cup 2008 dataset. Error bars denote 95\% confidence intervals.} \label{fig:kdd}
\end{figure}
\subsection{Precision at a fixed recall}
In this section, we evaluate the quantile framework on the target metric of precision at fixed recall for a range of recall values on a variety of datasets.
\subsubsection{Synthetic dataset}
To illustrate the benefits of minimizing the precision at recall quantile loss (\ref{eq:unconstrained_fp_at_r}) rather than maximizing likelihood and adjusting the decision threshold, we consider the synthetic dataset in Figure \ref{fig:synthetic}. The data consists of a mixture of isotropic Gaussians with a prior of $p(y=1) = 0.1$, and the objective is to maximize precision at a recall of 0.95. A similar synthetic dataset is considered in \cite{eban2017scalable}. We initialize the weights of a linear classifier randomly, and minimize (\ref{eq:unconstrained_fp_at_r}) using the Gaussian kernel quantile estimator with $h = 0.05$. For this simple problem, we were unable to find initializations that led to different results.
Adjusting the threshold learned by logistic regression to satisfy the recall constraint results in a classifier which misclassifies most negatives. In contrast, the linear classifier trained using the precision at recall loss performs nearly as well as possible. Threshold adjustment performs poorly in this case because the logistic regression classifier is poorly calibrated; the conditional class probability $p(y=1|x)$ is inaccurate.
\begin{figure}[ht]
\centering
{\includegraphics[width=80mm]{synthetic.pdf}}\\
\caption{Logistic (black) and quantile surrogate loss (magenta) classifiers on the synthetic dataset. The black line depicts the learned threshold of the logistic classifier, while the black-dashed line is the adjusted threshold to satisfy a $90\%$ recall constraint. The precision of the logistic classifier at recall 0.9 is 0.13, the QS loss classifiers achieves a precision of 0.37.} \label{fig:synthetic}
\end{figure}
\section{Generalization Bounds}
Consider an $L$-estimator which we call the \textit{interval quantile estimator}
\begin{equation}\label{eq:interval-estimator}
\hat{q}_I(S, c) = \left|\frac{1}{\floor*{N(k_2 - k_1)}} \sum_{i=\floor*{Nk_1}}^{\floor*{Nk_2}} s_{(i)}\right|,
\end{equation}
where $0 < k_1 < c < k_2$, and $0\leq s_1, \dots, \leq s_N$. This is a generalized version of the upper bound estimator in Eq.(\ref{eq:convex-estimator}), since instead of taking all scores lower than the quantile, we take the average on an arbitrary interval.
We prove a generalization bound for the quantile loss function where the quantile estimator is either the interval estimator or a kernel quantile estimator (Eq.\ref{eq:kernel-estimator}) where $\phi_h$ is bounded and Lipschitz. Moreover, the bound is uniform with respect to model parameters if the model is linear. The conclusion holds for quantile estimators on an arbitrary subset of the feature set $X$, and in particular includes the $P@R$ and $P@k$ case used in the experiments. The proof is similar to that in \cite{kar2015surrogate}, and follows mainly from repeated applications of Hoeffding's inequality (which also holds in the case of sampling without replacement \cite{bardenet2015concentration}).
All proofs are presented in the Appendix.
\begin{proposition}[Uniform Convergence]
\label{prop:unif-conv}
Let $Z = \{(x_1, y_1), \ldots, (x_N, y_N)\}$ be a set of feature-label pairs, $\hat{Z}$ be a sample of $b$ elements chosen from $Z$ (either i.i.d or without replacement), $A$ be some subset of $Z$, $\hat{A} = A \cap \hat{Z}$, and $f(x) = w^T x$ be a linear model with parameters $w$ satisfying $\|w\| \leq C$. Let $\hat{q}(f(A))$, $\hat{q}(f(\hat{A}))$ be either the kernel estimator (\ref{eq:kernel-estimator}) with $\phi$ bounded and Lipschitz, or the interval estimator (\ref{eq:interval-estimator}). Define $L(w;Z, A) = \sum_i (1-y_i) l(f(x_i) - \hat{q}(f(A)))$. Then with probability at least $1 - \delta$,
\begin{equation*}
\begin{split}
\left|L_q(w; Z, A) - L_q(w; \hat{Z}, \hat{A})\right|= O\left(\sqrt{\frac{1}{b} \log\frac{1}{\delta}}\right)
\end{split}
\end{equation*}
uniformly in $w$.
\end{proposition}
Proposition \ref{prop:unif-conv} gives a uniform bound on the population loss based on the sample loss. However, because the quantile surrogate does not decompose across datapoints, minibatches give biased estimates and the efficacy of stochastic gradient methods is not immediately clear. In the case when $q$ is the lower bound quantile estimator defined in Eq.\ref{eq:convex-estimator}, we have the following convergence bound for stochastic gradient descent on the quantile surrogate loss.
\begin{proposition}
Let $w^*$ be the parameters of a linear model learned by $T$ steps of stochastic gradient descent with batch size $b$ on the quantile loss $L_q$, where $q$ is the lower bound estimator defined in Eq.\ref{eq:convex-estimator}. Then for any parameters $w$, with probability at least $1 - \delta$
\begin{equation*}
\begin{split}
L_q(w^*; Z) \leq L_q(w; Z) + O\left(\sqrt{\frac{1}{b}\log\frac{T}{\delta}}\right) + O\left(\sqrt{\frac{1}{T}}\right).
\end{split}
\end{equation*}
\end{proposition}
The proof of Proposition \ref{prop:unif-conv} depends on the following concentration bounds for the kernel and interval quantile estimators.
\begin{lemma}\label{lemma:stability-kernel-estimators}
Let $F = \{f_1, \dots, f_N\}$ be real numbers sorted in ascending order, and $|f_i| \leq 1$. Let $\hat{F} = \{\hat{f}_1, \dots, \hat{f}_b\}$ be a sample (either i.i.d or without replacement) from the set $F$, also sorted in ascending order. Let $\hat{q}^h(F, c)$, $\hat{q}^h(\hat{F}, c)$ be the kernel quantile estimator defined in Eq.\ref{eq:kernel-estimator}, and assume the kernel function $\phi_h$ is bounded and Lipschitz continuous, then the following holds
\begin{equation*}
\begin{split}
&\left|\hat{q}^h(F, c) - \hat{q}^h(\hat{F}, c)\right| = O\left(\sqrt{\frac{1}{b} \log\frac{1}{\delta}}\right)
\end{split}
\end{equation*}
with probability at least $1 - \delta$.
\end{lemma}
\begin{lemma}\label{lemma:stability}
Let $F = \{f_1, \dots, f_N\}$ be real numbers sorted in ascending order, and $|f_i| \leq 1$. Let $\{\hat{f}_1, \dots, \hat{f}_b\}$ be a sample (either i.i.d or without replacement) from the set $F$, also sorted in ascending order. Let $0 < k_1< k_2 < 1$. Then the following holds with probability at least $1 - \delta$:
\begin{equation*}
\begin{split}
&\left|\frac{1}{\floor*{N(k_2 - k_1)}} \sum_{i=\floor*{Nk_1}}^{\floor*{Nk_2}} f_i - \frac{1}{\floor*{b(k_2 - k_1)}} \sum_{j=\floor*{bk_1}}^{\floor*{bk_2}} \hat{f}_j\right| \\
&= O\left(\sqrt{\frac{1}{b} \log\frac{1}{\delta}}\right).
\end{split}
\end{equation*}
\end{lemma}
\section{Conclusion}
A number of recent papers have demonstrated the value of constrained optimization for machine learning with non-accuracy objectives. We show that for a large class of these problems, the constraint can be eliminated by substitution using the quantile function, which can be effectively estimated in a way which is amenable to standard learning methods. The algorithm enjoys standard empirical risk bounds and strong performance relative to other methods and surrogates for enforcing constraints relevant to non-accuracy objectives.
While we have presented examples for Precision at a fixed recall and Precision at K, our main contribution -- the use of quantile function estimators in constrained machine learning problems -- is more general.
\section*{Acknowledgements}
The authors would like to thank Ofer Meshi for helpful discussions and insightful comments on the manuscript.
\section{Proofs}
\begin{proposition}[Uniform Convergence]
Let $Z = \{(x_1, y_1), \ldots, (x_N, y_N)\}$ be a set of feature-label pairs, $\hat{Z}$ be a sample of $b$ elements chosen from $Z$ (either i.i.d or without replacement), $A$ be some subset of $Z$, $\hat{A} = A \cap \hat{Z}$, and $f(x) = w^T x$ be a linear model with parameters $w$ satisfying $\|w\| \leq C$. Let $\hat{q}(f(A))$, $\hat{q}(f(\hat{A}))$ be either the kernel estimator (\ref{eq:kernel-estimator})
with $\phi$ bounded and Lipschitz, or the interval estimator (\ref{eq:interval-estimator}). Define $L(w;Z, A) = \sum_i (1-y_i) l(f(x_i) - \hat{q}(f(A)))$. Then with probability at least $1 - \delta$,
\begin{equation}\label{eq:generalization-bound-1}
\begin{split}
\left|L_q(w; Z, A) - L_q(w; \hat{Z}, \hat{A})\right|= O\left(\sqrt{\frac{1}{b} \log\frac{1}{\delta}}\right)
\end{split}
\end{equation}
uniformly in $w$.
\end{proposition}
\begin{proof}
We first show pointwise convergence with high probability. Let $\hat{\theta}_N:=\hat{q}(f(A))$, and $\hat{\theta}_b:=\hat{q}(f(\hat{A}))$. We split Eq.(\ref{eq:generalization-bound-1}) to two parts. Let $\mL(x):=l(x)$, we have
\begin{equation*}
\begin{split}
& |L_q(w; Z, A) - L_q(w; \hat{Z}, \hat{A})|\\
& \leq \left|\frac{1}{N}\sum_{i = 1}^N \mL(f(x_i) - \hat{\theta}_N)-\frac{1}{b}\sum_{i = 1}^b \mL(f(\hat{x}_i) - \hat{\theta}_N) \right| \quad \text{(A)}\\
& + \left| \frac{1}{b}\sum_{i = 1}^b \mL(f(x_i) - \hat{\theta}_N)
- \frac{1}{b}\sum_{i = 1}^b\mL(f(x_i) - \hat{\theta}_b)\right| \\
&\leq (A) + \left|\hat{\theta}_N - \hat{\theta}_b\right|
\end{split}
\end{equation*}
where the last line follows from the logloss being Lipschitz with constant $1$.
Since $w$ is bounded, the scores $f(x_i)$ are bounded and an application of Hoeffding's inequality gives $\text{(A)}=O\left(\frac{1}{b} \log\frac{1}{\delta}\right)$ w.h.p.
The bound for the term $|\hat{\theta}_N - \hat{\theta}_b| $ is proved in Lemma \ref{lemma:stability} and Lemma \ref{lemma:stability-kernel-estimators} by setting $f_{i'} = f(x_i), i\in A$, and scaling $f_i$ such that $|f_i| < 1$.
Because $f$ is linear, it can be shown that the bound is uniform with respect to $w$ by arguing along the lines of Theorem 12 in \cite{kar2015surrogate}. Namely, we first show that the quantile loss is Lipschitz with respect to model parameters $w$. Note that logloss is Lipschitz continuous with constant 1, and $\theta_N(w)$, $\theta_b(w)$ are Lipschitz with constant $\max_i\{\|x_i\|_\infty\}$. Since the quantile loss $L_q$ is a composition of logloss and the quantile estimator, $L_q$ is Lipschitz. Applying the $L_\infty$ covering number argument in \cite{zhang2002covering} for linear models, together with pointwise convergence, gives uniform convergence.
\end{proof}
\begin{proposition}
Let $w^*$ be the parameters of a linear model learned by $T$ steps of stochastic gradient descent with batch size $b$ on the quantile loss $L_q$, where $q$ is the lower bound estimator defined in Eq.\ref{eq:convex-estimator}. Then for any parameters $w$, with probability at least $1 - \delta$
\begin{equation}
\label{eq:data-stream}
\begin{split}
L_q(w^*; Z) \leq L_q(w; Z) + O\left(\sqrt{\frac{1}{b}\log\frac{T}{\delta}}\right) + O\left(\sqrt{\frac{1}{T}}\right).
\end{split}
\end{equation}
\end{proposition}
\begin{proof}
Since the quantile loss $L_q$ with the lower bound quantile estimator is convex, we can apply Theorem 6 from \cite{kar2014online} which states that any convex loss satisfying the uniform convergence property in Proposition \ref{prop:unif-conv} satisfies Eq.\ref{eq:data-stream}.
\end{proof}
\begin{lemma
Let $F = \{f_1, \dots, f_N\}$ be real numbers sorted in ascending order, and $|f_i| \leq 1$. Let $\hat{F} = \{\hat{f}_1, \dots, \hat{f}_b\}$ be a sample (either i.i.d or without replacement) from the set $F$, also sorted in ascending order. Let $\hat{q}^h(F, c)$, $\hat{q}^h(\hat{F}, c)$ be the kernel quantile estimator defined in Eq.\ref{eq:kernel-estimator}, and assume the kernel function $\phi_h$ is bounded and Lipschitz continuous, then the following holds
\begin{equation*}
\begin{split}
&\left|\hat{q}^h(F, c) - \hat{q}^h(\hat{F}, c)\right| = O\left(\sqrt{\frac{1}{b} \log\frac{1}{\delta}}\right)
\end{split}
\end{equation*}
with probability at least $1 - \delta$.
\end{lemma}
\begin{proof}
For simplicity, assume the numbers $f_i, i=1\dots N$ are distinct. Define $p(x):=\frac{|\{\hat{f_j} \leq x\}|}{b}$, and writing $p_k = p(f_k)$ for short, we have
\begin{equation}
\label{eq:lemma-kernel}
\begin{split}
&\hat{q}^h(\hat{F}, c) := \frac{1}{b} \sum_{i=1}^{b} \phi_h\left(\frac{i^*}{b} - c\right) \hat{f}_i\\
&= \frac{1}{b} \sum_{i=1}^{b} \phi_h\left(p(\hat{f}_i) - c \right) \hat{f}_i\\
&= \frac{1}{b} \sum_{k=1}^N \phi_h(p(f_k) - c) f_k \times |\{\hat{f}_i = f_k\}| \\
&= \frac{1}{b} \sum_{k=1}^N \phi_h(p(f_k) - c) f_k \times \left(|\{\hat{f}_i \leq f_k\}| - |\{\hat{f}_i \leq f_{k - 1}\}|\right)\\
&= \sum_{k=1}^{N} \phi_h\left(p_k - c\right) \left(p_k - p_{k-1}\right)f_k,
\end{split}
\end{equation}
with $p_0 :=0$. Since $|p_k - \frac{k}{N}| = |\frac{1}{b}\sum_{i=1}^b \mathbf{1}_{\hat{f}_i \leq f_k} - \mathbb{E}\mathbf{1}_{\hat{f}_i \leq f_k}|$, we have for all $k$, $|p_k - \frac{k}{N}| = O\left(\sqrt{\frac{1}{b} \log\frac{1}{\delta}}\right)$ w.h.p. by Hoeffding's inequality. Similarly, we also have $|p_k - p_{k-1} - \frac{1}{N}| = O\left(\sqrt{\frac{1}{b} \log\frac{1}{\delta}}\right).$ Let $|\phi_h|$ be bounded by $M$ with Lipschitz constant $K$. Then by Eq.\ref{eq:lemma-kernel},
\begin{equation*}
\begin{split}
&\hat{q}^h(\hat{F}, c) = \sum_{k=1}^{N} \phi_h(p_k - c) (p_k - p_{k-1})f_k \\
&= \sum_{k=1}^{N} \frac{1}{N}\phi_h\left(\frac{k}{N} - c\right) f_k + (K+M)O\left(\sqrt{\frac{1}{b} \log\frac{1}{\delta}}\right)\\
&= \hat{q}^h(F, c) + O\left(\sqrt{\frac{1}{b} \log\frac{1}{\delta}}\right)
\end{split}
\end{equation*}
holds w.h.p. The case where $f_i$ are not distinct could be proved similarly by considering a non-uniform draw from the set of unique elements in $\{f_i\}$.
\end{proof}
\begin{lemma
Let $F = \{f_1, \dots, f_N\}$ be real numbers sorted in ascending order, and $|f_i| \leq 1$. Let $\{\hat{f}_1, \dots, \hat{f}_b\}$ be a sample (either i.i.d or without replacement) from the set $F$, also sorted in ascending order. Let $0 < k_1< k_2 < 1$. Then the following holds with probability at least $1 - \delta$:
\begin{equation*}
\begin{split}
&\left|\frac{1}{\floor*{N(k_2 - k_1)}} \sum_{i=\floor*{Nk_1}}^{\floor*{Nk_2}} f_i - \frac{1}{\floor*{b(k_2 - k_1)}} \sum_{j=\floor*{bk_1}}^{\floor*{bk_2}} \hat{f}_j\right| \\
&= O\left(\sqrt{\frac{1}{b} \log\frac{1}{\delta}}\right).
\end{split}
\end{equation*}
\end{lemma}
\begin{proof}
For convenience, assume that $Nk_1$, $Nk_2$, $bk_1$, and $bk_2$ are all integers. Let $w_i = f_{\floor*{Nk_i}}$, $\hat{w}_i = \hat{f}_{\floor*{b k_i}}$ for $i = 1, 2$. Define $\mathbb{T}_1(f) = \mathbbm{1}_{f > w_1}$, $\mathbb{T}_2(f) = \mathbbm{1}_{f \leq w_2}$, and $\hat{\mathbb{T}}_1(f) = \mathbbm{1}_{f > \hat{w}_1}$, $\hat{\mathbb{T}}_2(f) = \mathbbm{1}_{f \leq \hat{w}_2}$. Letting $c = \frac{1}{k_2 - k_1}$, we have the following estimate:
\begin{equation*}
\begin{split}
&\left|\frac{1}{\floor*{N(k_2 - k_1)}} \sum_{i=\floor*{Nk_1+1}}^{\floor*{Nk_2}} f_i - \frac{1}{\floor*{b(k_2 - k_1)}} \sum_{j=\floor*{bk_1}+1}^{\floor*{bk_2}} \hat{f}_j\right|
\\&= c\left|\frac{1}{N}\sum_{i=1}^N\mathbb{T}_1(f_i)\mathbb{T}_2(f_i)f_i - \frac{1}{b}\sum_{i=1}^b\hat{\mathbb{T}}_1(\hat{f}_i)\hat{\mathbb{T}}_2(\hat{f}_i)\hat{f}_i \right| \\
&\leq c\left|\frac{1}{N}\sum_{i=1}^N\mathbb{T}_1(f_i)\mathbb{T}_2(f_i)f_i - \frac{1}{b}\sum_{i=1}^b\mathbb{T}_1(\hat{f}_i)\mathbb{T}_2(\hat{f}_i)\hat{f}_i \right| \text{(A)}\\
&+ c \left|\frac{1}{b}\sum_{i=1}^b\mathbb{T}_1(\hat{f}_i)\mathbb{T}_2(\hat{f}_i)\hat{f}_i - \frac{1}{b}\sum_{i=1}^b\hat{\mathbb{T}}_1(\hat{f}_i)\hat{\mathbb{T}}_2(\hat{f}_i)\hat{f}_i\right|. \text{\hspace{3pt}(B)}
\end{split}
\end{equation*}
(A) is $O\left(\sqrt{\frac{1}{b} \log\frac{1}{\delta}}\right)$ w.h.p. by Hoeffding's inequality (since $w_i$ is fixed with respect to the samples $\hat{f}_i$). For (B), we use the observation that
\[
\begin{split}
|&\mathbb{T}_1(x)\mathbb{T}_2(x) - \hat{\mathbb{T}}_1(x)\hat{\mathbb{T}}_2(x)| = |\mathbb{T}_1(x) - \hat{\mathbb{T}}_1(x) \\&+ \mathbb{T}_2(x) - \hat{\mathbb{T}}_2(x)|
\end{split}
\]
holds for all $w_i$, $\hat{w}_i$, and $x$, which can be verified by checking all cases. Using the equality above, we have
\begin{equation*}
\begin{split}
&\left|\frac{1}{b}\left(\sum_{i=1}^b\mathbb{T}_1(\hat{f}_i)\mathbb{T}_2(\hat{f}_i) - \sum_{i=1}^b\hat{\mathbb{T}}_1(\hat{f}_i)\hat{\mathbb{T}}_2(\hat{f}_i)\right)\hat{f}_i\right| \\
&\leq \left|\frac{1}{b}\left(\sum_{i=1}^b\mathbb{T}_1(\hat{f}_i)\mathbb{T}_2(\hat{f}_i) - \sum_{i=1}^b\hat{\mathbb{T}}_1(\hat{f}_i)\hat{\mathbb{T}}_2(\hat{f}_i)\right)\right|\\
&\leq \frac{1}{b}\sum_{i=1}^b\left|\left(\mathbb{T}_1(\hat{f}_i) - \hat{\mathbb{T}}_1(\hat{f}_i)\right) + \left(\mathbb{T}_2(\hat{f}_i) - \hat{\mathbb{T}}_2(\hat{f}_i)\right)\right| \\
&\leq \frac{1}{b}\sum_{i=1}^b\left|\left(\mathbb{T}_1(\hat{f}_i) - \hat{\mathbb{T}}_1(\hat{f}_i)\right) \right| +\frac{1}{b}\sum_{i=1}^b\left|\left(\mathbb{T}_2(\hat{f}_i) - \hat{\mathbb{T}}_2(\hat{f}_i)\right) \right|\\
&= \left|\frac{1}{b}\sum_{i=1}^b\left(\mathbb{T}_1(\hat{f}_i) - \hat{\mathbb{T}}_1(\hat{f}_i)\right) \right| +\left|\frac{1}{b}\sum_{i=1}^b\left(\mathbb{T}_2(\hat{f}_i) - \hat{\mathbb{T}}_2(\hat{f}_i)\right) \right|,
\end{split}
\end{equation*}
where the last line follows from the fact that the function $\mathbb{T}_i(x)- \hat{\mathbb{T}}_i(x)$ has a fixed sign for all $x$. Note that $$\left|\frac{1}{b}\sum_{i=1}^b\left(\mathbb{T}_1(\hat{v}_i) - \hat{\mathbb{T}}_1(\hat{f}_i)\right) \right| = \left|\frac{1}{ b}\sum_{i=1}^b\mathbb{T}_1(\hat{f}_i) - k_1\right|,$$ which is again bounded by $O\left(\sqrt{\frac{1}{b} \log\frac{1}{\delta}}\right)$ w.h.p. via Hoeffding's inequality. Arguing similarly for the other term with $\mathbb{T}_2$ and $\hat{\mathbb{T}}_2$, we conclude the proof of the lemma.
\end{proof}
| {'timestamp': '2018-03-02T02:02:14', 'yymm': '1803', 'arxiv_id': '1803.00067', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00067'} | arxiv |
\section{Abstract}
Students have a limited time to study and are typically ineffective at allocating study time. Machine-directed study strategies that identify which items need reinforcement and dictate the spacing of repetition have been shown to help students optimize mastery (Mozer \& Lindsey 2017). The large volume of research on this matter is typically conducted in constructed experimental settings with fixed instruction, content, and scheduling; in contrast, we aim to develop methods that can address any demographic, subject matter, or study schedule. We show two methods that model item-specific recall probability for use in a discrepancy-reduction instruction strategy. The first model predicts item recall probability using a multiple logistic regression (MLR) model based on previous answer correctness and temporal spacing of study. Prompted by literature suggesting that forgetting is better modeled by the power law than an exponential decay (Wickelgren 1974), we compare the MLR approach with a Recurrent Power Law (RPL) model which adaptively fits a forgetting curve. We then discuss the performance of these models against study datasets comprised of millions of answers and show that the RPL approach is more accurate and flexible than the MLR model. Finally, we give an overview of promising future approaches to knowledge modeling.
\section{Introduction}
Students need to memorize and recall knowledge components (KC) to pass exams in academic and professional settings: this is a requirement that spans nearly all demographics and disciplines. To prepare for these tests, students need to make decisions that maximize the likelihood of recall for all KCs on the test date. Given large swaths of content to learn, students must wade through material and distill source material into lists of digestible KCs. With these components in hand, students need to organize, review, and reinforce them for efficient practice. They must accurately monitor what they know and need to learn, apply the right techniques, and allocate study time appropriately; achieving this has a large impact on test performance (Ariel, 2013; Kornell \& Metcalfe, 2006; Metcalfe \& Kornell, 2005; Thiede, Anderson, \& Therriault, 2003; Thiede \& Dunlosky, 1999; Pyc \& Dunlosky, 2010).
There are several common methods utilized by students to practice KCs, both self-directed and instructor-directed. Given primary sources or textbooks, students will read and then re-read material as review, sometimes using note-taking to distill facts and key concepts from long-form text. A more structured form of such notes can be realized as flashcards, where students or teachers break concepts into paired text, sometimes including other media like images, to represent knowledge components. Finally, the practice test (or study guide) is a commonly used format for self-testing wherein students practice recalling knowledge in a setting that closely mimics the final exam. These practice tests are typically acquired through a bank made available by a teacher, or in some cases can be purchased through publishers targeting practice for certain standardized exams. The efficacies of these existing forms of study have been studied extensively, showing that testing, as opposed to re-reading or non-generative review, typically has the highest positive effect on future recall probability (Dunlosky, 2013). As a result, there has been much research into developing teaching software that leverages repeated testing as a study tool (Ridgeway, Mozer, \& Bowles 2016; Lindsey, et. al 2014; Ritter et. al 2007; Anderson, Conrad, \& Corbett 1989).
\subsection{Quizlet: an online learning platform}
Quizlet.com is an online learning platform that allows students to encode multimedia knowledge components into digital flashcards. Students and teachers can create lists of flashcards up to any length and use them for self study or share them with other users. Quizlet offers a range of practice experiences for these lists of flashcards, ranging from traditional flashcard review to spatial study games to dynamic practice test generation. One in particular, called \textit{Learn}, generates an adaptive study path on a question-by-question basis, choosing the next KC and question format that should be surfaced at each step to maximize the likelihood of a student's overall mastery of a given list of flashcards.
As of the end of 2017, about 30 million teachers and students use Quizlet each month to create and/or study flashcards. Over 8 billion flashcards, over 200 million lists, and over 30 billion answers have been logged on the platform, which provides a remarkable dataset for research. The most common learning goal on the platform is foreign vocabulary memorization, followed by preparation for biology and psychology oriented exams; the primary users are U.S. high schoolers enrolled in the public school system. In this paper we discuss the development of a subject matter, language, and demographic agnostic algorithm for allocating a student's study time to optimize their mastery of a given list of flashcards through the \textit{Learn} study experience.
\subsection{Knowledge state modeling}
There are many aspects of the study process that can and should be programmatically optimized. Since students only have limited time to study, the first task is to accurately determine which knowledge components they are least likely to recall during the test. With a notion of strong and weak KCs in hand, the ideal reinforcement technique (whether generative or non-generative, question components, visual or textual mnemonic aids, to give some examples) can be deduced and generated. The ideal study spacing can be derived and individual KCs scheduled for reinforcement. This final aspect of study has been explored extensively, with most literature concluding that spaced study is superior to massed study, and that a student can benefit from scheduling dictated by spaced repetition software or SRS (Cepeda et. al 2009; Cepeda et. al 2008; Cepeda et. al 2006; Cepeda et. al 2006).
Because our population consists largely of high school students studying KCs associated with a textbook or guided classroom instruction, the content selection component of the process is less important than helping students prioritize the order of KCs during study. Additionally, the majority of students use the platform to study the day before a test, so we don't have as much opportunity to leverage a scheduling algorithm. Therefore, this study focuses on the problem of optimizing our platform's ability to predict the recall probability of any KC at any point in time. This would effectively enable us to rank KCs within a list from weakest to strongest, and act on the assumption that the weakest KC should always be the first to be reinforced. This is a greedy optimization since it is locally optimal to attempt to reset the knowledge state of the weakest KC to 1 through feedback, thereby increasing the overall mastery of the list to as much as possible. This strategy is consistent with the discrepancy-reduction mechanism (Dunlosky \& Thiede, 1998), a frequently observed student-directed item allocation strategy during self-paced study. That being said, this is a baseline implementation which does not consider more long-lived outcomes related to list strength effect, failure to reset the knowledge state to 1, or long term memory of a list past the test date. There is ongoing work to model and optimize the other aforementioned components to provide an integrated end-to-end programmatic study advisor.
The task of accurately predicting recall requires a model of a student's knowledge state for any given KC at a certain point in time. Existing mathematical and computational models of knowledge state frequently rely on a model of forgetting, or how the probability of recall for a KC decays over time without reinforcement. There has been extensive research for an accurate forgetting model since Ebbinghaus' self-experimentation and initial establishment of the general nature of memory decay (Ebbinghaus, 1885/1964). Generally, it has been shown that a power law decay explains the data the best (Rubin \& Wenzel, 1996; Wixted \& Carpenter, 2007; Wixted 2004; Wixted \& Ebbesen, 1991; Wixted \& Ebbesen 1997), while exponential decay as the kernel function for forgetting has evolved into a nearly exponential function through the contextual drift framework (Mensink \& Raaijmakers, 1988; Murdock, 1997; Howard \& Kahana, 2002). The declarative knowledge module of the ACT-R cognitive architecture model (Anderson et al., 2004) essentially assumes a power law decay for traces laid down by reinforcements of each KC. These theories are subject matter agnostic and are elegant, interpretable baselines for understanding item-specific knowledge state.
Another framework that provides a model for knowledge state as well as likelihood of correct question application is Bayesian Knowledge Tracing or BKT (Corbett, Anderson 1995), which postulates that the internal knowledge state is incrementally affected by the previous answer given; subsequently, the ability to answer a question is influenced by both a guessing and slippage parameter. Free parameters associated with each of the models mentioned can be derived from a suitable amount of training data and gives models the flexibility of personalization such as rate of memory decay in the forgetting curve and slippage for BKT.
Most of these studies have drawn conclusions and compared knowledge state models amongst populations of subjects that have their demographics, instruction, content, and scheduling regimented by the experiment. Both for practical and scientific purposes, we wanted to demonstrate a knowledge model that could cut across demographics, subject matter, and study schedule.
\section{Methodology}
Our starting point was evidence from research that knowledge state is at the very least a function of practice history and time elapsed since a previous calculation. We began with an application of a traditional machine learning approach, multiple logistic regression (MLR), to produce a portable and inspectable model and used learnings to subsequently create a custom forgetting algorithm, the Recurrent Power Law model (RPL).
\subsection{Multiple Logistic Regression}
Multiple Logistic Regression (MLR) is a simple method for predicting categorical variables, in our case whether or not a student will be able to recall an item at a given point in time. An item corresponds to a "side" of a flashcard containing text, with the potential for either item of a KC to act as a cue for the other during cued recall. MLR produces a very interpretable model, generating weights for independent explanatory variables. Prior research points to several strong predictors, including success or failure to recall the KC on previous trials (Corbett \& Anderson, 1995), time elapsed since last trial (Cepeda et. al 2008), time between previous trials (Cepeda et. al 2008; Wixted \& Carpenter, 2007), the format of previous trials , and the \textit{direction} of past study (i.e. recalling A given B vs. recalling B given A) (Kahana \& Caplan, 2002; Murdock 1966). MLR also produces a fast, lightweight model, which makes it ideal for implementation in an online teaching system at Quizlet's scale that must make predictions for every student, for every KC, and update those predictions adaptively as items are studied.
All predictors for our model are derived from past trials by a specific student on a specific KC. The strongest predictors are derived from the sequence of successes or failures on the student's past trials on the KC. Because more recent trials are more predictive of future recall, we assign indices to past trials in reverse chronological order. Trial 1 (if any) being the most recent, up to some limit $n$. This threshold was determined experimentally by increasing increasing this value until it no longer produced statistically significant weights at $p=0.05$-- refer to the Appendix for more details.
\begin{equation}
a = \sum_{i=1}^n w_{c_i} c_i
\end{equation}
$c_i$ is $0$ or $1$ depending on whether the trial was incorrect or correct, respectively.
Forgetting is assumed to follow an approximately exponential decay of an independent trace corresponding to each previous trial. Again ranking previous trials in reverse chronological order, we find the number of seconds elapsed between the current time and each previous trial, and take the natural log of this value to linearize the underlying exponential decay. A weight is assigned to each log-time delta where $t$ is the time of the trial at that index.
\begin{equation}
b = \sum_{j=1}^m w_{t_j} ln(t_{current}- t_j)
\end{equation}
The window size $m$ determining the number of trials to look back is again determined experimentally.
We assume a spacing effect proportional to the natural log of the time between the two most recent trials, if any.
\begin{equation}
c = \sum_{k=1}^{l} w_{s_k} ln(t_{k+1} - t_{k+2})
\end{equation}
Again, we experimentally determined the window size $l$.
While we've thus far treated study in either direction as equivalent, past study in the current direction should be more strongly predictive of successful recall than study in the opposite direction. We model this by accounting for the proportion of past trials on the KC that were in the current direction.
\begin{equation}
d = w_{r_0} \frac{count(trial_s)}{count(trial)}
\end{equation}
where $trial_s$ are the trials that occurred on the same side of the flashcard and a $trial$ occurrence is any trial.
Finally, we introduce two features meant to capture information from trials beyond the limited windows of recent trials we arrived at above:
\begin{equation}
e = w_{r_1} count(trial) + w_{r_2} ln(t_{current} - t_{firstTrial})
\end{equation}
The final assembled equation to predict recall probability is:
\begin{equation}
\begin{split}
logit[\pi(t_{current})] = \beta + a + b + c + d + e
\end{split}
\end{equation}
where $\pi(t)$ is the probability of recall at current time $t$.
We trained this model on approximately 1.5 million questions from Quizlet's \textit{Write} instruction system, which given a user-generated set of KCs and user-selected study direction, prompts the student with cued recall questions. To answer a question correctly, a student must type the answer to the cue accurately character for character except for some punctuation-based edge cases. The \textit{Write} system will repeat incorrectly recalled KCs until all KCs are recalled correctly, at which point the student may choose to repeat the process.
The model was trained using the Newton-Raphson method to find a maximum likelihood estimate of the parameters. The resulting coefficients indicated that the history of correctness across trials were the most predictive variables, followed by the proportion of same side trials. More recent trial time spacings were more predictive than older ones, as expected. Refer to the Appendix for a comprehensive overview of our empirically derived coefficients.
\subsection{Recurrent Power Law}
The MLR model's use of a log of time between trials implies an exponential decay forgetting curve assumption. Literature indicates that power law decay better describes forgetting than exponential decay (Wixted \& Carpenter 2007). Additionally, MLR is limited in its assumption that each feature has an independent, linear effect on the log-odds of the recall probability. This limitation made it difficult to account for differences in question formats, which have a non-obvious and non-linear relationship with other model features.
To address these limitations, we developed a model that explicitly fits a series of power law forgetting curves to each series of trials on a KCs. Recall probability is reset to $1$ after each trial because incorrect answers are immediately followed with feedback informing the student of the correct answer. Recall probability then follows a power law decay with a shape that is successively updated based on the outcome of each trial. Because the model at its core relies on a power law decay function, and because the parameters of that function are recurrently updated with each trial, we refer to it here as a Recurrent Power Law (RPL) model.
\begin{figure}[H]
\centering
\includegraphics[width=0.8\textwidth]{fig_1_forgetting_curves.png}
\caption{Example of estimated forgetting curves following power law decays as generated by the RPL model. Forgetting curves get steeper after incorrect answers and shallower after correct answers. Estimated recall probability always resets to 1 after each question because Quizlet always gives the user immediate feedback. }
\end{figure}
The general shape of the forgetting curve is described by:
\begin{eqnarray}
s\prime = e^{-s} \\
\tau\prime = e^{-\tau} \\
p_{cr} = (1 + s\prime r)^{-\tau\prime}
\end{eqnarray}
where $r$ is the retention interval in seconds, and $s$ and $\tau$ are fit parameters describing the shape of the forgetting curve. $p_{cr}$ is interpretable as recall probability for a cued response question.
On the first trial, $s$ is set to its initial value, $s_0$. $\tau$ is initialized based on the outcome of the first trial, $\tau_{0c}$ if correct, and $\tau_{0i}$ if incorrect. On subsequent trials, $s$ and $\tau$ are updated based on a function of their previous values, the current estimated cued response recall probability $p_{cr}$, the assumed guess probability $g$, the outcome of the trial, and additional fit parameters $\gamma_c$, $\gamma_i$, $\tau_c$, $\tau_i$, $s_c$, and $s_i$ modulating the magnitude of the update:
\begin{equation}
\begin{split}
\gamma, \tau, s
\begin{cases}
\begin{split}
\hspace{20 mm} \\
\gamma = \gamma_c \\
\tau = \tau_{n - 1} ( 1 + ( \tau_c (1 - p_{cr}) ) ^ \gamma ( 1 - g_f ) ) \\
s = s_{n - 1} ( 1 + s_c (1 - p_{cr}) ( 1 - g_f ) ) \\
\hspace{20 mm}
\end{split}
,& \text{if } c_n = 1\\
\begin{split}
\hspace{20 mm} \\
\gamma = \gamma_i \\
\tau = \tau_{n - 1} ( 1 - \frac{( \tau_i p_{cr} ) ^ \gamma}{ 1 - g_f }) \\
s = s_{n - 1} ( 1 - \frac{s_i p_{cr}}{1 - g_f} )\\
\hspace{20 mm}
\end{split}
,& \text{if } c_n = 0
\end{cases}
\end{split}
\end{equation}
Note that in the case of successful recall, when $p_d$ is near $1$, corresponding to short retention intervals, the updates to $\tau$ and $s$ are small, while at longer retention intervals when $p_d$ is small, the updates to $\tau$ and $s$ are larger. This models the spacing effect as a function of recall probability, consistent with the retrieval effort hypothesis (Pyc \& Rawson 2009). Inversely, in the case of failed recall, the updates to $\tau$ and $s$ are larger at shorter retention intervals, when $p_d$ is large. The parameter $\gamma$ allows this relationship to have a non-linear form.
The parameter $g_f$ serves to reduce the magnitude of change to the forgetting curve parameters $\tau$ and $s$ in instances where a question may have been answered correctly purely by chance in the case that the student can't actually recall the correct answer. We fix $g_f$ to $1$ divided by the number of options available for the given question format, for example 0.25 for a 4-option multiple choice question and 0.5 for a true/false question. For cued recall, we assume no chance of guessing by chance $(g_{cr}=0)$. When $g_f$ is larger, the updates to $\tau$ and $s$ in the case of a correct answer are small, because correct answers are not guaranteed to indicate accurate recall.
Even after accounting for the possibility of guessing by chance, the underlying probability of a student knowing the answer to a question varies by question type. This can likely be attributed to the requirement to either recall an item (cued recall), or to merely recognize it (multiple choice). For each non-cued recall question format, we fit a "difficulty factor" $k$, corresponding to a ratio of the odds that a student knows the answer to a question of the given format (for the given item), divided by the odds that a student would know the answer when prompted as a cued recall question.
\begin{equation}
p_k= \frac{k_f p_{cr}}{1 - p_{cr}(1 - k_f) }
\end{equation}
The probability of a correct answer is a function of the probability of guessing $g_f$ and the probability of knowing the answer, given the question format $f$:
\begin{equation}
p_c=p_k + (1 - p_k) g_f
\end{equation}
Note that as $p_k$ approaches $1$, the influence of $g_f$ approaches $0$. This implies that the probability of guessing becomes small as the probability of knowing the answer gets larger. This formulation of guessing is reminiscent of Bayesian Knowledge Tracing (Corbett \& Anderson, 1995).
Finally, we must account for study direction. We treat the two possible studyable directions of a two dimensional KC (recalling A when cued with B vs recalling B when cued with A) as two separate but interacting items. Each item maintains its own $\tau$ and $s$ parameters, updated as described above, and only when the KC is studied in that direction. However, if there exists at least one past trial of the inverse item, we assume the possibility that the target item was forgotten (or never learned), but that inverse item is both remembered and that knowledge transfers to the target item.
\begin{equation}
p=p_c + (1 - p_c)(p_o t)
\end{equation}
Where $p_o$ represents the $p_c$ value for the inverse item, and $t$ represents a fixed probability of inverse item transfer.
The model was trained using the Nelder-Mead method to find a maximum likelihood estimate of the parameters. Refer to the Appendix for more detail about the parameters we arrived at.
\section{Results}
Both models were trained on data collected from usage of two of Quizlet's instruction systems. The first is Quizlet's\textit{Write}, an instruction system that uses only cued recall questions. The second is Quizlet's \textit{Learn}, an instruction system that incorporates cued recall, multiple choice, and self-graded (know or don't know) flashcard questions. Quizlet \textit{Learn} also incorporates a knowledge model into its algorithm for prioritizing KCs for study. Subject to other constraints, the algorithm attempts to greedily schedule the KCs predicted to be least likely to be recalled correctly. Here we compare results for a version of \textit{Learn} that uses the RPL model for this purpose.
\begin{figure}[H]
\centering
\includegraphics[width=0.8\textwidth]{fig_2_write_learn_auc.png}
\caption{AUC scores for each model for Write (cued recall only) and Learn (mixed question format). Error bars indicate $\pm$ 1.96 standard error of the mean. The introduction of question formats other than cued recall makes the knowledge modeling problem more difficult, but RPL better handles this case.}
\end{figure}
Both models do well for \textit{Write}, with only cued recall questions, and performance of both suffers for \textit{Learn}, which introduces variable question formats. However, for \textit{Learn} with a variety of question formats, RPL significantly outperforms MLR in this case. While MLR is unable to capture the impact of differences in question format, RPL is able to do so, making it a more general model that's not limited to modeling a single type of study.
Since past study history on a KC is the only input, both models perform much better in cases where there exist at least two past study trials on the KC.
\begin{figure}[H]
\centering
\includegraphics[width=0.8\textwidth]{fig_3_num_trials_aucs.png}
\caption{AUC scores for each model for Write (cued recall only), segmented by number of past trials on the KC. Error bars indicate $\pm$ 1.96 standard error of the mean. Performance improves significantly when there are at least two past trials on each KC. Trying to predict the first answer is on par with random guessing which is to be expected since there is no context on the student's knowledge state.}
\end{figure}
\section{Discussion}
The RPL model integrates mechanisms from many existing knowledge state models including the power law decay of memory, contextual traces from cued recall of both items of a KC, guessing, and an odds ratio that encapsulates aspects of question format difficulty. It has been a practical success-- it is inspectable, simple to reason about, portable, and content agnostic but question format aware. However, there are still many parameters that could be encoded, including but not limited to intrinsic item difficulty, the topic being learned (e.g. vocabulary, cell division lifecycle, historical battles), and adaptive modeling of a student's pre-existing knowledge state based on initial question performance. Intrinsic item difficulty has been especially explored in foreign language acquisition, with findings that characteristics of word pairs like cognates or grouping target words by valence and concreteness have a significant impact on memory retention (Kroll \& Tocowicz, 2005). Furthermore, we have a large volume of behavioral data from which we can deduce which items have been historically harder to acquire than others, implying that we could perhaps arrive at item-specific difficulty weights empirically. A necessary practical concern for any digital tutor is the reality that students receive instruction in other environments, so establishing the new baseline of knowledge each time a student begins a new study session is essential for efficient item scheduling.
The extensions mentioned above address content-aware modeling, but not of the individual student. Since our models were globally trained, the decay and update parameters for every student was the same, an aggregate across all individuals. Instead, given enough trial data for any individual, we could adapt parameters such as the rate of forgetting to be personalized. Personalized teaching software has also seen success in the field such as with the system developed by Lindsey et. al (2014).
Beyond the scope of RPL improvements, and towards the goal of an end-to-end adaptive study experience, we need to move beyond two dimensional cue-target KC encoding and implement more comprehensive KC modeling and question generation. For any given knowledge component, there commonly exists on the order of 5-10 popular cues: a foreign vocabulary word could be cued by the translation in the native language, the spoken audio, a representative picture, the definition in the native or foreign language, an example sentence in the target language with the word omitted, or a synonym. These are valuable devices that could be used to generate more optimal questions that better reinforce a student's ability to recall and apply KCs (Murdock, 1997). Our existing models are not robust to these kinds of increases in dimensionality, so there is a need for frameworks that are similarly portable and accurate. On that front, we are exploring promising techniques such as Bayesian Networks in which knowledge states are latent variables, and neural networks which are more suited to modeling a high number of variables with unknown interactions.
\section*{Appendix}
\subsection*{MLR trial lengths}
We experimentally determined the trial lengths (variables $m$, $n$, and $l$) to be the maximum values that still produced statistically significant coefficients on the training data with $p = 0.05$. For our training data, we arrived at $n = 6$, $m = 5$, and $l=3$.
\subsection*{MLR coefficients}
These were coefficients we obtained from training and deployed in production with the MLR model. Notably, the most recent trial correctnesses were the most predictive.
\begin{table}[H]
\centering
\begin{tabular}{|l|l|l|l|l|l|l|}
\hline
\textbf{Coef} & \textbf{Value} & \textbf{Std Err} & \textbf{$z$} & \textbf{$P > |z|$} &\textbf{ 0.025 }& \textbf{0.975 }\\
\hline
$\beta$ & 0.4742 & 0.022 & 21.212 & 0.000 & 0.430 & 0.518 \\
\hline
$w_{c_1}$ & 1.8193 & 0.049 & 37.116 & 0.000 & 1.723 & 1.915\\
$w_{c_2}$ & 0.8491 & 0.065 & 13.077 & 0.000 & 0.722 & 0.976 \\
$w_{c_3}$ & 0.7068 & 0.082 & 8.669 & 0.000 & 0.547 & 0.867 \\
$w_{c_4}$ & 0.4325 & 0.097 & 4.470 & 0.000 & 0.243 & 0.622 \\
$w_{c_5}$ & 0.4940 & 0.112 & 4.409 & 0.000 & 0.274 & 0.714 \\
$w_{c_6}$ & 0.3857 & 0.122 & 3.167 & 0.002 & 0.147 & 0.624 \\
\hline
$w_{t_1}$ & -0.0958 & 0.011 & -8.869 & 0.000 & -0.117 & -0.075 \\
$w_{t_2}$ & -0.0778 & 0.011 & -7.153 & 0.000 & -0.099 & -0.057 \\
$w_{t_3}$ & -0.0535 & 0.011 & -4.888 & 0.000 & -0.075 & -0.032 \\
$w_{t_4}$ & -0.0257 & 0.012 & -2.128 & 0.033 & -0.049 & -0.002 \\
$w_{t_5}$ & -0.0238 & 0.008 & -2.849 & 0.004 & -0.040 & -0.007 \\
\hline
$w_{s_1}$ & 0.0657 & 0.012 & 5.264 & 0.000 & 0.041 & 0.090 \\
$w_{s_2}$ & 0.0285 & 0.012 & 2.351 & 0.019 & 0.005 & 0.052 \\
$w_{s_3}$ & 0.0325 & 0.014 & 2.382 & 0.017 & 0.006 & 0.059 \\
\hline
$w_{r_0}$ & 0.2126 & 0.054 & 3.916 & 0.000 & 0.106 & 0.319 \\
$w_{r_1}$ & -0.0719 & 0.009 & -7.750 & 0.000 & -0.090 & -0.054 \\
$w_{r_2}$ & 0.0407 & 0.011 & 3.618 & 0.000 & 0.019 & 0.063 \\
\hline
\end{tabular}
\caption{Coefficients, errors, and z-statistics for the MLR model}
\end{table}
\subsection*{RPL fit parameters}
These tables are the parameters we arrived at for the RPL model. The $k$ factors are question format dependent and will vary depending on the nature of how difficult it is to answer the question by guessing.
\begin{table}[H]
\centering
\begin{tabular}{|l|l|}
\hline
\textbf{Param} & \textbf{Value} \\
\hline
$s_0$ & -3.51706760045 \\
$s_c$ & 0.00643324313615 \\
$s_i$ & -0.0544722896411 \\
$\tau_{0c}$ & 3.86991863068 \\
$\tau_{0i}$ & 3.54103122648 \\
$\tau_c$ & 0.396606246542 \\
$\tau_i$ & 0.294149151118 \\
$\gamma_c$ & 0.887589628199 \\
$\gamma_i$ & 1.39704082213 \\
$p_0$ & 0.378245635733 \\
\hline
\end{tabular}
\caption{Fit parameter values for RPL model}
\end{table}
\begin{table}[H]
\centering
\begin{tabular}{|l|p{6cm}|l|}
\hline
\textbf{Question Type} & \textbf{Description} & \textbf{Value}\\
\hline
Multiple Choice & Cued recall with four possible answers & 2.055274 \\
\hline
Multiple Choice w/ None & The above question type with a ``none of the above'' option & 1.826852 \\
\hline
True/False & Whether a cue/target item pair is correct associated & 1.9616543 \\
\hline
\end{tabular}
\caption{Difficulty factor $k$ values for example question formats for RPL model}
\end{table}
\section*{Acknowledgements}
Many thanks to Dustin Stansbury, Michael Mozer, Diana Chien for reviewing this manuscript, and all the people who use Quizlet and enable our learning research!
\section*{References}
\begin{hangparas}{.25in}{1}
Anderson, J. R., Conrad, F. G., \& Corbett, A. T. (1989). Skill acquisition and the LISP tutor. Cognitive Science, 13 , 467 - 506.
Benjamin, A. S., \& Tullis, J. (2010). What makes distributed practice effective? Cognitive Psychology, 61 , 228 - 247.
Cepeda, N. J., Coburn, N., Rohrer, D., Wixted, J. T., Mozer, M. C., \& Pashler, H. (2009). Optimizing distributed practice: Theoretical analysis and practical implications. Journal of Experimental Psychology, 27 56 , 236 - 246.
Cepeda, N. J., Pashler, H., Vul, E., \& Wixted, J. T. (2006). Distributed practice in verbal recall tasks: A review and quantitative synthesis. Psychological Bulletin \& Review, 132 , 364 - 380.
Cepeda, N. J., Pashler, H., Vul, E., Wixted, J. T., \& Rohrer, D. (2006). Distributed practice in verbal recall tasks: A review and quantitative synthesis. Psychological Bulletin, 132 , 354 - 380.
Cepeda, N. J., Vul, E., Rohrer, D., Wixted, J. T., \& Pashler, H. (2008). Spacing effects in learning: A temporal ridgeline of optimal retention. Psychological Science, 19 , 1095 - 1102.
Cohen, M.S., Yan V.X., Halamish V., \& Bjork R.A. (2013). Do students think that difficult or valuable materials should be restudied sooner rather than later? J Exp Psychol Learn Mem Cogn. 2013 Nov; 39(6) : 1682 - 96.
Corbett, A. T. \& Anderson, J. R. (1995). Knowledge tracing: Modeling the acquisition of procedural knowledge. User Modeling and User-Adapted Interaction, 4, 253-278.
Dunlosky, J., Rawson, K., Marsh, E., Nathan, M., \& Willingham, D. (2013). Improving students' learning with effective learning techniques: Promising directions from cognitive and educational psychology. Psychological Science in the Public Interest, 14 (1), 4-58.
Dunlosky J. \& Thiede KW. 1998. What makes people study more? An evaluation of factors that affect people's self-paced study and yield ``labor-and-gain'' effects. Acta Psychol. 98:37 - 56
Ebbinghaus, H. (1885/1964). Memory: A contribution to experimental psychology. Mineola, NY: Dover
Howard, M. W. \& Kahana, M. J. (2002). A distributed representation of temporal context. Journal of Mathematical Psychology, 46.
Kahana, M.J. \& Caplan, J.B. Memory \& Cognition (2002) 30: 841.
Kornell N, Bjork RA. The promise and perils of self-regulated study. Psychonomic Bulletin Review. 2007;14:219 - 224.
Kornell N, Bjork RA. Optimising self-regulated study: The benefits - and costs - of dropping flashcards. Memory. 2008;16:125?136.
Kornell N, Metcalfe J. Study efficacy and the region of proximal learning framework. Journal of Experimental Psychology. Learning, Memory, and Cognition. 2006;32:609 - 622.
Kroll, J. F., and Tokowicz, N. (2005). Models of bilingual representation and
processing: looking back and to the future, in Handbook of Bilingualism:
Psycholinguistic Approaches, eds J. F. Kroll and A. M. B. de Groot (New York,
NY: Oxford University Press), 531 - 533.
Lindsey, R. V., Shroyer, J. D., Pashler, H., \& Mozer, M. C. (2014). Improving students' long-term knowledge retention through personalized review. Psychological Science, 25, 639 - 647.
Mensink, G.-J. M. \& Raaijmakers, J. G. W. (1988). A model for interference and forgetting. Psychological Review, 95, 434 - 455.
Metcalfe J, Kornell N. The dynamics of learning and allocation of study time to a region of proximal learning. Journal of Experimental Psychology: General. 2003;132:530 - 542.
Metcalfe J, Kornell N. A region of proximal learning model of study time allocation. Journal of Memory and Language. 2005;52:463 - 477.
Mozer, M. C., \& Lindsey, R. V. (2016). Predicting and improving memory retention: Psychological theory matters in the big data era. In M. Jones (Ed.), Big data in cognitive science. Sussex, UK: Psychology Press.
Mozer, M. C., Pashler, H., Cepeda, N., Lindsey, R. V., \& Vul, E. (2009). Predicting the optimal spacing of study: A multiscale context model of memory. In Y. Bengio, D. Schuurmans, J. Lafferty, C. Williams, \& A. Culotta (Eds.), Advances in Neural Information Processing Systems (Vol. 22, p. 1321-1329).
Murdock, B. B. (1966). Forward and backward associations in paired associates.Journal of Experimental Psychology,71, 732 - 737.
Murdock, B. B. (1997). Context and mediators in a theory of distributed associative memory (TODAM2). Psychological Review, 104, 839 - 862
Pavlik, P., \& Anderson, J. (2008). Using a model to compute the optimal schedule of practice. Journal of Experimental Psychology: Applied, 14, 101 - 117.
Potts R, Shanks DR. (2013) The benefit of generating errors during learning. J Exp Psychol. 2014;143:644 - 67.
Pyc M. A., Dunlosky J. (2010). Toward an understanding of students' allocation of study time: why do they decide to mass or space their practice? Mem. Cogn. 38 431 - 440.
Ridgeway, K., Mozer, M. C., \& Bowles, A. (2016). Forgetting of foreign-language skills: A corpus-based analysis of online tutoring software. Cognitive Science Journal.
Ritter, S., Anderson, J. R., Koedinger, K. R., \& Corbett, A. (2007) Cognitive Tutor: Applied research in mathematics education. Psychonomic Bulletin \& Review, 14, 249-255.
Rubin, D. C., \& Wenzel, A. E. (1996). One hundred years of forgetting: A quantitative description of retention. Psychological Review, 103, 734 - 760.
Wickelgren, W. A. (1974). Single-trace fragility theory of memory dynamics. Memory \& Cognition, 2, 775 - 780.
Wixted, J. T. (2004). On common ground: Jost's (1897) law of forgetting and Ribot's (1881) law of retrograde amnesia. Psychological Review, 111(4), 864 - 879.
Wixted, J. T., \& Carpenter, S. K. (2007). The Wickelgren power law and the Ebbinghaus savings function. Psychological Science, 18, 133 - 134.
Wixted, J. T., \& Ebbesen, E. (1991). On the form of forgetting. Psychological Science, 2, 409 - 415.
Wixted, J. T., \& Ebbesen, E. B. (1997). Genuine power curves in forgetting: A quantitative analysis of individual subject forgetting functions. Memory \& Cognition, 25(5), 731 - 739.
\end{hangparas}
\end{document} | {'timestamp': '2018-03-02T02:03:41', 'yymm': '1803', 'arxiv_id': '1803.00111', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00111'} | arxiv |
\section{Introduction}
\label{sec:intro}
As a successful learning algorithm, stochastic gradient descent (SGD) was originally adopted for dealing with the computational bottleneck of training neural networks with large-scale datasets~\cite{bottou1991stochastic}. Its empirical efficiency and effectiveness have attracted lots of attention. And thus, SGD and its variants have become standard workhorse for learning deep models. Besides the aspect of empirical efficiency, recently, researchers started to analyze the optimization behaviors of SGD and its impacts on generalization.
The optimization properties of SGD have been studied from various perspectives. The convergence behaviors of SGD for simple one hidden layer neural networks were investigated in~\cite{li2017convergence,brutzkus2017sgd}. In non-convex settings, the characterization of how SGD escapes from stationary points, including saddle points and local minima, was analyzed in~\cite{daneshmand2018escaping,jin2017escape,hu2017diffusion}.
On the other hand, in the context of deep learning, researchers realized that the noise introduced by SGD impacts the generalization, thanks to the research on the phenomenon that training with a large batch could cause a significant drop of test accuracy~\cite{keskar2016large}. Particularly, several works attempted to investigate how the magnitude of the noise influences the generalization during the process of SGD optimization, including the batch size and learning rate~\cite{hoffer2017,goyal2017accurate,chaudhari2017stochastic,jastrzkebski2017three}.
Another line of research interpreted SGD from a Bayesian perspective. In \cite{mandt2017,chaudhari2017stochastic}, SGD was interpreted as performing variational inference, where certain entropic regularization involves to prevent overfitting. And the work~\cite{smith2018bayesian} tried to provide an understanding based on model evidence. These explanations are compatible with the flat/sharp minima argument~\cite{hochreiter1997flat,keskar2016large}, since Bayesian inference tends to
targeting the region with large probability mass, corresponding to the flat minima.
However, when analyzing the optimization behavior and regularization effects of SGD, most of existing works only assume the noise covariance of SGD is constant or upper bounded by some constant, and
what role the noise structure of stochastic gradient plays in optimization and generalization was rarely discussed in literature.
In this work, we theoretically study a general form of gradient-based optimization dynamics with unbiased noise, which unifies SGD and standard Langevin dynamics. By investigating this general dynamics, we analyze how the noise structure of SGD influences the escaping behavior from minima and its regularization effects. Several novel theoretical results and empirical justifications are made.
\begin{enumerate}
\item We derive a key indicator to characterize the efficiency of escaping from minima through measuring the alignment of noise covariance and the curvature of loss function. Based on this indicator, two conditions are established to show which type of noise structure is superior to isotropic noise in term of escaping efficiency;
\item We further justify that SGD in the context of deep neural networks satisfies these two conditions, and thus provide a plausible explanation why SGD can escape from sharp minima more efficiently, converging to flat minima with a higher probability. Moreover, these flat minima typically generalize well according to various works~\cite{hochreiter1997flat,keskar2016large,neyshabur2017,wu2017towards}. We also show that Langevin dynamics with well tuned isotropic noise cannot beat SGD, which further confirms the importance of noise structure of SGD;
\item A large number of experiments are designed systematically to justify our understanding on the behavior of the anisotropic diffusion of SGD. We compare SGD with full gradient descent with different types of diffusion noise, including isotropic and position-dependent/independent noise. All these comparisons demonstrate the effectiveness of anisotropic diffusion for good generalization in training deep networks.
\end{enumerate}
The remaining of the paper is organized as follows. In Section~\ref{sec:back}, we introduce the background of SGD and a general form of optimization dynamics of interest. We then theoretically study the behaviors of escaping from minima in Ornstein-Uhlenbeck process in Section~\ref{sec:ou}, and establish two conditions for characterizing the noise structure that affects the escaping efficiency. In Section~\ref{sec:sgdnoise}, we show that the noise of SGD in the context of deep learning meets the two conditions, and thus explains its superior efficiency of escaping from sharp minima over other dynamics with isotropic noise. Various experiments are conducted for verifying our understanding in Section~\ref{sec:exp}, and we provide further discussion and conclusion in Section~\ref{sec:dis} and~\ref{sec:con}.
\section{Background}
\label{sec:back}
In general, supervised learning usually involves an optimization process of
minimizing an empirical loss over training data,
$
L(\theta) := 1/N \sum_{i=1}^N \ell(f(x_i; \theta), y_i),
$
where $\{ (x_i, y_i)\}_{i=1}^N$ denotes the training set with
$N$ \emph{i.i.d.} samples, the prediction function $f$ is often parameterized
by $\theta \in \Rbb^D $, such as deep neural networks.
And $\ell(\cdot, \cdot)$ is the loss function, such as mean squared error
and cross entropy, typically corresponding to certain negative log likelihood.
Due to the over parameterization and non-convexity of the loss function in deep networks, there exist multiple
global minima, exhibiting diverse generalization performance.
We call those solutions generalizing well good solutions or minima, and vice versa.
\textbf{Gradient descent and its stochastic variants}
A typical approach to minimize the loss function is gradient descent (GD),
the dynamics of which in each iteration $t$ is, $
\theta_{t+1} = \theta_t - \eta_t g_0(\theta_t), $
where $g_0(\theta_t) = \down_{\theta}L(\theta_t)$ denotes the full gradient
and $\eta_t$ denotes the learning rate.
In non-convex optimization, a more useful kind of gradient based optimizers act like GD with an unbiased noise,
including gradient Langevin dynamics (GLD),
$\theta_{t+1} = \theta_t - \eta_t g_0(\theta_t) + \sigma_t \epsilon_t, \epsilon_t \sim \Ncal \left(0, I\right)$,
and stochastic gradient descent (SGD), during each iteration $t$ of which,
a minibatch of training samples with size $m$ are randomly selected, $B_t \subset \{ 1,2,\dots, N\}$,
and a stochastic gradient is evaluated based on the chosen minibatch,
$\tilde{g}(\theta_t) = \sum_{i \in B_t} \nabla_{\theta} \ell(f(x_i; \theta_t), y_i)/m$,
which is an unbiased estimator of the full gradient $g_0(\theta_t)$.
Then, the parameters are updated with some learning rate $\eta_t$ as
$\theta_{t+1} = \theta_t - \eta_t \tilde{g}(\theta_t)$.
Denote $g(\theta) = \nabla_{\theta} \ell((f(x; \theta), y)$, the gradient for loss with a single data point $(x,y)$,
and assume that the size of minibatch is large enough for the central limit theorem to hold,
and thus $\tilde{g}(\theta_t)$ follows a Gaussian distribution,
\begin{equation}
\tilde{g} (\theta_t) \sim \Ncal \left(g_0(\theta_t),
\frac{1}{m} \Sigma (\theta_t) \right), \text{ where } \Sigma(\theta_t) \approx \frac{1}{N} \sum_{i=1}^N
\left( g(\theta_t; x_i) - g_0(\theta_t)\right) \left(g(\theta_t; x_i)
- g_0(\theta_t) \right) ^T. \label{eq:sgdcov}
\end{equation}
Note that the covariance matrix $\Sigma$ depends on the model architecture, dataset and the current parameter $\theta_t$.
Now we can rewrite the update of SGD as,
\begin{equation}
\theta_{t+1} = \theta_t - \eta_t g_0(\theta_t) + \frac{\eta_t}{\sqrt{m}} \epsilon_t, \quad \epsilon_t \sim \Ncal \left(0, \Sigma(\theta_t) \right). \label{eq:sgd}
\end{equation}
Inspired by GLD and SGD, we may consider a general kind of optimization dynamics, namely,
\emph{gradient descent with unbiased noise},
\begin{equation}
\theta_{t+1} = \theta_t - \eta_t g_0(\theta_t) + \sigma_t\epsilon_t, \quad
\epsilon_t \sim \Ncal \left(0, \Sigma_t \right). \label{eq:gdnoise}
\end{equation}
For small enough constant learning rate $\eta_t=\eta$, the above iteration in Eq.~(\ref{eq:gdnoise})
can be treated as the numerical discretization of the following stochastic differential equation
\cite{li2015stochastic,jastrzkebski2017three,chaudhari2017stochastic},
\begin{equation}
\dif \theta_t = -\down_{\theta} L(\theta_t) \dif t + \sqrt{\eta\sigma_t^2\Sigma_t}\dif W_t. \label{eq:sde}
\end{equation}
Considering $\sqrt{\eta\sigma_t^2\Sigma_t}$ as the coefficient of noise term, existing works~\cite{hoffer2017,jastrzkebski2017three} studied the influence of noise magnitude of SGD on generalization, i.e. $\eta \sigma_t^2 = \eta/m$.
In this work, we focus on studying the benefits of anisotropic structure of $\Sigma_t$ in SGD helping escape from minima by bridging the covariance matrix with the Hessian of the loss surface, and its implicit regularization effects on generalization, especially in deep learning context.
For the purpose of eliminating influences of the noise magnitude, we add the following constraint,
\begin{equation}
\text{given time }t, \quad \eta\Tr (\sigma^2_t\Sigma_t) = \text{ constant},
\label{eq:tr_const}
\end{equation}
since the magnitude of the noise term can be characterized as $\Tr (\sigma^2_t\Sigma_t)$ according to the expected squared norm of the noise term $\sqrt{\eta}\sigma_t\epsilon_t$~\cite{li2015stochastic},
\begin{equation}
\Ebb[ (\sqrt{\eta}\sigma_t\epsilon_t)^T(\sqrt{\eta}\sigma_t\epsilon_t)] = \eta\sigma_t^2\Ebb [\epsilon^T\epsilon] = \eta\sigma_t^2\Tr\Ebb[\epsilon\epsilon^T] = \eta\sigma_t^2\Tr\Sigma_t.
\end{equation}
For simplicity, we absorb $\eta\sigma^2_t$ into $\Sigma_t$, denoting $\eta\sigma_t^2\Sigma_t$ as $\Sigma_t$. If not pointed out, we omit the subscript $t$ for matrix $\Sigma_t$ to emphasize that we are fixing a time $t$ and discussing the varying structure of $\Sigma$.
\section{The behaviors of escaping from minima in Ornstein-Uhlenbeck process}
\label{sec:ou}
For a general loss function $ L(\theta) = \Ebb_X\ell_X(\theta)$,
where $X$ denotes data example and $\theta$ denoted parameters to be optimized, under suitable smoothness assumptions, the SDE associated with the gradient variant optimizer as shown in Eq.~(\ref{eq:sde}) can be written as follows, with little abuse of notation,
\begin{equation}
\dif \theta_t = -\down_{\theta} L(\theta_t) \dif t + \Sigma_t^{\half}\dif W_t. \label{eq:sde1}
\end{equation}
Let $L_0=L(\theta_0)$ be one of the minimal values of $L(\theta)$, then for a fixed $t$ small enough, $\Ebb_{\theta_t} [L_t] = \Ebb_{\theta_t}[L_t - L_0] + L_0$ characterizes the efficiency of $\theta$ escaping from the minimum $\theta_0$ of $L(\theta)$.
\begin{proposition}[Escaping efficiency for general process]
For the process~(\ref{eq:sde1}), provided mild smoothness assumptions, the escaping efficiency from the minimum $\theta_0$ is,
\begin{equation}
\Ebb [L_t] = L_0 + \int_{0}^{t} \Ebb \left[ \down L^T \down L\right]+\int_{0}^{t} \half \Ebb \Tr (H_t\Sigma_t) \dif t,
\end{equation}
where $H_t$ denotes the Hessian of $L(\theta_t)$ at $\theta_t$.
\label{thm:escape_general}
\end{proposition}
We provide the proof in Supplementary Materials, and the same for the other propositions.
The escaping efficiency for general processes is hard to analyze due to the intractableness of the integrals. However, we may consider a second-order approximation locally near the minima $\theta_0$, where $L(\theta) \approx L_0 + \half (\theta - \theta_0)^T H (\theta - \theta_0)$. Without loss of generality, we assume the minimum $\theta_0 = 0$, and $L(\theta_0)=0$.
Further, suppose that $H$ is a positive definite matrix and the diffusion covariance $\Sigma_t=\Sigma$ is constant for $t$.
Then the SDE~(\ref{eq:sde1}) becomes an Ornstein-Uhlenbeck process,
\begin{equation}
\dif \theta_t = -H \theta_t \dif t + \Sigma^{\half} \dif W_t. \label{eq:ou}
\end{equation}
\begin{proposition}[Escaping efficiency of Ornstein-Uhlenbeck process]
For Ornstein-Uhlenbeck process~(\ref{eq:ou}) with $t$ small enough, the escaping efficiency from minimum zero is,
\begin{equation}
\Ebb L_t=\frac{1}{4} \Tr\left(\left( I-e^{-2Ht}\right)\Sigma\right)\approx \frac{t}{2} \Tr\left(H\Sigma\right).
\end{equation}
\label{thm:escape_ou}
\end{proposition}
Inspired by Proposition~(\ref{thm:escape_general}) and Proposition~(\ref{thm:escape_ou}), we propose $\Tr\left(H\Sigma\right)$ as an empirical indicator measuring the efficiency for a stochastic process escaping from minima.
Generally speaking, $H$ and $\Sigma$ being semi-positive definite, to achieve the maximum of $\Tr(H\Sigma)$ under constraint~(\ref{eq:tr_const}), $\Sigma$ should be $\Sigma^* = (\Tr\Sigma)\cdot\lambda_1 u_1 u_1^T$, where $\lambda_1, u_1$ are the maximal eigenvalue and corresponding unit eigenvector of $H$.
Note that the rank-1 matrix $\Sigma^*$ is highly anisotropic. More generally, the following Proposition~(\ref{thm:aniso_benefit}) characterizes one kind of anisotropic noise significantly outperforming isotropic noise in order of number of parameters $D$, given $H$ is ill-conditioned.
\begin{proposition}[The benefits of anisotropic noise]
With $H$ and $\Sigma$ being semi-positive definite, assume
(1) $H$ is ill-conditioned. To be specific, let $\lambda_1 \ge \lambda_2 \ge \dots, \ge \lambda_D \ge 0$ be the eigenvalues of $H$ in descent order, and for some constant $k\ll D$ and $d>\half$,
\begin{equation}
\lambda_1 > 0,\qquad \lambda_{k+1}, \lambda_{k+2}, \dots, \lambda_{D} < \lambda_1 D^{-d},
\label{eq:cond1_H_ill}
\end{equation}
(2) $\Sigma$ is ``aligned'' with $H$. Let $u_i$ be the corresponding unit eigenvector of eigenvalue $\lambda_i$, for some projection coefficient $a>0$,
\begin{equation}
u_1^T\Sigma u_1 \ge a \lambda_1 \frac{\Tr\Sigma}{\Tr H},
\label{eq:cond2_Sigma_align}
\end{equation}
then $\frac{\Tr\left(H\Sigma\right)}{\Tr(H\bar{\Sigma})} = \Ocal \left(a D^{(2d-1)}\right)$, where $\bar{\Sigma} = \frac{\Tr\Sigma}{D}I$ denotes the covariance of isotropic noise under constraint~(\ref{eq:tr_const}).
\label{thm:aniso_benefit}
\end{proposition}
To give some geometric intuitions on the left hand side of Eq.~(\ref{eq:cond2_Sigma_align}), let the maximal eigenvalue and its corresponding unit eigenvector of $\Sigma$ be $\gamma_1, v_1$, then the right hand side has a lower bound as
$ u_1^T\Sigma u_1 \geq u_1^Tv_1\gamma_1 v_1^T u_1 = \gamma_1 \left<u_1, v_1\right>^2 $.
Thus if the maximal eigenvalues of $H$ and $\Sigma$ are aligned in proportion, $\gamma_1/\Tr\Sigma \ge a_1 \lambda_1/\Tr H$, and the angle of their corresponding unit eigenvectors is close to zero, $\left<u_1, v_1\right> \ge a_2$, the second condition Eq.~(\ref{eq:cond2_Sigma_align}) in Proposition~\ref{thm:aniso_benefit} holds for $a =a_1a_2$.
Typically, in the scenario of modern deep neural networks, due to the over-parameterization, Hessian and the gradient covariance are usually ill-conditioned and anistropic near minima, as shown by \cite{sagun2017empirical} and \cite{chaudhari2017stochastic}. Thus the first condition in Eq.~(\ref{eq:cond1_H_ill}) usually holds for deep neural networks, and we further justify it by experiments in Section~\ref{sec:verification}.
Therefore, in the following section, we turn to discuss how the gradient covariance, i.e. the covariance of SGD noise meets the second condition of Proposition~\ref{thm:aniso_benefit} in the context of deep neural networks.
\section{The anisotropic noise of SGD in deep networks}
\label{sec:sgdnoise}
In this section, we mainly investigate the anisotropic structure of gradient covariance in SGD, and explore its connection with the Hessian of loss surface $H(\theta):=\nabla^2 L(\theta) = \Ebb_{(x,y)}[\down^2\ell(\theta)]$.
\textbf{Around the true parameter}
According to the classic statistical theory~\citep[Chap. 8]{pawitan2001all}, when evaluating at the true parameter $\theta^*$, we have the exact equivalence between the expected Hessian of negative log likelihood and \emph{ Fisher information matrix} $F$,
\begin{equation*}
F(\theta^*) := \Ebb_{(x,y)} [\down_{\theta} \ell(\theta^*) \down_{\theta} \ell(\theta^*)^T] = \Ebb_{(x, y)} [\nabla_{\theta} ^2\ell(\theta^*)] = H(\theta^*).
\end{equation*}
In practice, with the assumptions that the sample size $N$ is large enough (i.e. indicating asymptotic behavior) and suitable smoothness conditions, when the current parameter $\theta_t$ is not far from the ground truth, Fisher is close to Hessian. Thus we can obtain the following approximate equality between gradient covariance and Hessian,
\begin{equation*}
\Sigma(\theta_t) = F(\theta_t) - \down_{\theta} L^T(\theta_t)\down_{\theta}L(\theta_t) \approx F(\theta_t) \approx H(\theta_t).
\end{equation*}
The first approximation is due to the dominance of noise over the mean of gradient in the later stage of SGD optimization, which has been shown in \cite{shwartz2017opening}. A similar experiment as \cite{shwartz2017opening} has been conducted to demonstrate this observation, please refer to Supplementary Materials for it.
The closeness between the two matrices depends on the sample size, model family and $\|\theta_t-\theta^*\|$. From this perspective, the gradient covariance intuitively satisfies the condition (2) of Proposition~\ref{thm:aniso_benefit}.
\textbf{One hidden layer neural network with fixed output layer parameters}
For binary classification neural network with one hidden layer in classic setups (with softmax and cross-entropy loss), we have following results to bound Fisher and Hessian with each other.
\begin{proposition}[General relationship between Fisher $F$ and Hessian $H$ in one hidden layer neural network]
For binary classification problem with data $\{(x_i, y_i)\}_{i=1}^N, y\in\{0,1\}$, the typical neural network model has the following empirical loss,
\begin{equation*}
L(\theta) = \Ebb_{\text{emp}}[\phi \circ f(x; \theta)],
\end{equation*}
where $f$ denotes the output of neural network, and $\phi$ denotes the cross-entropy loss with softmax,
\begin{equation*}
\phi(f(x), y) = -\left(y\log \frac{e^{f(x)}}{1+e^{f(x)}} + (1-y)\log\frac{1}{1+e^{f(x)}}\right), y\in\{0, 1\}.
\end{equation*}
With the following conditions:
(1) the neural network $f$ is with one hidden layer and piece-wise linear activation. And the parameters of output layer are fixed during training;
(2) the output of neural network is bounded during the training, $f(x;\theta) \in (-C, C)$ for $\theta \in U \subset \mathbb{R}^D$.
Then, we have the following relationship between Fisher $F$ and Hessian $H$ almost everywhere:
\begin{equation*}
e^{-C}F(\theta) \preceq H(\theta) \preceq e^C F(\theta).
\end{equation*}
$A\preceq B$ means that $(B-A)$ is semi-positive definite.
\label{thm:F_H}
\end{proposition}
Note that as shown in \cite{brutzkus2017sgd}, the neural network appears in Proposition~(\ref{thm:F_H}) is non-convex, and has multiple minima.
Using Proposition~\ref{thm:F_H}, we can derive the following relationship between gradient covariance and Hessian.
\begin{proposition}[Relationship bewteen gradient covariance and Hessian in one hidden layer neural network]
Assume the conditions in Proposition~\ref{thm:F_H} hold, then for some small $\delta >0$ and for $\theta$ close enough (please refer to Supplementary Materials for details) to minima $\theta^*$ (local or global),
\begin{equation*}
u^T\Sigma u \geq e^{-2(C + \delta)} \lambda \frac{\Tr \Sigma}{\Tr H}
\end{equation*}
holds for any positive eigenvalue $\lambda$ and its corresponding unit eigenvector $u$ of Hessian $H$.
\label{thm:Sigma_H}
\end{proposition}
Hence under this circumstance, the second condition in Proposition~\ref{thm:aniso_benefit} holds for one hidden layer neural networks.
Therefore, given the ill-conditioning of $H$ due to the over-parameterization of modern deep networks, according to Proposition~\ref{thm:aniso_benefit}, we can conclude the noise structure of SGD helps to escape from sharp minima much faster than the dynamics with isotropic noise, and converge to flatter solutions with a high probability. These flat minima typically generalize well. Thus, we attribute such properties of SGD on its better generalization performance comparing to GD, GLD and other dynamics with isotropic noise.
In the following, we conduct various experiments to verify our understanding on the behavior of escaping from minima and its regularization effects for different optimization dynamics.
\section{Experiments}
\label{sec:exp}
To better understanding the behavior of anisotropic noise different from isotropic ones, we introduce dynamics with different kinds of noise structure to empirical study with, as shown on table~(\ref{tb:dynamics}).
\begin{table}[h]
\centering
\caption{\small Compared dynamics defined in Eq.~(\ref{eq:gdnoise}). For {\bf GLD dynamic}, {\bf GLD diagonal}, {\bf GLD Hessian} and {\bf GLD 1st eigvec($H$)}, $\sigma_t$ are adjusted to make $\sigma_t \epsilon_t$ share the same expected norm as that of SGD. For {\bf GLD leading}, $\sigma_t$ is same as in SGD.
Note that {\bf GLD 1st eigvec($H$)} achieves the best escaping efficiency as our indicator suggested.}
\label{tb:dynamics}
\begin{tabular}{|c|c|p{7cm}|}
\hline
\small
&Noise $\epsilon_t$ & {Remarks}\\ \hline
{\bf SGD}&$\epsilon_t \sim \Ncal \left(0, \Sigma^{\text{sgd}}_t\right)$&$\Sigma^{\text{sgd}}_t$ is defined as in Eq.~(\ref{eq:sgdcov}), and $\sigma_t = \frac{\eta_t}{\sqrt{m}}$\\ \hline
{\bf GLD constant}&$\epsilon_t \sim \Ncal \left(0, I\right)$&$\sigma_t$ is a tunable constant\\ \hline
{\bf GLD dynamic}&$\epsilon_t \sim \Ncal \left(0, I\right)$&$\sigma_t$ is adjusted to make $\sigma_t \epsilon_t$ share the same expected norm as that of SGD\\ \hline
{\bf GLD diagonal}&$\epsilon_t \sim \Ncal \left(0,\diag(\Sigma_t)\right)$&The covariance $\diag(\Sigma_t)$ is the diagonal of the covariance of SGD noise.\\ \hline
{\bf GLD leading}&$\epsilon_t \sim \Ncal \left(0, \tilde{\Sigma}_t\right)$&$\tilde{\Sigma}_t = \sum_{i=1}^k \gamma_i v_i v_i^T$. $\gamma_i, v_i$ are the first $k$ leading eigenvalues and corresponding eigenvalues of the covariance of SGD noise, respectively. (A low rank approximation of $\Sigma^{\text{sgd}}_t$)\\ \hline
{\bf GLD Hessian}&$\epsilon_t \sim \Ncal \left(0, \tilde{H}_t\right)$&$\tilde{H}_t$ is a low rank approximation of the Hessian matrix of loss $L(\theta)$ by its the first $k$ leading eigenvalues and corresponding eigenvalues.\\ \hline
{\bf GLD 1st eigven($H$)}&$\epsilon_t \sim \Ncal \left(0, \lambda_1u_1u_1^T\right)$&$\lambda_1, u_1$ are the maximal eigenvalue and its corresponding unit eigenvector of the Hessian matrix of loss $L(\theta_t)$.\\ \hline
\end{tabular}
\end{table}
\subsection{Two-dimensional toy example}
We design a 2-D toy example $L(w_1, w_2)$ with two basins, a small one and a large one, corresponding to a sharp and flat minima, $(1,1)$ and $(-1,-1)$, respectively, both of which are global minima. Please refer to Supplementary Materials for the detailed constructions. We initialize the dynamics of interest with the sharp minimum $(w_1, w_2) = (1,1)$, and run them to study their behaviors escaping from this sharp minimum.
To explicitly control the noise magnitude, we only conduct experiments on GD, GLD const, GLD diag, GLD leading (with $k=2=D$ in Table~(\ref{tb:dynamics}), or in other words, the exactly covariance of SGD noise), GLD Hessian ($k=2$) and GLD 1st eigven($H$). And we adjust $\sigma_t$ in each dynamics to force their noise to share the same expected squared norm as defined in Eq.~(\ref{eq:tr_const}).
Figure~\ref{fig:2d}(a) shows the trajectories of the dynamics escaping from the sharp minimum $(1,1)$ towards the flat one $(-1,-1)$, while Figure~\ref{fig:2d}(b) presents the success rate of escaping for each dynamic during $100$ repeated experiments.
As shown in Figure~\ref{fig:2d}, GLD 1st eigvec($H$) achieves the highest success rate, indicating the fastest escaping speed from the sharp minimum. The dynamics with anisotropic noise aligned with Hessian well, including GLD 1st eigvec($H$), GLD Hessian and GLD leading, greatly outperform GD, GLD const with isotropic noise, and GLD diag with noise poorly aligned with Hessian.
These experiments are consistent with our theoretical analysis on Ornstein-Uhlenbeck process shown Proposition~\ref{thm:escape_ou} and~\ref{thm:aniso_benefit}, demonstrating the benefits of anisotropic noise for escaping from sharp minima.
\begin{figure}[ht]
\centering
\begin{tabular}{cc}
\includegraphics[width=0.37\columnwidth]{./figures/basin_trajectory.pdf} & \includegraphics[width=0.37\columnwidth]{./figures/basin_success.pdf} \\
(a) & (b)
\end{tabular}
\vspace{-0.4cm}
\caption{\small 2-D toy example. Compared dynamics are defined as in table~(\ref{tb:dynamics}), $k=2$, $\sigma_t^2$ is tuned to keep noise of all dynamics sharing same expected squared norm, $0.01$. All dynamics are run by $500$ iterations with learning rate $0.005$. Please refer to Supplementary Materials for more detailed setups.
\textbf{(a)} The trajectory of each compared dynamics for escaping from the sharp minimum in one run. \textbf{(b)} Success rate of arriving the flat solution in $100$ repeated runs.}
\label{fig:2d}
\end{figure}
\subsection{FashionMNIST with corrupted labels}
In this part, we conduct a series of experiments in real deep learning scenarios to demonstrate the behavior of SGD noise and its implicit regularization effects.
We construct a noisy training set based on FashionMNIST dataset\footnote{\url{https://github.com/zalandoresearch/fashion-mnist}}. Concretely, the training set consist of $1000$ images with correct labels, and another $200$ images with random labels. All the test data are with clean labels.
A small LeNet-like network is utilized such that the spectrum decomposition over gradient covariance matrix and Hessian matrix are computationally feasible. The network consists of two convolutional layers and two fully-connected layers, with $11,330$ parameters in total.
We firstly run the standard gradient decent for $3000$ iterations to arrive at the parameters $\theta^*_{GD}$ near the global minima with near zero training loss and $100\%$ training accuracy, which are typically sharp minima that generalize poorly~\cite{neyshabur2017}. And then all other compared methods are initialized with $\theta^*_{GD}$ and run for optimization with the same learning rate $\eta_t = 0.07$ and same batch size $m=20$ (if needed) for fair comparison\footnote{In fact, in our experiment, we test the equally spacing learning rates in the range $[0.01,0.1]$, and the final results are consistent with each other.}.
\textbf{Verification of SGD noise satisfying the conditions in Proposition~\ref{thm:aniso_benefit}} \label{sec:verification}
To see whether the noise of SGD in real deep learning circumstance satisfies the two conditions in Proposition~\ref{thm:aniso_benefit}, we run SGD optimizer initialized from $\theta^*_{GD}$, i.e. the sharp minima found by GD.
Figure~\ref{fig:sgdnoise}(a) shows the first $400$ eigenvalues of Hessian at $\theta^*_{GD}$, from which we see that the $140$th eigenvalue has already decayed to about $1\%$ of the first eigenvalue. Note that Hessian $H \in \mathbb{R}^{D\times D},\ D=11330$, thus $H$ around $\theta^*_{GD}$ approximately meets the ill-conditioning requirement in Proposition~{\ref{thm:aniso_benefit}}.
Figure~\ref{fig:sgdnoise}(b) shows the projection coefficient estimated by $\hat{a} = \frac{u_1^T \Sigma u_1 \Tr H}{\lambda_1 \Tr\Sigma}$ along the trajectory of SGD. The plot indicates that the projection coefficient is in a descent scale comparing to $D^{2d-1}$, thus satisfying the second condition in Proposition~\ref{thm:aniso_benefit}.
Therefore, Proposition~\ref{thm:aniso_benefit} ensures that SGD would escape from minima $\theta^*_{GD}$ faster than GLD in order of $\Ocal (D^{2d-1})$, as shown in Figure~\ref{fig:sgdnoise}(c).
An interesting observation is that in the later stage of SGD optimization, $\Tr(H\Sigma)$ becomes significantly ($10^7$ times) smaller than in the beginning stage, implying that SGD has already converged to minima being almost impossible to escape from. This phenomenon demonstrates the reasonability to employ $\Tr(H\Sigma)$ as an empirical indicator for escaping efficiency.
\begin{figure}[ht]
\centering
\begin{tabular}{ccc}
\includegraphics[width=0.3\columnwidth]{./figures/fashionmnist_eigenspectrum.pdf} & \includegraphics[width=0.3\columnwidth]{./figures/fashionmnist_projectioncoef.pdf} & \includegraphics[width=0.3\columnwidth]{./figures/fashionmnist_trace.pdf} \\
(a) & (b) & (c)
\end{tabular}
\vspace{-0.3cm}
\caption{\small FashionMNIST experiments. \textbf{(a)} The first $400$ eigenvalues of Hessian at $\theta^*_{GD}$, the sharp minima found by GD after $3000$ iterations. \textbf{(b)} The projection coefficient estimation $\hat{a} = \frac{u_1^T \Sigma u_1 \Tr H}{\lambda_1 \Tr\Sigma}$, as shown in Proposition~\ref{thm:aniso_benefit}. \textbf{(c)}$\Tr(H_t\Sigma_t)$ versus $\Tr(H_t\bar{\Sigma}_t)$ during SGD optimization initialized from $\theta^*_{GD}$, $\bar{\Sigma}_t = \frac{\Tr\Sigma_t}{D}I$ denotes the isotropic noise with same expected squared norm as SGD noise.}
\label{fig:sgdnoise}
\end{figure}
\textbf{Behaviors of different dynamics escaping from minima and its generalization effects}
To compare the different dynamics on escaping behaviors and generalization performance, we run dynamics initialized from the sharp minima $\theta^*_{GD}$ found by GD.
The settings for each compared method are as follows. The hyperparameter $\sigma^2$ for GLD const has already been tuned as optimal ($\sigma=0.001$) by grid search. For GLD leading, we set $k=20$ for comprising the computational cost and approximation accuracy. As for GLD Hessian, to reduce the expensive evaluation of such a huge Hessian in each iteration, we set $k=20$ and update the Hessian every $10$ iterations. We adjust $\sigma_t$ in GLD dynamic, GLD Hessian and GLD 1st eigvec($H$) to guarantee that they share the same expected squred noise norm defined in Eq.~(\ref{eq:tr_const}) as that of SGD.
And we measure the expected sharpness of different minima as $\Ebb_{\nu \sim \Ncal(0, \delta^2 I)} \left[ L(\theta + \nu)\right] - L(\theta)$, as defined in (\cite{neyshabur2017}, Eq.(7)). The results are shown in Figure~\ref{fig:fashion}.
\begin{figure}[ht]
\centering
\begin{tabular}{ccc}
\includegraphics[width=0.28\columnwidth]{./figures/fashionmnist_acc_train.pdf} & \includegraphics[width=0.28\columnwidth]{./figures/fashionmnist_acc_test.pdf} & \includegraphics[width=0.28\columnwidth]{./figures/fashionmnist_flatness1e-2.pdf}\\
(a)&(b)&(c)
\end{tabular}
\vspace{-0.3cm}
\caption{\small FashionMNIST experiments. Compared dynamics are initialized at $\theta^*_{GD}$ found by GD, marked by the vertical dashed line in iteration $3000$. The learning rate is same for all the compared methods, $\eta_t = 0.07$, and batch size $m=20$.
\textbf{(a)} Training accuracy versus iteration.
\textbf{(b)} Test accuracy versus iteration.
\textbf{(c)} Expected sharpness versus iteration. Expected sharpness is measured as $\Ebb_{\nu \sim \Ncal(0, \delta^2 I)} \left[ L(\theta + \nu)\right] - L(\theta)$, and $\delta=0.01$, the expectation is computed by average on $1000$ times sampling.}
\label{fig:fashion}
\end{figure}
As shown in Figure~\ref{fig:fashion}, SGD, GLD 1st eigvec($H$), GLD leading and GLD Hessian successfully escape from the sharp minima found by GD, while GLD, GLD dynamic and GLD diag are trapped in the minima. This demonstrates that the methods with anisotropic noise ``aligned'' with loss curvature can help to find flatter minima that generalize well.
We also provide experiments on standard CIFAR-10 with VGG11 in Supplementary Materials.
\section{Discussions}
\label{sec:dis}
\textbf{Benefits of considering covariance structure.} Previous works on SGD for deep learning typically ignores the covariance structure, as we have shown in this work, which has significant effects on its dynamics behaviors and generalization performance as well.
The key observation on connecting gradient noise structure with curvature of the loss landscape, especially near the minima, provides a new perspective for understanding why SGD can achieve good generalization in practice. Our work is an initial attempt to reveal the non-negligible benefits of SGD's covariance structure. More theoretical explorations are needed along this direction.
\textbf{Effects of learning rate and batch size.} As seen from the SGD dynamics in Eq.~(\ref{eq:sgd}), when the learning rate is too small or batch size is overly large, the magnitude of gradient noise will become small, and thus effects of covariance structure is not obvious as before. In these cases, SGD often needs long time for diffusion towards flat minina to obtain better solutions, as shown in existing research~\cite{keskar2016large,hoffer2017,jastrzkebski2017three}.
\textbf{Designing optimizers that help to generalize better.} The derived indicator also sheds some light on designing the optimizers that might generalize better than SGD by adding the noise covariance $\Sigma = \lambda_1 u_1 u_1^T$, which can achieve the largest $\Tr (H \Sigma)$ under the constant trace constraint~\eqref{eq:tr_const}. We leave the exploration regarding to this as future work.
\section{Conclusion}
\label{sec:con}
We have theoretically investigate a general optimization dynamics with unbiased noise, which unifies various existing optimization methods, including SGD. We provide some novel results on the behaviors of escaping from minima and its regularization effects. A novel indicator is derived for characterizing the escaping efficiency. Based on this indicator, two conditions are constructed for showing what type of noise structure is superior to isotropic noise in term of escaping. We then analyze the noise structure of SGD in deep learning and find that it indeed satisfies the two conditions, thus explaining the widely know observation that SGD can escape from sharp minima efficiently toward flat minina that generalize well. Various experimental evidence supports our arguments on the behavior of SGD and its effects on generalization.
Our study also shows that isotropic noise helps little for escaping from sharp minima, due to the highly anisotropic nature of landscape. This indicates that it is not sufficient to analyze SGD by treating it as an isotropic diffusion over landscape \cite{zhang2017hitting,mou2017generalization}. A better understanding of this out-of-equilibrium behavior \cite{chaudhari2017stochastic} is on demand.
\small
| {'timestamp': '2018-05-22T02:19:49', 'yymm': '1803', 'arxiv_id': '1803.00195', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00195'} | arxiv |
\section{Introduction}
Due to the effectiveness and relative ease of implementation, there is now a proliferation of toolkits for neural machine translation \citep{Kalchbrenner2013,Sutskever2014,Bahdanau2014}, as many as 51 according to the tally by \texttt{nmt-list}.\footnote{\url{https://github.com/jonsafari/nmt-list}}
The common requirements for such toolkits are speed, memory efficiency, and translation accuracy, which are essential for the use of such systems in practical translation settings.
Many open source toolkits do an excellent job at this to the point where they can be used in production systems (e.g. OpenNMT\footnote{\url{http://opennmt.net}} is used by Systran \citep{crego2016systran}).
This paper describes XNMT, the eXtensible Neural Machine Translation toolkit, a toolkit that optimizes not for efficiency, but instead for ease of use in practical research settings.
In other words, instead of only optimizing time for training or inference, XNMT aims to reduce the time it takes for a researcher to turn their idea into a practical experimental setting, test with a large number of parameters, and produce valid and trustable research results.
Of course, this necessitates a certain level of training efficiency and accuracy, but XNMT also takes into account a number of considerations, such as those below:
\begin{itemize}
\setlength{\itemsep}{0.5pt}
\item XNMT places a heavy focus on modular code design, making it easy to swap in and out different parts of the model. Ideally, implementing research prototypes with XNMT involves only few changes to existing code.
\item XNMT is implemented in Python, the de facto standard in the research community.
\item XNMT uses DyNet \citep{Neubig2017} as its deep learning framework. DyNet uses dynamic computation graphs, which makes it possible to write code in a very natural way, and benefit from additional flexibility to implement complex networks with dynamic structure, as are often beneficial in natural language processing. Further benefits include transparent handling of batching operations, or even removing explicit batch handling and relying on autobatching for speed-up instead.
\item XNMT of course contains standard NMT models, but also includes functionality for optimization using reinforcement learning \citep{ranzato2015sequence} or minimum risk training \citep{shen-EtAl:2016:P16-1}, flexible multi-task learning \citep{dai2015semi}, encoders for speech \citep{chan2016listen}, and training and testing of retrieval-based models \citep{huang2013learning}.
\end{itemize}
In the remainder of the paper, we provide some concrete examples of the design principles behind XNMT, and a few examples of how it can be used to implement standard models.
\section{Model Structure and Specification}
\subsection{NMT Design Dimensions: Model, Training, and Inference}
\label{sec:nmtdesign}
When training an NMT system there are a number of high-level design decisions that we need to make: what kind of model do we use? how do we test this model? at test time, how do we generate outputs?
Each of these decisions has a number of sub-components.
For example, when specifying our model, if we are using a standard attentional model such as that defined by Bahdanau et al. \citep{Bahdanau2014}, we must at least decide:
\begin{description}
\setlength{\itemsep}{0.5pt}
\item[Input Data Format:] Do we use plain text or structured data such as trees?
\item[Embedding Method:] Do we lookup words in a table or encode their characters or other units?
\item[Encoder:] Do we use bidirectional LSTMs, convolutional nets, self attention?
\item[Decoder:] Do we use standard LSTM-based word-by-word decoders or add tricks such as memory, syntax, or chunks?
\item[Attention Method:] Do we use multi-layer perceptrons or dot-products, or something more complicated?
\end{description}
\noindent
When specifying the training regimen, there are also choices, including:
\begin{description}
\setlength{\itemsep}{0.5pt}
\item[Loss Function:] Do we use maximum likelihood or a sequence-based training criterion such as REINFORCE or minimum-risk training?
\item[Batching:] How many sentences in a mini-batch, and do we sort by length before batching?
\item[Optimizer:] What optimization method do we use to update our parameters?
\item[Stopping Criterion:] How do we decide when to stop training?
\end{description}
\begin{figure}[t!]
\centering
\begin{minted}[mathescape,
numbersep=5pt,
gobble=0,
frame=lines,
framesep=2mm]{yaml}
mini_experiment: !Experiment # top of experiment hierarchy
exp_global: !ExpGlobal # global (default) experiment settings
model_file: examples/output/{EXP}.mod
log_file: examples/output/{EXP}.log
default_layer_dim: 512
dropout: 0.3
model: !DefaultTranslator # attentional seq2seq model
src_reader: !PlainTextReader
vocab: !Vocab {vocab_file: examples/data/train.ja.vocab}
trg_reader: !PlainTextReader
vocab: !Vocab {vocab_file: examples/data/train.en.vocab}
src_embedder: !SimpleWordEmbedder {} # {} indicates defaults
encoder: !BiLSTMSeqTransducer
layers: 1
attender: !MlpAttender {}
trg_embedder: !SimpleWordEmbedder
emb_dim: 128 # if not set, default_layer_dim is used
decoder: !MlpSoftmaxDecoder
layers: 1
bridge: !CopyBridge {}
train: !SimpleTrainingRegimen # training strategy
run_for_epochs: 20
batcher: !SrcBatcher
batch_size: 32
src_file: examples/data/train.ja
trg_file: examples/data/train.en
dev_tasks: # what to evaluate at every epoch
- !LossEvalTask
src_file: examples/data/dev.ja
ref_file: examples/data/dev.en
evaluate: # what to evaluate at the end of training
- !AccuracyEvalTask
src_file: examples/data/test.ja
ref_file: examples/data/test.en
eval_metrics: bleu
\end{minted}
\vspace{-6mm}
\caption{Example configuration file \label{yaml_example_1}}
\end{figure}
\noindent
And in inference, there are also options:
\begin{description}
\setlength{\itemsep}{0.5pt}
\item[Search Strategy:] Do we perform greedy search? beam search? random sampling? What are the parameters of each?
\item[Decoding Time Score Adjustment:] At decoding time, do we do something like length normalization to give longer hypotheses higher probability?
\end{description}
Within XNMT, effort is made to encapsulate all of these design decisions in Python classes, making it possible for a researcher who wants to experiment with new alternatives to any one of these decisions to implement a new version of the class and compare it with many other similar alternatives.
\subsection{YAML Model Specification}
In order to specify experimental settings, XNMT uses configuration files in YAML\footnote{http://yaml.readthedocs.io/en/latest/example.html} format, which provides an easy-to-read, Python-like syntax.
An example of such a file, demonstrating how it is possible to specify choices along the various design dimensions in \S\ref{sec:nmtdesign} is shown in Figure~\ref{yaml_example_1}.%
\footnote{For many of these parameters XNMT has reasonable defaults, so the standard configuration file is generally not this verbose.}
As shown in the example, XNMT configuration files specify a hierarchy of objects, with the top level always being an \texttt{Experiment} including specification of the model, training, and evaluation, along with a few global parameters shared across the various steps.
One thing that is immediately noticeable from the file is the \texttt{!} syntax, which allows to directly specify Python class objects inside the YAML file.
For any item in the YAML hierarchy that is specified in this way, all of its children in the hierarchy are expected to be the arguments to its constructor (the Python method).
So for example, if a user wanted to test create a method for convolutional character-based encoding of words \citep{zhang2015character} and see its result on machine translation, they would have to define a new class \texttt{ConvolutionalWordEmbedder(filter\_width, embedding\_size=512)}, implement it appropriately, then in the YAML file replace the \texttt{src\_embedder:} line with
\begin{figure}[h!]
\begin{minted}[mathescape,
numbersep=5pt,
gobble=0,
frame=lines,
framesep=2mm]{yaml}
src_embedder: !ConvolutionalWordEmbedder
filter_width: 3
embedding_size: 512
\end{minted}
\vspace{-6mm}
\end{figure} \\
optionally omitting \texttt{embedding\_size:} if the defaults are acceptable.
As may be evident from the example, this greatly helps extensibility for two reasons: (1) there is no passing along of command line arguments or parsing of complex argument types necessary. Instead, objects are simply configured via their Python interface as given in the code, and newly added features can immediately be controlled from the configuration file without extra argument handling. (2) Changing behavior is as simple as adding a new Python class, implementing the required interface, and requesting the newly implemented class in the configuration file instead of the original one.
\subsection{Experimental Setup and Support}
As Figure \ref{yaml_example_1} demonstrates, XNMT supports the basic functionality for experiments described in \S\ref{sec:nmtdesign}.
In the example, the model specifies the input data structure to be plain text (\texttt{PlainTextReader}), word embedding method to be a standard lookup-table based embedding (\texttt{SimpleWordEmbedder}), encoder to be a bidirectional LSTM (\texttt{BiLSTMSeqTransducer}), attender to be a multi-layer perceptron based attention method (\texttt{MlpAttender}), and the decoder to use a LSTM with a MLP-based softmax (\texttt{MlpSoftmaxDecoder}).
Similarly, in the \texttt{training:} and \texttt{evaluate:} subsections, the training and evaluation parameters are set as well.
In addition to this basic functionality, XNMT provides a number of conveniences to support efficient experimentation:
\begin{description}
\setlength{\itemsep}{0.5pt}
\item[Named experiments and overwriting:] All experiments are given a name, in this case \texttt{mini\_experiment}. The \texttt{\{EXP\}} strings in the configuration file are automatically overwritten by this experiment name, which makes it possible to easily distinguish between log files or model files from different experiments.
\item[Multiple experiments and sharing of parameters:] It is also possible to specify multiple experiments in a single YAML file. To do so, we simply define multiple top-level elements of the YAML file. These multiple experiments can share settings through YAML anchors, where one experiment can inherit the settings from another, only overwriting the relevant settings that needs to be changed.
\item[Saving configurations:] In order to aid reproducibility of experiments, XNMT dumps the whole experiment specification when saving a model. Thus, experiments can be re-run by simply opening the configuration file associated with any model.
\item[Re-starting training:] A common requirement is loading a previously trained model, be it for fine-tuning on different data, tuning decoding parameters, or testing on different data. XNMT allows this by re-loading the dumped configuration file, overwriting a subset of the settings such as file paths, decoding parameters, or training parameters, and re-running the experiment. An example is shown in Figure~\ref{yaml_example_3}, which decodes on a different test set by turning training off, and rewriting the specification of the evaluation set.
\item[Random parameter search:] Often we would like to tune parameter values by trying several different configurations. Currently XNMT makes it possible to do so by defining a set of parameters to evaluate and then searching over them using random search. In the future, we may support other strategies such as Bayesian optimization or enumeration.
\end{description}
\begin{figure}[tb]
\centering
\begin{minted}[mathescape,
numbersep=5pt,
gobble=0,
frame=lines,
framesep=2mm]{yaml}
tied_exp: !Experiment
...
model: !DefaultTranslator
..
trg_embedder: !DenseWordEmbedder
emb_dim: 128
decoder: !MlpSoftmaxDecoder
layers: 1
bridge: !CopyBridge {}
vocab_projector: !Ref { path: model.trg_embedder }
\end{minted}
\vspace{-6mm}
\caption{Illustration of referencing mechanism \label{yaml_example_2}}
\end{figure}
\begin{figure}[tb]
\centering
\begin{minted}[mathescape,
numbersep=5pt,
gobble=0,
frame=lines,
framesep=2mm]{yaml}
decode_exp: !Experiment
load: examples/output/standard.mod
overwrite:
- path: exp_global.eval_only
val: True
- path: evaluate
val: !AccuracyEvalTask
src_file: examples/data/head.ja
ref_file: examples/data/head.en
hyp_file: examples/output/{EXP}.test_hyp2
\end{minted}
\vspace{-6mm}
\caption{Illustration of load-and-overwrite mechanism. Here, a trained model is loaded for testing on some particular data. \label{yaml_example_3}}
\end{figure}
\section{Advanced Features}
\subsection{Advanced Modeling Techniques}
XNMT aims to provide a wide library of standard modeling tools of use in performing NMT, or sequence-to-sequence modeling experiments in general.
For example, it has support for speech-oriented encoders \citep{chan2016listen,harwath2016unsupervised} that can be used in speech recognition, preliminary support for self-attentional ``Transformer'' models \citep{vaswani2017attention}.
It also has the ability to perform experiments in retrieval \citep{huang2013learning} instead of sequence generation.
\subsection{Parameter Sharing and Multi-task Learning}
Modern deep learning architectures often include parameter sharing between certain components. For example, tying the output projection matrices and embeddings has been proposed by \citet{press2016using}. While it would be possible to develop a specialized component to achieve this, XNMT features a referencing mechanism that allows simply tying the already existing components (Figure~\ref{yaml_example_2}). References are created by specifying the path of the object to which they point, and result in the exact same object instance being used in both places. The only requirement is for the object's interface to be compatible with both usages, which is usually easily achieved using Python's duck typing coding paradigm.
This component sharing is also very useful in multi-task training paradigms, where two tasks are trained simultaneously and share some or all of their component parts.
This multi-task training can be achieved by replacing the \texttt{SimpleTrainingRegimen} with other regimens specified for multi-task learning, and defining two or more training tasks that use different input data, models, or training parameters.
\subsection{Training and Inference Methods}
XNMT provides several advanced methods for training and inference.
With regards to training, XNMT notably makes it easy to implement other training criteria such as REINFORCE or minimum risk training by defining a separate class implementing the training strategy.
REINFORCE has been implemented, and more training criteria may be added in the near future.
For inference, it is also possible to specify several search strategies (e.g. beam search), along with several length normalization strategies that helps reduce the penalty on long sentences.
\section{Case Studies}
In this section, we describe three case studies of using XNMT to perform a variety of experiments: a standard machine translation experiment (\S\ref{sec:expmt}), a speech recognition experiment (\S\ref{sec:expasr}), and a multi-task learning experiment where we train a parser along with an MT model (\S\ref{sec:expmultitask}).
\subsection{Machine Translation}
\label{sec:expmt}
We trained a machine translation model on the WMT English-German benchmark, using the preprocessed data by Stanford.\footnote{\url{https://nlp.stanford.edu/projects/nmt/}} Our model was a basic 1-layer model with bidirectional LSTM encoder and 256 units per direction, LSTM decoder output projections and MLP attention mechanism all with 512 hidden units. We applied joint BPE of size 32k \citep{sennrich2016bpe}. We also applied input feeding, as well as variational dropout of rate 0.3 to encoder and decoder LSTMs. Decoding was performed with a beam of size 1. Overall, results were similar, with our model achieving a BLEU of 18.26 and \citet{luong2015effective} achieving a BLEU of 18.1. Note that the model by \citet{luong2015effective} is simpler because it does not use BPE and only a unidirectional encoder.
\subsection{Speech Recognition}
\label{sec:expasr}
We performed experiments in a speech recognition task with a simple listen-attend-spell model \citep{chan2016listen}. This model features a 4-layer pyramidal LSTM encoder, subsampling the input sequence by factor 2 at every layer except the first, resulting in an overall subsampling factor of 8. The layer size is set to 512, the target embedding size is 64, and the attention uses an MLP of size 128. Input to the model are Mel-filterbank features with 40 coefficients. For regularization, we apply variational dropout of rate 0.3 in all LSTMs, and word dropout of rate 0.1 on the target side \citep{gal2016theoretically}. For training, we use Adam \citep{kingma2014adam} with initial learning rate of 0.0003, which is decayed by factor 0.5 if no improved in WER is observed. To further facilitate training, label smoothing \citep{szegedy2016rethinking} is applied. For the search, we use beam size 20 and length normalization with the exponent set to 1.5. We test this model on both the Wall Street Journal (WSJ; \citet{paul1992design}) corpus which contains read speech, and the TEDLIUM corpus \citep{rousseau2014enhancing} which contains recorded TED talks. Numbers are shown in Table~\ref{tab:asr_results}. Comparison to results from the literature shows that our results are competitive.
\begin{table}[tb]
\centering
\label{tab:asr_results}
\begin{tabular}{lllll}
Model & WSJ dev93 & WSJ eval92 & TEDLIUM dev & TEDLIUM test \\
\hline
XNMT & 16.65 & 13.50 & 15.83 & 16.16 \\
\citet{zhang2017very} & --- & 14.76 & --- & \\
\citet{rousseau2014enhancing} & --- & --- & 15.7 & 17.8
\end{tabular}
\caption{Speech recognition results (WER in \%) compared to a similar pyramidal LSTM model \citep{zhang2017very} and a highly engineered hybrid HMM system \citep{rousseau2014enhancing}.}
\end{table}
\subsection{Multi-task MT + Parsing}
\label{sec:expmultitask}
We performed a multi-task training of a sequence-to-sequence model for parsing and a machine translation task. The main task is the parsing task, and we followed the general setup in \citep{VinyalsKKPSH15}, but we only used the standard WSJ training data. It is jointly trained with English-German translation system. Since the source side is English sentence for both tasks, they can share the source embedder and source encoder. We also trained a single sequence-to-sequence model for parsing with the same hyperparameters as the multi-task model. As a result, a model trained only on WSJ achieved a test F-score of 81\%, while the multi-task trained model achieved an F-score of 83\%. This experiment was done with very few modifications to existing XNMT multi-task architecture, demonstrating that it is relatively easy to apply multi-tasking to new tasks.
\section{Conclusion}
This paper has introduced XNMT, an NMT toolkit with extensibility in mind, and has described the various design decisions that went into making this goal possible.
\section*{Acknowledgments}
Part of the development of XNMT was performed at the Jelinek Summer Workshop in Speech and Language Technology (JSALT) ``Speaking Rosetta Stone'' project \citep{scharenborg18icassp}, and we are grateful to the JSALT organizers for the financial/logistical support, and also participants of the workshop for their feedback on XNMT as a tool.
Parts of this work were sponsored by Defense Advanced Research Projects Agency Information Innovation Office (I2O). Program: Low Resource Languages for Emergent Incidents (LORELEI). Issued by DARPA/I2O under Contract No. HR0011-15-C-0114. The views and conclusions contained in this document are those of the authors and should not be interpreted as representing the official policies, either expressed or implied, of the U.S. Government. The U.S. Government is authorized to reproduce and distribute reprints for Government purposes notwithstanding any copyright notation here on.
\small
\bibliographystyle{apalike}
| {'timestamp': '2018-03-02T02:06:01', 'yymm': '1803', 'arxiv_id': '1803.00188', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00188'} | arxiv |
\section{Introduction}
The information centric networking (e.g., CCN \cite{jacobson2009networking}, DONA \cite{koponen2007data}, PURSUIT/PSIRP \cite{tarkoma2009publish}, POINT \cite{point}, NetInf \cite{dannewitz2009netinf}) emerges as a paradigm shift from the host centric conventional Internet. The conventional Internet is becoming increasingly infeasible and less meaningful in terms of a number of recognized limitations, for instance, decoupling address from an end-point identity, mobility and disruption tolerance, and above all, scalable and efficient content distribution. The extensive usage of current Internet is dominated by the content distribution and retrieval of a substantial amount of digital content. ICN allows user to retrieve a particular content regardless of any reference to the physical location of the content. However, the emergency network, such as the consequence of a natural disaster scenario like earthquake, hurricane, or tsunami, or network disruption means a significant challenge for the ICN deployment. For instance, name resolution may fail due to network disruptions, especially when the components of the distributed resolution services are devastated by network partitioning. Moreover, name resolution may become unreliable, particularly when content names are resolved to locator(s) that do not exist anymore. In such scenario, it is very essential to spread the important news for public protection and disaster relief. Nevertheless, in such scenario mobile devices can be exploited to form a peer-to-peer network. This issue is addressed in the Delay-tolerant networking (DTN) architecture \cite{cerf2007delay} which follows the store-carry-and-forward model.
The goal of this paper is introducing a novel approach for constructing an Information Centric Networking (ICN) for a disaster network. For such network, we envision the possibility of exploiting the basic design principle of the native Content Centric Networking (CCN) \cite{jacobson2009networking} in DTN architecture. While designing our proposed architecture, we leverage the inherent properties of the CCN and the Bundle Protocol (BP) \cite{burleigh2007bundle} of the DTN architecture. We position our work in the forwarding plane so that the existing DTN routing or the content based DTN routing ( e.g., \cite{neves2013cedo}, \cite{krifa2012message}) can easily be adapted/operated on top of the CIDOR.
In summary, the main contributions of this paper are as follows:
\begin{itemize}
\item We design a content-centric architecture for a disaster network called CIDOR, which includes content-centric framework on top of the Bundle Protocol (BP) \cite{burleigh2007bundle} of the DTN architecture \cite{ccnx} (Figure~\ref{CIDOR_node}).
\vspace{.15cm}
\item A key contribution of this work is introducing a new forwarding mechanism for DTN based on a new data structure called as CIDOR-PRIT (Section ~\ref{pit}) which stores the pending requester information on the interest packet.
\vspace{.15cm}
\item \textit{Duplicate suppression} and \textit{Redundancy elimination} mechanism at the content level (Section~\ref{duplicate} and~\ref{re}) using the CIDOR-PRIT and a randomly generated \textit{Nonce} value which is a part of the request packet. These duplicates may result from the forwarding loop or similar requests issued by multiple requesters. These duplicates can not be detected by the host-centric DTN.
\vspace{.15cm}
\item To enable content centric fashion for the DTN and duplicate suppression, the CIDOR utilizes the extension blocks of the DTN message (Section~\ref{format}). The content centric functionality of the CIDOR enables the host centric DTN to perform in a content-centric fashion.
\vspace{.15cm}
\item We have implemented our design as a proof-of-concept in the ONE \cite{keranen2009one} simulator and evaluated thoroughly the efficiency of the CIDOR architecture using simulation with different classes of the DTN routing strategies in different mobility scenarios. The DTN routing strategies are applied on top of the CIDOR architecture.
\end{itemize}
\vspace{.15cm}
The rest of this paper is organized as follows: We first introduce the background in Section~\ref{back}. Section~\ref{motivation} defines the problem statement and gives an overview of our solution. Section~\ref{design} describes our proposed architecture and the implementation details. After that, the proposed architecture is evaluated in Section~\ref{result}, with different classes of DTN routing strategies for the different mobility scenarios. Section~\ref{related} investigates the related work and finally, Section~\ref{conclude} concludes the paper.
\input{motivation}
\input{design}
\input{performance}
\section{\textbf{Related Work}}
\label{related}
\subsection{Mobile Ad-hoc CCN}
In the last few years, numerous research efforts explored the applicability of the CCN in dynamic environments \cite{meisel2010ad, anastasiades2014opportunistic, meisel2010listen, amadeo2011chanet, varvello2011design, strayer2013cascade}. The authors of \cite{varvello2011design} investigates the potential of existing MANET routing algorithms into the CCN based on analytical models. In \cite{anastasiades2014opportunistic}, the authors implement an extension for the CCN caching so that the user can retrieve the content with resume capability in a situation where the data transmission would not have completed. Similar to the CCN, Mooi et al. \cite{chuah2011secure} describes a secure content-centric mobile network (SECON) which enables a user to issue requests in a mobile environment. The authors of \cite{meisel2010listen} has proposed Listen First, Broadcast Later (LFBL) for MANET in line with the named data that is not relying on a predetermined end-to-end path information, the IP addressing, or a MAC layer. In \cite{amadeo2011chanet}, the authors exploit the CCN communication model on top of IEEE 802.11 protocol in the MANET. Similar aspiration is explored in the CASCADE \cite{strayer2013cascade} for the tactical MANET that utilizes the concept of topological and interest-based communities to serve the content quickly in a resource-friendly fashion. Sourlas \textit{et al.} \cite{sourlasinformation} extend the CCN router by introducing a new data structure called Satisfied Interest Table (SIT) which stores the information of the users to whom the data packets are forwarded. In case the server of origin is not reachable, the proposed scheme exploits the SIT entries to forward the request. However, the proposed scheme performs well only if the users listed in the SIT entries are connected. All these works are still based on the implicit assumption of eventual end-to-end connectivity for a while. In contrast, our proposed scheme exploits the opportunistic communication of mobile users using DTN mechanisms (store-carry-and-forward).
\subsection{Combining ICN and DTN}
There are also several research efforts in the DTN environment \cite{tysontowards}, \cite{trossen2016towards}. In \cite{tysontowards}, the author investigates the possibility of integrating the ICN and the DTN principles into a shared ICDTN architecture. Combining the ICN and the DTN has been demonstrated in a recent effort called RIFE architecture \cite{trossen2016towards}. The RIFE is a universal communication architecture that combine the publish/subscribe based POINT architecture \cite{point} and the DTN that provides services for the existing IP-based protocols (e.g., HTTP, CoAP, basic IP) through the ICN core. The IP endpoints are connected through the ICN using a gateway. In contrast, the CIDOR integrates a new content centric framework in DTN, where an end user issues a request based on the CCN naming scheme. The name based replication system \cite{psaras2014name} based on the message priority in a fragmented network can benefit the CIDOR since the system spread important messages quickly and stay longer in the network.
\subsection{Content centric routing for DTN}
User-centric content distribution in the DTNs has been widely explored from various different points of view~\cite{gao2011user, costa2008socially, yoneki2007socio, lu2014information}. Authors of \cite{gao2011user} exploits the caching of mobile users in sharing content items with their neighbours in the same network domain. From a social-based point of view, authors of SocialCast \cite{costa2008socially} proposed a routing framework that exploits the social ties among users for effective relay selection, while Yoneki et al. in \cite{yoneki2007socio} proposed a publish-subscribe based communication overlay maintaining the social groups based on centrality measures. However, this routing mechanisms can be complementary to our proposed scheme which operates independently of any routing algorithm. Lu \textit{et al.} at \cite{lu2014information} used the K-means clustering algorithm to create the social level forwarding scheme for reducing the transmitted messages. This approach raises several inevitable limitations: \textit{(i)} the interest may fail to reach the encountered node with the same social level, that might have the content to satisfy the interest, \textit{(ii)} the request from the higher social level will never reach a content provider with lower social level, \textit{(iii)} the proposed scheme cannot detect the routing loop of the interest packet and, \textit{(iv)} the authors do not consider how to optimise similar interests from multiple users. These limitations are addressed in our solution.
\section{Conclusion}
\label{conclude}
In this paper, we have proposed and investigated a content distribution and retrieval framework (CIDOR) based on the Bundle Protocol (BP) of the DTN architecture. This new architecture achieves the content retrieval, caching and forwarding of the packets more efficiently and enables BP to operate in a content centric fashion in a disaster scenario. The CIDOR introduces a new duplicate suppression mechanism and redundancy elimination technique at content level for BP. Then, we have simulated and recorded the performance of the CIDOR. Next, we have thoroughly studied its efficiency applying the different kinds of DTN routing strategies in different mobility models. The result of our study validates that CIDOR can benefit BP while operating in a content centric fashion. For instance, CIDOR can achieve the response ratio almost 100$\%$ with reduced latency up to 50$\%$ (Figure~\ref{helsinki1},~\ref{rwp}). We also observe that CIDOR enables the hybrid routing \textit{EP$_{p}$SWRouting} (Section~\ref{dr}) to achieve the similar performance compared to Epidemic routing in terms of response ratio with higher delivery probability and much lower cost. While CIDOR bridges the content-centric and host-centric paradigms, it also remains flexible in adapting the existing content-centric DTN routing algorithms because of its modular design.
Our next steps will be focused on the integration of the CIDOR architecture with the infrastructure network which runs the native CCN as well as POINT architecture. We envision that the integration of CIDOR architecture with the native CCN will enrich the connectivity options of the native CCN in a fragmented network. Moreover, we plan to consider the incentive mechanism that motivate the mobile users to cooperate and store others content.
\section{Acknowledgement}
The work presented in this paper was supported by the EU funded H2020 ICT project POINT, under contract 643990. Andrei Gurtov was supported by the Center for Industrial Information Technology (CENIIT)
\tiny
\bibliographystyle{unsrt}
\section{\textbf{CIDOR Architecture}}
\label{design}
CIDOR architecture (Figure~\ref{CIDOR_node}) provides the content-centric framework as an application logic on top of the Bundle Protocol and requests transmission of, accepts delivery of, and processes the CIDOR specific data. The key component of CIDOR architecture is the control plane decision engine that performs packet (Interest/Data) management. The control plane is implemented on top of Bundle Protocol (BP) and its functionalities are responsible for performing specific actions based on the packet type (Interest/Data). For this the control plane inserts the meta-information in DTN messages, that enables the host centric DTN to perform in content centric fashion.
\subsection{CIDOR Routing and Forwarding}
\label{rf}
In the Internet architecture, we differentiate between routing and forwarding. Forwarding is the basic method for transferring the packet to the next hop, i.e., a packet is transferred between a source interface and a destination interface. In contrast, routing is the process by which one router sends packets to another router by means of routing protocols which decide the appropriate path for the packet. The routing protocol assists the router in choosing the best path out of many paths. Nevertheless, the CIDOR is designed in a way that it can operate independently of the DTN routing protocols and therefore complements the existing routing protocols suitable for a particular environment.
\begin{figure}[!t]
\centering
\includegraphics[width=.9\linewidth]{cidor.eps}
\caption{CIDOR Node Engine.}
\label{CIDOR_node}
\end{figure}
\subsection{Packet format}
\label{format}
The CIDOR follows the message format of the Bundle Protocol while operating on a emergency network. In addition, the content centric metadata information is also encapsulated into the bundle message as metadata information. In the DTN architecture, an application can send messages of arbitrary size called as Application Data Units (ADUs). The bundle layer transforms the ADUs into one or more Protocol Data Units (PDUs). The PDU is referred as \textit{bundle} which is forwarded by DTN nodes. In general, a bundle contains two or more \textit{blocks} of data in a defined format. Each block may contain either application data or other metadata used to deliver the bundle to its destination(s). At least two block structures are required to form a bundle: primary bundle block and payload block. Primary bundle block contains source/destination information on a bundle and expiration time (time-to-live). Bundle protocol supports the extension to the primary bundle block which allows specifying application specific metadata information. The CIDOR introduces the following metadata information for content-centric operation.
\begin{enumerate}
\item \textit{Nonce}: A randomly-generated byte string that is used to detect and discard duplicate \textit{Interest/Data} packet. Note that the Nonce is not the only way of detecting and discarding duplicates at a node.
\item \textit{Bundle Expiration time (TTL)}: Lifetime of the bundle.
\item \textit{Bundle Type Extension block}: This field is used to define a packet as \textit{Interest} or \textit{Response}.
\item \textit{CIDOR PRIT Extension block}: This block contains a list of destination EIDs, which are interested for a particular \textit{Response}.
\end{enumerate}
\subsection{Caching in CIDOR}
\label{oc}
The persistent storage of a DTN node stores the bundle until it gets the opportunity to forward the bundle to another node. The DTN node deletes the entry for a bundle for which the DTN node successfully forwards the bundle to the next opportunistic contact(s). Therefore, the persistent storage of the DTN node can not meet the future interests right after deleting the popular content. For this, the CIDOR allows the intermediate relay node to store the popular content for a while in the Opportunistic Content Store (LRU cache) to meet the future requests. Content providers store the content in the Content Store (CS). Nevertheless, each CIDOR searches a particular content in both the CS and the Opportunistic CS (if exist). In the disaster scenario, the opportunistic cache can enable the user to serve the critical information through the Opportunistic Content Store.
\subsection{CIDOR-PRIT structure for DTN}
\label{pit}
The CIDOR-PRIT table stores the requester EID of the \textit{Interest} packet. Upon reception of the \textit{Interest} packet, the CIDOR node checks its CIDOR-PRIT table. If there is a match, it adds the requester EID to that entry and drops the packet. While handling the response packet, the CIDOR node checks its CIDOR-PRIT table to find if there is any pending requester(s) for this response. If there is a match, the node adds the pending requester EID(s) in the Bundle PIT Extension block of the response packet.
\begin{figure*}[!t]
\centering
\subfloat[A, B, C are relaying similar interests from multiple requesters]{
\centering
\includegraphics[width=.8\columnwidth]{dtn}%
\label{dtn1}}
\hfill \centering
\subfloat[A, B relaying similar interests of same requester whereas C is relaying similar interest of different requester. ]{\includegraphics[width=.8\columnwidth]{dtn1}%
\label{dtn2}}
\subfloat[A is relaying response for request id1 that is heading towards S.]{\includegraphics[scale=0.45]{response}%
\label{response}}
\hfill
\caption{A simple scenario of duplicate suppression and redundancy elimination of the CIDOR (a) interest forwarding policy (similar requests from multiple requesters), (b) duplicate reduction; requests containing the same nonce value are suppressed (c) Response forwarding policy.}
\label{dup}
\end{figure*}
\begin{algorithm}
\algsetup{linenosize=\small}
\footnotesize
\caption{Handling Interest Message}
\label{interest}
\begin{algorithmic}[1]
\STATE $key \leftarrow [Interest]$
\IF{$key\ in\ Local\ Cache $}
\STATE $content \leftarrow Cache(key)$
\ENDIF
\IF {$content \neq NULL$}
\STATE $sourceEID \leftarrow [Interest] $
\STATE $response \leftarrow createResponse(content)$
\STATE $addPRITExtBlock(response)$
\STATE $Send\ response\ back\ to\ sourceEID$
\ELSE
\IF{$ myEID $ = $destinationEID$}
\IF {$TTL\ not\ expired $}
\STATE $destinationEID \leftarrow newRandomHost$
\ENDIF
\ENDIF
\STATE $Add\ source\ EID\ to\ PRIT\ table$
\STATE $forward\ the\ Interest\ to\ next\ Hop $
\ENDIF
\end{algorithmic}
\end{algorithm}
\subsection{Interest Propagation}
On the reception of an \textit{Interest} packet, a node applies the handling \textit{Interest} packet algorithm as shown in \textbf{Algorithm~\ref{interest}}. First, it searches its opportunistic cache. If no match is found, it searches its \textit{Content Store}. If the node does not find a match in its \textit{Content Store}, it adds the \textit{source EID} of the \textit{Interest} packet into the CIDOR-PRIT table. These \textit{source EID}(s) are used as the \textit{destination EID}(s) in the response. The duration of a request propagation solely depends on the bundle expiration time (TTL). When a bundle expires, the BPA deletes the bundle.
\begin{algorithm}
\algsetup{linenosize=\small}
\small
\caption{Handling Response Packet}
\label{responsealg}
\begin{algorithmic}[1]
\IF {$myEID$= $destinationEID $}
\STATE $notify\ application$
\IF {$ PRITBlock\ is\ empty $}
\STATE $drop\ the\ packet$
\RETURN
\ENDIF
\ENDIF
\IF {$myEID \in PRITBlock $}
\STATE $notify\ application$
\STATE $ PRITBlock \leftarrow PRITBlock \setminus \{myEID\}$
\ELSE
\STATE $key \leftarrow [Response]$
\STATE$record \leftarrow PRITtable(key)$
\IF {$record \neq NULL$}
\STATE $srcEID \leftarrow getRequester(record) $
\STATE $PRITBlock \leftarrow \cup \{srcEID\} $
\ENDIF
\ENDIF
\STATE $add\ content\ to\ opportunitistic\ cache$
\STATE $Forward\ response\ to\ next\ hop$
\end{algorithmic}
\end{algorithm}
\subsection{Response Forwarding}
When the \textit{Interest} packet reaches a node having content in its content store, the node constructs a \textit{response bundle} with the content and sends it back to the originator of the request. The content provider inserts the \textit{bundle expiration time} from the received \textit{Interest} packet. On the reception of the \textit{response bundle}, a node follows the handling response message algorithm as shown in \textbf{Algorithm~\ref{responsealg}}. Intermediate nodes check the CIDOR-PRIT table and removes the entry if there is a match for the response bundle. If a match is found in the PIT table, the node adds all the \textit{Source EIDs} of originator(s) in the \textit{bundle extension block}. When the \textit{response bundle} reaches the originator of the \textit{Interest} packet, it checks the \textit{bundle extension block}. If the extension block is not empty, it updates the destination host list of the \textit{response bundle} by deleting itself from the list and waits for the next opportunistic contact.
\subsection{Duplicate Suppression}
\label{duplicate}
If multi-copy DTN routing strategies are used, both \textit{Interest and Data} packets get duplicated and are spread into the network. This duplication is inherent in the DTN routing which can also suppress some duplicates in every node. However, messages in the DTN routing are generally distinguished by the tuple of the source and destination addresses and a unique identifier assigned by the source end-point of these messages. The host-centric DTN has no way of detecting loops at the content level. Nevertheless, our proposed architecture includes some distinct parameters (e.g., \textit{Nonce}) for detecting and preventing such duplication.
For instance, Figure~\ref{dtn1} and~\ref{dtn2} illustrates the duplicate suppression in an intermediate node. In Figure~\ref{dtn1}, node A, B, and C are relaying the similar interests of different nonce values. The similar interest of different nonce values indicates the similar requests from different requesters. Upon reception of these interests, D keeps records of requester information on the \textit{Interest} packet in the CIDOR-PRIT table and forward only one \textit{Interest} packet to the next opportunistic contact. In Figure~\ref{dtn2}, D receives the similar interests from the intermediate relay nodes (A and C) containing the same nonce value. Therefore, D keeps record of one \textit{Interest} packet in the CIDOR-PRIT table and discard the other one. CIDOR node also maintains a data structure referred as \texttt{processedMessageList}. This structure keeps records of the seen message (\textit{Interest/Data}) packets for a while, so that intermediate nodes can detect the forwarding loop and drop the same message.
\subsection{Redundancy Elimination}
\label{re}
The CIDOR can reduce the generation of redundant \textit{Interest/Data} packets by maintaining the CIDOR-PRIT table. Figure~\ref{dup} illustrates the scenario of reducing the forwarding of redundant \textit{Interest} packets. As discussed in Section~\ref{duplicate}, the intermediate CIDOR nodes aggregate the similar interests in the CIDOR-PRIT table. The \textit{Interest} packets containing a different nonce value are recorded in the CIDOR-PRIT table. CIDOR-PRIT table is exploited while forwarding the response. Each response packet contains a \textit{CIDOR PRIT extension block} which contains a list of the pending requester(s) information provided by the CIDOR-PRIT table. Upon the reception of a response packet, each node checks its CIDOR-PRIT table to verify the pending requester(s) for this response. For example, in Figure~\ref{response}, node A receives a response heading to the node S. A checks its PRIT table and finds a pending requester R for this response. Node A, therefore, adds R into the PRIT extension block of the response packet. Similarly, node B adds Q in the block. Subsequently, the node M meets the node R and Q. Then, the node M creates two copies of this response and forward to R and Q. The node R keeps its copy and forward another copy towards S.
\subsection{Compatibility Consideration}
The CIDOR has a good compatibility with the native DTN architecture due to the following design principles. First content-centric functionalities remain in the CIDOR control plane decision engine. CIDOR does not modify the native BP. The \textit{Interest/Data} packet is encapsulated in the BP packet in addition to the content-centric meta-information. The CIDOR exploits the BP extension blocks to specify content-centric meta-information. Second not all the nodes are required to implement CIDOR since the nodes (vanilla DTN) perform as the intermediate relay nodes forwarding the packet to the next opportunistic contact. Finally CIDOR separates the forwarding plane from the routing and therefore, the existing DTN routing or the content-based DTN routing can easily be adapted to the CIDOR as shown in Figure~\ref{CIDOR_node}.
\section{Introduction}
Today's Internet architecture very much relies on the fundamental assumption that there exists an end-to-end path between the source and destination for the duration of a communication session. Rapid developments and technological advances have enriched the mobile technology with a variety of embedded sensors, such as GPS, camera, and digital compass. Users can create their own content and share it with other people through social networks. Therefore, the vast majority of Internet usage is dominated by the content distribution and retrieval of a large amount of digital content. The conventional Internet is becoming increasingly infeasible and less meaningful in terms of a number of recognized limitations, for instance, decoupling address from an end-point identity, mobility and disruption tolerance, and above all, scalable and efficient content distribution.
In response to these, Information-Centric Networking (ICN) architecture (e.g., CCN \cite{jacobson2009networking}, DONA \cite{koponen2007data}, PURSUIT/PSIRP \cite{tarkoma2009publish}, POINT \cite{point}, NetInf \cite{dannewitz2009netinf}) emerges a paradigm shift from host centric to information centric communication model. It supports the retrieval of a particular content without any reference to the physical location of the content. \textit{Named data} is the central element of ICN communication instead of its physical location. When a node needs content, it sends a request for a particular content. If any node on the way of the request packet has the content in its content store, it replies the content back to the requester.
Intermittently connected network topology or network disruption incurs a significant challenge for ICN deployment. For instance, name resolution may fail due to network disruptions especially when the elements of the distributed resolution services are affected by network partitioning, such as the consequence of a disaster scenario like hurricane, earthquake, or tsunami. Moreover, name resolution may become unreliable, particularly when names are resolved to locator(s) that do not exist anymore. On March 2011, a magnitude-9 earthquake struck northeastern Japan. The power generation systems, fixed infrastructure networks and mobile telephony towers were completely destroyed. The satellite telecommunication equipment was used for relief and rescue activities, as well as to provide emergency humanitarian assistance. Presently, GreenICN EU-Japan project \cite{green} has given effort to exploit the ICN usage in disaster scenario, when it is difficult to efficiently disseminate disaster notifications and critical rescue information.
In contrast, Delay-tolerant networking (DTN) \cite{cerf2007delay} is an initiative that introduces an architecture for such scenarios, which are particularly characterized by long delay paths, frequent unpredictable disconnections and network partitions. This architecture provides a flexible and resilient protocol for such networks. DTN is based on the store-carry-and-forward model utilizing persistent storage that is well distributed throughout the network. All data are cached in the network until an opportunistic contact is available to forward data.
The goal of this paper is to design a content-centric architecture in DTN called C2DTN that enriches the connectivity options of the native CCN in disaster scenario. For this, C2DTN implements the content-centric features on top of the Bundle Protocol (BP) \cite{burleigh2007bundle} of DTN architecture.
In summary, the main contributions of this paper are as follows:
\begin{itemize}
\item Integration of BP interface to the forwarding scheme of the CCN router \cite{ccnx} (Figure~\ref{c2dtn_node}).
\item Extension of the DTN message to support the seamless integration of the Bundle Protocol in the native CCN (Section~\ref{format}).
\item \textit{Duplicate suppression} and \textit{Redundancy elimination} mechanism at content level (Section~\ref{duplicate} and ~\ref{re}).
\item Modular design to support the existing DTN routing strategies during the forwarding of messages using BP.
\item A thorough evaluation of the efficiency of C2DTN architecture using simulation with different classes of DTN routing strategies for different mobility scenarios.
\end{itemize}
The rest of this paper is organized as follows: We first introduce the background in Section~\ref{back}. Section~\ref{motivation} defines the problem statement and gives an overview of our solution. Section~\ref{design} describes our proposed architecture and the implementation details. After that, the proposed architecture is evaluated in Section~\ref{result}, with different classes of DTN routing strategies for the different mobility scenarios. Section~\ref{related} investigates the related work and finally, Section~\ref{conclude} concludes the paper.
\section{\textbf{Background}}
\label{back}
\subsection{Content-Centric Networking}
\label{ccn}
Among all the ICN proposals, the CCN is gaining more and more interest for its architectural design. The CCN supports two types of messages: \textit{Interest} and \textit{Data}. Each CCN node maintains three data structures; \textit{Pending Interest Table (PIT)}, \textit{ Forwarding Information Base (FIB)} and \textit{Content Store (CS)}. The CCN communication is consumer driven, i.e., a consumer issues an \textit{Interest} packet towards the content source based on the information stored in the FIB. Upon reception of an interest, a node first checks its local cache for the matching content. Otherwise, the node forwards the \textit{Interest} packet to the interface(s) based on the FIB table until the \textit{Interest} packet reaches a content source. Intermediate nodes store the interests in the PIT table which is used to send the data back to the appropriate requester. In addition, the PIT is used to detect the duplicate interests and suppress the forwarding the duplicates over the same interface. Furthermore, PIT provides content aggregation on a particular node. CCN interest, which is not satisfied within a reasonable amount of time, is retransmitted. As CCN senders are stateless \cite{jacobson2009networking}, the consumer is responsible for re-expressing interest, but only if the interest is not satisfied.
\subsection{Delay Tolerant Networking}
The Delay-tolerant networking (DTN) \cite{cerf2007delay,fall2003delay} is an initiative that introduces an architecture for a challenged environment which is particularly specified by long delay paths, sporadic connections, and network partitions. To achieve this, the DTN creates an opportunistic network on top of the existing underlying Layer 2 and Layer 3 protocols. This is achieved through an asynchronous communication along with the use of underlying Convergence Layer Adapter (CLA) (TCP, UDP, Bluetooth, etc.). It weakens the necessity of a stable connection between a source and destination end-points for a communication session. Consequently, DTN architecture provides a flexible and resilient protocol for such networks. The DTN is based on store-and-forward model utilizing persistent storage that is well distributed throughout the network. All data are cached in the network until an opportunistic contact is available to forward data. Nevertheless, content-based routing has been explored in the DTN architecture \cite{costa2006adaptive}. The DTN architecture has some properties (e.g., in-network caching, late binding) similar to ICN design and vice versa.
\section{\textbf{Problem Statement}}
\label{motivation}
Similar to IP, the CCN's network layer is designed to operate on unreliable packet services, i.e., it makes a weak demand on layer 2 (e.g., stateless, unreliable, unordered, best effort delivery). Consequently, \textit{Interest}, \textit{Data}, or both might be lost during transport. Unlike TCP, CCN consumers (the application that originates interest) are stateless and are responsible for reissuing an unsatisfied interest. Intermediate forwarders are responsible for retransmission on a particular interface since the forwarder node knows the lifetime of the CCN packet for the upstream node(s). In a emergency network during natural disaster, mobile users are highly dynamic and the connections are intermittent. It is quite difficult to keep track of the network topology change. In such a scenario, retransmission and re-expression of interests might happen due to a large RTT. The retransmission and re-expression of interests may create a redundant network traffic and consume a significant amount of bandwidth. Furthermore, the PIT table may overflow with frequent disruptions that may lead to the unnecessary retransmissions since the previous hop information stored in the PIT table may not exist due to the sporadic connectivity. Nevertheless, the PIT bottleneck may raise an inevitable constraint in terms of reliability and scalability. Thus, a reverse path based on the PIT and interest aggregation are not suitable for the fragmented network. To handle this, we introduce a separate PIT table for the DTN environment called as CIDOR-PRIT. Unlike CCN, the CIDOR-PRIT keeps track of the requester information on the \textit{Interest} packet instead of the arrival interface. Section~\ref{duplicate} and Figure~\ref{response} illustrate the CIDOR operations on the CIDOR-PRIT table and how the CIDOR reduces the generation of redundant \textit{Interest/Data} packets.
In contrast to CCN, the DTN architecture provides a flexible and resilient protocol through asynchronous communication between two end-points, along with the use of underlying Convergence Layer Adapter (CLA) in a fragmented network.
The fundamental principle of the DTN architecture provides a sender initiated host-centric unicast communication model and still relies on the conventional addressing scheme of the senders and the receivers. To address this, the CIDOR extends the DTN message format to include CIDOR metadata information and enable BP to operate in a content centric fashion. However, The host-centric DTN has no way to detect request forwarding loop at the content level. In addition, messages in the DTN routing are typically identified by the pair of the source and destination addresses and assigned a unique identifier by the originator of these messages. Therefore, messages from different requesters/responders are considered as different ones and hence DTN routing cannot suppress those messages as duplicates. To overcome this, the CIDOR architecture introduces \textit{Duplicate Suppression} mechanism at the content level to detect the forwarding loop and duplicate messages. Moreover, the CIDOR can reduce redundant packet generation by maintaining the CIDOR-PRIT table while operating in a disruptive scenario (see Section~\ref{duplicate} and Figure~\ref{response} for details).
\section{\textbf{Performance Evaluation}}
\label{result}
We evaluate the prototype of the CIDOR architecture using the Opportunistic Network Simulator (ONE) \cite{keranen2009one}. The primary goal of our evaluation is investigating the efficiency of our proposed architecture in terms of the response ratio and latency with respect to the availability of resources in the network. Besides this, we also investigate other evaluation metrics (see Section~\ref{metric}). For this evaluation, we run the simulation with different classes of DTN routing strategies in different mobility scenarios. Our experiment is divided into 4 phases. \textbf{(\rom{1})} We run simulation in the Helsinki city scenario (Section~\ref{city}) by varying the buffer size and fixed TTL 500s. From this phase, we choose a suitable value of the buffer size, at which all routing achieve a good performance in terms of the response ratio. \textbf{(\rom{2})} We fix the buffer size from the phase \rom{1} and evaluate the effect of TTL on the performance. Then we choose a suitable TTL value at which all routing (see Section~\ref{dr}) achieves a good performance. \textbf{(\rom{3})} With the fixed buffer size and the fixed TTL value (from phase \rom{1} and \rom{2}), our experiment follows by varying the number of producers. \textbf{(\rom{4})} With the fixed buffer size, TTL and number of producers, we continue our experiment using Random Way Point (RWP) mobility model by varying the number of resources of each producer. We use both uniform distribution and Zipf distribution to generate queries in the simulation. We plot the average result of 10 simulation runs for each figure.
\begin{figure*}[!t]
\centering
\subfloat[Uniform]{\includegraphics[width=1.5in]{Figures/BufferSize_VS_ResponseRatio_Routing_All_Random}%
\label{a}}
\hfil
\subfloat[Zipf]{\includegraphics[width=1.5in]{Figures/BufferSize_VS_ResponseRatio_Routing_All_Zipf}%
\label{b}}
\hfil
\subfloat[Uniform]{\includegraphics[width=1.5in]{Figures/BufferSize_VS_Latency_Routing_All_Random}%
\label{c}}
\hfil
\subfloat[Zipf]{\includegraphics[width=1.5in]{Figures/BufferSize_VS_Latency_Routing_All_Zipf}%
\label{d}}
\vspace{.2cm}
\subfloat[Uniform]{\includegraphics[width=1.5in]{Figures/MessageState/BufferSize_VS_DeliveryProbability_Routing_All_Random}%
\label{e}}
\hfil
\subfloat[Zipf]{\includegraphics[width=1.5in]{Figures/MessageState/BufferSize_VS_DeliveryProbability_Routing_All_Zipf}%
\label{f}}
\hfil
\subfloat[Uniform]{\includegraphics[width=1.5in]{Figures/MessageState/BufferSize_VS_AverageCost_Routing_All_Random}%
\label{g}}
\hfil
\subfloat[Zipf]{\includegraphics[width=1.5in]{Figures/MessageState/BufferSize_VS_AverageCost_Routing_All_Zipf}%
\label{h}}
\caption{The behaviour of CIDOR with different DTN routing varying the buffer size in Helsinki City Scenario.}
\label{helsinki}
\end{figure*}
\subsection{Helsinki City Scenario}
\label{city}
The ONE simulator provides the map of Helsinki city area (e.g., roads and pedestrian walkways). Besides, three Map-based Movement models are incorporated in the simulator: 1) Random Map-Based Movement, 2) Shortest Path Map-Based Movement, and 3) Routed Map-Based Movement. In Random Map-Based Movement model, nodes move randomly following the paths provided by the map data. However, the random walk may not be a very accurate approximation of real human mobility. In contrast, Shortest Path Map-Based Movement is a more pragmatic model where the nodes select a destination point randomly from a list of Points of Interest (POI) on the map and choose the shortest path to that point. The list of POI may include the popular destinations (e.g., shops, restaurant, tourist attractions). Nevertheless, our simulation uses the Shortest Path Map-Based Movement model. Routed Map-Based Movement model considers the pre-determined routes (e.g., bus, tram or train routes) of the nodes.
\subsection{DTN Routing}
\label{dr}
The CIDOR operates independently of the routing strategies. The forwarding function determines which exit interface to use to send the packet to next hop. For our experiment, we choose three different routing strategies: \textit{Epidemic} \cite{vahdat2000epidemic}, \textit{Spray-and-Wait} \cite{spyropoulos2005spray}, \textit{First contact} \cite{jain2004routing}. The first two represent multi-copy routing scheme, whereas the third one represents single-copy routing scheme. \textit{Epidemic} routing has no limitation of generating copies of each message. Each node of \textit{Epidemic} router carries a list of all pending messages to be delivered. Subsequently, the node exchanges all messages to the next opportunistic contact that are not common on their list. \textit{Spray-and-Wait} generates a limited number of copies for every message and spreads initially. If a node does not find the destination in spray phase, it waits for the destination to perform direct transmission. In our experiment, \textit{Spray-and-Wait} generates 10 copies for every message in the spray phase while \textit{First contact} generates only one copy per message. In addition, we experiment the CIDOR with a combination of the \textit{Epidemic} and the \textit{Spray-and-Wait} (referred as \textit{EP$_{p}$SWRouting}). \textit{EP$_{p}$SWRouting} broadcasts \textit{Interest} packets using the Epidemic (limited by 10 copies) to reach the potential \textit{content providers} faster. When the \textit{Interest} packet reaches the content source, \textit{EP$_{p}$SWRouting} uses the \textit{Spray-and-Wait} routing to deliver the content back to the requester.
\subsection{Query Distribution}
\label{dist}
The simulation generates user requests based on a query key range Q with size N = 100 assuming that query key Q$_{j} \in $K is the $j^{th}$ popular content in the network. The probability of each query Q$_{j}$ issued by an user is randomly selected from a normal distribution with P$_{j}$ as the mean value. In real applications, the popularity of content is correlated with user requests \cite{liu2005client} and follows the well-known Zipf distribution \cite{breslau1999web}. Therefore, we exploit the Zipf distribution and uniform distribution for generating P$_{j}$ of different query keys. All content items are enumerated in the content ladder and assigned a probability of appearance P$_{j}$ for the Zipf distribution with parameter 1 and normalizing constant 0.2. A number of distinct resources matching with each query is distributed in the network. Let us assume that the list of popular contents is [A, B, C, D]. The probability of appearance, then, is [0.2, 0.1, 0.067, 0.05]. Assuming the value range (0, 1000), the content ladder contains [200 (0.2$\times$1000), 300 ((0.2+0.1)$\times$1000), 367 ((0.2+0.1+0.067)$\times$1000), 417]. While generating requests, the requester picks up a random value from the range (0,1000). For instance, if the random number is 333, then the requester checks the content ladder to determine the position of 333 (index 2). The corresponding content of index 2 from the list of popular content is C.
\subsection{Evaluation Metrics}
\label{metric}
\begin{itemize}
\item Response Ratio. The probability for retrieving content in response to an \textit{Interest} packet issued by a node.
\item Latency. The average amount of time passed to receive content in response to a request.
\item Delivery Ratio. The average ratio of the total number of successfully delivered messages with respect to the total number of messages sent.
\item Average cost. The average number of content transmissions required to deliver a data item. It also includes all duplicate messages during transmissions.
\end{itemize}
\begin{figure*}[!t]
\centering
\subfloat[Uniform]{\includegraphics[width=1.5in]{Figures/TTL_VS_ResponseRatio_Routing_All_Random}%
\label{i}}
\hfil
\subfloat[Zipf]{\includegraphics[width=1.5in]{Figures/TTL_VS_ResponseRatio_Routing_All_Zipf}%
\label{j}}
\hfil
\subfloat[Uniform]{\includegraphics[width=1.5in]{Figures/TTL_VS_Latency_Routing_All_Random}%
\label{k}}
\hfil
\subfloat[Zipf]{\includegraphics[width=1.5in]{Figures/TTL_VS_Latency_Routing_All_Zipf}%
\label{l}}
\vspace{.2cm}
\subfloat[Uniform]{\includegraphics[width=1.5in]{Figures/MessageState/TTL_VS_DeliveryProbability_Routing_All_Random}%
\label{m}}
\hfil
\subfloat[Zipf]{\includegraphics[width=1.5in]{Figures/MessageState/TTL_VS_DeliveryProbability_Routing_All_Zipf}%
\label{n}}
\hfil
\subfloat[Uniform]{\includegraphics[width=1.5in]{Figures/MessageState/TTL_VS_AverageCost_Routing_All_Random}%
\label{o}}
\hfil
\subfloat[Zipf]{\includegraphics[width=1.5in]{Figures/MessageState/TTL_VS_AverageCost_Routing_All_Zipf}%
\label{p}}
\caption{The behaviour of CIDOR with different DTN routing strategies varying the TTL in Helsinki City Scenario.}
\label{helsinki1}
\end{figure*}
\subsection{Experimental Settings}
Our experiment uses two different mobility models: Map-based mobility model and well known Random Way Point (RWP). Each model contains three groups of users: \textit{content provider}, \textit{requester}, and intermediate nodes. The Map based movement model constraints the node movements to actual streets provided by the map of the Helsinki city. Users move with realistic speed along the shortest paths between different points of interests (POIs) and random locations. Nodes are divided into four different groups and assigned with different probabilities to choose the next group specific POI or random places to visit. The simulation area approximately is 4.5km x 4.5km. For Helsinki scenario, we use 5 requesters, 35 intermediate nodes, and 10 content providers. A brief overview of all the simulation parameters is presented in Table~\ref{simulation}. We evaluate our metrics by varying the number of resources in the RWP mobility scenario. For this simulation, nodes move with relatively slower speed than vehicles in the range of 0.5-1.5 m/s.
\begin{table}
\small
\centering
\caption{Simulation Parameters}
\label{simulation}
\begin{tabular}{ |l|l| } \hline
Parameter & Value \\ \hline
Simulation Duration & 86400s \\
Number of Requesters & 5 \\
Time interval of generating Interests & 100s \\
Number of Intermediate nodes & 35 \\
Number of Producers & 10:[1-15] \\
Buffer Size & 64M [1M-128M] \\
TTL value & 500s:[50-500s] \\
Transmission range & 100m \\
Transmission speed & 2500Kbps. \\ \hline
\end{tabular}
\label{SimulationParameters}
\end{table}
\subsection{Effect of Buffer Size}
In this experiment, we vary the buffer size of each node and evaluate the performance of the CIDOR with four different DTN routing strategies. In general, a larger buffer size helps achieving a higher delivery and response ratio. As expected, the \textit{Epidemic} routing achieves a higher response ratio and a reduced latency with a larger average cost. The response ratio of the \textit{Epidemic} routing tends to increase when the buffer size is more than 16MB (Fig~\ref{a},~\ref{b}). We observe that the response ratio of the \textit{Epidemic} routing decreases gradually up to the buffer size 16MB. This is because the router does not have sufficient space to accept all the requests due to the lower buffer size. Fig~\ref{e} and~\ref{f} show that the delivery ratio is quite low, around 30$\%$. However, the delivery ratio and the average cost start increasing when the buffer size is more that 16MB (Fig~\ref{g},~\ref{h}). In addition, the response ratio tends to increase with the increase of the buffer size from 16MB. The average latency to retrieve the contents is reported in Fig~\ref{g} and~\ref{h}. Among all routings (\textit{First contact, \textit{Spray-and-Wait}, \textit{Epidemic}, \textit{EP$_{p}$SWRouting}}), the \textit{First contact} shows a poor performance in terms of the response ratio and latency, because the \textit{First contact} generates a single copy for each request and therefore, the average cost is lower compared to other routings. In contrast, when the buffer size increases, the \textit{EP$_{p}$SWRouting} achieves a higher response ratio with a slightly higher latency than \textit{Epidemic} routing. Nevertheless, if the buffer size is sufficiently large (e.g., 64MB in our settings), the response ratio gets saturated for all the routing schemes.
The notable finding is that the delivery ratio of the single copy (\textit{First contact}) and multi-copy (\textit{Spray-and-Wait} and \textit{EP$_{p}$SWRouting}) routing scheme is much higher than \textit{Epidemic} routing, while achieving a comparable response ratio. This is because the CIDOR applies duplicate suppression mechanism to suppress the duplicates.
\subsection{Effect of TTL}
A greater value of TTL increases the probability of a request reaching the content provider. With a large TTL, nodes get more time to relay the messages towards the potential destinations, therefore the delivery ratio of all DTN routings increase accordingly (Fig~\ref{m},~\ref{n}). Fig~\ref{i},~\ref{j},~\ref{k}, and~\ref{l} show that the \textit{Epidemic} outperforms all the other routings in terms of the response ratio and latency. However, the average cost of the \textit{Epidemic} routing is considerably larger than all of the other routings ((Fig~\ref{o},~\ref{p})). This is because the Epidemic routing generates unlimited number copies of each request until the request reaches the content provider. For the \textit{Epidemic} routing, the delivery ratio tends to decrease with the increase of TTL (Fig~\ref{m},~\ref{n}) and drops to 60$\%$ at TTL 500s. This is because, with a larger TTL, the \textit{Epidemic} spreads more messages which are mostly dropped by the duplicate suppression mechanism of the CIDOR and by the buffer constraint of the \textit{Epidemic} router. Fig~\ref{i} and~\ref{j} show that if a TTL value is more than 150s, it does not have any impact on the \textit{Spray-and-Wait} and the \textit{EP$_{p}$SWRouting}. The response ratio in the both \textit{Epidemic} and \textit{EP$_{p}$SWRouting} is almost 100$\%$. On the other hand, the \textit{First contact} shows a poor performance with the smaller TTL values, but performs well for the higher TTL values. In Fig~\ref{o} and~\ref{p}, we find that the average cost of the \textit{Epidemic} is quite large as compared to others.
\begin{figure*}[!t]
\centering
\subfloat[Uniform]{\includegraphics[width=1.5in]{Figures/NumOfProducer_VS_ResponseRatio_Routing_All_Random}%
\label{aa}}
\hfil
\subfloat[Zipf]{\includegraphics[width=1.5in]{Figures/NumOfProducer_VS_ResponseRatio_Routing_All_Zipf}%
\label{bb}}
\hfil
\subfloat[Uniform]{\includegraphics[width=1.5in]{Figures/NumOfProducer_VS_Latency_Routing_All_Random}%
\label{cc}}
\hfil
\subfloat[Zipf]{\includegraphics[width=1.5in]{Figures/NumOfProducer_VS_Latency_Routing_All_Zipf}%
\label{dd}}
\vspace{.2cm}
\subfloat[Uniform]{\includegraphics[width=1.5in]{Figures/MessageState/NumOfProducer_VS_DeliveryProbability_Routing_All_Random}%
\label{ee}}
\hfil
\subfloat[Zipf]{\includegraphics[width=1.5in]{Figures/MessageState/NumOfProducer_VS_DeliveryProbability_Routing_All_Zipf}%
\label{ff}}
\hfil
\subfloat[Uniform]{\includegraphics[width=1.5in]{Figures/MessageState/NumOfProducer_VS_AverageCost_Routing_All_Random}%
\label{gg}}
\hfil
\subfloat[Zipf]{\includegraphics[width=1.5in]{Figures/MessageState/NumOfProducer_VS_AverageCost_Routing_All_Zipf}%
\label{hh}}
\caption{The behaviour of CIDOR with different DTN routing varying the number of Producers in Helsinki City Scenario.}
\label{helsinki1}
\end{figure*}
\subsection{Effect of the number of Resources}
In this experiment we fix 5 requesters, 35 intermediate nodes and vary the number of content providers. The requesters generate requests for content at a regular interval of 100s as discussed in Section~\ref{dist}. Resources are distributed to a fixed number of nodes prior to starting the simulations. Fig~\ref{aa} and~\ref{bb} show that the response ratio of all of the DTN routings gradually increase with the increase of the number of producers, as expected. Both the \textit{Epidemic} and the \textit{EP$_{p}$SWRouting} achieve the response ratio close to 100$\%$ when the number of producers are more than 8, whereas the \textit{Spray-and-Wait} routing achieves 80$\%$. The latency of retrieving content decreases with the increase of the number of producers (Fig~\ref{cc},~\ref{dd}). With 15 producers, the latency of the \textit{Epidemic}, \textit{EP$_{p}$SWRouting}, and \textit{First contact} are reduced by 67, 58, and 70 percent respectively. The delivery ratio of the \textit{Epidemic} routing ((Fig~\ref{ee},~\ref{ff})) is quite low as compared to the other routings. The \textit{Epidemic} routing gains 10$\%$ delivery ratio when the number of producers is maximum, but the average cost gradually increases ((Fig~\ref{gg},~\ref{hh})). This is because the Epidemic routing generates a unlimited number of copies of each request until the request reaches the content provider.
The interesting observation is that with the increase of the number of resources in the network the \textit{Epidemic} routing achieves 100$\%$ response ratio with a slight increase of the delivery ratio. In addition, the \textit{Spray-and-Wait} achieves a similar response ratio compared to the \textit{Epidemic} routing with a lower average cost and a comparable latency when the number of resources increases in the network.
In the RWP mobility model scenario (Fig~\ref{rwp}) we fix 10 producers and vary the number of resources in each producer. The \textit{EP$_{p}$SWRouting} and the \textit{Epidemic} routing show a similar performance in terms of the response ratio with the increase of the number of resources (Fig~\ref{aaa},~\ref{bbb}), but the average cost of the \textit{Epidemic} routing is much higher than that of the \textit{EP$_{p}$SWRouting} (Fig~\ref{ggg},~\ref{hhh}). In terms of latency, the \textit{Epidemic} routing benefits more, as the number of resources increases. In addition, the gaps between the \textit{Epidemic} and the other routings tends to decrease (Fig~\ref{ccc},~\ref{ddd}). The delivery ratio of the \textit{Epidemic} increases by 10$\%$. The \textit{Spray-and-Wait} and the \textit{EP$_{p}$SWRouting} show a similar delivery ratio (Fig~\ref{eee},~\ref{fff}), when the number of resources are more than 30 for each producer. We observe that the delivery ratio of all of the other routings except the \textit{Epidemic} is almost constant because in this experiment we fix the buffer size to 64MB and TTL to 500s. With this settings, all the routing except \textit{Epidemic} achieves a considerably high delivery ratio (Fig~\ref{helsinki} and \ref{helsinki1}).
\subsection{Effect of Zipf Distribution}
When the buffer size is less than 10MB, all routings in the case of the Zipf and uniform distribution show the similar performance in terms of the response ratio (Fig~\ref{b} vs. Fig~\ref{a}). With the increase of the buffer size, the \textit{First contact} and the \textit{Spray-and-Wait} gain 5$\%$ response ratio. When the buffer size is sufficiently large (above 64MB), Zipf distribution has little effect on the \textit{Epidemic} and the \textit{EP$_{p}$SWRouting}. This is because the router has sufficient space to cache both the popular and unpopular content. In terms of the average cost, the Zipf distribution has a great impact on the \textit{Epidemic} (Fig~\ref{ee} vs Fig~\ref{hh}), but a little impact on the other routings. In terms of latency, \textit{First contact} achieves good performance, since the requests for popular contents can reach the content source faster. Other routings have a little effect on latency (Fig~\ref{cc} vs Fig~\ref{dd}). In the RWP, the results show that the Zipf has a little impact on the performance of all routings in terms of response ratio and delivery probability (Fig~\ref{rwp}). However, the latency significantly drops (Fig~\ref{ccc} vs Fig~\ref{ddd}) in the case of Zipf distribution, e.g., the latency in the \textit{First contact} routing drops by 50$\%$.
\begin{figure*}[!t]
\centering
\subfloat[Uniform]{\includegraphics[width=1.5in]{Figures/MessageState/NumOfResource_VS_ResponseRatio_Routing_All_Random}%
\label{aaa}}
\hfil
\subfloat[Zipf]{\includegraphics[width=1.5in]{Figures/MessageState/NumOfResource_VS_ResponseRatio_Routing_All_Zipf}%
\label{bbb}}
\hfil
\subfloat[Uniform]{\includegraphics[width=1.5in]{Figures/MessageState/NumOfResource_VS_Latency_Routing_All_Random}%
\label{ccc}}
\hfil
\subfloat[Zipf]{\includegraphics[width=1.5in]{Figures/MessageState/NumOfResource_VS_Latency_Routing_All_Zipf}%
\label{ddd}}
\vspace{.2cm}
\subfloat[Uniform]{\includegraphics[width=1.5in]{Figures/MessageState/NumOfResource_VS_DeliveryProbability_Routing_All_Random}%
\label{eee}}
\hfil
\subfloat[Zipf]{\includegraphics[width=1.5in]{Figures/MessageState/NumOfResource_VS_DeliveryProbability_Routing_All_Zipf}%
\label{fff}}
\hfil
\subfloat[Uniform]{\includegraphics[width=1.5in]{Figures/MessageState/NumOfResource_VS_AverageCost_Routing_All_Random}%
\label{ggg}}
\hfil
\subfloat[Zipf]{\includegraphics[width=1.5in]{Figures/MessageState/NumOfResource_VS_AverageCost_Routing_All_Zipf}%
\label{hhh}}
\caption{The behaviour of CIDOR with different DTN routing varying the number of resources of each Producer in Random Way Point movement model.}
\label{rwp}
\end{figure*}
\vspace{.2cm}
| {'timestamp': '2018-03-02T02:08:14', 'yymm': '1803', 'arxiv_id': '1803.00275', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00275'} | arxiv |
\section{Introduction}
Human learning automatically induces more general rules from a large number of experiences. These rules are taken as the elements to form the inertial thinking schemes that will be used to solve similar problems later. The reasons that inertial thinking exists for humans lie in the fact that it can solve a large number of daily problems when there is insufficient information and it can solve them quickly \cite{Corcoran2009}. However, the accuracy of solutions to the problems will generally be reduced when the problems are different from those for learning.
Like human learning, machine learning automatically learns new concepts from a large number of data. In the learning process, inertial thinking schemes will be formed, including illusion inertial thinking, leading to low generalization ability of the machine learning methods. According to the law of Hoeffding \cite{Hoeffding1963}, the accuracy of machine learning methods depend heavily on a large number of training samples, and this is why most advanced machine learning methods require a large number of training samples \cite{Lake2015}, e.g., deep learning methods \cite{LeCun2015}. However, it is difficult to obtain a large number of training samples for most real applications, such as disease diagnosis, where the training samples are few, easily leading to formation of illusion inertial thinking in machine learning methods. One way for humans to solve these kinds of problem is the use of reverse thinking, which is an effective method of creative thinking \cite{Sawaguchi2015}. However, for machine learning methods, reverse thinking is totally not considered. Therefore, in this paper we present a new method that applies reverse thinking to correct illusion inertial thinking for machine learning methods so that their generalization ability can be enhanced. This method is suitable for any machine learning method, as long as illusion inertial thinking is facilitated.
\subsection{Machine learning principles}
Machine learning methods are all based on the principle of inertial thinking. They first learn from the training data to form the inertial thinking scheme that is then applied to solve new problems.
Suppose that for the testing sample $X$, a learning approach is applied to obtain the probability model $P$ from the training database, so that
\begin{equation}
C^*=\arg\max_{C_i\in C}P(C_i=X),
\end{equation}
where $C=\{C_1,\cdots,C_i,\cdots,C_n\}$ is a set of classes and $P(C_i=X)$ is the probability that $X$ belongs to class $C_i$.
For example, if there are two classes $C_1,C_2$, the learned probability model will work as follows:
\begin{displaymath}
P(C_1=X)> P(C_2=X)\Longrightarrow X\in C_1,
\end{displaymath}
\begin{displaymath}
P(C_2=X)>P(C_1=X)\Longrightarrow X\in C_2
\end{displaymath}
The ability of the learned probability model to correctly classify the new samples is measured as its generalization ability. A lower generalization ability of the model may result from the training samples being insufficient to correctly fit the data distribution of the problem.
In order to formally illustrate the generalization ability of the model, all data are taken as balls of different colors in a jar. It is expected that the proportion of different color balls in the jar can be computed through a portion of the balls partially taken out of the jar. It assumes that the ratio of orange balls in the jar is $\mu$ and the proportion of green balls for $1-\mu$. In the balls taken out of the jar, the ratio of orange balls is $\nu$, and the proportion of green balls is $1-\nu$. The relationship between the two cases follows the Hoeffding inequality \cite{Hoeffding1963}:
\begin{equation}
P(|\mu-\nu|>\varepsilon)\leq 2exp(-2\varepsilon^2N).
\end{equation}
This law shows that when \emph{N} is large, the right-hand side of the inequality will be very small, indicating that the probability of the difference between $\mu$ and $\nu$ being larger than the given $\varepsilon$ is very small. In such a case, the distribution of the overall samples can be inferred from the distribution of the partially taken samples. However, in real applications, \emph{N} is usually difficult to be sufficiently large, so error is inevitable.
The current machine learning methods only consider suitable inertial thinking, ignoring illusion inertial thinking. In such a case, when the size of the training samples are not large enough, the testing samples could have a high probability of differing from the training samples, inevitably leading to error. This is why there are many machine learning methods that perform well on some experimental data, with even up to 100\% accuracy, but they may behave badly in practice.
\section{Modeling reverse thinking}
Generally, inertial thinking is composed of both suitable inertial thinking and illusion inertial thinking. When the illusion inertial thinking appears, people can use reverse thinking to deal with it. This process begins with designing the inertial thinking discrimination model to judge whether the current testing data is in line with inertial thinking or illusion inertial thinking. Second, the reverse thinking model is created to correct illusion inertial thinking. The overall procedure is shown in Fig. \ref{Figure1}, where classifiers are trained on the training database to form a suitable inertial thinking model, an illusion inertial thinking model, and an inertial thinking discrimination model.
\begin{figure*}[htbp]
\centering
\includegraphics[width=\textwidth]{Figure1.eps}
\caption{Training and testing procedures of machine learning methods based on reverse thinking}
\label{Figure1}
\end{figure*}
\subsection{Inertial thinking model}
The suitable inertial thinking model works well on the simple samples that are easily classified, while illusion inertial thinking easily occurs when classifying complicated samples. There are many measures that can be applied to rank samples by simplicity \cite{Smith2014}. Hence, we rank samples in the training data according to the simplicity of samples using the k-fold cross-validation method. When samples in a fold are removed from the training data, the remaining ones are used to train the classifier, which is then applied to classify all training data. In such a case, the simplicity of each sample can be computed.
\textbf{Definition}. Supposing that there are $N$ classification models, the simplicity of sample $X$ is defined by
\begin{equation}
m(X)=\frac{1}{N}\sum_{i=1}^N m_i(X)
\end{equation}
\begin{displaymath}
m_i(X)= \left\{
\begin{array}{ll}
1, & \hbox{X is classified correctly;} \\
0, & \hbox{else.}
\end{array}
\right.
\end{displaymath}
The definition of simplicity means that a sample is simple if it is correctly classified by many models. In this way, all samples can be ranked according to their simplicity:
\begin{displaymath}
S=\{X_1,...,X_i,...,X_n|m(X_i)\geq m(X_{i+1})\}.
\end{displaymath}
Subsequently, a simple training database $(S_E,L_E)$ can be constructed, the samples of which are of greater simplicity than the given threshold $\theta$. Similarly, a complicated training database $(S_D,L_D)$ can also be constructed:
\begin{displaymath}
S_E=\{X_i|Xi\in S \wedge m(X_i)> \theta\},
\end{displaymath}
\begin{displaymath}
S_D=\{X_i|Xi\in S \wedge m(X_i)\leq \theta\},
\end{displaymath}
\begin{displaymath}
S=S_E\cup S_D, S_E\cap S_D=\emptyset.
\end{displaymath}
Using these training databases, three models are trained as follows, where $\xi$ is a classification method and $\varphi$ is a discrimination method for judging whether a sample is simple.
\begin{itemize}
\item Inertial thinking model: $M_I=\xi(S,L)$.
\item Suitable inertial thinking model: $M_S=\xi(S_E,L_E)$.
\item Discrimination model: $M_{D}=\varphi(S_E\cup S_D,\{+,-\})$ , where $+$ denotes samples to be classified easily and $-$ denotes the samples to be classified difficultly.
\end{itemize}
\subsection{Reverse thinking rules}
Owing to illusion inertial thinking, the learned inertial thinking model may misclassify the coming samples. For example, it classifies the test sample $X$ with true class $C_1$ as belonging to the class $C_2$; that is,
\begin{equation}
r:C_1\rightarrow C_2.
\end{equation}
In such a case, according to reverse thinking, the above rule can be reversed to obtain the reverse thinking rule by recomputing the probability:
\begin{equation}
rr:C_2\rightarrow C_1.
\end{equation}
Because the results obtained by illusion inertial thinking are not absolute, a probabilistic model like the Bayesian theorem is applied. In conditions of the complete statistical knowledge of a model presented, the classifier designed according to the Bayesian theorem can obtain the minimum classification error in terms of probability, which means that the classifier based on the reverse thinking rule is optimal.
As the testing sample $X$ has been misclassified as belonging to the class $C_2$, according to the Bayesian theorem its true class is $C_1$ with the probability
\begin{equation}
P(C_1=X|C_2=X)=\frac{P(C_2=X|C_1=X)P(C_1=X)}{P(C_2=X)},
\end{equation}
where $P(C_i=X)$ refers to the probability that $X$ belongs to class $C_i$, and $P(C_2=X|C_1=X)$ denotes the probability that $X$ with the class $C_2$ is misclassified as belonging to $C_1$. The right-hand side of the above equation involves the prior probability that is then applied to compute the posterior probability of the left-hand side of the equation. Equation (6) is applied to implement the reverse thinking rule in Eq. (5) by recomputing the probability. All posterior probabilities can be computed from the confusion matrix. To avoid confusion, Eq. (6) can be rewritten as
\begin{equation}
P(C_1=X|C_2=X)=\frac{P(C_2|C_1)P(C_1=X)}{P(C_2=X)}.
\end{equation}
\textbf{Theorem 1}. If $X\in C_2\wedge P(C_1=X) > P(C_2=X)$, under certain conditions, $P(C_2=X|C_1=X)>P(C_1=X|C_2=X)$, so that $X\in C_1$
\textbf{Proof}. The inertial thinking model classifies the sample with the true class $C_1$ as belonging to the class $C_2$, and the reverse thinking rule can be applied to recompute the probability so as to classify the sample as belonging to the correct class $C_1$; that is,
\begin{displaymath}
P(C_1=X|C_2=X)=\frac{P(C_2|C_1)P(C_1=X)}{P(C_2=X)}
\end{displaymath}
However, the reverse thinking rule may be also applied to recompute the probability
\begin{displaymath}
P(C_2=X|C_1=X)=\frac{P(C_1|C_2)P(C_2=X)}{P(C_1=X)}.
\end{displaymath}
In such a case,
\begin{displaymath}
\frac{P(C_1=X|C_2=X)}{P(C_2=X|C_1=X)}=
\end{displaymath}
\begin{displaymath}
\frac{P(C_2|C_1)P(C_1=X)}{P(C_2=X)}\times \frac{P(C_1=X)}{P(C_1|C_2)P(C_2=X)}
\end{displaymath}
\begin{displaymath}
=\frac{P(C_2|C_1)}{P(C_1|C_2)}\times (\frac{P(C_1=X)}{P(C_2=X)})^2.
\end{displaymath}
To satisfy $X\in C_1$,
\begin{displaymath}
\frac{P(C_2|C_1)}{P(C_1|C_2)}\times (\frac{P(C_1=X)}{P(C_2=X)})^2 >1,
\end{displaymath}
\begin{equation}
\frac{P(C_2|C_1)}{P(C_1|C_2)} > (\frac{P(C_2=X)}{P(C_1=X)})^2,
\end{equation}
\begin{displaymath}
\frac{P(C_2|C_1)}{P(C_2=X)} > \frac{P(C_1|C_2)}{P(C_1=X)}\times \frac{P(C_2=X)}{P(C_1=X)}.
\end{displaymath}
The learning model has classified $X$ as belonging to $C_2$ -- that is, $P(C_2=X)>P(C_1=X)$ -- leading to
\begin{displaymath}
\frac{P(C_2|C_1)}{P(C_2=X)} > \frac{P(C_1|C_2)}{P(C_1=X)}.
\end{displaymath}
Thus, the reverse thinking rule can enhance the probability that the classifier will classify $X$ as belonging to $C_1$ more than it will classify it as belonging to $C_2$. This proves that the reverse thinking rule has the ability to correct the classification of samples that have been misclassified.
Since $P(C_2=X)>P(C_1=X)$, their difference is less, the inequality (8) is easily satisfied, and then the reverse thinking rule is more useful in correcting the misclassified category. However,
\begin{displaymath}
\frac{P(C_2|C_1)}{P(C_1|C_2)} > 1,
\end{displaymath}
which means that the sample with class $C_1$ is easily misclassified as belonging to the class $C_2$ in the confusion matrix, but not \textit{vice versa}.
As the classifier classified the samples depending on $P(C_1)=X$ and $P(C_2=X)$, they may be wrong, so they can be also replaced by the prior probability computed in the confusion matrix. Subsequently, we have another alternative reverse thinking rule, as
\begin{equation}
P(C_1=X|C_2=X)=\frac{P(C_2|C_1)P(C_1)}{P(C_2)}.
\end{equation}
It is noteworthy that the reverse thinking rule is only applied to the classification of complicated samples, in which only one reverse direction is considered to deal with the misclassified samples. Therefore, in the following context, the necessary condition for the reverse thinking rule is simplified as follows to design the new machine learning approach:
\begin{equation}
P(C_1=X|C_2=X)>P(C_1=X)\Rightarrow X\in C_1,
\end{equation}
indicating that the reverse thinking rule can enhance the probability that the classifier correctly classifies the sample.
\subsection{Computing prior probabilities}
It is necessary to use the Bayesian theorem to calculate the probabilities of reverse thinking rules, which can be calculated by computing the confusion matrix of the specified classifier on the given training data. For example, if the training data have 60 samples with two categories, where each category is composed of 30 samples, the confusion matrix of the given classifier can be computed through 10-fold cross-validation. As shown in Table \ref{Table1}, each column in the table represents the predicted category, and the total number of each column represents the number of samples predicted for the category. Each row represents the true category of the sample, and the total number of samples per row represents the number of samples in that class. For example, the number, 23, located at the cross-point of both the first row and first column indicates that the samples with the true class $C_1$ are correctly predicted to be $C_1$. The number, 5, located at the cross-point between the first column and second row indicates that there are five samples with true class $C_2$, which are incorrectly predicted to be class $C_1$.
\begin{table}[htbp]
\centering
\caption{Confusion matrix}
\label{Table1}
\begin{tabular}{llll}
\hline\noalign{\smallskip}
Predicted class & & & \\
$\Downarrow$ & &$C_1$ & $C_2$ \\
\noalign{\smallskip}\hline\noalign{\smallskip}
& $C_1$ & 23 & 7 \\
True class$\Rightarrow$ & $C_2$ &5 &25\\
\noalign{\smallskip}\hline
\end{tabular}
\end{table}
According to the confusion matrix, the prior conditional probabilities that the samples are misclassified as belonging to each category can be computed by
\begin{equation}
P(C_1=X|C_2=X)=\frac{23}{7+25},
\end{equation}
\begin{equation}
P(C_2=X|C_1=X)=\frac{25}{23+5}.
\end{equation}
\subsection{RTML algorithm}
The reverse thinking for machine learning (RTML) algorithm is described in Table \ref{Table2}, including both training and testing stages. The inertial thinking model in the RTML algorithm is obtained by training the classifier on all the training data. This is because illusion inertial thinking is formed in the original environment. Second, for any new testing sample, the discrimination model is used to decide whether the testing sample is easy to classify. If the testing sample is easy to classify, it is classified by using the suitable inertial thinking model that is trained on the easy training data. If the testing sample is hard to classify, the inertial thinking model will be applied, and then the reverse thinking model is applied to modify its result. The final category is determined by the modified results.
\begin{table}[htbp]
\centering
\caption{Reverse thinking for machine learning (RTML) algorithm}
\label{Table2}
\begin{tabular}{rlll}
\hline\noalign{\smallskip}
Input &training data $(S,L)$ and testing sample $X$\\
&The threshold parameter $\theta$\\
Output& The class label $\omega$ for X\\
\noalign{\smallskip}\hline\noalign{\smallskip}
Training &\\
1 &Compute $m(X_i),X_i\in S$ \\
2 &Build $(S_E,L_E ) \wedge X_i\in S_E$ $\wedge m(X_i)<\theta$\\
3 &Build $(S_D,L_D )\wedge X_i\in S $$\wedge m(X_i)\geq\theta$\\
4 &Train suitable inertial thinking model \\
&$M_S=\xi(S_E,L_E)$ \\
5 &Train illusion inertial thinking model\\
&$M_I=\xi(S,L)$\\
6 &Train the discrimination model\\
& $M_{II}=\varphi(S_E\cup S_D,\{+,-\})$\\
\noalign{\smallskip}\hline\noalign{\smallskip}
Testing&\\
7&$y\leftarrow M_{II}(X)$\\
8&If $y\in \{+\},\omega\leftarrow M_S(X)$\\
9& Else /* reverse thinking is required*/\\
10 &$\omega\leftarrow M_{I}(X)$\\
11 & If $\omega = C_1$ and \\
& $P(C_2=X|C_1=X) > P(C_2=X)$\\
12 & $\omega\leftarrow C_2$\\
13 & End\\
14 & If $\omega = C_2$ and\\
& $P(C_1=X|C_2=X) > P(C_1=X)$\\
15 & $\omega\leftarrow C_1$\\
16 & End\\
\noalign{\smallskip}\hline
\end{tabular}
\end{table}
In this algorithm, only two classes are considered because most of the datasets in real tasks are binary class. Second, for binary-class datasets, the use of reverse thinking rules only needs to consider the Bayesian theorem, without considering the Bayesian network, so as to simplify the problem. Finally, the multi-class tasks can be classified through classification methods on binary-class tasks, such as the support vector machine (SVM) \cite{Ji2017}.
The complexity of the RTML algorithm at the training stage is mainly distributed in computing the confusion matrix and training three classifiers. Therefore, the complexity of the RTML algorithm is equal to the maximum complexity of the three classifiers. The complexity of the RTML algorithm at the testing stage is also the maximum complexity of the three classifiers for testing a sample. The calculation of reverse thinking rules is only related to the number of categories, which can be regarded as a constant. The RTML algorithm has an additional parameter, the simplicity threshold, which determines the boundary between the illusion inertial thinking model and suitable inertial thinking model.
\section{Experimental results}
The effectiveness of the proposed method is demonstrated through experiments on standard datasets. In principle, the proposed method is applicable to all existing classification methods, so as to improve their classification performance. In experiments, a highly representative machine learning method is selected, namely SOFTMAX, because it is widely used in deep learning \cite{Szegedy2014,LeCun2015}, and it is expected that the RTML algorithm can be applied to deep learning. For the discrimination model, SVM-KNN (where KNN denotes \textit{k}th nearest neighbor) is selected \cite{Zhang2006}, as it inherits the SVM advantages \cite{Ji2017}, while be able to elegantly deal with large datasets.
\subsection{Experimental databases}
Experimental databases include artificial datasets and benchmark real datasets.
Using artificial data, we can control the number of available samples and add noise according to the experimental purpose. In the experiments, two spirals of data are selected, which is synthetic, but very difficult for many machine learning methods. Such data have been widely used by many classifiers as standard data \cite{Wen2013}. Here, they are applied to observe the effect of reverse thinking on noisy data of different sizes. One of the data examples is shown in Fig. \ref{Figure2}, where there are 200 points with some noise disruption. Obviously, these data are not linearly separable and are nearly evenly distributed for two classes.
\begin{figure}[htbp]
\centering
\subfigure[SOFTMAX]{
\includegraphics[width=2.0 in]{Figure2a.eps}}
\hspace{0 in}
\subfigure[RTML]{
\includegraphics[width=2.0 in]{Figure2b.eps}}
\caption{Classification results in which misclassified samples are indicated in red}
\label{Figure2}
\end{figure}
In addition to artificial data, 15 benchmark real datasets with two classes are selected from LIBSVM \cite{Chang2011} and KEEL \cite{Alcal-Fdez2011}; see Table \ref{Table3}. The reason for selecting data with only two classes is that most of the real datasets are binary class. Second, for binary-class datasets, the use of reverse thinking rules only needs to consider the Bayesian theorem, without considering the Bayesian network, so as to simplify the problem. Finally, the multi-class data can be classified through classification methods on binary-class data, such as the SVM \cite{Ji2017}.
\begin{table}[htbp]
\centering
\caption{Illustration of benchmark data used for experiments}
\label{Table3}
\begin{tabular}{lllll}
\hline\noalign{\smallskip}
No. &data name &classes &features &samples\\
\noalign{\smallskip}\hline\noalign{\smallskip}
1& fourclass &2 &2 &862\\
2& waveform &2 &21 &5000\\
3& svmguide1 &2 &4 &3089\\
4& madelon &2 &500 &2000\\
5& splice &2 &60 &1000\\
6& thyroid &2 &5 &215\\
7& titanic &2 &3 &2201\\
8& segment0 &2 &19 &2308\\
9& vehicle1 &2 &18 &846\\
10& glass1 &2 &9 &214\\
11& pima &2 &8 &768\\
12& haberman &2 &3 &306\\
13& spambase &2 &57 &4597\\
14& mammographic &2 &5 &830 \\
15& phoneme &2 &5 &5404\\
\noalign{\smallskip}\hline
\end{tabular}
\end{table}
\subsection{Analysis of RTML algorithm}
In order to observe the effectiveness of the RTML algorithm more clearly, experiments on two spirals of data are conducted, the results of which are presented in Fig. \ref{Figure2}, where the misclassified testing data are denoted in red. It can be seen that the number of red points misclassified by SOFTMAX is larger than that misclassified by the RTML algorithm. Some samples misclassified by SOFTMAX have been corrected by the RTML algorithm, showing that the reverse thinking model is effective. However, when the easy points are misclassified, the RTML algorithm cannot modify them. This depends on the ability of the original classifier, i.e., SOFTMAX. This, in turn, means that the original classifier should be selected to be the best as possible. Some misclassified samples cannot be modified, since in such cases illusion inertial thinking has not formed.
The RTML algorithm has a simplicity threshold as a parameter to decide whether the illusion inertia thinking model can be formed on the database composed of samples with a simplicity larger than the given threshold. Experiments are conducted on two real datasets to illustrate the influence of the parameter on the RTML algorithm. It can be seen from Fig. \ref{Figure3} that the RTML algorithm is sensitive to the threshold. When the threshold $\theta>0.4$ in Fig. \ref{Figure3}(a), the RTML algorithm has the worse effect, since in such a case many samples are mistaken for the easy ones. This indicates that the threshold parameter values need to be determined as accurately as possible. However, from Fig. \ref{Figure3}, the parameter varies in terms of a law, indicating that its optimal value can be determined easily using the \emph{k}-fold cross-validation method.
\begin{figure}
\centering
\subfigure[titanic]{
\includegraphics[width=2.0 in]{Figure3a.eps}}
\hspace{0 in}
\subfigure[RTML]{
\includegraphics[width=2.0 in]{Figure3b.eps}}
\caption{Impact of the simplicity threshold $\theta$ on the performance of RTML algorithm}
\label{Figure3}
\end{figure}
As simplicity of samples plays a very important role in the RTML algorithm, it needs to be measured as precisely as possible. In our context, many models have been applied to define the simplicity. These models are created using the \emph{k}-fold cross-validation method on the training database, with the same classification method. It can be seen from Fig. \ref{Figure4} that when the number of models is larger than 35, the accuracy tends to the optimal one, and the threshold can be easily selected. This means that the number of models used to measure the simplicity of the samples should be large as possible to make the measurement more stable.
\begin{figure*}
\centering
\includegraphics[width=\textwidth]{Figure4.eps}
\caption{Experimental results of RTML algorithm with different numbers of models }
\label{Figure4}
\end{figure*}
\subsection{Influence of noisy artificial data on RTML algorithm}
Generally, machine learning methods are easily influenced by noisy data. Some experiments are therefore conducted to assess the influence of noisy data on the RTML algorithm, the results of which are shown in Fig. \ref{Figure5}. Here, datasets with 100, 200, and 400 points are added by noises whose variances are 0.02, 0.04, and 0.06, respectively (as well as a variance of 0.0). In this way, 12 different datasets are formed to observe the effects of the noise and the size of the data on the performance of the RTML algorithm. In order to observe the sensitivity of the RTML algorithm to its parameters at the same time, classification results corresponding to each parameter are computed and plotted in the figure. It can be seen from Fig. \ref{Figure5} that the noise has negative effects on the RTML algorithm; the more intense the noise, the lower the accuracy. This is because the noise is random, disrupting the formation of illusion inertial thinking. However, in the case of noise, the RTML algorithm still obviously increases the accuracy of SOFTMAX. At the same time, the RTML algorithm is sensitive to its parameter, but still achieves remarkable results at many values, indicating that the choice of parameter is easier. Finally, when the data size becomes larger, the RTML algorithm increases the effect more obviously while being less sensitive to its parameter. This is because the number of misclassified samples will increase in the larger dataset, leading to the formation of more stable illusion inertial thinking.
\begin{figure*}[htbp]
\centering
\includegraphics[width=\textwidth]{Figure5.eps}
\caption{Experimental results of RTML algorithm with different numbers of models}
\label{Figure5}
\end{figure*}
\subsection{Effect of real datasets on RTML algorithm}
As the artificially constructed examples may not correspond to situations that are likely to occur in practice, some experiments on real datasets are conducted. One of the advantages of real data is that they are generated without any knowledge of the classification procedures that will be used for testing. Here, 15 real datasets, shown in Table \ref{Table4}, are applied to conduct experiments using the 10-fold cross-validation method to determine the training data and testing data, and then the average classification accuracy can be obtained. In each set of training data, the 10-fold cross-validation method is used to select the optimal parameters for the given classifier.
\begin{table*}[htbp]
\centering
\caption{Experimental results on real datasets for which SOFTMAX is learning method}
\label{Table4}
\begin{tabular}{lllllllllll}
\hline\noalign{\smallskip}
& &SOFTMAX &SOFTMAX & \\
No. &Data name &(all data) &(simple data) & RTML algorithm\\
\noalign{\smallskip}\hline\noalign{\smallskip}
1& fourclass & 0.6893$\pm$0.0316 &0.6893$\pm$0.0316 &\textbf{0.9837$\pm$0.0103}\\
2& waveform &0.7742$\pm$0.0218 &0.7754$\pm$0.0231 &\textbf{0.8710$\pm$0.0236}\\
3& svmguide1 & 0.8460$\pm$0.0140 &0.8447$\pm$0.0112 &\textbf{0.9314$\pm$0.0175}\\
4& madelon & 0.5365$\pm$0.0142 &\textbf{0.5685$\pm$0.0376} &0.488$\pm$0.0430 0\\
5& splice &\textbf{0.8405$\pm$0.0235} &\textbf{0.8405$\pm$0.0216} &0.8368$\pm$0.0219\\
6& thyroid &0.8985$\pm$0.0671 &0.9212$\pm$0.0534 &\textbf{0.9396$\pm$0.0577}\\
7& titanic &0.7733$\pm$0.0179&\textbf{0.7833$\pm$0.0108} &\textbf{0.7815$\pm$0.0125}\\
8& segment0 &0.9970$\pm$0.0036 &0.9970$\pm$0.0036 &0.9965$\pm$0.0034\\
9& vehicle1 &\textbf{0.8062$\pm$0.0466} &0.8003$\pm$0.0477 &0.7920$\pm$0.0573\\
10& glass1 & 0.6397$\pm$0.0842 &0.6111$\pm$0.0516 &\textbf{0.7185$\pm$0.0522}\\
11& pima &0.6849$\pm$0.0355 &0.6875$\pm$0.0300 & \textbf{0.7148$\pm$0.0351}\\
12& haberman &\textbf{0.7448$\pm$0.0425} &0.7414$\pm$0.0425 &0.7148$\pm$0.0787\\
13& spambase & 0.9180$\pm$ 0.0143 & 0.9213$\pm$0.0115 &\textbf{0.9245$\pm$0.0096}\\
14& mammographic & 0.7901$\pm$0.0509 & \textbf{0.7937$\pm$0.0491} & \textbf{0.7913$\pm$0.0502}\\
15& phoneme &0.7541$\pm$0.0186 &0.7648$\pm$0.0174 &\textbf{0.8960$\pm$0.0154}\\
\noalign{\smallskip}\hline
\end{tabular}
\end{table*}
It can be easily seen from Table \ref{Table4} that the RTML algorithm is much effective for most datasets. The RTML algorithm's performance was especially prominent in the fourclass, svmguide1, waveform, glass1, and phoneme data, outperforming SOFTMAX in terms of accuracy by 30\%, 10\%, 10\%, 10\%, and 14\%, respectively, indicating that illusion inertial thinking definitely exists, so that the reverse thinking model can effectively correct these illusions. This can be confirmed from the confusion matrices. For example, \emph{CF(svmguide1)} is the confusion matrix of the \emph{svmguide1} data performed by SOFTMAX, where the significant illusion inertial thinking is established, as it often classifies the samples with class 1 as belonging to class 2, but not\textit{vice versa}:
$CF(svmguide1)=\left(
\begin{array}{cc}
0.6513 & 0.3487 \\
0.0517 & 0.9483 \\
\end{array}
\right)
$,
$CF(fourclass)=\left(
\begin{array}{cc}
0.7951 & 0.2049 \\
0.3773 & 0.6227 \\
\end{array}
\right)
$.
However, the RTML algorithm fails in some data, such as \emph{madelon} and \emph{splice}, performing poorly on these two data. The reason is that there the illusion inertial thinking is not obvious. It can be seen from the confusion matrix, such as \emph{CF(madelon)}, that the illusion inertial thinking schemes between the two classes are very similar. The thinking falls into chaos and cannot form stable illusion inertial thinking in one direction, leading to the failure of the reverse thinking model. In this case, good measures should be applied to maintain suitable inertial thinking and enhance illusion inertial thinking, so as to improve the overall performance. This is because strengthening the inertial thinking may also significantly strengthen the illusion inertial thinking. Both are consistent and not in conflict with each other:
$CF(splice)=\left(
\begin{array}{cc}
0.8354 & 0.1646\\
0.1481 & 0.8519\\
\end{array}
\right)
$,
$CF(madelon)=\left(
\begin{array}{cc}
0.7546 & 0.2454\\
0.2516 & 0.7484\\
\end{array}
\right)
$.
Additionally, on some datasets, such as \emph{madelon} and \emph{mammographic}, SOFTMAX performs better by taking easy samples as the training database rather than by taking all the samples as the training database. This indicates that it is reasonable to rank samples in training database by their simplicity.
\section{Conclusions}
Similar to human learning, machine learning can easily form illusion inertial thinking, but all machine learning methods do not consider it. In this paper, we use reverse thinking to overcome illusion inertial thinking, so as to improve the generalization ability of machine learning methods. The experimental results indicate that our method is very effective. The proposed method is universal, applicable to any machine learning methods, especially to those performing badly on some data, such as unbalanced data, for which machine learning methods can easily form the illusion inertial thinking. In planned future work, we will select some machine learning methods to combine with the RTML algorithm to solve concrete tasks like emotion recognition, because the training data for emotion recognition are generally unbalanced, easily inducing machine learning methods to form illusion inertial thinking. Second, the proposed method uses the Bayesian theorem, but not the Bayesian network. As a matter of fact, reverse and inertial thinking between categories are linked, and the dialectical unity between them will be investigated under the framework of the Bayesian network in the future \cite{DeMotta2016}.
\section*{Funding}
This study was supported by the China National Science Foundation (60973083/61273363), Science and Technology Planning Project of Guangdong Province (2014A010103009/2015A020217002), and Guangzhou Science and Technology Planning Project(201504291154480).
\section*{Conflicts of interest}
The authors declare that they have no conflicts of interest.
\section*{Ethical approval}
This paper does not contain any studies with human or animals participants.
| {'timestamp': '2018-03-02T02:05:24', 'yymm': '1803', 'arxiv_id': '1803.00158', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00158'} | arxiv |
\subsubsection{\hskip -1em.~#1}}
\newcommand{\\[-0.6cm]}{\\[-0.6cm]}
\newcommand{\\[-0.9cm]}{\\[-0.9cm]}
\newcommand{\mygraphic}[4]
{
\begin{figure}
\includegraphics[width=#4cm]{figures/#1}%
~\\[-0.45cm]
\caption{\label{#3} #2}%
~\\[-1.3cm]
\end{figure}
}
\setcounter{page}{48}
\pagestyle{plain}
\begin{document}
\title{~\\[-1.5cm] Autonomous Reconfiguration Procedures for EJB-based Enterprise Applications\\[-0.5cm]}
\author{Thomas Vogel, Jens Bruhn, and Guido Wirtz\\
Distributed and Mobile Systems Group, University of Bamberg\\
Feldkirchenstra\ss e 21, 96052 Bamberg, Germany\\
[email protected],
$\{$jens.bruhn$|$guido.wirtz$\}[email protected]\\[-0.5cm]
}
\maketitle
\begin{abstract}
\noindent
Enterprise Applications (EA) are complex software systems for supporting the business of companies. Evolution of an EA should not affect its availability, e.g., because of a temporal shutdown, business operations may be affected. One possibility to address this problem is the seamless reconfiguration of the affected EA, i.e., applying the relevant changes while the system is running. Our approach to seamless reconfiguration focuses on component-oriented EAs. It is based on the Autonomic Computing infrastructure \emph{mKernel} that enables the management of EAs that are realized using Enterprise Java Beans (EJB) 3.0 technology. In contrast to other approaches that provide no or only limited reconfiguration facilities, our approach consists of a comprehensive set of steps, that perform fine-grained reconfiguration tasks. These steps can be combined into generic and autonomous reconfiguration procedures for EJB-based EAs. The procedures are not limited to a certain reconfiguration strategy. Instead, our approach provides several reusable strategies and is extensible w.r.t. the opportunity to integrate new ones.
\\[4pt]
\end{abstract}
{\bf Keywords}: maintenance, seamless reconfiguration, EJB \\[-0.9cm]
\begin{Section}{Introduction}
\label{sec:intro}
\noindent
\emph{Enterprise Applications} (EA) are complex software systems for supporting the business of a company. According to Lehman's laws \cite{637156} software implementing real world applications like EAs must continually evolve, else their use and value would decline. The need for system evolution originates, e.g., from failures, inefficiencies or changes of the business or of the system environment that lead to new or changing requirements for EAs. Thus, system evolution can be categorized as \emph{corrective} (removing software faults), \emph{adaptive} (adjusting the system to the changing environment), or \emph{perfective} (enhancing or improving the functional and non-functional system characteristics) (cf. \cite{302181,807723}). Due to the critical role of an EA within a company this evolution should not affect the availability of an EA and therefore the business operations. Otherwise, the company might miss business opportunities and loose reputation and trust. One approach to address this problem is the \emph{seamless} reconfiguration, i.e., applying the relevant changes to the system while it is running. Except of delays in the response time reconfiguration should be transparent to the clients of the EA. This \emph{post-deployment runtime evolution} can be seen as one critical challenge in software evolution \cite{1572302}.
To cope with this issue, the modularity of software systems, as proposed by the concept of \emph{Component Orientation} (CO) \cite{515228}, and the automation of system maintenance tasks, as described by the vision of \emph{Autonomic Computing} (AC) \cite{1014770, 642200}, can help. With the \emph{mKernel} system \cite{aiccsa, mkernel} a generic AC infrastructure is available that enables comprehensive management of component-oriented EAs that are realized with the \emph{Enterprise Java Beans (EJB) 3.0} technology \cite{jsr220}. Based on \emph{mKernel}, we provide a comprehensive set of steps, that are customizable and perform fine-grained reconfiguration tasks. These steps can be combined flexibly to generic and autonomous reconfiguration procedures for EJB-based EAs. Each of these procedures realizes a certain \emph{reconfiguration strategy}, i.e., a certain way to perform a reconfiguration. Currently, our approach provides four reusable strategies that serve as templates for easing the planning and execution of a concrete reconfiguration.
The rest of the paper is structured as follows: Section \ref{sec:background} provides an overview to the background, namely system reconfiguration, CO and the AC infrastructure \emph{mKernel}. Section \ref{sec:relatedwork} discusses related work, while section \ref{sec:reconf} presents our approach of reconfiguration procedures. Finally, the last section gives a conclusion and an outlook on future work.
\end{Section}
\begin{Section}{Background}
\label{sec:background}
\noindent
After introducing the basics of system reconfiguration, the concept of CO and relevant aspects of the EJB standard are presented. Finally, we describe how \emph{mKernel} combines EJB with the vision of AC.
\begin{SubSection}{System Reconfiguration}
\label{subsec:reconf}
\noindent
The architecture of a software system is the \emph{high-level organization of [its constituent] computational elements and the interactions between those elements} (\cite{10.1109/TSE.1995.10003}, p.269). In this context, according to \cite{10.1109/MC.2004.48}, there are two general approaches for software reconfiguration: \emph{parameter adaptation} and \emph{compositional adaptation}. The first one modifies variables of one or more elements that determine their behavior. The second one addresses structural reconfiguration through addition and removal of elements, including the manipulation of connections among them (cf. e.g. \cite{60317, 302181, 760388}). The weakness of parameter adaptation is that it allows only changes that were anticipated during development, because the elements have to provide the variables and react appropriately to their modifications. In contrast, compositional adaptation is intended for the dynamic and unanticipated reconfiguration of a system.
For carrying out a reconfiguration, two objectives are to be considered and desirable \cite{60317}. First, the reconfiguration should minimize the disruption to the system, i.e., the affected part of the system may notice delays but no failures, while the rest of the system should be able to continue its execution normally. Thus, reconfiguration should be carried out \emph{seamlessly}. Second, a consistent state of the system must be preserved during and after reconfiguration. Consequently, a reconfiguration, like, e.g., the replacement of an element, may require to place the affected part of the system in a consistent state before structural changes are performed. A state is consistent if the affected elements are \emph{quiescent} \cite{60317}, i.e., none of them is currently engaged in servicing a request and none of them will initiate a request. Furthermore, no requests initiated by non-affected elements are forwarded to affected ones.
To reach a quiescent state, requests that are currently serviced must be finished. New requests must be blocked except those which are needed to finish servicing ones. Otherwise, some elements are not able to reach a quiescent state and end up in a deadlock. Quiescence of the affected part of the system gives new elements the opportunity to be initialized in a state which is consistent with the rest of the system, and elements to be removed the opportunity to leave the system in a consistent state \cite{60317}. In case of an element replacement, this may include the need for transferring the internal state of a replaced element to a replacing one \cite{302181, rosaAuto}.
How to apply changes are questions of reconfiguration strategies. In \cite{rosaAuto} the three strategies \emph{Flash}, \emph{Non-Interrupt} and \emph{Interrupt} are presented. The \emph{Flash} strategy reconfigures one element without concerning about other elements. Reconfiguration takes place immediately without handling existing interactions and the states of the affected elements. No state transfer is performed and existing connections to old elements are not updated. Therefore, these connections become invalid and are likely to cause errors. Finally, the system may become inconsistent.
Consequently, \emph{Flash} does not always perform a seamless and consistent reconfiguration. Nevertheless, it can be used, amongst others, for parameter adaptation or for reconfiguring elements not being critical for the consistency of the application. In contrast, the other strategies preserve consistency of the system and perform a seamless reconfiguration.
The \emph{Non-Interrupt} strategy supports the exchange of elements without the need for quiescence, hence reducing system disruption significantly. Both elements, the old one that is going to be replaced and the replacing one, are active. An intercepting facility forwards requests of already existing sessions to the old one and requests of new sessions to the replacing one. After all sessions on the old element have finished, it can be removed and only the new element is used. This strategy does not require a state transfer. It requires that the two elements can be used concurrently.
The \emph{Interrupt} strategy transfers the affected part of the system into a quiescent state before reconfiguration takes place. The states of the affected elements and existing connections between elements are handled, such that, e.g., an element replacement can be performed without causing any failures. After reconfiguration, the affected part of the system is released at once from the quiescent state, such that it can be assured that all elements and connections are reconfigured appropriately, before resuming their execution. Comparably with the other strategies, an advantage of requiring quiescence is that, e.g., an underlying database is not used during quiescence, which enables its consistent modification or transfer.
Consideration of strategies is important to find the best way to reconfigure a system.
\end{SubSection}
\begin{SubSection}{Component Orientation}
\label{subsec:co}
\noindent
The concept of \emph{Component Orientation} (CO) \cite{515228} is a paradigm for the development of software systems in a modular way through functional decomposition. Such systems are composed of modules, called \emph{Components}. A component encapsulates a certain functionality and provides it through contractually specified \emph{Interfaces}. A component may use services from other components through their provided interfaces. An interface required by a component is called \emph{Receptacle}. Consequently, a component-based system can be seen as a collection of loosely-coupled modules which collaborate among each other through their interfaces. Furthermore, a component can be deployed independently and is subject to composition by third parties \cite{515228}. Thus, CO addresses the complexity during development and deployment by modularity of requirements, architectures, designs, implementations and deployments. This modularity supports the partial reconfiguration of component oriented systems.
The \emph{Enterprise Java Beans} standard (EJB), version 3.0, \cite{jsr220} is a component standard for the realization of component-oriented EAs on top of the \emph{Java} programming language. It defines a sound component model that is based on so called \emph{Enterprise Beans}, or \emph{Beans} for short. There are two types of beans considered in the standard, namely \emph{Message Driven Bean} and \emph{Session Bean}. The former one is intended to be accessed through asynchronous message passing, and the latter one provides interfaces to access its encapsulated functionality. Session beans can be either \emph{stateless} or \emph{stateful}. An instance of a stateful session bean is exclusively used by a single client and retains its client-specific \emph{Conversational State} across multiple invocations. In contrast, an instance of a stateless session bean is not exclusively used by a client. Moreover, each invocation from a client on the same reference may be executed on different instances. Thus, all instances of one stateless session bean are equivalent, and their states are client independent.
Receptacles can be declared for session and message driven beans through \emph{EJB References}. These can be connected to interfaces provided by session beans. Beans may be customized through \emph{Simple Environment Entries} which can be interpreted as a kind of property. Before deploying beans, they must be configured, i.e., their properties must be set and their corresponding receptacles and interfaces must be connected. As unit of deployment the EJB standard defines the \emph{EJB module} that must contain at least one bean. In the EJB context, parameter adaptation is performed through setting bean properties, and compositional adaptation through (un)deploying modules and manipulating connections between beans. However, after the deployment of a module into an \emph{EJB Container}, the runtime environment for components, the configurations of beans can not be changed.
\end{SubSection}
\begin{SubSection}{Autonomic Computing and mKernel}
\label{subsec:ac}
\noindent
The vision of \emph{Autonomic Computing} (AC) \cite{1014770, 642200} addresses the management of systems at runtime. Its basic idea is to assign low level, administrative tasks to the managed system itself to disburden human administrators. The system manages itself according to the goals specified by the administrator. Autonomous management covers the four aspects \emph{self-healing}, \emph{self-protection}, \emph{self-optimization}, and \emph{self-configuration}. The last aspect addresses reconfiguration explicitly. Furthermore, each aspect can be mapped to at least one of the different kinds of system evolution discussed in section \ref{sec:intro}, namely corrective, adaptive, and perfective.
The \emph{mKernel} system \cite{aiccsa, mkernel} provides a generic AC infrastructure for EJB-based autonomous applications. It includes a comprehensive \emph{Application Programming Interface} (API) of \emph{sensors} and \emph{effectors} through which the managed application can be inspected and manipulated by a higher level facility. Through this API, \emph{mKernel} provides a reflective view, the \emph{meta level}, of the managed application, the \emph{base level}. Both levels are causally connected \cite{38821}. This reflective view enables the management of the application at three different levels of abstraction.
The \emph{Type Level} addresses information regarding types of the constituting elements of the managed application, i.e., artifacts being the result of development.
The \emph{Deployment Level} concentrates on a concrete configuration of the managed application that is deployed into a container.
Finally, the \emph{Instance Level} addresses the bean instances and interactions among them. With this multi-level view, subtle management operations are possible.
As discussed in section \ref{subsec:co}, the EJB standard limits the configuration of bean properties and connections among beans to the deployment time, but \emph{mKernel} enables the modifications of them at runtime. Together with supporting the lifecycle of EJB modules, \emph{mKernel} provides runtime support for parameter and compositional adaptation. Nevertheless, the EJB specification is not violated or restricted by \emph{mKernel}. Developers of EJB modules do not have to follow special guidelines beyond those of the EJB standard during development to enable the manageability of modules through \emph{mKernel}. Thus, the developer can solely focus on the application logic while a preprocessing tool weaves the sensors and effectors into the EJB module. This approach maintains the idea of \emph{Separation of Concerns}.
Furthermore, \emph{mKernel} is realized as a plugin for an existing EJB container and does not require any adjustments of the container implementation.
\end{SubSection}
\end{Section}
\begin{Section}{Related Work}
\label{sec:relatedwork}
\noindent
Our approach to seamless reconfiguration is inspired by the work of Rosa, Rodrigues and Lopes \cite{rosaAuto} who present a framework for message-oriented systems that supports a fixed set of reconfiguration strategies. In contrast to their work, our approach is extensible w.r.t. the integration of new strategies. Moreover, the replacement of strategy elements is supported which provides additional flexibility. We support separation of concerns, because developers of EAs do not have to consider reconfigurations during development.
Finally, the deployment and instance level are explicitly addressed, especially the transfer of conversational states of stateful session bean instances is supported. Our work addresses a different application area, namely EJB-based EAs.
G\"obel and Nestler \cite{984812} extend the EJB specification by adding one more bean type, namely a composite bean. This composite encapsulates runtime adaptation by selecting different sub-components of the composite. Thus, the developer must consider this extension to the standard and only anticipated reconfiguration is possible that depends on the internals of the composite.
Jarir, David, and Ledoux \cite{obasco:jarir-david-ledoux.wcop-ecoop2002} enhance the EJB container to provide limited reconfiguration by intercepting calls to impose user-defined functionality. More possibilities are provided by Rutherford et al. \cite{760388}, though their work is restricted to reconfiguration at the deployment level. They consider the management of the deployment lifecycle of modules and the modification of properties and of connections of beans. Nothing is said about the handling of bean instances, i.e., replacing bean instances together with their possible conversational states is not considered.
In contrast, Matevska-Meyer, Olliges, and Hasselbring \cite{matevskameyer-2004-DECOR04}, who confine reconfiguration to redeploying modules, recognize the problem of the state transfer. They conclude that stateful beans are not safe to structural changes and provide no solution.
Finally, the research group of the \emph{Peking University Application Server} (PKUAS) \cite{1167760} has implemented an own EJB container that incorporates the necessary technological facilities for updating modules including bean instances and state transfer. Thus, they consider the deployment and instance level. But they do not support higher-level facilities, like reconfiguration strategies that may simplify the role of administrators.
\end{Section}
\begin{Section}{Autonomous Reconfiguration Procedures}
\label{sec:reconf}
\noindent
Our approach to seamless reconfiguration of EJB-based EAs covers parameter and compositional adaptation. To meet various reconfiguration needs we identified and provide a comprehensive and complete set of customizable and reusable \emph{steps}, that are described in table \ref{tab:table}. The first column contains identifiers for the steps. The second column covers a short description of the particular step. Each step performs a special reconfiguration task, like, e.g., the deployment of a module (step $a$) or the establishment of connections between beans (step $l$). Steps are realized by so called \emph{executors} that are based on the \emph{mKernel} API. This is depicted on the left hand side in the reconfiguration model in figure \ref{fig:reconf-model}.
\begin{table*}[t]
\normalsize
\begin{tabular}[c]{|m{0.2cm}|m{12.3cm}|m{0.8cm}|m{0.3cm}|m{0.4cm}|m{0.3cm}|m{0.6cm}|}
\hline
\textbf{ID} & \textbf{Step} & \textbf{dep.} & \textbf{$F$} & \textbf{$NI$} & \textbf{$I$} & \textbf{$I/NI$} \\ \hline \hline
$a$ & Deployment of the new EJB module. Setting the \emph{Simple Environment Entries} and connecting the \emph{EJB Reference} of its beans. & / & 1 & 1 & 1 & 1 \\ \hline
$b$ & Declaration of the quiescence region which comprises those beans or whole modules that must be quiescent at a later point in time. For module replacement, this region is the module which is going to be replaced. & / & - & - & 2 & 2 \\ \hline
$c$ & Start tracking and collecting session bean instances of beans of the quiescence region to get to know the instances that are handled with step $f$. & $b$ & - & - & 3 & 3 \\ \hline
$d$ & Initializing the quiescence, i.e., initializing the blocking of calls on the instances of beans of the quiescence region. The region becomes quiescent after finishing current calls. & $b$ & - & - & 4 & 6 \\ \hline
$e$ & Waiting until the quiescence region becomes quiescent. & $d$ & - & - & 5 & 7 \\ \hline
$f$ & Extracting the state of stateful session bean instances being collected because of step $c$. & $c$, $e$ & - & - & 6 & 8 \\ \hline
$g$ & Extracting the database that underlies the quiescence region. & $e$, $f$ & - & - & 7 & - \\ \hline
$h$ & Transfer or modify the database. & $g$ & - & - & 8 & - \\ \hline
$i$ & Starting of the new EJB module. & $a$ & 2 & 2 & 9 & 4 \\ \hline
$j$ & Modifying (optional) and injecting the states, being extracted at step $f$, to newly created instances of the corresponding stateful session beans of the new EJB module. & $f$, $h$, $i$ & - & - & 10 & 9 \\ \hline
$k$ & Publishing the references of the new bean instances that have been the target of the transfer of step $j$. Client components holding references to replaced stateful session bean instances are provided with the corresponding new reference to the replacing instance. & $j$ & - & - & 11 & 10 \\ \hline
$l$ & Re-route connections that are newly established. The source of the these connections are client components of the new/old EJB module and the target of these connections shifts from the beans of the old EJB module to the beans of the new EJB module. & $h$, $i$ & 3 & 3 & 12 & 5 \\ \hline
$m$ & Re-route already existing connections, i.e., clients of the old module holding references to bean instances of the old module are provided with new references to bean instances of the new module. In case of an $I$ or $I/NI$ this step only considers connections whose targets are bean instances which have not been transferred. Connections to transferred bean instances are already covered by step $k$. In case of $NI$ this step is optional and only consistently applicable if the target of the connection is a stateless session bean instance. & $h$, $i$ & - & 4 & 13 & 11 \\ \hline
$n$ & Release the quiescence region, i.e., blocked calls and eventually blocked bean instance lookup requests are released and continue executing through using the reference already held before quiescence or the reference provided in steps $k$, $l$ or $m$. & $d$, $h$, $k$, $l$, $m$ & - & - & 14 & 12 \\ \hline
$o$ & Stop and optionally undeploy the old EJB module if the old module is not used any more, or in case of the $F$ strategy, should not be used any more through existing connections. & $g$, $k$, $l$, $m$ & 4 & 5 & 15 & 13 \\ \hline
\end{tabular}
\caption{Reconfiguration procedures and their steps}
\label{tab:table}
\end{table*}
Our implementation provides default executors for all steps, except the step that is intended for reconfiguration of databases. Nevertheless, administrators have the freedom to provide \emph{custom executors} for arbitrary steps replacing the default ones. In this way, special requirements for reconfiguring concrete applications can be fulfilled.
\begin{figure}[htb]
\vspace{-0.2cm}
\centering
\includegraphics[width=7cm]{img/reconfiguration-model6.jpg}
\caption{Reconfiguration Model}
\label{fig:reconf-model}
\vspace{-0.5cm}
\end{figure}
The provided steps are the basis for the \emph{strategies} (see figure \ref{fig:reconf-model}). Therefore, steps can be combined into generic and autonomous reconfiguration procedures. A procedure must fulfill the dependencies between its constituting steps. The third column of table \ref{tab:table} contains the steps each step depends on transitively. A '/' depicts that the particular step does not depend on any other step. Starting a new EJB module, e.g., requires that the module has been deployed before, therefore step $i$ depends on $a$. Nevertheless, as some steps may be optional, corresponding dependencies need not to be met. For the case, that no state transfer is necessary, steps $c$, $f$, $j$ and $k$ can be omitted, and the step of stopping the old EJB module ($o$) does not depend on step $k$, but only on $g$, $l$ and $m$. Consequently, these dependencies are influenced by a concrete arrangement of steps that may skip optional steps and by the concrete modules and beans each step is addressing. However, dependencies can be used to find basic restrictions in ordering the steps or potentials for parallel execution of steps. There exists, e.g., no dependency between the steps $a$ and $b$, such that they can be executed in arbitrary order or even in parallel. The reusability of each step, the flexibility in ordering the steps and the possibility to omit optional steps enable various combinations of steps into generic reconfiguration procedures. Each procedure realizes a certain reusable reconfiguration strategy. Therefore, administrators can develop \emph{custom} strategies, that may be derived from others or that may be completely new ones. Even, a dynamic arrangement of steps during runtime is possible, resulting in \emph{ad-hoc} strategies (see figure \ref{fig:reconf-model}).
Our approach provides the four strategies \emph{Flash} ($F$), \emph{Non-Interrupt} ($NI$), \emph{Interrupt} ($I$), and \emph{Interrupt/Non-Interrupt} ($I/NI$). Besides the first three ones, already presented in section \ref{subsec:reconf}, we identified $I/NI$ as an additional new strategy for replacing modules. It is a mixture of the strategies $I$ and $NI$. Its idea is that the new and old module are running concurrently, but newly created sessions are forwarded to the new module and start processing immediately. Already running sessions on the old module will not run until they finish, like it is done with the $NI$ strategy. In contrast, they are driven into a quiescent state and their instances of the stateful session beans are transferred to the new module, where finally the sessions continue their processing. The advantage of $I/NI$ is that system disruption is minimized because newly created sessions are not blocked from servicing requests. Therefore, the underlying database must be usable by both modules concurrently. Furthermore, the old module is removed from the system consistently.
In the following, we discuss in detail how the four strategies $F$, $NI$, $I$ and $I/NI$ can be applied for the case of replacing an EJB module with an alternative implementation.
Therefore, each of the last four columns of table \ref{tab:table} describes a realizing procedure for the corresponding strategy. The entries of these columns are to be read as follows. A step that is not applicable or available within a strategy is denoted with a '-'. Otherwise, the number indicates the position of this step within the procedure.
For the $F$ strategy only the deployment level is relevant since existing bean instances and connections among them are not handled. The other strategies distinguish between already existing connections and newly established connections of bean instances, hence considering the instance level of the application. Re-routing a connection before it is created is always possible. Re-routing existing connections is feasible if the target of the connection is a stateless session bean, because the states of stateless session bean instances are client independent (see section \ref{subsec:co}) and both beans, replaced and replacing one, provide the same functionality. However, if the target is a stateful session bean, an existing connection can only be modified consistently if the conversational state is transferred to the corresponding target instance, otherwise the client-specific state would get lost. As described in section \ref{subsec:reconf} a state transfer requires quiescence of the affected beans, i.e., \emph{all} instances of the affected beans must be quiescent. Reaching quiescence is simplified by the EJB standard because bean instances are per definition non-reentrant and are not allowed to perform any kind of thread handling. Quiescence is performed by the steps $b$, $d$, $e$ and $n$. Another motivation for quiescence is the need to transfer or modify the database (steps $g$ and $h$) that underlies the modules, i.e., the old and the new module must be either quiescent or in a stopped state. This is addressed by the $I$ strategy. In summary, a state transfer (steps $c$, $f$, $j$ and $k$) is only required if stateful session beans are involved and an $I$ or $I/NI$ strategy should be used. Without state transfer and database reconfiguration there is no need for quiescence, hence $F$ or $NI$ are the preferable strategies.
For each step being part of a concrete strategy an executor must be assigned. A step executor may define input and output parameters. Inputs represent information required for an appropriate execution and information about execution results are provided through outputs. Outputs can be mapped to inputs of subsequent executors. E.g., our executor implementation for step $f$ outputs the extracted conversational states which are used as inputs for the executor of step $j$. At strategy level, inputs can also be specified. These can be connected to those executors inputs for which no matching outputs are given. Likewise, outputs can be defined for a strategy that provide information about execution results of an instantiated strategy to an administrator. Therefore, executor outputs can be connected to strategy outputs. To sum up, a concrete strategy consists of a set of steps together with their executors, specifications of inputs and outputs at the strategy level, and mapping specifications between parameters. In addition to the dependencies described in the third column of table \ref{tab:table}, these mappings may introduce additional dependencies. A strategy is \emph{valid} if there are no circular dependencies and if all executor inputs are connected either to strategy inputs or outputs of preceding executors. As long as the dependencies are fulfilled, the order of steps may change within a procedure. Thus, it is conceivable that a strategy is realized by several procedures, i.e., different orders of steps. The procedures described in the last four columns of table \ref{tab:table} reflect the provided implementations. For a concrete reconfiguration need, an administrator must provide a reconfiguration plan, i.e., a strategy must be chosen, instantiated and configured. Consequently, the plan consists only of the selected strategy and of values for strategy inputs (see right hand side of the figure \ref{fig:reconf-model}). During execution, parameter values are injected to the relevant step executors.
Therefore, the reconfiguration can be executed without further interaction need. Thus, an administrator only needs to know \emph{what} a strategy is doing, but not \emph{how} it is realized.
Our current implementation supports all four aforementioned strategies to replace one EJB module with an alternative implementation of this module. The reconfiguration plan for each strategy requires only the identifiers of the replaced module and of the replacing module type as input values to perform the reconfiguration autonomically.
Nevertheless, the following restrictions must be fulfilled.
\begin{enumerate}\addtolength{\itemsep}{-0.5\baselineskip}
\item The replacing module must provide implementations for at least those interfaces that are provided by the replaced module and referenced by clients. This implies that the replacing module must fulfill the same contracts specified by these interfaces as the replaced module.
\item Each interface identified through restriction 1 must be implemented by exactly one session bean inside both, replaced and replacing modules.
\item For all required \emph{EJB References} of each of the session beans providing at least one of the interfaces identified through restriction 1, there must exist appropriate providers. An appropriate provider is a session bean which is not part of the replaced module. If the provider is part of the replacing module, this restriction must hold recursively. All \emph{EJB References} of providers not being part of the replacing module must be connected to interfaces, recursively.
\item For each bean of the replaced module, there exists one bean in the replacing module that provides at least the same interfaces w.r.t. restriction 1.
\item For stateful session beans, the state transfer at instance level is only performed for those fields of the replaced bean - regardless of their access modifiers - for which there exists a matching counterpart in the replacing bean. In this context, two fields are matching if they have the same name and type in both, the replacing and the replaced beans.
\end{enumerate}
Though these restrictions are imposed on modules, the alternative implementation of the replacing module may eliminate failures in the behavior of the replaced one or it may be a more efficient implementation. Additionally, the integration of new functionality through adopting new or enhanced interfaces by the replacing module is possible.
\end{Section}
\begin{Section}{Conclusion and Future Work}
\label{sec:conlusion}
\noindent
With this paper we presented a flexible approach to seamless reconfiguration of EJB-based EA that need not to be anticipated during EA development, hence it maintains the idea of separation of concerns. By providing generic and reusable procedures an administrator is freed from handling fine-grained reconfiguration tasks for each reconfiguration need. Instead of prescribing how a reconfiguration should be applied, the administrator can choose between several strategies. Thus, the role of the administrator is reduced to selecting an appropriate strategy and creating a reconfiguration plan that configures a generic procedure for a concrete reconfiguration need. The reconfiguration is performed autonomically.
As future work, it would be desirable if a mixture of the presented strategies could be applied for the replacement of a module, i.e., a strategy is applied only to a subset of beans of the module instead to all of its beans. Thus, disjoint subsets of beans can be reconfigured individually. Perhaps, this can be even broken down to the instance level. Finally, first considerations are made to weaken the restrictions of our current executors, e.g., to enable the replacement of $n$ modules with $m$ modules. Additionally, we investigate $x$-to-$y$ relations for the bean replacement instead of only $x$-to-$1$ relations.
\end{Section}
\bibliographystyle{latex8}
| {'timestamp': '2018-03-02T02:01:04', 'yymm': '1803', 'arxiv_id': '1803.00049', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00049'} | arxiv |
\section{Introduction}
This paper investigates the problem of estimating the relative motion of two \textit{non-calibrated cameras} from rotational invariant features. In particular, we are interested in the minimal case, i.e.\ to estimate fundamental matrix $\matr{F} \in \mathbb{R}^{3 \times 3}$ exploiting \textit{five} point correspondences together with rotational components obtained by, e.g.\ SIFT detector~\cite{lowe1999object}. The method requires three points to be co-planar and two additional ones in arbitrary position (see Fig.~\ref{fig:setup}).
The classical way of estimating $\matr{F}$ for non-calibrated cameras is to apply the eight- or seven-point algorithms~\cite{hartley2003multiple}. They are both widely-used in the literature and fundamental tools of computer vision applications. The eight-point algorithm estimates the direct linear transformation induced by the epipolar constraint. The seven-point algorithm enforces the rank-two constraint by solving the cubic polynomial equation which it implies.
\begin{figure}[htbp]
\centering
\includegraphics[width = 0.95\columnwidth]{assets/synthetic_environment.pdf}
\caption{ The proposed minimal solver estimates a fundamental matrix between views $C_1$ and $C_2$. It first estimates a homography from three correspondences of co-planar points ($\textbf{P}_1$, $\textbf{P}_2$ and $\textbf{P}_3$) lying on plane $\pi$. The fundamental matrix is then obtained from the homography and two additional points ($\textbf{P}_4$ and $\textbf{P}_5$) in general position.}
\label{fig:setup}
\end{figure}
From theoretical point of view, getting \textit{more information exclusively from point correspondences is not possible}. However, of course, there are approaches to reduce the number of unknowns. For example, knowing the intrinsic parameters of the cameras (i.e.\ the principal point, focal length, pixel ratios) enables to enforce the trace constraint. The problem becomes solvable using six point pairs~\cite{li2006simple,Kukelova2008BMVC,Stewenius2008IVC,torii2010six} if all intrinsics parameters but a common focal length are known, or five correspondences~\cite{nister2004efficient,li2006five,batra2007alternative,Kukelova2008BMVC,hartley2012efficient} are enough for fully calibrated cameras. One can also restrict the camera movement, e.g.\ the one point method proposed by Davide Scaramuzza~\cite{scaramuzza20111} assumes the cameras to move on a plane and the so-called non-holonomic constraint to hold.
By looking the other way, it is very rare nowadays to get solely the point coordinates from the applied feature detector. As an example, the widely-used SIFT detector provides a rotation and scale besides the coordinates. This additional information is rarely exploited in state-of-the-art geometric model estimators and just thrown away at the very beginning. \textit{This information is available} in most of the cases. In this paper, we aim at involving these additional \textit{affine parameters}, e.g.\ rotation of the feature, into the process to reduce the size of the minimal sample required for fundamental matrix estimation.
Exploiting full affine correspondences (point correspondence, rotation, scales along both image axes and shear) for fundamental or essential matrix estimation, of course, is not a new idea. Perdoch et al.~\cite{PerdochMC06} proposed techniques for approximating the relative camera motion using two and three correspondences. Bentolila and Francos~\cite{Bentolila2014} proposed a method to estimate the exact, i.e.\ with no approximation, $\matr{F}$ from three correspondences. Raposo et al.~\cite{Raposo2016} proposed a solution for direct essential matrix estimation using two correspondences.
Exploiting only a part of an affine correspondence, e.g.\ exclusively the rotation component, is a well-known technique for example in wide-baseline feature matching~\cite{matas2004robust}. However, to the best of our knowledge, the only work involving them into geometric model estimation is that of Barath et al.~\cite{barath2017phaf}. In \cite{barath2017phaf}, $\matr{F}$ is assumed to be known a priori and a technique is proposed for estimating a homography using two SIFT correspondences exploiting their scale and rotation components. Even so, an assumption is made, considering that the scales along axes $u$ and $v$ equal to that of the SIFT features -- which is generally not true in practice. Thus, the method yields only an approximation.
The contributions of the paper are: (i) we propose a technique for estimating homography $\matr{H}$ using three rotation invariant feature correspondences. To recover $\matr{H}$, in addition to the point coordinates, the rotations of the features are exploited. (ii) The recovered homography is then used to calculate fundamental matrix $\matr{F}$ using two additional correspondences. (iii) It is reported on both synthesized and real worlds tests, that combining the proposed method with a robust estimator, e.g.\ LO-RANSAC~\cite{chum2003locally}, leads to results superior to the state-of-the-art in term of accuracy and the number of iterations required. Moreover, we demonstrate that using the proposed method in two-view multi-motion fitting is beneficial and leads to more accurate clusterings.
\section{Theoretical Background}
\paragraph{Affine Correspondences.}
In this paper, we consider an affine correspondence (AC) as a triplet: $(\matr{p}_1, \matr{p}_2, \matr{A})$, where $\matr{p}_1 = [u_1 \quad v_1 \quad 1]^\text{T}$ and $\matr{p}_2 = [u_2 \quad v_2 \quad 1]^\text{T}$ are a corresponding homogeneous point pair in the two images (the projections of the 3D points in Fig.~\ref{fig:setup}), and
\begin{equation*}
\matr{A} = \begin{bmatrix}
a_{1} & a_{2} \\
a_{3} & a_{4}
\end{bmatrix}
\end{equation*}
is a $2 \times 2$ linear transformation which we call \textit{local affine transformation}. To define $\matr{A}$, we use the definition provided in~\cite{Molnar2014} as it is given as the first-order Taylor-approximation of the $\text{3D} \to \text{2D}$ projection functions. Note that, for perspective cameras, $\matr{A}$ is the first-order approximation of the related \textit{homography} matrix
\begin{equation*}
\matr{H} = \begin{bmatrix}
h_1 & h_2 & h_3 \\
h_4 & h_5 & h_6 \\
h_7 & h_8 & h_9
\end{bmatrix}
\end{equation*}
as follows:
\begin{eqnarray}
\begin{array}{llllll}
a_{1} & = & \frac{\partial u_2}{\partial u_1} = \frac{h_{1} - h_{7} u_2}{s}, &
a_{2} & = & \frac{\partial u_2}{\partial v_1} = \frac{h_{2} - h_{8} u_2}{s}, \\
a_{3} & = & \frac{\partial v_2}{\partial u_1} = \frac{h_{4} - h_{7} v_2}{s}, &
a_{4} & = & \frac{\partial v_2}{\partial v_1} = \frac{h_{5} - h_{8} v_2}{s},
\end{array}
\label{eq:taylor_approximation}
\end{eqnarray}
where $u_i$ and $v_i$ are the directions in the $i$th image ($i \in \{1,2\}$) and $s = u_1 h_7 + v_1 h_8 + h_9$ is the projective depth.
\paragraph{Fundamental matrix}
\begin{equation*}
\matr{F} = \begin{bmatrix}
f_1 & f_2 & f_3 \\
f_4 & f_5 & f_6 \\
f_7 & f_8 & f_9
\end{bmatrix}
\end{equation*}
is a $3 \times 3$ transformation matrix ensuring the so-called epipolar constraint $\matr{p}_2^\text{T} \matr{F} \matr{p}_1 = 0$ for rigid scenes. Since its scale is arbitrary and $\det(\matr{F}) = 0$, $\matr{F}$ has seven degrees-of-freedom (DoF).
These properties will help us to recover the fundamental matrix from five rotation invariant feature correspondences.
\section{Homography from Three Correspondences}
In this section, it is shown how a homography can be estimated from three rotation invariant feature correspondences. First, we show the relationship of homographies and affine correspondences. Then this is decomposed into affine components establishing the way to exploit them independently. Selecting the appropriate equations from the obtained system, we finally use the given rotations to get the homography parameters.
\subsection{Homographies and Affine Correspondences}
To form a linear equation system using $\matr{A}$, Eqs.~\ref{eq:taylor_approximation} are multiplied by the common denominator ($s$ -- projective depth), then rearranged as follows:
\begin{eqnarray}
\label{eq:orig_hom_aff}
\begin{array}{ccc}
h_1 - (u_2 + a_1 u_1) h_7 - a_1 v_1 h_8 - a_1 & = & 0 \\
h_2 - (u_2 + a_2 v_1) h_8 - a_2 u_1 h_8 - a_2 & = & 0 \\
h_4 - (v_2 + a_3 u_1) h_7 - a_3 v_1 h_8 - a_3 & = & 0 \\
h_5 - (v_2 + a_4 v_1) h_8 - a_4 u_1 h_8 - a_4 & = & 0
\end{array}
\end{eqnarray}
These equations encode the connection of a local affine transformation and a homography.
As it is well-known, the relationship of a homography and a point correspondence $\matr{H} \matr{p}_1 \sim \matr{p}_2$ can be interpreted as an inhomogeneous linear system of equations. Note that operator $\sim$ means ``equality up to an arbitrary scale''. The system is as follows:
\begin{eqnarray}
\label{eq:dlt}
\begin{array}{ccc}
u_1 h_1 + v_1 h_2 + h_3 - u_1 u_2 h_7 - v_1 u_2 h_8 & = & u_2 \\
u_1 h_4 + v_1 h_5 + h_6 - u_1 v_2 h_7 - v_1 v_2 h_8 & = & v_2
\end{array}
\end{eqnarray}
Combining Eqs.~\ref{eq:orig_hom_aff} and \ref{eq:dlt}, an affine correspondence yields six linear equations on total. Thus each of them reduces the DoF of homography estimation by six.
\paragraph{Affine Transformation Model.}
Although the relationship of full affine correspondences and homographies are well-defined, the current problem is the exploitation of features containing only a part of $\matr{A}$ -- the rotation. Therefore, let us define an affine transformation model as a combination of linear transformations as follows:
\begin{eqnarray}
\label{eq:affine_model}
\begin{array}{lcl}
\matr{A} & = & \begin{bmatrix}
a_{1} & a_{2} \\
a_{3} & a_{4}
\end{bmatrix} =
\begin{bmatrix}
\cos(\alpha) & -\sin(\alpha) \\
\sin(\alpha) & \cos(\alpha)
\end{bmatrix}
\begin{bmatrix}
s_{u} & w \\
0 & s_{v}
\end{bmatrix} = \\[5mm]
& & \begin{bmatrix}
s_{u} \cos(\alpha) & w \cos(\alpha) - s_{v} \sin(\alpha) \\
s_{u} \sin(\alpha) & w \sin(\alpha) + s_{v} \cos(\alpha)
\end{bmatrix},
\end{array}
\end{eqnarray}
where $\alpha$, $s_{u}$, $s_{v}$, and $w$ are the rotational angle, scales along axes $u$ and $v$, and shear parameter, respectively.
Substituting the components of the matrix defined in Eqs.~\ref{eq:affine_model} into Eqs.~\ref{eq:orig_hom_aff}, the following system is given:
\begin{eqnarray}
\label{eq:hom_aff_sys}
\begin{array}{lcl}
h_1 - u_2 h_7 - u_1 c_{\alpha} s_{u} h_7 - v_1 c_{\alpha} s_{u} h_8 - c_{\alpha} s_{u} & = & 0, \\
h_2 - u_2 h_8 + v_1 c_{\alpha} w h_8 - v_1 s_{\alpha} s_{v} h_8 - & & \\
u_1 c_{\alpha} w h_8 + u_1 s_{\alpha} s_{v} h_8 - c_{\alpha} w + s_{\alpha} s_{v} & = & 0, \\
h_4 - v_2 h_7 - u_1 s_{\alpha} s_{u} h_7 - v_1 s_{\alpha} s_{u} h_8 - s_{\alpha} s_{u} & = & 0, \\
h_5 - v_2 h_8 - v_1 s_{\alpha} w h_8 - v_1 c_{\alpha} s_{v} h_8 - & & \\
u_1 s_{\alpha} w h_8 - u_1 c_{\alpha} s_{v} h_8 - s_{\alpha} w - c_{\alpha} s_{v} & = & 0,
\end{array}
\end{eqnarray}
where $c_{\alpha} = \cos(\alpha)$ and $s_{\alpha} = \sin(\alpha)$. Note that this system shows the general way of the affine parameters affecting the related homography. Even though we will consider exclusively $\alpha$ to be known in the subsequent sections, one can easily exploit these equations to solve for different features containing e.g.\ scales or shear besides the rotation.
\subsection{Homography Estimation}
Assume three co-planar point correspondences $\matr{p}_{1,i} = [u_{1,i} \quad v_{1,i} \quad 1]^\text{T}$, $\matr{p}_{2,i} = [u_{2,i} \quad v_{2,i} \quad 1]^\text{T}$ ($i \in [1,3]$) and the related rotation components $\alpha_i$, obtained by e.g.\ SIFT, to be known. The objective is to find homography $\matr{H}$ for which $\matr{H} \matr{p}_{1,i} \sim \matr{p}_{2,i}$ and also satisfies Eqs.~\ref{eq:hom_aff_sys}.
In the first part of the algorithm, only the coordinates are used to reduce the number of unknown parameters. We form $\matr{H} \matr{p}_{1,i} \sim \matr{p}_{2,i}$ (Eq.~\ref{eq:dlt}) for all correspondences as a homogeneous linear system $\textbf{B} \textbf{h} = 0$. Since each point pair yields two equations for the nine unknowns, coefficient matrix $\textbf{B}$ is of size $6 \times 9$ and $\textbf{h} = [h_1 \; h_2 \; h_3 \; h_4 \; h_5 \; h_6 \; h_7 \; h_8 \; h_9]^\text{T}$ is the vector of unknown parameters. The null-space of $\textbf{B}$ is three-dimensional, therefore the final solution is calculated as a linear combination of the three null-vectors as follows:
\begin{equation}
\label{eq:null_space}
\textbf{h} = \beta \textbf{b} + \gamma \textbf{c} + \delta \textbf{d},
\end{equation}
where $\textbf{b} = [b_1 \; ... \; b_9]^\text{T}$, $\textbf{c} = [c_1 \; ... \; c_9]^\text{T}$ and $\textbf{d} = [d_1 \; ... \; d_9]^\text{T}$ are the null-vectors, and $\beta$, $\gamma$, $\delta$ are unknown scalars. Due to the scale ambiguity of $\matr{H}$ one of them can be set to an arbitrary value, thus in our algorithm, $\delta = 1$.
Remember, that three rotation components are given, each providing four equations and three unknowns via Eqs.~\ref{eq:hom_aff_sys}. Two rotations yield eight equations and six unknowns, therefore, they are enough for estimating $\beta$ and $\gamma$. To exploit them, Eqs.~\ref{eq:null_space} have to be substituted into Eqs.~\ref{eq:hom_aff_sys} replacing each $h_j$ by $\beta b_j + \gamma c_j + d_j$ ($j \in [1,9]$). Since the scale along axis $v$ and shear $w$ are not known, the 2nd and 4th equations of Eqs.~\ref{eq:hom_aff_sys} yield no additional information, they are removed from the system. Without them, the two rotations lead to a multivariate polynomial system consisting of four equations with monomials
$[\beta \quad \gamma \quad s_{u,1} \quad s_{u,1} \beta \quad s_{u,1} \gamma \quad s_{u,2} \quad s_{u,2} \beta \quad s_{u,2} \gamma]^\text{T}$.
Coefficient matrix $\textbf{C}$ is visualized in Table~\ref{tab:coefficient_mat}.
\begin{table}
\caption{Homography estimation. Coefficient matrix $\textbf{C}$ of the multivariate polynomial system to which the rotation components lead. Each column represents the coefficients of a monomial (1st row) in the four equations (rows).}
\resizebox{.99\columnwidth}{!}{\begin{tabular}{c c c c c c c c }
$\beta$ & $\gamma$ & $s_{u,1}$ & $s_{u,1} \beta$ & $s_{u,1} \gamma$ & $s_{u,2}$ & $s_{u,2} \beta$ & $s_{u,2} \gamma$ \\
\hline
$c_{11}$ & $c_{12}$ & $c_{13}$ & $c_{14}$ & $c_{15}$ & $c_{16}$ & $c_{17}$ & $c_{18}$ \\
& & & \multicolumn{2}{c}{...} & & & \\
$c_{41}$ & $c_{42}$ & $c_{43}$ & $c_{44}$ & $c_{45}$ & $c_{46}$ & $c_{47}$ & $c_{48}$ \\
\hline
\end{tabular}}
\label{tab:coefficient_mat}
\end{table}
Since four equations are given for four unknowns ($s_{u,1}$, $s_{u,2}$, $\beta$, and $\gamma$), and there are no higher order monomials, the system can straightforwardly be rearranged, then solved. The final formulas for $\beta$ and $\gamma$ are shown in Appendix~\ref{app:homography_parameters}. Finally, homography $\matr{H}$ is recovered through Eq.~\ref{eq:null_space}.
Note that assuming that close points more likely belong to the same homography, we choose the rotations of the two closest points. Although this is a heuristics, it worked well in our experiments and does not require much computation. For problems, where the time is not critical, it is a possible choice to estimate the three homographies which the three rotations induce and select the one with the most inliers.
Also note that all minimal samples, i.e.\ the selected five correspondences, can be rejected for which the two points in general positions also lie on the plane, thus leading to degenerate configuration. This can be checked by simply thresholding the re-projection error implied by $\matr{H}$ and each point pair.
\section{Fundamental Matrix Estimation from \\Five Correspondences}
Suppose that homography $\matr{H}$, estimated in the previously described way, and two additional point correspondences are given. The objective is to estimate fundamental matrix $\matr{F}$
compatible both with $\matr{H}$ and the two correspondences and $\det(\matr{F}) = 0$ holds. The compatibility with $\matr{H}$ could be ensured through the well-known formula~\cite{hartley2003multiple}:
$ \matr{H}^\text{T} \matr{F} + \matr{F}^\text{T} \matr{H} = 0 $.
However, the \textit{direct linear method} solving this system is unstable for inaccurate homographies, sometimes leading to completely meaningless results. The reason is that the samples are far from the normal distribution required for least squares fitting to work reasonably well~\cite{szeliski1998geometrically}. Zhou et al.~\cite{zhou2015revisit} proposed a normalization technique solving this problem, even so, this method needs at least three homographies to be known and do not consider the case when additional correspondences are given. Thus we chose the \textit{hallucinated point} technique generating five point correspondences using $\matr{H}$. The five generated and two given point pairs yield seven linear equations through $\matr{p}_{2,i}^\text{T} \matr{F} \matr{p}_{1,i} = 0$ ($i \in [1,7]$). Combining them, the following homogeneous linear system is given:
$
\textbf{D} \textbf{f} = 0,
$
where $\textbf{D}$ is the coefficient matrix and $\textbf{f} = [f_1 \; f_2 \; f_3 \; f_4 \; f_5 \; f_6 \; f_7 \; f_8 \; f_9]^\text{T}$ is the vector of unknown parameters. Matrix $\textbf{D}$ is as
\begin{eqnarray*}
\mathbf{D} = \\
\resizebox{.99\hsize}{!}{$\begin{bmatrix}
u_{1,1} u_{2,1} & v_{1,1} u_{2,1} & u_{2,1} & u_{1,1} v_{2,1} & v_{1,1} v_{2,1} & v_{2,1} & u_{1,1} & v_{1,1} & 1 \\
& & & \multicolumn{2}{c}{...} & & & & \\
u_{1,7} u_{2,7} & v_{1,7} u_{2,7} & u_{2,7} & u_{1,7} v_{2,7} & v_{1,7} v_{2,7} & v_{2,7} & u_{1,7} & v_{1,7} & 1
\end{bmatrix}$}.
\end{eqnarray*}
Note that making the estimator more stable, the normalization proposed by Hartley~\cite{hartley1997defense} is applied and the equations from the three co-planar points are also added.
The null-space of matrix $\matr{D}$ is two-dimensional and the solution is calculated as the linear combination of the two null-vectors:
\begin{equation}
\matr{F} = \epsilon \matr{e} + \eta \matr{g},
\label{eq:fund_null_space}
\end{equation}
where $\epsilon$ and $\eta$ are unknown scalars, $\matr{e} = [e_1\; ...\; e_9]^\text{T}$ and $\matr{g} = [g_1\; ...\; g_9]^\text{T}$ are the null-vectors. Due to the scale ambiguity of $\matr{F}$, $\eta$ can be set to an arbitrary value. To achieve stability we use $\eta = 1 - \epsilon$, thus keeping the sum of the weights to be one. Substituting Eq.~\ref{eq:fund_null_space} into $\det(\matr{F}) = 0$ leads to a cubic polynomial equation. The possible solutions for $\epsilon$ (their number is $\in \{1,2,3\}$, similarly to the seven-point algorithm) are obtained as the real roots of the polynomial. The resulting fundamental matrices are finally calculated by substituting each $\epsilon$ to Eq.~\ref{eq:fund_null_space}.
Note that all fundamental matrices are discarded for which the \textit{oriented} epipolar constraint~\cite{chum2004epipolar} does not hold.
Concluding the current and the previous sections, fundamental matrix $\matr{F}$ can be estimated from three co-planar and two arbitrary correspondences of rotation invariant features.
\section{Experimental Results}
In this section, we compare the proposed method with the widely used seven- and eight-point algorithms~\cite{hartley2003multiple} both on synthesized and real worlds tests.
\textit{The Matlab implementation is submitted as supplementary material.}
\subsection{Synthesized Tests}
\begin{figure*}[htbp]
\centering
\includegraphics[width = 0.65\columnwidth]{assets/motion_random.pdf}
\includegraphics[width = 0.65\columnwidth]{assets/motion_pure_sideways.pdf}
\includegraphics[width = 0.65\columnwidth]{assets/motion_pure_forward.pdf}
\caption{ The mean error (in pixels; plotted as the function of the noise $\sigma$) of the proposed, seven- and eight-point algorithms on cameras motions: random (left), sideways (middle) and forward (right). For random motion, both cameras are placed at a random point of a $10$-radius sphere and look towards the origin. For sideways and forward motions, the distance of the cameras was $10$ unit and a small zero-mean Gaussian-noise (with standard deviation set to $0.1$) is added to each coordinate. }
\label{fig:synthetic_tests}
\end{figure*}
For synthesized testing, two perspective cameras were generated by their projection matrices $\matr{P}_1, \matr{P}_2 \in \mathbb{R}^{3 \times 4}$ and five random planes were sampled, each at four locations. The generated $20$ points were then projected onto the cameras and the ground truth affine transformations were computed from the image points and plane parameters. Zero-mean Gaussian-noise were added to the point coordinates, thus contaminating the affine components as well.
Fig.~\ref{fig:synthetic_tests} shows the results of the proposed, eight- and seven-points algorithms applied to view pairs with specific camera motions (left -- random motion, middle -- pure sideways motion, right -- pure forward motion). The error is plotted as the function of the noise $\sigma$ (horizontal axis; in pixels). It is the mean symmetric epipolar distance from the correspondences not used for the estimation. For random motion, both cameras were located at a random point of a $10$-radius sphere and look towards the origin. For sideways and forward motions, the distance of the cameras was $10$ unit and a small perturbation, i.e.\ zero-mean Gaussian-noise with $0.1$ standard deviation, was added to the camera coordinates.
It can be seen, that the proposed method leads similar accuracy to the seven-point algorithm for general movement. However, for purely sideways motion, the method is significantly less sensitive to the noise than the other competitors. For forward motion, if the noise $\sigma$ does not exceed $0.5$, the $5$-point technique is most accurate. After that point, the seven-point algorithm outperforms it.
\subsection{Real World Tests}
\begin{figure}[htbp]
\centering
\includegraphics[width = 0.49\columnwidth]{assets/increasing_baseline_error.pdf}
\includegraphics[width = 0.49\columnwidth]{assets/increasing_baseline_samples.pdf}\\[0.2cm]
\includegraphics[width = 0.49\columnwidth]{assets/increasing_baseline_error_30fps.pdf}
\includegraphics[width = 0.49\columnwidth]{assets/increasing_baseline_samples_30fps.pdf}
\caption{ The mean error (left; in pixels) and sample number (right) plotted as the function of the baseline (in degrees; rotation around the object) for confidence $99\%$ (top) and time limit $1 / 30$ secs (bottom). Results are computed from 100 runs on each image pair (\#515) in the {\fontfamily{cmtt}\selectfont Strecha} dataset. }
\label{fig:increasing_baseline}
\end{figure}
\begin{figure}[htbp]
\centering
\begin{subfigure}{0.99\columnwidth}
\includegraphics[width = 0.49\columnwidth]{assets/barrsmith1.png}
\includegraphics[width = 0.49\columnwidth]{assets/barrsmith2.png}
\caption{ {\fontfamily{cmtt}\selectfont AdelaideRMF} }
\end{subfigure}
\begin{subfigure}{0.99\columnwidth}
\includegraphics[width = 0.49\columnwidth]{assets/plant1.png}
\includegraphics[width = 0.49\columnwidth]{assets/plant2.png}
\caption{ {\fontfamily{cmtt}\selectfont Kusvod2} }
\end{subfigure}
\begin{subfigure}{0.99\columnwidth}
\includegraphics[width = 0.49\columnwidth]{assets/glasscaseb1.png}
\includegraphics[width = 0.49\columnwidth]{assets/glasscaseb2.png}
\caption{ {\fontfamily{cmtt}\selectfont Multi-H} }
\end{subfigure}\\
\begin{subfigure}{0.99\columnwidth}
\includegraphics[width = 0.49\columnwidth]{assets/fountainp11_0_52.png}
\includegraphics[width = 0.49\columnwidth]{assets/fountainp11_0_51.png}
\caption{ {\fontfamily{cmtt}\selectfont Strecha} }
\end{subfigure}
\caption{ The results of the proposed method combined with Graph-Cut RANSAC. An image pair from each dataset with the corresponding epipolar lines of $50$ random inliers drawn by colors. The five point pairs which are used as the minimal sample are visualized by red dots. }
\label{fig:real_images}
\end{figure}
To test the proposed method on real world data, we used the {\fontfamily{cmtt}\selectfont AdelaideRMF}\footnote{\url{cs.adelaide.edu.au/~hwong/doku.php?id=data}}, {\fontfamily{cmtt}\selectfont Kusvod2}\footnote{\url{cmp.felk.cvut.cz/data/geometry2view}}, {\fontfamily{cmtt}\selectfont Multi-H}\footnote{\url{web.eee.sztaki.hu/~dbarath}}, and {\fontfamily{cmtt}\selectfont Strecha}\footnote{\url{cvlab.epfl.ch/data/strechamvs}} datasets (see Fig.~\ref{fig:real_images} for examples). {\fontfamily{cmtt}\selectfont AdelaideRMF}, {\fontfamily{cmtt}\selectfont Kusvod2} and {\fontfamily{cmtt}\selectfont Multi-H} consist of image pairs of resolution from $455 \times 341$ to $2592 \times 1944$ and manually annotated (assigned to outlier or inlier classes) correspondences. Since the reference points do not contain rotation components we detected and matched points applying SIFT detector.
{\fontfamily{cmtt}\selectfont Strecha} dataset consists of image sequences (each image is of size $3072 \times 2048$) and a projection matrix for every image. Therefore, we paired the images in each sequence in every possible way. The ground truth $\matr{F}$ was estimated from the projection matrices~\cite{hartley2003multiple} and SIFT was used to get correspondences. Every detected point pair was considered as a reference point for which the symmetric epipolar distance~\cite{hartley2003multiple} from the ground truth $\matr{F}$ was smaller than $1.0$ pixels. If less then $20$ reference points were kept, the pair was not used in the latter evaluation.
We chose Graph-Cut RANSAC~\cite{barath2017graph} as a robust estimator since it can be considered as state-of-the-art and its source code is publicly available\footnote{\url{https://github.com/danini/graph-cut-ransac}}. In brief, it is a locally optimized RANSAC using graph-cut to achieve efficiency and global optimality w.r.t.\ the current so-far-the-best model.
Validating the estimated fundamental matrices, we used the reference point sets. The geometric error was computed as the mean symmetric epipolar distance as follows:
\begin{equation}
\frac{1}{2} \sum_{(\matr{p}_1, \matr{p}_2) \in \mathcal{P}_{\text{R}}} \frac{\matr{F} \matr{p}_1}{\sqrt{(\matr{F} \matr{p}_1)^2_1 + (\matr{F} \matr{p}_1)^2_2}} + \frac{\matr{p}_2^\text{T} \matr{F}}{\sqrt{(\matr{p}_2^\text{T} \matr{F})^2_1 + (\matr{p}_2^\text{T} \matr{F})^2_2}},
\label{eq:geometric_error}
\end{equation}
where $\mathcal{P}_{\text{R}}$ is the set of reference correspondences.
The competitor methods, i.e.\ the minimal solvers combined with GC-RANSAC, were the normalized eight- and seven-point algorithms\footnote{OpenCV is used for the eight- and seven-point algorithms.}. In the least-squares model re-fitting step of GC-RANSAC, the normalized eight-point method was applied using the current inlier set.
Blocks (a--f) of Table~\ref{tab:Strecha_comparison} reports the mean result of $100$ runs on each pair from the {\fontfamily{cmtt}\selectfont Strecha} dataset. The first column is the name of the sequence, the second one is the number of the image pairs -- the ones having more than $20$ reference points. The next two blocks, each consisting of three columns, show the results of the methods if the confidence of GC-RANSAC is set to $99\%$ (1st block) and for a strict 30 FPS time limit (interrupted after $1 / 30$ secs; 2nd block). The reported properties are the geometric error of the estimated fundamental matrices (Eq.~\ref{eq:geometric_error}) w.r.t.\ the reference point sets, and the number of the samples drawn by GC-RANSAC. It can be seen that using the proposed method leads to \textit{more accurate model estimates using less samples} than the competitor algorithms. However, this test is slightly unfair since {\fontfamily{cmtt}\selectfont Strecha} dataset consists of images of buildings with large planar facades. Thus finding three co-planar points is not a challenging task.
Blocks (g--i) show the mean results on {\fontfamily{cmtt}\selectfont AdelaideRMF}, {\fontfamily{cmtt}\selectfont Kusvod2} and {\fontfamily{cmtt}\selectfont Multi-H} datasets (1st column) if the confidence is set to $99\%$ (4th -- 6th cols) and for a strict $1 / 30$ seconds time limit (7th -- 9th cols). It can be seen that for both cases, the proposed method achieved the lowest mean errors in all but one test cases.
\begin{table*}
\center
\caption{ Fundamental matrix estimation using GC-RANSAC~\cite{barath2017graph} with minimal methods ($2$nd row) applied to the sequences of the {\fontfamily{cmtt}\selectfont Strecha} dataset. The $1$st column shows the sequences: (a) Fountain-P11, (b) {\fontfamily{cmtt}\selectfont Entry-p10}, (c) {\fontfamily{cmtt}\selectfont Castle-p19}, (d) {\fontfamily{cmtt}\selectfont Castle-p30}, (e) Herzjesus-p8, and (f) {\fontfamily{cmtt}\selectfont Herzjesus-p25}, (g) {\fontfamily{cmtt}\selectfont Kusvod2}, (h) {\fontfamily{cmtt}\selectfont AdelaideRMF}, and (i) {\fontfamily{cmtt}\selectfont Multi-H}. The number of the image pairs and the tested properties are reported in the $2$nd and $3$rd columns. The next three report the results at $99\%$ confidence. For the remaining columns, there was a time limit set to $30$ FPS, i.e.\ the run is interrupted after $1 / 30$ secs. Values are the means of $100$ runs. The mean geometric error (in pixels) of the results w.r.t.\ the manually annotated inliers are written in each $1$st row; the required number of samples are reported in every $2$th row. The error is the symmetric epipolar distance. }
\begin{tabular}{| l | l | r || r | r | r || r | r | r | }
\hline
\multicolumn{3}{|c||}{} & \multicolumn{3}{c||}{Confidence 99\%} & \multicolumn{3}{c|}{30 FPS} \\
\hline
\multicolumn{3}{|r||}{Minimal methods $\to$} & \multicolumn{1}{c|}{\textbf{5}} & \multicolumn{1}{c|}{7} & \multicolumn{1}{c||}{8} & \multicolumn{1}{c|}{\textbf{5}} & \multicolumn{1}{c|}{7} & \multicolumn{1}{c|}{8} \\
\hline
\multirow{2}{*}{\rot{(a)}} & \multirow{2}{*}{\rot{53}} & Avg Err (px) & \textbf{3.06} & 4.34 & 16.21 & \textbf{4.31} & 7.29 & 17.15 \\
& & Samples & \textbf{3\;692} & 5\;084 & 5\;471 & 42 & \textbf{38} & 59 \\
\hline
\multirow{2}{*}{\rot{(b)}} & \multirow{2}{*}{\rot{45}} & Avg Err (px) & \textbf{1.42} & 1.63 & 3.10 & \textbf{2.33} & 3.93 & 8.95 \\
& & Samples & \textbf{4\;953} & 6\;621 & 7\;045 & 40 & \textbf{36} & 57 \\
\hline
\multirow{2}{*}{\rot{(c)}} & \multirow{2}{*}{\rot{81}} & Avg Err (px) & \textbf{6.71} & 9.52 & 20.54 & \textbf{6.80} & 10.75 & 23.92 \\
& & Samples & \textbf{6\;450} & 7\;394 & 7\;586 & 30 & \textbf{29} & 33 \\
\hline
\multirow{2}{*}{\rot{(d)}} & \multirow{2}{*}{\rot{196}} & Avg Err (px) & \textbf{5.40} & 8.71 & 20.51 & \textbf{6.78} & 8.82 & 19.01 \\
& & Samples & \textbf{6\;720} & 7\;780 & 8\;094 & 49 & \textbf{42} & 82 \\
\hline
\multirow{2}{*}{\rot{(e)}} & \multirow{2}{*}{\rot{26}} & Avg Err (px) & \textbf{2.86} & 6.08 & 19.85 & 7.36 & \textbf{6.54} & 19.38 \\
& & Samples & \textbf{5\;432} & 6\;545 & 7\;088 & 45 & \textbf{40} & 74 \\
\hline
\multirow{2}{*}{\rot{(f)}} & \multirow{2}{*}{\rot{114}} & Avg Err (px) & \textbf{4.84} & 9.14 & 16.21 & \textbf{7.69} & 10.06 & 27.83 \\
& & Samples & \textbf{5\;881} & 7\;100 & 7\;434 & 58 & \textbf{47} & 103 \\
\hline
\multirow{2}{*}{\rot{(g)}} & \multirow{2}{*}{\rot{18}} & Avg Err (px) & 0.63 & \textbf{0.52} & 0.53 & 0.70 & \textbf{0.56} & 0.59 \\
& & Samples & \textbf{523} & 1\;178 & 1\;656 & \textbf{153} & 232 & 413 \\
\hline
\multirow{2}{*}{\rot{(h)}} & \multirow{2}{*}{\rot{24}} & Avg Err (px) & \textbf{6.11} & 6.93 & 9.08 & \textbf{7.44} & 7.55 & 10.94 \\
& & Samples & \textbf{1\;353} & 2\;273 & 2\;859 & \textbf{100} & 182 & 285 \\
\hline
\multirow{2}{*}{\rot{(i)}} & \multirow{2}{*}{\rot{4}} & Avg Err (px) & \textbf{0.34} & 0.37 & 0.38 & \textbf{0.79} & 0.97 & 5.46 \\
& & Samples & \textbf{1\;985} & 3\;299 & 4\;991 & 42 & \textbf{33} & 68 \\
\hline
\hline
\multirow{2}{*}{\rot{(all)}} & \multirow{2}{*}{\rot{561}} & Avg Err (px) & \textbf{3.47} & 7.41 & 16.53 & \textbf{4.90} & 8.33 & 19.51 \\
& & Samples & \textbf{5\;560} & 6\;276 & 7\;055 & \textbf{52} & \textbf{52} & 93 \\
\hline
\end{tabular}
\label{tab:Strecha_comparison}
\end{table*}
Fig.~\ref{fig:increasing_baseline} shows the error (in pixels) and the sample number plotted as the function of the baseline (in degrees). The results are the mean of $100$ runs on each image pair, \#515 on total, of the {\fontfamily{cmtt}\selectfont Strecha} dataset. Since the cameras in the sequences move around a building with approx. $180^{\circ}$, the baseline is indicated by the current angle.
Fig.~\ref{fig:real_images} shows example image pairs from each dataset with the epipolar lines of $50$ random inliers and five correspondences used as a minimal sample in the proposed method (red dots). It can be seen, that the results seem good: the epipolar lines go through the same pixels in the first (left) and second (right) images. Pairs (a) and (b) show an interesting effect: there are no entirely co-planar three points.
Nevertheless, the initially estimated fundamental matrix was precise enough to be accurately refined by the local optimization step of GC-RANSAC.
\subsection{Application: Rigid Motion Segmentation}
In this section, we show an possible application where estimating a fundamental matrix using fewer points than the state-of-the-art is beneficial.
Multiple rigid motions in two views can be interpreted as a set of fundamental matrices. Typically, they are estimated by applying a multi-model fitting algorithm like PEARL~\cite{isack2012energy}. State-of-the-art fitting algorithms generate a set of initial fundamental matrices using a RANSAC-like sampling combined with a minimal method. Then an optimization is applied assigning the points to motion clusters and selecting the motions best interpreting the scene.
The methods were evaluated on the {\fontfamily{cmtt}\selectfont AdelaideRMF} motion dataset (see Fig.~\ref{fig:real_motion_images} for examples) consisting of $18$ image pairs and the ground truth -- correspondences assigned to their motion clusters or outlier class.
Table~\ref{tab:motion_comparison} reports the result of PEARL combined with minimal methods (rows). The error is the misclassification error
\begin{equation*}
\text{ME} = \frac{\# \text{Misclassified Points}}{\# \text{Points}},
\end{equation*}
which is the ratio of the points not assigned to the desired motion cluster. PEARL used the same initial model number for all methods, i.e.\ twice the input point number. The inlier-outlier threshold was tuned for each problem and each method separately.
It can be seen that by using the five-point algorithm, the \textit{obtained clusterings are the most accurate}.
\begin{figure}[htbp]
\centering
\begin{subfigure}{0.99\columnwidth}
\includegraphics[width = 0.49\columnwidth]{assets/best_breadcubechips1.png}
\includegraphics[width = 0.49\columnwidth]{assets/best_breadcubechips2.png}
\caption{ breadcubechips }
\end{subfigure}
\begin{subfigure}{0.99\columnwidth}
\includegraphics[width = 0.49\columnwidth]{assets/best_toycubecar1.png}
\includegraphics[width = 0.49\columnwidth]{assets/best_toycubecar2.png}
\caption{ toycubecar }
\end{subfigure}
\caption{ Example results of PEARL~\cite{isack2012energy} combined with the proposed algorithm applied to the {\fontfamily{cmtt}\selectfont {\fontfamily{cmtt}\selectfont AdelaideRMF}} motion dataset. Colors denote motions, black dots are outliers. }
\label{fig:real_motion_images}
\end{figure}
\begin{table}
\center
\caption{ Two-view multi-motion clustering by PEARL~\cite{isack2012energy} combined with minimal methods (5th -- 7th cols). The number of points (P), motions (M) and the outlier percentage (O). The reported misclassification errors (in percentage) are the ratio of the points assigned to not the desired motion cluster. Test pairs from the {\fontfamily{cmtt}\selectfont {\fontfamily{cmtt}\selectfont AdelaideRMF}} motion dataset: (1) biscuit, (2) biscuitbookbox, (3) boardgame, (4) book, (5) breadcartoychips, (6) breadcube, (7) breadcubechips, (8) breadtoy, (9) breadtoycar, (10) carchipscube, (11) cube, (12) cubebreadtoychips, (13) cubechips, (14) cubetoy, (15) dinobooks, (16) game, (17) gamebiscuit, (18) toycubecar. }
\resizebox{.99\columnwidth}{!}{\begin{tabular}{| r | c c c | c c c | }
\hline
& P & M & O & \textbf{5-point} & 7-point & 8-point \\
\hline
(1) & 330 & 1 & 55.8 & \phantom{x}1.4 & \phantom{x}2.7 & \phantom{x}\textbf{0.0} \\
(2) & 259 & 3 & 37.5 & \phantom{x}\textbf{2.2} & \phantom{x}3.0 & \phantom{x}\textbf{2.2} \\
(3) & 279 & 3 & 40.5 & \phantom{x}9.0 & \phantom{x}8.6 & \phantom{x}\textbf{7.5} \\
(4) & 187 & 1 & 43.9 & \phantom{x}\textbf{2.1} & \phantom{x}\textbf{2.1} & \phantom{x}\textbf{2.1} \\
(5) & 237 & 4 & 34.6 & \phantom{x}6.1 & \phantom{x}\textbf{5.1} & \phantom{x}7.0 \\
(6) & 242 & 2 & 31.8 & \phantom{x}\textbf{1.5} & \phantom{x}\textbf{1.5} & \phantom{x}2.5 \\
(7) & 230 & 3 & 35.2 & \phantom{x}\textbf{0.9} & \phantom{x}1.9 & \phantom{x}2.0 \\
(8) & 288 & 2 & 36.8 & \phantom{x}1.4 & \phantom{x}\textbf{1.3} & \phantom{x}1.8 \\
(9) & 166 & 3 & 33.7 & \phantom{x}7.9 & \phantom{x}\textbf{6.5} & \phantom{x}6.6 \\
(10) & 165 & 3 & 36.4 & \phantom{x}3.8 & \phantom{x}3.8 & \phantom{x}\textbf{3.1} \\
(11) & 302 & 1 & 67.9 & \textbf{10.4} & 12.4 & 12.4 \\
(12) & 327 & 4 & 26.9 & \phantom{x}\textbf{3.2} & \phantom{x}3.8 & \phantom{x}4.1 \\
(13) & 284 & 2 & 50.3 & \phantom{x}\textbf{1.6} & \phantom{x}3.8 & \phantom{x}4.9 \\
(14) & 249 & 2 & 39.8 & \phantom{x}1.0 & \phantom{x}\textbf{0.5} & \phantom{x}1.6 \\
(15) & 360 & 3 & 43.1 & 15.1 & 16.3 & \textbf{10.5} \\
(16) & 233 & 1 & 73.0 & \phantom{x}\textbf{5.5} & \phantom{x}6.1 & \phantom{x}\textbf{5.5} \\
(17) & 328 & 2 & 50.9 & \phantom{x}\textbf{1.6} & \phantom{x}2.4 & \phantom{x}2.2 \\
(18) & 200 & 3 & 36.0 & \phantom{x}5.4 & \phantom{x}7.1 & \phantom{x}\textbf{4.3} \\
\hline
Avg & & & & \phantom{x}\textbf{4.5} & \phantom{x}4.9 & \phantom{x}\textbf{4.5} \\
Med & & & & \phantom{x}\textbf{2.7} & \phantom{x}3.8 & \phantom{x}3.6 \\
\hline
\end{tabular}}
\label{tab:motion_comparison}
\end{table}
\subsection{Processing Time}
The proposed method consists of three main steps: (i) the null-space computation of a matrix of size $6 \times 9$, then the homography parameters are calculated in closed form. (ii) Using the estimated $\matr{H}$ and two additional correspondences, a coefficient matrix of size $7 \times 9$ is built and its null-space is computed. (iii) Finally, the roots of a cubic polynomial are estimated. The average processing time of $100$ runs of our C++ implementation using OpenCV was $0.16$ milliseconds.
Combining RANSAC-like \textit{hypothesize-and-verify} robust estimators with the proposed method is beneficial since their processing time highly depends on the size of the minimal sample required for the estimation. Table~\ref{tab:ransac_iterations} shows the theoretically needed iteration number of RANSAC combined with minimal methods (columns) on different outlier levels (rows). The confidence value was set to $95\%$. It can be seen that using the proposed 5-point algorithm leads to significant improvement in the processing time.
\begin{table}[h!]
\centering
\caption{Required theoretical iteration number of RANSAC~\cite{fischler1981random} combined with minimal methods (columns) with confidence set to $95\%$ on different outlier levels (rows).}
\begin{tabular}{ | c | r r r | }
\hline
& \multicolumn{3}{c|}{Confidence $95\%$}\\
\hline
Outl. & \textbf{5}{\footnotesize\phantom{xx}} & 7{\footnotesize\phantom{xx}} & 8{\footnotesize\phantom{xx}} \\
\hline
50\% & $\mathbf{94}${\footnotesize\phantom{xx}} & $382${\footnotesize\phantom{xx}} & $765${\footnotesize\phantom{xx}} \\
80\% & $\mathbf{\sim10^4}${\footnotesize\phantom{x}} & $\sim10^5${\footnotesize\phantom{x}} & $\sim10^6${\footnotesize\phantom{x}} \\
95\% & $\mathbf{\sim10^7}${\footnotesize\phantom{x}} & $\sim10^9${\footnotesize\phantom{x}} & $\sim10^{10}$ \\
99\% & $\mathbf{\sim10^{10}}$ & $\sim10^{14}$ & $\sim10^{16}$\\
\hline
\end{tabular}
\label{tab:ransac_iterations}
\end{table}
\section{Conclusion}
In this paper, we proposed a method for estimating the fundamental matrix between two non-calibrated cameras from five correspondences of rotation invariant features. Three of the points have to be co-planar and two of them be in general position. The solver, combined with Graph-Cut RANSAC, was superior to the seven- and eight-point algorithms both in terms of accuracy and needed sample number on the evaluated $561$ publicly available real image pairs.
It is demonstrated that the co-planarity of three points is not a too restrictive constraint in real world (e.g.\ in urban environment) and can be weakened by state-of-the-art robust estimators.
Moreover, we showed that the method makes multi-motion fitting more accurate than using the eight- or seven-point algorithms.
\section{Introduction}
Please follow the steps outlined below when submitting your manuscript to
the IEEE Computer Society Press. This style guide now has several
important modifications (for example, you are no longer warned against the
use of sticky tape to attach your artwork to the paper), so all authors
should read this new version.
\subsection{Language}
All manuscripts must be in English.
\subsection{Dual submission}
Please refer to the author guidelines on the ICCV 2017 web page for a
discussion of the policy on dual submissions.
\subsection{Paper length}
For ICCV 2017, the rules about paper length have changed, so please
read this section carefully. Papers, excluding the references section,
must be no longer than eight pages in length. One additional page
containing {\em only} cited references is allowed, for a total maximal
length of nine pages.
Overlength papers will simply not be reviewed. This includes papers
where the margins and formatting are deemed to have been significantly
altered from those laid down by this style guide. Note that this
\LaTeX\ guide already sets figure captions and references in a smaller font.
The reason such papers will not be reviewed is that there is no provision for
supervised revisions of manuscripts. The reviewing process cannot determine
the suitability of the paper for presentation in eight pages if it is
reviewed in eleven.
\subsection{The ruler}
The \LaTeX\ style defines a printed ruler which should be present in the
version submitted for review. The ruler is provided in order that
reviewers may comment on particular lines in the paper without
circumlocution. If you are preparing a document using a non-\LaTeX\
document preparation system, please arrange for an equivalent ruler to
appear on the final output pages. The presence or absence of the ruler
should not change the appearance of any other content on the page. The
camera ready copy should not contain a ruler. (\LaTeX\ users may uncomment
the \verb'\iccvfinalcopy' command in the document preamble.) Reviewers:
note that the ruler measurements do not align well with lines in the paper
--- this turns out to be very difficult to do well when the paper contains
many figures and equations, and, when done, looks ugly. Just use fractional
references (e.g.\ this line is $095.5$), although in most cases one would
expect that the approximate location will be adequate.
\subsection{Mathematics}
Please number all of your sections and displayed equations. It is
important for readers to be able to refer to any particular equation. Just
because you didn't refer to it in the text doesn't mean some future reader
might not need to refer to it. It is cumbersome to have to use
circumlocutions like ``the equation second from the top of page 3 column
1''. (Note that the ruler will not be present in the final copy, so is not
an alternative to equation numbers). All authors will benefit from reading
Mermin's description of how to write mathematics:
\url{http://www.pamitc.org/documents/mermin.pdf}.
\subsection{Blind review}
Many authors misunderstand the concept of anonymizing for blind
review. Blind review does not mean that one must remove
citations to one's own work---in fact it is often impossible to
review a paper unless the previous citations are known and
available.
Blind review means that you do not use the words ``my'' or ``our''
when citing previous work. That is all. (But see below for
techreports.)
Saying ``this builds on the work of Lucy Smith [1]'' does not say
that you are Lucy Smith; it says that you are building on her
work. If you are Smith and Jones, do not say ``as we show in
[7]'', say ``as Smith and Jones show in [7]'' and at the end of the
paper, include reference 7 as you would any other cited work.
An example of a bad paper just asking to be rejected:
\begin{quote}
\begin{center}
An analysis of the frobnicatable foo filter.
\end{center}
In this paper we present a performance analysis of our
previous paper [1], and show it to be inferior to all
previously known methods. Why the previous paper was
accepted without this analysis is beyond me.
[1] Removed for blind review
\end{quote}
An example of an acceptable paper:
\begin{quote}
\begin{center}
An analysis of the frobnicatable foo filter.
\end{center}
In this paper we present a performance analysis of the
paper of Smith \etal [1], and show it to be inferior to
all previously known methods. Why the previous paper
was accepted without this analysis is beyond me.
[1] Smith, L and Jones, C. ``The frobnicatable foo
filter, a fundamental contribution to human knowledge''.
Nature 381(12), 1-213.
\end{quote}
If you are making a submission to another conference at the same time,
which covers similar or overlapping material, you may need to refer to that
submission in order to explain the differences, just as you would if you
had previously published related work. In such cases, include the
anonymized parallel submission~\cite{Authors14} as additional material and
cite it as
\begin{quote}
[1] Authors. ``The frobnicatable foo filter'', F\&G 2014 Submission ID 324,
Supplied as additional material {\tt fg324.pdf}.
\end{quote}
Finally, you may feel you need to tell the reader that more details can be
found elsewhere, and refer them to a technical report. For conference
submissions, the paper must stand on its own, and not {\em require} the
reviewer to go to a techreport for further details. Thus, you may say in
the body of the paper ``further details may be found
in~\cite{Authors14b}''. Then submit the techreport as additional material.
Again, you may not assume the reviewers will read this material.
Sometimes your paper is about a problem which you tested using a tool which
is widely known to be restricted to a single institution. For example,
let's say it's 1969, you have solved a key problem on the Apollo lander,
and you believe that the ICCV70 audience would like to hear about your
solution. The work is a development of your celebrated 1968 paper entitled
``Zero-g frobnication: How being the only people in the world with access to
the Apollo lander source code makes us a wow at parties'', by Zeus \etal.
You can handle this paper like any other. Don't write ``We show how to
improve our previous work [Anonymous, 1968]. This time we tested the
algorithm on a lunar lander [name of lander removed for blind review]''.
That would be silly, and would immediately identify the authors. Instead
write the following:
\begin{quotation}
\noindent
We describe a system for zero-g frobnication. This
system is new because it handles the following cases:
A, B. Previous systems [Zeus et al. 1968] didn't
handle case B properly. Ours handles it by including
a foo term in the bar integral.
...
The proposed system was integrated with the Apollo
lunar lander, and went all the way to the moon, don't
you know. It displayed the following behaviours
which show how well we solved cases A and B: ...
\end{quotation}
As you can see, the above text follows standard scientific convention,
reads better than the first version, and does not explicitly name you as
the authors. A reviewer might think it likely that the new paper was
written by Zeus \etal, but cannot make any decision based on that guess.
He or she would have to be sure that no other authors could have been
contracted to solve problem B.
FAQ: Are acknowledgements OK? No. Leave them for the final copy.
\begin{figure}[t]
\begin{center}
\fbox{\rule{0pt}{2in} \rule{0.9\linewidth}{0pt}}
\end{center}
\caption{Example of caption. It is set in Roman so that mathematics
(always set in Roman: $B \sin A = A \sin B$) may be included without an
ugly clash.}
\label{fig:long}
\label{fig:onecol}
\end{figure}
\subsection{Miscellaneous}
\noindent
Compare the following:\\
\begin{tabular}{ll}
\verb'$conf_a$' & $conf_a$ \\
\verb'$\mathit{conf}_a$' & $\mathit{conf}_a$
\end{tabular}\\
See The \TeX book, p165.
The space after \eg, meaning ``for example'', should not be a
sentence-ending space. So \eg is correct, {\em e.g.} is not. The provided
\verb'\eg' macro takes care of this.
When citing a multi-author paper, you may save space by using ``et alia'',
shortened to ``\etal'' (not ``{\em et.\ al.}'' as ``{\em et}'' is a complete word.)
However, use it only when there are three or more authors. Thus, the
following is correct: ``
Frobnication has been trendy lately.
It was introduced by Alpher~\cite{Alpher02}, and subsequently developed by
Alpher and Fotheringham-Smythe~\cite{Alpher03}, and Alpher \etal~\cite{Alpher04}.''
This is incorrect: ``... subsequently developed by Alpher \etal~\cite{Alpher03} ...''
because reference~\cite{Alpher03} has just two authors. If you use the
\verb'\etal' macro provided, then you need not worry about double periods
when used at the end of a sentence as in Alpher \etal.
For this citation style, keep multiple citations in numerical (not
chronological) order, so prefer \cite{Alpher03,Alpher02,Authors14} to
\cite{Alpher02,Alpher03,Authors14}.
\begin{figure*}
\begin{center}
\fbox{\rule{0pt}{2in} \rule{.9\linewidth}{0pt}}
\end{center}
\caption{Example of a short caption, which should be centered.}
\label{fig:short}
\end{figure*}
\section{Formatting your paper}
All text must be in a two-column format. The total allowable width of the
text area is $6\frac78$ inches (17.5 cm) wide by $8\frac78$ inches (22.54
cm) high. Columns are to be $3\frac14$ inches (8.25 cm) wide, with a
$\frac{5}{16}$ inch (0.8 cm) space between them. The main title (on the
first page) should begin 1.0 inch (2.54 cm) from the top edge of the
page. The second and following pages should begin 1.0 inch (2.54 cm) from
the top edge. On all pages, the bottom margin should be 1-1/8 inches (2.86
cm) from the bottom edge of the page for $8.5 \times 11$-inch paper; for A4
paper, approximately 1-5/8 inches (4.13 cm) from the bottom edge of the
page.
\subsection{Margins and page numbering}
All printed material, including text, illustrations, and charts, must be kept
within a print area 6-7/8 inches (17.5 cm) wide by 8-7/8 inches (22.54 cm)
high.
\subsection{Type-style and fonts}
Wherever Times is specified, Times Roman may also be used. If neither is
available on your word processor, please use the font closest in
appearance to Times to which you have access.
MAIN TITLE. Center the title 1-3/8 inches (3.49 cm) from the top edge of
the first page. The title should be in Times 14-point, boldface type.
Capitalize the first letter of nouns, pronouns, verbs, adjectives, and
adverbs; do not capitalize articles, coordinate conjunctions, or
prepositions (unless the title begins with such a word). Leave two blank
lines after the title.
AUTHOR NAME(s) and AFFILIATION(s) are to be centered beneath the title
and printed in Times 12-point, non-boldface type. This information is to
be followed by two blank lines.
The ABSTRACT and MAIN TEXT are to be in a two-column format.
MAIN TEXT. Type main text in 10-point Times, single-spaced. Do NOT use
double-spacing. All paragraphs should be indented 1 pica (approx. 1/6
inch or 0.422 cm). Make sure your text is fully justified---that is,
flush left and flush right. Please do not place any additional blank
lines between paragraphs.
Figure and table captions should be 9-point Roman type as in
Figures~\ref{fig:onecol} and~\ref{fig:short}. Short captions should be centred.
\noindent Callouts should be 9-point Helvetica, non-boldface type.
Initially capitalize only the first word of section titles and first-,
second-, and third-order headings.
FIRST-ORDER HEADINGS. (For example, {\large \bf 1. Introduction})
should be Times 12-point boldface, initially capitalized, flush left,
with one blank line before, and one blank line after.
SECOND-ORDER HEADINGS. (For example, { \bf 1.1. Database elements})
should be Times 11-point boldface, initially capitalized, flush left,
with one blank line before, and one after. If you require a third-order
heading (we discourage it), use 10-point Times, boldface, initially
capitalized, flush left, preceded by one blank line, followed by a period
and your text on the same line.
\subsection{Footnotes}
Please use footnotes\footnote {This is what a footnote looks like. It
often distracts the reader from the main flow of the argument.} sparingly.
Indeed, try to avoid footnotes altogether and include necessary peripheral
observations in
the text (within parentheses, if you prefer, as in this sentence). If you
wish to use a footnote, place it at the bottom of the column on the page on
which it is referenced. Use Times 8-point type, single-spaced.
\subsection{References}
List and number all bibliographical references in 9-point Times,
single-spaced, at the end of your paper. When referenced in the text,
enclose the citation number in square brackets, for
example~\cite{Authors14}. Where appropriate, include the name(s) of
editors of referenced books.
\begin{table}
\begin{center}
\begin{tabular}{|l|c|}
\hline
Method & Frobnability \\
\hline\hline
Theirs & Frumpy \\
Yours & Frobbly \\
Ours & Makes one's heart Frob\\
\hline
\end{tabular}
\end{center}
\caption{Results. Ours is better.}
\end{table}
\subsection{Illustrations, graphs, and photographs}
All graphics should be centered. Please ensure that any point you wish to
make is resolvable in a printed copy of the paper. Resize fonts in figures
to match the font in the body text, and choose line widths which render
effectively in print. Many readers (and reviewers), even of an electronic
copy, will choose to print your paper in order to read it. You cannot
insist that they do otherwise, and therefore must not assume that they can
zoom in to see tiny details on a graphic.
When placing figures in \LaTeX, it's almost always best to use
\verb+\includegraphics+, and to specify the figure width as a multiple of
the line width as in the example below
{\small\begin{verbatim}
\usepackage[dvips]{graphicx} ...
\includegraphics[width=0.8\linewidth]
{myfile.eps}
\end{verbatim}
}
\subsection{Color}
Please refer to the author guidelines on the ICCV 2017 web page for a discussion
of the use of color in your document.
\section{Final copy}
You must include your signed IEEE copyright release form when you submit
your finished paper. We MUST have this form before your paper can be
published in the proceedings.
Please direct any questions to the production editor in charge of these
proceedings at the IEEE Computer Society Press: Phone (714) 821-8380, or
Fax (714) 761-1784.
{\small
\bibliographystyle{ieee}
| {'timestamp': '2018-03-02T02:07:47', 'yymm': '1803', 'arxiv_id': '1803.00260', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00260'} | arxiv |
\section{Conclusions and Future Work}
In this paper, we have extended and applied the Regularization by Denoising (RED) framework to the problem of PR.
Our new algorithm, prDeep, is exceptionally robust to noise thanks to the use of the DnCNN image denoising neural network.
As we demonstrated in our experiments, prDeep is also able to handle a wide range of measurement matrices, from intensity-only coded diffraction patterns to Fourier measurements.
By integrating a neural network into a traditional optimization algorithm, prDeep inherits the strengths of both optimization and deep-learning. Like other optimization-based algorithms, prDeep is flexible and can be applied to PR problems with different measurement models, noise levels, etc., without having to undergo costly retraining. Like other deep-learning-based techniques, for any given problem prDeep can take advantage of powerful learned priors and outperform traditional, hand-designed methods.
prDeep is not a purely academic PR algorithm; it can handle Fourier measurements of real-valued signals, a measurement model that plays a key role in many imaging applications. However, prDeep does have a major limitation; it is presently restricted to amplitude-only targets.
Extending prDeep to handle complex-valued targets is a promising and important direction for future research.
\section{Introduction}
The PR problem manifests when one wants to recover the input from only the amplitude, or intensity, of the output of a linear system. Mathematically, PR refers to the problem of recovering a vectorized signal $x \in \mathbb{R}^n~\text{or}~\mathbb{C}^n$ from measurements $y$ of the form
\begin{align}
y=|\mathbf{A}x|+w,
\end{align}
where the measurement matrix $\mathbf{A}$ represents the forward operator of the system and $w$ represents noise.
PR shows up in many imaging applications including microscopy \cite{zheng2013wide}, crystallography \cite{millane1990phase}, astronomical imaging \cite{fienup1987phase}, and inverse scattering \cite{katz2014non, MetzlerICCP}, to name just a few.
PR algorithms were first developed in the early 1970s and have been continuously studied by the optics community since then \cite{gerchberg1972practical,fienup1978reconstruction, HIO, griffin1984signal,ERHIO, OSS}.
More recently, PR has been taken up by the optimization community. This has produced a number of algorithms with theoretical, if not always practical, benefits \cite{candes2013phaselift,candes2015phase,goldstein2016phasemax,bahmani2017phase}. For a benchmark study of over a dozen popular PR algorithms, see PhasePack \cite{chandra2017phasepack}.
Following the popularity of compressive sensing, numerous algorithms were developed that use prior information, oftentimes sparsity, to improve PR reconstructions and potentially enable {\em compressive} PR \cite{moravec2007compressive, prGAMP}. In general, these methods do not improve reconstructions when the signal of interest is dense.
In the last few years, three methods, SPAR \cite{SPAR1,SPAR2}, BM3D-prGAMP \cite{bm3dprgamp}, and Plug-and-Play ADMM \cite{P&PADMM,Proximal}, have been developed to solve the PR problem using natural-image priors, which make their reconstructions more robust to noise. These methods all apply a natural-image prior via the BM3D image-denoising algorithm \cite{BM3D}.
Unfortunately, two of these three methods, SPAR and BM3D-prGAMP, are restricted to i.i.d Gaussian or coded diffraction measurements \cite{candesCodedDiffraction}, which prevents their use in many practical applications.
All three methods are computationally demanding.
In this work, we make two technical contributions. First, we show how the Regularization by Denoising (RED) \cite{RED} framework can be adapted to solve the PR problem. We call this adaption prRED. Because it sets up a general optimization problem, rather than using a specific algorithm, prRED is flexible and can handle a wide variety of measurements including, critically, Fourier measurements.
Second, we show how prRED can utilize convolutional neural networks by incorporating the DnCNN neural network \cite{DnCNN}. We call this combination of RED and DnCNN applied to PR prDeep.
prDeep offers excellent performance with reasonable run times. In Section \ref{sec:Results}, we apply prDeep to simulated data and show that it compares favorably to existing algorithms with respect to computation time and robustness to noise.
\subsection*{Acknowledgements}
Phil Schniter was supported by NSF grants CCF-1527162 and CCF-1716388.
Richard Baraniuk, Ashok Veeraraghavan, and Chris Metzler were supported by the DOD Vannevar Bush Faculty Fellowship N00014-18-1-2047, NSF Career– IIS-1652633, and the NSF GRF program, respectively.
They were also supported by NSF grant CCF-1527501, ARO grant W911NF-15-1-0316, AFOSR grant FA9550-14-1-0088, ONR grant N00014-17-1-2551, DARPA REVEAL grant HR0011-16-C-0028, ARO grant Supp-W911NF-12-1-0407, and an ONR BRC grant for Randomized Numerical Linear Algebra.
\FloatBarrier
\section{Phase Retrieval}
GS
HIO
...
Cite Tom's paper to show that few algorithms are significantly better than HIO.
D-prGAMP
prVAMP
RED-DnCNN
Ashok said writing up RED phase retrieval here is worth doing.
\section{Ptychography}
Need algorithms that work with overlapping Fourier measurements. In most contexts, accuracy is of primary concern.
\section{PR via Regularization by Denoising}
In this section we first show how the Regularization by Denoising (RED) \cite{RED} framework can be adapted to solve the PR problem. We call this adaption prRED. Later, we combine prRED with the state-of-the-art DnCNN neural network \cite{DnCNN} to form prDeep.
\subsection{RED}\label{ssec:RED}
RED is an algorithmic approach to solving imaging inverse-problems that was recently proposed by Romano, Elad, and Milanfar.
Like many of the plug-and-play techniques described in Section \ref{ssec:pandp}, RED can incorporate an arbitrary denoiser to regularize an arbitrary imaging inverse-problem. However, whereas the other methods use a denoiser to minimize some {\em implicit} cost function, RED uses a denoiser to setup and then minimize an {\em explicit} cost function.
In particular, the RED framework defines the regularizer as
\begin{align}\label{eqn:REDreg}
R(x)=\frac{\lambda}{2} x^T(x-D(x)),
\end{align}
where $D(x)$ is an arbitrary denoiser. Note that this regularizer serves two roles. First, it penalizes the residual difference between $x$ and its denoised self; when $x-D(x)$ is large, $R(x)$ will tend to be large. Second, it penalizes correlations between $x$ and the residual. This serves to prevent $D(x)$ from removing structure from $x$; if $D(x)$ removes structure from $x$, then this structure will show up in the residual, which will be correlated with $x$. In effect, the RED regularizer encourages the residual to look like additive white Gaussian noise \cite{RED}.
When $D(x)$ satisfies homogeniety and passivity conditions (see Section 3.1 of \cite{RED}) the proximal mapping of the RED regularization \eqref{eqn:REDreg} can be implemented recursively as follows\footnote{As these properties do not hold exactly in practice, \eqref{eqn:REDprox} should be considered only an approximation.}
\begin{align}\label{eqn:REDprox}
\text{prox}_R(z)&=\arg\min_x \frac{1}{2}\|x-z\|^2_2+\frac{\lambda}{2} x^T(x-D(x))\nonumber\\
&= v_\infty,\nonumber
\end{align}
where $v_j=\frac{1}{1+\lambda}(v_{j-1}+\lambda D(v_{j-1}))~\forall j>0$ and $v_0=z$.
In practice, the iterations must be terminated after a finite number $j$.
However, experiments suggest that $j=1$, which corresponds to calling the denoiser only once per use of the proximal mapping function, leads to good performance.
\subsection{prRED}
To apply RED to PR, we construct a cost function of the form
\begin{align}
f(x)+R(x),
\end{align}
where $R(x)$ is the RED regularization from \eqref{eqn:REDreg} and $f(x)$ is a
data-fidelity term that encourages $\mathbf{A}x$ to match the phaseless measurements $y$.
From a Bayesian perspective, the data-fidelity term $f(x)$ should be proportional to the negative log-likelihood function. For instance, if $y^2=|\mathbf{A}x|^2+w$ with $w\sim CN(0,\sigma_w^2\mathbf{I})$, then the negative log-likelihood function would be $-\log p(y|x)\propto \|y^2-|\mathbf{A}x|^2\|^2$.
The Bayesian perspective suggests that, when dealing with Poisson noise, which is the focus in this paper, one should use the Poisson log-likelihood function.
Interestingly, we experimented with the Poisson log-likelihood function as derived in \cite{TWF} and found that it performed slightly worse than the amplitude loss function $f(x)=\frac{1}{2}\|y-|\mathbf{A}x|\|^2_2$. This surprising behavior was also noted in \cite{PtychRobustness}.
In any case, a variety of data-fidelity terms can be used to solve the PR problem.
We adopt the amplitude loss $\frac{1}{2}\|y-|\mathbf{A}x|\|^2_2$, which leads us to the non-convex optimization problem
\begin{align}\label{eqn:prREDcost}
\arg\min_x\frac{1}{2}\|y-|\mathbf{A}x|\|^2_2+\lambda x^T(x-D(x)).
\end{align}
Although various solvers could be used to attack \eqref{eqn:prREDcost}, we use the FASTA solver \cite{FASTA}. FASTA implements the forward-backward splitting algorithm (a.k.a.~the proximal gradient method) and incorporates adaptive step sizes for acceleration. FASTA is very simple to use; after defining the loss function, one need only provide the solver with a proximal mapping for the regularization term \eqref{eqn:REDprox} and a (sub)gradient for the data-fidelity term with respect to $z$ (for $z\triangleq\mathbf{A}x$). For our adopted data-fidelity term, a useful subgradient is
\begin{align}\label{eqn:subGrad}
z-y\circ \frac{z}{|z|} \in \partial_z \frac{1}{2}\|y-|z|\|^2_2,
\end{align}
where $\circ$ denotes the Hadamard (i.e., elementwise) product and $\partial_zf(z)$ denotes the subdifferential of $f$ with respect to $z$.
In practice, the FASTA solver converges very quickly. As an example, Figure \ref{fig:Cost} shows a typical cost \eqref{eqn:prREDcost} per iteration trajectory for the FASTA solver. There it can be seen that the cost drops monotonically and converges after about 200 iterations.
\begin{figure}[t]
\centering
\includegraphics[width=.4\textwidth]{figs/prREDCost.png}
\caption{The cost \eqref{eqn:prREDcost} over the number of FASTA iterations. The cost decreases monotonically.}
\label{fig:Cost}
\end{figure}
\subsection{prDeep}
\begin{figure}[t]
\centering
\includegraphics[width=.45\textwidth]{figs/DnCNN2.png}
\caption{Network architecture of the DnCNN denoiser. Note that it takes advantage of residual learning.}
\label{fig:DnCNN}
\end{figure}
The prRED framework can incorporate nearly any denoising algorithm. We call the special case of prRED with the DnCNN denoiser ``prDeep''.
DnCNN \cite{DnCNN} is a state-of-the-art denoiser for removing additive white Gaussian noise from natural images. DnCNN consists of 16 to 20 convolutional layers of size $3\times3$ (we used 20). Sandwiched between these layers are ReLU \cite{Relu} and batch-normalization \cite{batchnorm} operations. DnCNN is trained using residual learning \cite{residuallearning}.
In practice, DnCNN noticeably outperforms the popular BM3D algorithm. Moreover, thanks to parallelization and GPU computing, it runs hundreds of times faster than BM3D.
We trained four DnCNN networks at different noise levels. To train, we loosely followed the procedure outlined in \cite{DnCNN}. In particular, we trained with 300\,000 overlapping patches drawn from $400$ images in the Berkeley Segmentation Dataset \cite{BSDDataset}. For each image patch, we added additive white Gaussian noise with a standard deviation of either $60$, $40$, $20$, or $10$. where our images had a dynamic range of $[0,255]$. We then setup DnCNN to recover the noise-free image.
We used the mean-squared error between the noise-free ground truth image and our denoised reconstructions as the cost function. We trained the network with stochastic gradient descent and the ADAM optimizer \cite{ADAMopt} with a batch size of 256. Our training rate was $0.001$, which we dropped to $0.0001$ and then $0.00001$ when the validation error stopped improving. Training took just over 3 hours per noise level on an Nvidia Pascal Titan X.
\section{Related Work}
Our work fits into the recent trend of using advanced signal priors to solve inverse problems in imaging. While priors like sparsity, smoothness, and structured sparsity have been studied for some time, we focus here on plug-and-play priors and deep-learning priors, which together represent the state-of-the-art for a range of imaging recovery tasks.
\subsection{Plug-and-Play Regularization for Linear Inverse Problems}\label{ssec:pandp}
Image denoising is arguably the most fundamental problem in image processing and, as such, it has been studied extensively. Today there exist hundreds of denoising algorithms that model and exploit the complex structure of natural images in order to remove additive noise.
Earlier this decade, researchers realized they could leverage these highly developed denoising algorithms to act as regularizers in order to solve other linear inverse-problems, such as deblurring, superresolution, and compressed sensing \cite{BM3DasReg}.
This technique was eventually coined {\em plug-and-play} regularization \cite{P&PADMM}, with the idea being that one could ``plug in'' a denoiser to impose a specific prior on the inverse problem. A number of techniques have been developed that use this idea to solve various linear inverse problems \cite{BM3DasReg,P&PADMM,FlexISP,Proximal, DAMP,DVAMP,RED}.
Most of these works implicitly assume that the denoiser is a proximal mapping for some cost function $R(x)$, i.e.,
\begin{align}
D(z)=\text{prox}_R(z)\triangleq\arg\min_x\frac{1}{2}\|z-x\|^2_2+R(x),
\end{align}
where $R(x)$ penalizes image hypotheses that are unnatural. From the maximum a posteriori (MAP) Bayesian perspective, $R(x)$ is the negative log-prior for the natural-image $x$, and $z$ is a Gaussian-noise corrupted measurement of $x$.
With this interpretation, a variety of algorithms, such as (Plug-and-Play) ADMM \cite{P&PADMM,FlexISP,Proximal} or (Denoising-based) AMP \cite{DAMP,DVAMP}, can be used to recover $x$ from the linear measurements $y$ by solving the optimization problem
\begin{align}
\arg\min_x\frac{1}{2}\|y-\mathbf{A}x\|^2_2+ R(x),
\end{align}
where again $R(x)$ is an implicit cost function associated with the denoiser.
Because the priors associated with advanced denoisers like BM3D accurately model the distribution of natural images, these methods have offered state-of-the-art recovery accuracy in many of the tasks to which they have been applied.
\subsection{Plug-and-Play Regularization for PR}\label{ssec:P&PforPR}
Following their success on linear inverse problems, plug-and-play priors were applied to the PR problem as well. We are aware of three prior works that take this approach.
The first, SPAR \cite{SPAR1, SPAR2}, uses alternating minimization to compute the MAP estimate of $x$ by using BM3D and a Poisson noise model; $y^2=\text{Poisson}(|z|^2)$, with $z\triangleq\mathbf{A}x$.
So far, the algorithm has only been succesfully applied to coded-diffraction pattern measurements.
The second, BM3D-prGAMP \cite{bm3dprgamp}, uses the generalized approximate message passing (AMP) framework \cite{AMP,GAMP,prGAMP,DAMP} to compute the minimum mean squared error (MMSE) estimate of $x$ using BM3D and a Rician channel model: $y=|z+w|$ with $w\sim CN(0,\sigma_w^2)$.
It requires the elements of $\mathbf{A}$ to be nearly i.i.d.~Gaussian, which can be approximated using coded-diffraction-pattern measurements.
Most recently, the authors of ProxIma
\cite{Proximal} used Plug-and-Play ADMM to estimate $x$ by solving the optimization problem
\begin{align}
\arg\min_x\frac{1}{2}\|y-|\mathbf{A}x|\|^2_2+R(x),
\end{align}
where $R(x)$ is the cost function implicitly minimized by BM3D.
Unlike the aforementioned methods, ADMM supports generic measurement matrices, including Fourier measurements.
\subsection{Neural Networks for Linear Inverse Problems}
Deep learning has recently disrupted computational imaging.
Through the use of elaborate learned priors, deep learning methods have competed with and sometimes surpassed the performance of plug-and-play priors, while running significantly faster (when implemented on a GPU). Two prominent examples include SRCNN for superresolution \cite{SRCNN} and DnCNN for denoising, superresolution, and the removal of JPEG artifacts \cite{DnCNN}.
In addition, a few works have blended plug-and-play algorithms with neural networks \cite{OneNet, LDAMP, diamond2017unrolled}, often using algorithm unfolding/unrolling \cite{LISTA}. In doing so, these works are able to incorporate powerful learned priors, while still leveraging the flexibility and interpretability that comes from using a well-defined algorithm (as opposed to a black-box neural net).
\subsection{Neural Networks for PR}
In the last few years, researchers have raced to apply deep learning to solve the PR problem \cite{PtychNet, KaushikPR, rivenson2017phase}. So far, each of the proposed methods has been designed for a specific PR application, either Ptychography \cite{PtychNet, KaushikPR} or Holography \cite{rivenson2017phase}. The Ptychography neural networks learn to combine a stack of low-resolution band-pass-filtered images to form a high resolution image. The holographic neural network learns how to remove the twin image component \cite{goodman2005introduction} from a hologram. Because each of these networks learns an application-specific mapping, they do not generalize to new PR problems. In fact, even changing the resolution or noise level requires completely retraining these neural networks.
Our work takes a different tack. Rather than setting up a neural network to solve a specific PR problem, we use a neural network as a regularizer within an optimization framework. This technique makes our network applicable to numerous PR problems
\section{Experimental Results}\label{sec:Results}
In this section we compare prDeep to several other PR algorithms on simulated data with varying amounts of Poisson noise. We test the algorithms with both coded diffraction pattern (CDP) and Fourier measurements. In both sets of tests, we sample and reconstruct 6 ``natural'' and 6 ``unnatural'' (real and nonnegative) test images, which are presented in Figures \ref{fig:NatTestImages} and \ref{fig:UnnatTestImages}.
\begin{figure}[t]
\centering
\subfigure[Barbara]{\includegraphics[width=.14\textwidth]{figs/barbara.png}}
\subfigure[Boat]{\includegraphics[width=.14\textwidth]{figs/boat.png}}
\subfigure[Couple]{\includegraphics[width=.14\textwidth]{figs/couple.png}}
\subfigure[Peppers]{\includegraphics[width=.14\textwidth]{figs/peppers.png}}
\subfigure[Cameraman]{\includegraphics[width=.14\textwidth]{figs/cameraman.png}}
\subfigure[Bridge]{\includegraphics[width=.14\textwidth]{figs/streamandbridge.png}}
\caption{The six ``natural'' test images. They follow a distribution very similar to the training data.}
\label{fig:NatTestImages}
\end{figure}
\begin{figure}[t]
\centering
\subfigure[E.~Coli]{\includegraphics[width=.14\textwidth]{figs/Ecoli.png}}
\subfigure[Yeast]{\includegraphics[width=.14\textwidth]{figs/Yeast.png}}
\subfigure[Pollen]{\includegraphics[width=.14\textwidth]{figs/Pollen.png}}
\subfigure[Tadpole Galaxy]{\includegraphics[width=.14\textwidth]{figs/TadpoleGalaxy.png}}
\subfigure[Pillars of Creation]{\includegraphics[width=.14\textwidth]{figs/PillarsofCreationSquareGray.png}}
\subfigure[Butterfly Nebula]{\includegraphics[width=.14\textwidth]{figs/Butterfly.png}}
\caption{The six ``unnatural'' test images. They follow a distribution distinct from the training data. Images are from Wikipedia and follow public domain licenses.}
\label{fig:UnnatTestImages}
\end{figure}
\subsection{Experimental Setup}
\paragraph{Competing Algorithms.}
We compare prDeep against Hybrid Input-Output (HIO) \cite{HIO}, Oversampling Smoothness (OSS) \cite{OSS}, Wirtinger Flow (WF) \cite{candes2015phase}, DOLPHIn \cite{dolphin}, SPAR \cite{SPAR1,SPAR2}, and BM3D-prGAMP \cite{bm3dprgamp}. We also compare with Plug-and-Play ADMM \cite{P&PADMM,Proximal} using both the BM3D and DnCNN denoisers.
HIO and WF are baseline algorithms designed for Fourier and CDP measurements, respectively.
OSS is an alternating projection algorithm designed for noisy Fourier measurements. It imposes a smoothness constraint to regions outside of the target's support.
DOLPHIn is an iterative PR algorithm designed to reconstruct images from noisy CDP measurements. It imposes a sparsity constraint with respect to a learned dictionary.
SPAR, BM3D-prGAMP, and Plug-and-Play ADMM were described in Section \ref{ssec:P&PforPR}
\begin{table*}[t]
\centering
\caption{PSNRs and run times (sec) of $128\times128$ reconstructions with four intensity-only CDP measurements and varying amounts of Poisson noise.}
\begin{tabular}{lrrrrrrrrr}
\toprule
& \multicolumn{3}{c}{$\alpha=9$} & \multicolumn{3}{c}{$\alpha=27$} & \multicolumn{3}{c}{$\alpha=81$} \\
\cmidrule{2-10}
& \multicolumn{1}{l}{\makecell{PSNR\\Natural}} & \multicolumn{1}{l}{\makecell{PSNR\\Unnatural}} & \multicolumn{1}{l}{Time} & \multicolumn{1}{l}{\makecell{PSNR\\Natural}} & \multicolumn{1}{l}{\makecell{PSNR\\Unnatural}} & \multicolumn{1}{l}{Time} & \multicolumn{1}{l}{\makecell{PSNR\\Natural}} & \multicolumn{1}{l}{\makecell{PSNR\\Unnatural}} & \multicolumn{1}{l}{Time} \\
\midrule
HIO & 36.1 & 36.0 & 4.2 & 26.1 & 26.0 & 5.9 & 14.8 & 16.9 & 5.9 \\
WF & 34.3 & 34.2 & 0.8 & 24.7 & 24.0 & 0.9 & 13.2 & 13.0 & 6.7 \\
DOLPHIn & 31.0 & 28.8 & 1.1 & 27.9 & 26.9 & 1.1 & 17.9 & 20.8 & 1.1 \\
SPAR & 34.4 & 36.0 & 15.7 & 29.4 & 31.1 & 15.7 & \textbf{24.5} & 26.4 & 15.7 \\
BM3D-prGAMP & 34.1 & 35.4 & 17.2 & 31.4 & 32.2 & 17.7 & 22.5 & 22.3 & 23.1 \\
BM3D-ADMM & 38.5 & 39.0 & 51.6 & 31.9 & 33.4 & 40.0 & 24.4 & \textbf{26.9} & 37.7 \\
DnCNN-ADMM & \textbf{39.9} & \textbf{40.6} & 17.1 & 32.6 & 33.4 & 9.8 & 21.6 & 22.7 & 7.9 \\
prDeep & 39.1 & 40.1 & 25.4 & \textbf{32.8} & \textbf{34.0} & 23.2 & 20.9 & 24.5 & 23.1 \\
\bottomrule
\end{tabular}%
\label{tab:diffraction}%
\end{table*}%
\begin{table*}[t]
\centering
\caption{PSNRs and run times (sec) of $128\times128$ reconstructions with $4\times$ over-sampled intensity-only Fourier measurements and varying amounts of Poisson noise. }
\begin{tabular}{lrrrrrrrrr}
\toprule
& \multicolumn{3}{c}{$\alpha=2$} & \multicolumn{3}{c}{$\alpha=3$} & \multicolumn{3}{c}{$\alpha=4$} \\
\cmidrule{2-10}
& \multicolumn{1}{l}{\makecell{PSNR\\Natural}} & \multicolumn{1}{l}{\makecell{PSNR\\Unnatural}} & \multicolumn{1}{l}{Time} & \multicolumn{1}{l}{\makecell{PSNR\\Natural}} & \multicolumn{1}{l}{\makecell{PSNR\\Unnatural}} & \multicolumn{1}{l}{Time} & \multicolumn{1}{l}{\makecell{PSNR\\Natural}} & \multicolumn{1}{l}{\makecell{PSNR\\Unnatural}} & \multicolumn{1}{l}{Time} \\
\midrule
HIO & 22.2 & 20.8 & 10.6 & 19.9 & 17.9 & 10.4 & 17.9 & 15.5 & 10.7 \\
WF & 15.2 & 18.8 & 6.7 & 15.1 & 18.5 & 6.6 & 15.2 & 18.5 & 6.7 \\
OSS & 18.6 & 23.8 & 18.3 & 18.4 & 23.1 & 18.6 & 18.6 & 22.7 & 18.1 \\
SPAR & 22.0 & 23.9 & 79.1 & 19.6 & 22.6 & 77.0 & 19.4 & 20.5 & 83.0 \\
BM3D-prGAMP & 24.5 & 26.0 & 84.3 & 23.2 & 24.4 & 82.8 & 21.0 & 22.7 & 84.4 \\
BM3D-ADMM & 27.5 & 28.3 & 155.7 & 24.5 & 25.0 & 156.8 & 21.8 & 23.1 & 156.8 \\
DnCNN-ADMM & \textbf{29.3} & \textbf{31.3} & 65.0 & 26.0 & 25.8 & 62.4 & 22.0 & 23.4 & 64.0 \\
prDeep & 28.4 & 30.6 & 105.1 & \textbf{28.5} & \textbf{26.4} & 105.0 & \textbf{26.4} & \textbf{25.1} & 107.1 \\
\bottomrule
\end{tabular}%
\label{tab:Fourier}%
\end{table*}%
\paragraph{Implementation.} All algorithms were tested using Matlab 2017a on a desktop PC with an Intel 6800K CPU and an Nvidia Pascal Titan X GPU. Dolphin, SPAR, and BM3D-prGAMP used their respective authors' implementations. We created our own version of Plug and Play ADMM based off of code original developed in \cite{chan2017plug}.
We use FASTA to solve the nonlinear least squares problem at each iteration of the algorithm.
prDeep and DnCNN-ADMM used a MatConvNet \cite{vedaldi15matconvnet} implementation of DnCNN. A public implementations of prDeep is available at \url{https://github.com/ricedsp/prDeep}.
\paragraph{Measurement and Noise Model.}
Model mismatch and Poisson shot noise are the dominant sources of noise in many PR applications \cite{PtychRobustness}.
In this paper, we focus on shot noise, which we approximate as
\begin{align}
y^2=|z|^2+w\text{ with }w\sim N(0,\alpha^2 \text{Diag}(|z|^2)),\nonumber
\end{align}
where $z=\mathbf{A}x$ with known $\mathbf{A}$, and where $\text{Diag}(|z|^2)$ is a diagonal matrix with diagonal elements $|z|^2$.
Some algebra and the central limit theorem can be used to show that $y^2/\alpha^2\sim \text{Poisson}((|z|/\alpha)^2)$. In effect, $y^2$ is a rescaled Poisson random variable. The term $\alpha$ controls the variance of the random variable and thus the effective signal-to-noise ratio in our problem.
\paragraph{Parameter Tuning.}
HIO was run for $1000$ iterations.
WF was run for $2000$ iterations.
BM3D-prGAMP was run for $50$ iterations.
prDeep was run for $200$ iterations four times; once for each of the denoisers networks (trained at standard deviations $60$, $40$, $20$, and $10$). The result from reconstructing with the first denoiser was used to warm-start reconstructing with the second, the second warm-started the third, etc.
Plug and Play ADMM was similarly run for $50$ iterations four times. ADMM converged faster than prDeep and did not benefit from additional iterations.
SPAR reconstructed $x$ using $y^2/\alpha^2$ rather than $y$, as its loss function expects Poisson distributed random variables.
prDeep's parameter $\lambda$, which determines the amount of regularization, was set to $\bar{\sigma}_w$ when dealing with Fourier measurements and $0.1\bar{\sigma}_w$ when dealing with CDP measurements, where $\bar{\sigma}_w^2$ denotes the sample variance of the noise.
The parameter in ADMM analogues to $\lambda$ was set to $.2\bar{\sigma}_w$ when dealing with Fourier measurements and $0.02\bar{\sigma}_w$ when dealing with CDP measurements.
The algorithms otherwise used their default parameters.
\paragraph{Initialization.}
With oversampled CDP measurements of real-valued signals, none of the algorithms were particularly sensitive to initialization; initializing with a vector of ones worked sufficiently well.
In contrast, with Fourier measurements, the algorithms were very sensitive to initialization. We experimented with various spectral initializers, but found they were ineffective with (noisy and only $4\times$ oversampled) Fourier measurements. Instead, we first ran the HIO algorithm (for $50$ iterations) $50$ times, from random initializations, to form 50 estimates of the signal: $\widehat{x}_1$, $\widehat{x}_2$, ... $\widehat{x}_{50}$. We then used the reconstruction $\widehat{x}_i$ with the lowest residual ($\|y-|\mathbf{A}\widehat{x}_i|\|_2$) as an initialization for HIO. HIO was then run for $1000$ iterations, and the result was used to initialize the other algorithms. This process was repeated three times and the reconstruction with the smallest residual was used as the final estimate. The reported computation times (for Fourier measurements) include the time required to initialize the algorithms and run them three times
\subsection{Simulated Coded Diffraction Measurements}
\begin{figure*}[t]
\centering
\subfigure[HIO (21 sec)]{\includegraphics[width=.22\textwidth]{figs/coded_diffractionalpha81HIO_recon.png}}
\subfigure[WF (24 sec)]{\includegraphics[width=.22\textwidth]{figs/coded_diffractionalpha81WF_recon.png}}
\subfigure[DOLPHIn (3 sec)]{\includegraphics[width=.22\textwidth]{figs/coded_diffractionalpha81DOLPHIN_recon.png}}
\subfigure[SPAR (58 sec)]{\includegraphics[width=.22\textwidth]{figs/coded_diffractionalpha81SPAR_recon.png}}
\subfigure[BM3D-prGAMP (91 sec)]{\includegraphics[width=.22\textwidth]{figs/BM3DprGAMPDiffractionAlpha80.png}}
\subfigure[BM3D-ADMM (153 sec)]{\includegraphics[width=.22\textwidth]{figs/CDPalpha81BM3DADMM_recon_time153_PSNR26.png}}
\subfigure[DnCNN-ADMM (25 sec)]{\includegraphics[width=.22\textwidth]{figs/CDPalpha81DnCNNADMM_recon_time25_im0_PSNR24.png}}
\subfigure[prDeep (72 sec)]{\includegraphics[width=.22\textwidth]{figs/coded_diffractionalpha81prDeep_recon.png}}
\caption{Reconstructions of $256\times 256$ image from four noisy intensity-only CDP measurements ($\alpha=81$) with several PR algorithms. All five plug-and-play methods provide similar reconstructions.}
\label{fig:CDI_visual}
\end{figure*}
We first test the algorithms with CDP intensity-only measurements.
CDP is a measurement model proposed in \cite{candesCodedDiffraction} that uses a spatial light modulator (SLM) to spread a target's frequency information and make it easier to reconstruct.
Under a CDP measurement model, the target is illuminated by a coherent source and then has its phase immediately modulated by a known random pattern using an SLM. The complex field then undergoes far-field Fraunhofer diffraction, which can be modeled by a 2D Fourier transform, before its intensity is recorded by a standard camera. Multiple measurements, with different random SLM patterns, are recorded. In this work, we model the capture of four measurements using a phase-only SLM. Mathematically, our measurement operator is as follows
\begin{align}
\mathbf{A}=\left[
\begin{array}{ll}
\mathbf{F}\mathbf{D_1}\\
\mathbf{F}\mathbf{D_2}\\
\mathbf{F}\mathbf{D_3}\\
\mathbf{F}\mathbf{D_4}
\end{array}
\right],
\end{align}
where $\mathbf{F}$ represents the 2D Fourier transform and $\mathbf{D}_1$, $\mathbf{D}_2$, ... are diagonal matrices with nonzero elements drawn uniformly from the unit circle in the complex plane.
In Table \ref{tab:diffraction} we compare the performance of the various PR algorithms.
We do not include a comparison with OSS as it is setup specifically for Fourier measurements.
We report recovery accuracy in terms of mean peak-signal-to-noise ratio (PSNR) across two sets of test images.\footnotetext{${\rm PSNR} = 10 \log_{10}(\frac{255^2}{{\rm mean}((\hat{x}-x_o)^2)})$ when the pixel range is 0 to 255.}
We report run time in seconds.
Table \ref{tab:diffraction} demonstrates that, when dealing with CDP measurements at low SNRs (large $\alpha$), all five plug-and-play methods produce similar reconstructions
In Figure \ref{fig:CDI_visual}, we visually compare the reconstructions of a $256\times256$ image using the algorithms under test. With CDP measurements, all of the plug-and-play algorithms do a good job reconstructing the signal from noisy measurements
\subsection{Simulated Fourier Measurements}
\begin{figure*}[t]
\centering
\subfigure[HIO (40 sec)]{\includegraphics[width=.22\textwidth]{figs/fourieralpha3HIO_recon.png}}
\subfigure[WF (63 sec)]{\includegraphics[width=.22\textwidth]{figs/fourieralpha3WF_recon.png}}
\subfigure[OSS (65 sec)]{\includegraphics[width=.22\textwidth]{figs/fourieralpha3OSS_recon.png}}
\subfigure[SPAR (294 sec)]{\includegraphics[width=.22\textwidth]{figs/fourieralpha3SPAR_recon.png}}
\subfigure[BM3D-prGAMP (306 sec)]{\includegraphics[width=.22\textwidth]{figs/fourieralpha3BM3DprGAMP_recon.png}}
\subfigure[BM3D-ADMM (576 sec)]{\includegraphics[width=.22\textwidth]{figs/fourieralpha3BM3DADMM_recon_time152_PSNR26p8.png}}
\subfigure[DnCNN-ADMM (426 sec)]{\includegraphics[width=.22\textwidth]{figs/fourieralpha3DnCNNADMM_recon_time31_PSNR27.png}}
\subfigure[prDeep (345 sec)]{\includegraphics[width=.22\textwidth]{figs/fourieralpha3prDeep_recon_time75_PSNR30.png}}
\caption{Reconstructions of $256\times 256$ image from noisy $4\times$ oversampled intensity-only Fourier measurements ($\alpha=3$) with several PR algorithms. Plug and Play ADMM and prDeep provide the best reconstructions.}
\label{fig:Fourier_visual}
\end{figure*}
Fourier measurements of real-valued signals are prevalent in many real-world applications.
Many PR applications exploit the Fourier-transform property $\mathbf{F}(x\star x)=|\mathbf{F}x|^2$, where $\star$ denotes correlation. This implies that in applications where one can measure or estimate the autocorrelation function of an object one can also measure the modulus squared of its Fourier transform. This allows PR algorithms to reconstruct the object.
This relationship has been used in multiple contexts. In astronomical imaging, this relationship has been used to image through turbulent atmosphere \cite{fienup1987phase}. In laser-illuminated imaging, this relationship has been used to reconstruct diffuse objects without speckle noise \cite{correlography}. More recently, this relationship has been used to image through random scattering media, such as biological tissue \cite{katz2014non}. In all of these applications, one reconstructs the { real-valued} intensity distribution of the object.
In these tests we oversampled the spectrum by $4\times$. That is, we first placed $128\times128$ images at the center of a $256\times256$ square and then took the 2D Fourier transform. We assumed that the support, i.e.,~the location of the image within the $256\times256$ grid, was known a priori.
Table \ref{tab:Fourier} compares the reconstruction accuracies and recovery times of several PR algorithms.\footnote{Our results account for the translation and reflection ambiguities associated with Fourier measurements}
We do not include results for DOLPHIn, as it completely failed with Fourier measurements.
Note that, at a given noise level, the reconstructions from Fourier measurements are far less accurate than their CDP counterpart. Table \ref{tab:Fourier} demonstrates that with Fourier measurements and large amounts of noise prDeep is superior to existing PR algorithms
In Figure \ref{fig:Fourier_visual}, we again visually compare the reconstructions from the algorithms under test, this time with Fourier measurements. In this regime prDeep produces fewer artifacts than competing methods.
\section{Coherent Inverse Scattering}
Need fast algorithms that work with $\{0,1\}$ measurements.
\section{Training and Initialization} | {'timestamp': '2018-07-03T02:00:34', 'yymm': '1803', 'arxiv_id': '1803.00212', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00212'} | arxiv |
\section{Proofs for Section~\ref{sec:exact_sub}}\label{app:exact_sub}
\begin{proof}[Proof of Theorem~\ref{thm:bad_sdp}]
We first show that the SDP admits exactly one feasible point. Indeed, let $X \succeq 0$ be feasible for the SDP. Then, constraints $n$ and $n+1$ imply $\ip{A_{n+1} - A_{n}}{X} = 0$. That is, the trace of the principal submatrix of size $n-1$ of $X$ is zero. Since this submatrix is also positive semidefinite, it is zero. Constraints 1 to $n-1$ further show that all entries but $X_{nn}$ are zero. Finally, constraints $n$ and ${n+1}$ force $X_{nn} = \frac{5(n-1)}{3}$. This $X$ has rank~1 and is necessarily optimal.
We now show that the proposed $\bar U$ is suboptimal for $L$. To this end, build $\tilde U \in \mathbb{R}^{n\times k}$ with the last row having squared 2-norm equal to $\frac{5(n-1)}{3}$, and all other rows are zero. Clearly, $\tilde U\tilde U^T$ is feasible for the SDP, so that $L(\tilde U) = 0$: this is optimal. On the other hand, $L(\bar U) = \frac{5}{18}(n-1)^2\epsilon^2 > L(\tilde U)$.
Finally, we check stationarity of $\bar U$. Let $\mathcal{A} \colon \Sym{n\times n} \to \mathbb{R}^m$ be the linear operator such that $\mathcal{A}(X)_i = \ip{A_i}{X}$, and define the residue function $\mathbf{r}(U) = \mathcal{A}(UU^T) - b$. The cost function and its derivatives take the following forms:
\begin{align*}
L(U) & = \frac{1}{2} \|\mathbf{r}(U)\|_2^2, \\
\nabla L(U) & = 2\mathcal{A}^*(\mathbf{r}(U))U, \\
\nabla^2 L(U)[\dot U] & = 2\mathcal{A}^*(\mathbf{r}(U))\dot U + 2\mathcal{A}^*(\mathcal{A}(U\dot U^T + \dot U U^T))U.
\end{align*}
Simple computations show that $\mathcal{A}(\bar U \bar U^T) = (0, \ldots, 0, (n-1)\epsilon, 2(n-1)\epsilon)^T$, so that $\mathcal{A}^*(\mathbf{r}(\bar U)) = -\frac{n-1}{3} \epsilon^2 \cdot e_n^{} e_n^T$: only the bottom-right entry is non-zero. Consequently, $\nabla L(\bar U) = 0$: $\bar U$ is an FOSP To show second-order stationarity, we must also show that $\nabla^2 L(\bar U)$ is positive semidefinite.
That is, we must show the inequalities:
\begin{align*}
0 \leq \ip{\dot U}{\nabla^2 L(U)[\dot U]} & = 2\ip{\dot U \dot U^T}{\mathcal{A}^*(\mathbf{r}(U))} + \left\|\mathcal{A}(U \dot U^T + \dot U U^T)\right\|_2^2
\end{align*}
for all $\dot U \in \mathbb{R}^{n\times k}$. Let
\begin{align*}
\dot U & = \begin{bmatrix}
\textrm{---} &\dot u_1^T & \textrm{---} \\ & \vdots& \\ \textrm{---} &\dot u_n^T& \textrm{---}
\end{bmatrix}, \quad \textrm{ with } \quad \dot u_1, \ldots, \dot u_n \in \mathbb{R}^{k} \textrm{ arbitrary.}
\end{align*}
Then, $\mathcal{A}(\bar U\dot U^T + \dot U\bar U^T) = (2\dot u_n^T, q_1, q_2)^T$ for some values $q_1, q_2$, so that:
\begin{align*}
\ip{\dot U}{\nabla^2 L(\bar U)[\dot U]} & = -2\frac{n-1}{3} \epsilon^2 \|\dot u_n\|_2^2 + 4 \|\dot u_n\|_2^2 + q_1^2 + q_2^2 \geq \left(4-2\frac{n-1}{3} \epsilon^2 \right) \|\dot u_n\|_2^2.
\end{align*}
Under our condition on $\epsilon$, this is indeed always nonnegative: $\bar U$ is an SOSP.
\end{proof}
\section{Proofs for Section~\ref{sec:exact}}\label{app:exact}
\begin{proof}[Proof of Lemma~\ref{lem:global}]
Necessary and sufficient optimality conditions for~\eqref{eq:prob_fx} are: $\nabla f(X) \succeq 0$ and $\nabla f(X)X = 0$. Let $U$ be an SOSP for~\eqref{eq:prob_fx_U} with $\operatorname{rank}(U) < k$ and define $X = UU^T$. Then, $\nabla g(U) = 2\nabla f(UU^T)U = 0$ and $\nabla^2 g(U) \succeq 0$. The first statement readily shows that $\nabla f(X)X = 0$. The Hessians of $f$ and $g$ are related by
\begin{align*}
\frac{1}{2}\nabla^2 g(U)[\dot U] & = \nabla f(UU^T)\dot U + \nabla^2 f(UU^T)[U\dot U^T + \dot U U^T]U.
\end{align*}
Since $\operatorname{rank}(U) < k$, there exists a vector $z \in \mathbb{R}^{k}$ such that $Uz = 0$ and $\|z\|_2 = 1$. For any $x \in \mathbb{R}^{n}$, set $\dot U = xz^T$ so that $U\dot U^T + \dot U U^T = 0$. Using second-order stationarity of $U$, we find:
\begin{align*}
0 \leq \frac{1}{2}\ip{\dot U}{\nabla^2 g(U)[\dot U]} & = \ip{xz^T}{\nabla f(UU^T)xz^T} = x^T \nabla f(UU^T) x.
\end{align*}
This holds for all $x \in \mathbb{R}^{n}$, hence $\nabla f(UU^T) \succeq 0$ and $X = UU^T$ is optimal for~\eqref{eq:prob_fx}. Since~\eqref{eq:prob_fx} is a relaxation of~\eqref{eq:prob_fx_U}, it follows that $U$ is optimal for~\eqref{eq:prob_fx_U}.
\end{proof}
\begin{proof}[Proof of Lemma~\ref{lem:rank_deficient}]
Let $U$ be any FOSP of~\eqref{eq:penalty_factored} and consider the linear operator $\mathcal{A} \colon \Sym{n\times n} \to \mathbb{R}^{m}$ defined by $\mathcal{A}(X)_i = \ip{A_i}{X}$. By first-order stationarity, we have:
\begin{align*}
\nabla L_\mu(U) & = 2\left( C + 2\mu \mathcal{A}^*(\mathcal{A}(UU^T) - b) \right)U = 0.
\end{align*}
Hence, the nullity of $C + 2\mu \mathcal{A}^*(\mathcal{A}(UU^T) - b)$ (the dimension of its kernel) satisfies:
\begin{align}
\operatorname{rank}(U) \leq \operatorname{null}(C + 2\mu \mathcal{A}^*(\mathcal{A}(UU^T) - b)) \leq \max_{y \in \mathbb{R}^{m}} \operatorname{null}(C + \mathcal{A}^*(y)).
\label{eq:maxnulliny}
\end{align}
The maximum over $y$ is indeed attained since the function $\operatorname{null}$ takes integer values in $0, \ldots, n$. Say the maximum evaluates to $\ell$. Then, for some $y$, $M \triangleq C + \mathcal{A}^*(y)$ has nullity $\ell$. Hence,
\begin{align*}
C & = M - \mathcal{A}^*(y) \in \mathcal{N}_\ell + \operatorname{im} \mathcal{A}^*,
\end{align*}
where $\mathcal{N}_\ell$ is the manifold of symmetric matrices of size $n$ and nullity $\ell$, $\operatorname{im} \mathcal{A}^*$ is the range of $\mathcal{A}^*$ and the plus is a set-sum. More generally, assuming the maximum in~\eqref{eq:maxnulliny} is $p$ or more, then
\begin{align*}
C & \in \mathcal{M}_p \triangleq \bigcup_{\ell = p, \ldots, n} \mathcal{N}_\ell + \operatorname{im} \mathcal{A}^*.
\end{align*}
The manifold $\mathcal{N}_\ell$ has dimension $\frac{n(n+1)}{2} - \frac{\ell(\ell+1)}{2}$~\citep[Prop.~2.1(i)]{helmke1995matrixlsq}, while $\operatorname{im} \mathcal{A}^*$ has dimension at most $m$. Hence, $$\dim \mathcal{M}_p \leq m + \max_{\ell = p, \ldots, n} \dim \mathcal{N}_\ell = m + \frac{n(n+1)}{2} - \frac{p(p+1)}{2}.$$ Since $C$ is in $\Sym{n\times n}$ and $\dim \Sym{n\times n} = \frac{n(n+1)}{2}$, almost no $C$ lives in $\mathcal{M}_p$ if $\dim\mathcal{M}_p < \dim \Sym{n\times n}$, which is the case if $\frac{p(p+1)}{2} > m$. Stated differently: $\operatorname{rank}(U) \leq p$, and for almost all $C \in \Sym{n\times n}$, $\frac{p(p+1)}{2} \leq m$. To conclude, require that $k$ is strictly larger than any $p$ which satisfies $\frac{p(p+1)}{2} \leq m$.
\end{proof}
\section{Proofs for Section~\ref{sec:gd}}\label{apdx:gd}
\begin{proof}[Proof of Lemma \ref{lem:gd_param}.]
We start by showing that the gradient is $l$-Lipschitz continuous. The gradient is given by:
$$\nabla {\widehat L_\mu}(U) = \left[2(C+G) + 4\mu\mathcal{A}^*(\mathbf{r})\right]U,$$
where $\mathbf{r} = \mathbf{r}(U) = \mathcal{A}(UU^T) - \mathbf{b}$. Hence, for $U_1, U_2 \in \mathbb{R}^{n\times k}$, with notation $\mathbf{r}_1 = \mathbf{r}(U_1), \mathbf{r}_2 = \mathbf{r}(U_2)$,
\begin{align*}
\norm{ \nabla {\widehat L_\mu}(U_1) -\nabla {\widehat L_\mu}(U_2)}_F
& \leq \norm{ 2(C+G)(U_1-U_2)}_F + 4\mu \norm{\mathcal{A}^*(\mathbf{r}_1)U_1 - \mathcal{A}^*(\mathbf{r}_2)U_2 }_F \\
& \leq 2\|C+G\|_2 \| U_1 -U_2\|_F + 4 \mu \norm{\mathcal{A}^*(\mathbf{r}_1) (U_1- U_2) }_F \\
& \quad \quad + 4 \mu \norm{\mathcal{A}^*(\mathbf{r}_1 - \mathbf{r}_2) U_2}_F \\
& \leq \left(2\|C+G\|_2 + 4 \mu \left\| \mathcal{A}^*(\mathbf{r}_1) \right\|_2 \right) \| U_1 -U_2\|_F \\
& \quad \quad + 4 \mu \norm{\mathcal{A}^*(\mathbf{r}_1 - \mathbf{r}_2) U_2}_F.
\end{align*}
This further simplifies using the norm of $\mathcal{A}$~\eqref{eq:normofA}: $\left\| \mathcal{A}^*(\mathbf{r}_1) \right\|_2 \leq \|\mathcal{A}\| \|\mathbf{r}_1\|_2$ and $\|\mathbf{r}_1\|_2 \leq \|\mathcal{A}\| \|U_1\|_F^2 + \|\mathbf{b}\|_2$, so that if $\|U_1\|_F \leq \tau$:
\begin{align*}
\left\| \mathcal{A}^*(\mathbf{r}_1) \right\|_2 & \leq (\tau^2\|\mathcal{A}\|+\|\mathbf{b}\|_2)\|\mathcal{A}\|.
\end{align*}
Similarly, using $\|U_2\|_F \leq \tau$ as well:
\begin{align}
\norm{\mathcal{A}^*(\mathbf{r}_1 - \mathbf{r}_2) U_2}_F & \leq \|\mathcal{A}^*(\mathcal{A}(U_1^{}U_1^T - U_2^{}U_2^T))\|_2 \|U_2\|_F\nonumber\\
& \leq \tau \|\mathcal{A}\|^2 \|U_1^{}U_1^T - U_2^{}U_2^T\|_F \nonumber\\
& = \tau \|\mathcal{A}\|^2 \|U_1^{}U_1^T - U_1^{}U_2^T + U_1^{}U_2^T - U_2^{}U_2^T\|_F \nonumber\\
& \leq \tau \|\mathcal{A}\|^2 \left( \|U_1^{}(U_1 - U_2)^T \|_F + \|(U_1^{} - U_2^{})U_2^T\|_F \right) \nonumber\\
& \leq 2\tau^2 \|\mathcal{A}\|^2 \|U_1 - U_2\|_F. \label{eq:Astarr1r2}
\end{align}
Combining, we find
\begin{align*}
\norm{ \nabla {\widehat L_\mu}(U_1) -\nabla {\widehat L_\mu}(U_2)}_F
& \leq \left(2\|C+G\|_2 + 4 \mu \|\mathcal{A}\| (\tau^2\|\mathcal{A}\|+\|\mathbf{b}\|_2) \right) \| U_1 -U_2\|_F \\
& \quad \quad + 8 \mu \tau^2 \|\mathcal{A}\|^2 \|U_1 - U_2\|_F,
\end{align*}
which establishes the Lipschitz constant for $\nabla {\widehat L_\mu}$.
We now show that the Hessian is $\rho$-Lipschitz continuous in operator norm, that is, we must show that for any $U_1$ and $U_2$ with norms bounded by $\tau$,
\begin{align*}
\underset{\|{\dot U}\|_F \leq 1}{\max}\ip{\nabla^2 {\widehat L_\mu}(U_1)[{\dot U}] -\nabla^2 {\widehat L_\mu}(U_2)[{\dot U}]}{{\dot U}} \leq \rho \|U_1 -U_2\|_F.
\end{align*}
Recall from~\eqref{eq:HessianLmuip} that
\begin{align*}
\ip{\nabla^2 {\widehat L_\mu}(U)[{\dot U}]}{{\dot U}} = 2\ip{C+G+2\mu \mathcal{A}^*(\mathbf{r})}{{\dot U}{\dot U}^T} + 2\mu \|\mathcal{A}(U{\dot U}^T+{\dot U}U^T)\|_2^2.
\end{align*}
Hence,
\begin{multline*}
\ip{\nabla^2 {\widehat L_\mu}(U_1)[{\dot U}]}{{\dot U}} -\ip{\nabla^2 {\widehat L_\mu}(U_2)[{\dot U}]}{{\dot U}} \\
= 4\mu\ip{\mathcal{A}^*(\mathbf{r}_1 - \mathbf{r}_2)}{{\dot U}{\dot U}^T} + 2\mu \left(\|\mathcal{A}(U_1{\dot U}^T+{\dot U}U_1^T)\|_2^2 - \|\mathcal{A}(U_2{\dot U}^T+{\dot U}U_2^T)\|_2^2\right).
\end{multline*}
On one hand, following the same reasoning as in~\eqref{eq:Astarr1r2}, we have
\begin{align*}
\ip{\mathcal{A}^*(\mathbf{r}_1 - \mathbf{r}_2)}{{\dot U}{\dot U}^T} & \leq \|\mathcal{A}^*(\mathbf{r}_1 - \mathbf{r}_2)\|_F \|{\dot U}{\dot U}^T\|_F \\
& \leq 2\tau \|\mathcal{A}\|^2 \|U_1 - U_2\|_F \|\dot U\|_F^2.
\end{align*}
On the other hand, using that for any two vectors $u, v$ we have
\begin{align*}
\|u\|_2^2 - \|v\|_2^2 = \ip{u+v}{u-v} \leq \|u+v\|_2 \|u-v\|_2 \leq (\|u\|_2 + \|v\|_2)\|u - v\|_2,
\end{align*}
we can find:
\begin{align*}
\|\mathcal{A}(U_1{\dot U}^T+{\dot U}U_1^T)\|_2^2 - \|\mathcal{A}(U_2{\dot U}^T+{\dot U}U_2^T)\|_2^2 & \leq 4 \tau \|\mathcal{A}\|^2 \|U_1 - U_2\|_F \|\dot U\|_F^2.
\end{align*}
For this, we used $\|\mathcal{A}(U\dot U^T + \dot U U^T)\|_2 \leq \|\mathcal{A}\| \|U\dot U^T + \dot U U^T\|_F \leq \tau \|\mathcal{A}\|\|\dot U\|_F$ when $\|U\|_F \leq \tau$ and
\begin{align*}
\|\mathcal{A}(U_1{\dot U}^T+{\dot U}U_1^T - U_2{\dot U}^T - {\dot U}U_2^T)\|_2
& \leq \|\mathcal{A}\| \left( \|(U_1-U_2)\dot U^T\|_F + \|\dot U(U_1-U_2)^T\|_F \right) \\
& \leq 2\|\mathcal{A}\|\|\dot U\|_F \|U_1 - U_2\|_F.
\end{align*}
Overall, this shows $\rho = 16\mu \tau \|\mathcal{A}\|^2$ is an appropriate Lipschitz constant.
\end{proof}
\section{Proof of Lemma~\ref{lem:eigenvalue_main}: lower-bound for smallest singular values}\label{apdx:proofNguyen}
First we state a special case of Corollary 1.17
from~\citep{nguyen2017repulsion}. Let $N_I(X) $, denote the number of
eigenvalues of $X$ in the interval $I$.
\begin{corollary}\label{cor:Nguyen}
Let $M'$ be a deterministic symmetric matrix in $\Sym{n\times n}$. Let $G'$ be a
random symmetric matrix with entries $G'_{ij}$ drawn i.i.d.\ from
$\mathcal{N}(0,1)$ for
$i \geq j$ (in particular, independent of $M'$.) Then, for given $0 < \gamma < 1$, there exists a
constant $c = c(\gamma)$ such that for any $\epsilon > 0$ and $k \geq 1$,
with $I$ being the interval,
$[-\frac{\epsilon k}{\sqrt{n}}, \frac{\epsilon k}{\sqrt{n}}]$,
$$
\Pr{N_I(M'+G') \geq k } \leq n^k \left(\frac{c\epsilon}{\sqrt{2\pi}}\right)^{(1-\gamma)k^2/2}.
$$
\end{corollary}
We can use the above corollary to prove
Lemma~\ref{lem:eigenvalue_main}.
\begin{proof}
In our case, entries of $G$ have variance $\sigma_G^2$. Thus, set $G = \sigma_G G'$, and set $\bar M = \sigma_G M'$.
From Corollary~\ref{cor:Nguyen}, we get
\begin{align*}
N_{\sigma_G I}(\bar M+G) = N_I(M'+G') < k
\end{align*}
with probability
at least $1 - n^k \left(\frac{c\epsilon}{\sqrt{2\pi}}\right)^{(1-\gamma)k^2/2}$. In this event,
$\sigma_{n-(k-1)}(\bar M+G) \geq \frac{\epsilon k}{\sqrt{n}} \sigma_G$. Choose
$\gamma =\frac{1}{2}$, and $\epsilon = \frac{1}{2 c}$. Substituting this we get with
probability at least
$1 - \exp\left( - \frac{k^2}{8} \log( 8 \pi) + k \log (n)\right)$
that
$$
\sigma_{n-(k-1)}(\bar M+G) \geq \frac{k}{2c \sqrt{n}}\sigma_G.
$$
Hence,
$\sum_{i=1}^{k} \sigma_{n-(i-1)}\left(\bar M+G\right)^2 \geq
\sigma_{n-(k-1)}\left(\bar M+G\right)^2 \geq \frac{k^2}{c_0 n}
\sigma_G^2$, for some absolute constant $c_0 = 4c^2$.
\end{proof}
\section{Proofs for Section~\ref{sec:smooth}}\label{app:smooth}
\begin{proof}[Proof of Lemma \ref{lem:compact_optimal_approx}]
The gradient and Hessian of $L_\mu$~\eqref{eq:penalty_factored}, with $\mathbf{r} \triangleq \mathbf{r}(U) = \mathcal{A}(UU^T)-b$, are:
\begin{align}
\nabla L_\mu(U) & = 2\left( C + 2\mu\mathcal{A}^*(\mathbf{r}) \right)U,\label{eq:gradLmu}\\
\nabla^2 L_\mu(U)[\dot U] & = 2\left( C + 2\mu\mathcal{A}^*(\mathbf{r}) \right)\dot U + 4\mu\mathcal{A}^*(\mathcal{A}(\dot U U^T + U\dot U^T))U. \label{eq:HessianLmu}
\end{align}
Since $U$ is an $(\epsilon, \gamma)$-SOSP, it holds for all $\dot U \in \mathbb{R}^{n\times k}$ with $\|\dot U\|_F = 1$ that:
\begin{align}
-\frac{\gamma\sqrt{\epsilon}}{2} & \leq \frac{1}{2} \ip{\dot U}{\nabla^2 L_\mu(U)[\dot U]} = \ip{C + 2\mu\mathcal{A}^*(\mathbf{r})}{\dot U \dot U^T} + \mu \left\|\mathcal{A}(\dot U U^T + U \dot U^T)\right\|_2^2.
\label{eq:HessianLmuip}
\end{align}
We now construct specific $\dot U$'s to exploit the fact that $U$ is almost rank deficient. Let $z \in \mathbb{R}^k$ be a right singular vector of $U$ such that $\|Uz\|_2 =\sigma_k(U)$ (that is, $z$ is associated to the least singular value of $U$ and $\|z\|_2 = 1$.) For any $x \in \mathbb{R}^{n}$ with $\|x\|_2 = 1$, introduce $\dot U = xz^T$ in~\eqref{eq:HessianLmuip}:
\begin{align*}
-\frac{\gamma\sqrt{\epsilon}}{2} & \leq x^T(C + 2\mu\mathcal{A}^*(\mathbf{r}))x + \mu \left\|\mathcal{A}(\dot U U^T + U \dot U^T)\right\|_2^2.
\end{align*}
The last term is easily controlled:
\begin{align*}
\left\|\mathcal{A}(\dot U U^T + U \dot U^T)\right\|_2 \leq 2 \|\mathcal{A}\| \|U\dot U^T\|_F = 2 \|\mathcal{A}\| \|Uzx^T\|_F \leq 2 \|\mathcal{A}\|\|Uz\|_2 \|x\|_2 = 2 \|\mathcal{A}\|\sigma_k(U).
\end{align*}
Let $x$ be an eigenvector of $C + 2\mu\mathcal{A}^*(\mathbf{r})$ associated to its least eigenvalue and combine the last two statements together with the assumption on $\sigma_k(U)$ to find:
\begin{align}
\lambda_{\min}(C + 2\mu\mathcal{A}^*(\mathbf{r})) \geq -\frac{\gamma\sqrt{\epsilon}}{2} - 4\mu\|\mathcal{A}\|^2\sigma_k^2(U) \geq -\gamma\sqrt{\epsilon}.
\label{eq:lambdaminC2mu}
\end{align}
This inequality is key to bound the optimality gap. For this part, we rely on the fact that $L_\mu(U) = F_\mu(UU^T)$ and $F_\mu$ is convex on $\Sym{n\times n}$~\eqref{eq:penalty_sdp}. Specifically, let $\tilde X$ be a global optimum for $F_\mu$ (assuming it exists), and set $X = UU^T$. Then, $\nabla F_\mu(X) = C + 2\mu\mathcal{A}^*(\mathbf{r}), \nabla L_\mu(U) = 2\nabla F_\mu(X)U$ and:
\begin{align*}
F_\mu(\tilde X) - F_\mu(X) & \geq \ip{\nabla F_\mu(X)}{\tilde X - X} = \ip{C+2\mu\mathcal{A}^*(\mathbf{r})}{\tilde X} - \frac{1}{2}\ip{\nabla L_\mu(U)}{U} \\
& \geq -\gamma \sqrt{\epsilon} \operatorname{Tr}(\tilde X) - \frac{1}{2}\epsilon \|U\|_F.
\end{align*}
In the last step, we used~\eqref{eq:lambdaminC2mu} as well as approximate first-order stationarity .
\end{proof}
\begin{proof}[Proof of Proposition \ref{prop:compactSDPconsraintA0}]
One direction is elementary: if there exists $A_0 \succ 0$ and $b_0 \geq 0$ such that $\ip{A_0}{X} = b_0$ for all $X \in \mathcal{C}$, then,
\begin{align*}
\forall X \in \mathcal{C}, \quad \trace{X} = \ip{I_n}{X} \leq \lambda_{\min}(A_0)^{-1} \ip{A_0}{X} = \lambda_{\min}(A_0)^{-1} b_0.
\end{align*}
Thus, the trace of $X \succeq 0$ is bounded, and it follows that $\mathcal{C}$ is compact. Furthermore: if $b_0 = 0$, then $\mathcal{C} = \{0\}$; and if $b_0 > 0$, then $0 \notin \mathcal{C}$.
To prove the other direction, assume $\mathcal{C}$ is non-empty and compact. If $\mathcal{C} = \{0\}$, let $A_0 = I_n, b_0 = 0$. Now assume $\mathcal{C} \neq \{0\}$. The SDP comes in a primal-dual pair:
\begin{align*}
\min_{X\in\Sym{n\times n}} \ip{C}{X} \quad & \textrm{ s.t. } \quad \mathcal{A}(X) = b, \ X \succeq 0, \tag{P} \label{eq:proofP}\\
\max_{y\in\mathbb{R}^m} \ip{b}{y} \quad & \textrm{ s.t. } \quad C \succeq \mathcal{A}^*(y). \tag{D} \label{eq:proofD}
\end{align*}
It is well known that if~\eqref{eq:proofD} is infeasible, then~\eqref{eq:proofP} is unbounded or infeasible~\citep[Thm.~4.1(a)]{wolkowicz1981optimization}. Since we assume $\mathcal{C}$ is non-empty, this simplifies to: if~\eqref{eq:proofD} is infeasible, then~\eqref{eq:proofP} is unbounded. The contrapositive states: if~\eqref{eq:proofP} is bounded, then~\eqref{eq:proofD} is feasible. By our compactness assumption on $\mathcal{C}$, we know that~\eqref{eq:proofP} is bounded for all $C \in \Sym{n\times n}$. Thus,~\eqref{eq:proofD} is feasible for any $C$. In particular, take $C = -I_n$: there exists $-y \in \mathbb{R}^m$ such that $A_0 \triangleq \mathcal{A}^*(y) \succeq I_n$. Furthermore,
\begin{align*}
\forall X \in \mathcal{C}, \quad \ip{A_0}{X} = \ip{\mathcal{A}^*(y)}{X} = \ip{y}{\mathcal{A}(X)} = \ip{y}{b} \triangleq b_0.
\end{align*}
Since there exists $X \neq 0$ in $\mathcal{C}$, it follows that $b_0 > 0$.
\end{proof}
\begin{proof}[Proof of Theorem \ref{thm:compact_eps_fosp}]
Using~\eqref{eq:gradLmu}, $U$ is an $\epsilon$-FOSP of the perturbed problem if and only if $\| (M+G)U\|_F \leq \frac{\epsilon}{2}$, where $M = C + 2\mu\mathcal{A}^*(\mathbf{r})$.
Let $U = P \Sigma Q^T$ be a thin SVD of $U$ ($P$ is $n\times k$ with orthonormal columns; $Q$ is $k\times k$ orthogonal). Then,
\begin{align*}
\| (M+G)U\|_F & = \| (M+G) P \Sigma \|_F \\
& \geq \sigma_k(U)\| (M+G) P\|_F \\
& \geq \sigma_k(U) \sqrt{\sum_{i=1}^k \sigma_{n-(i-1)}(M+G)^2}.
\end{align*}
Hence, we control the smallest singular value of $U$ in terms of $\epsilon$ and the $k$ smallest singular values of $M+G$:
\begin{align}
\sigma_k(U) & \leq \frac{\epsilon}{2\sqrt{\sum_{i=1}^{k}\sigma_{n-(i-1)}(M+G)^2}}.
\label{eq:keyboundsigmak}
\end{align}
The next lemma helps lower-bound the denominator---it follows from Theorem 1.16 and Corollary 1.17 in \citep{nguyen2017repulsion}; see proof in Appendix~\ref{apdx:proofNguyen}.
\begin{lemma}\label{lem:eigenvalue_main}
Let $\bar M$ be a fixed symmetric matrix of size $n$. Let $G$ be a symmetric Gaussian matrix of size $n$, independent of $\bar M$, with diagonal and upper-triangular entries sampled independently from $\mathcal{N}(0,\sigma_G^2)$. There exists an absolute constant $c_0$ such that:
\begin{align*}
\Pr{\sum_{i=1}^{k} \sigma_{n-(i-1)}\left(\bar M+G\right)^2 < \frac{k^2}{c_0 n} \sigma_G^2 } \leq \exp\left( - \frac{k^2}{8} \log(8 \pi) + k \log (n)\right).
\end{align*}
\end{lemma}
We cannot use Lemma~\ref{lem:eigenvalue_main} directly, as in our case $M$ is not statistically independent of $G$. Indeed, $M$ depends on $U$ through the residue $\mathbf{r} = \mathbf{r}(U)$ and $U$ is an $\epsilon$-FOSP: a feature that depends on $G$.
To resolve this, we cover the set of possible $M$'s with a net, under the assumption that $\mathbf{r}$ is bounded. Lemma~\ref{lem:eigenvalue_main} provides a bound for each $\bar M$ in this net. This can be extended to hold for all $\bar M$'s in the net simultaneously via a union bound. By taking a sufficiently dense net, we can then infer that $M$ is necessarily close to one of these $\bar M$'s, and conclude.
Let $\mathcal{E}$ be the event (on $G$) that $\|\mathbf{r}\|_2 \leq B$ for all $\epsilon$-FOSPs of the perturbed problem.
Conditioned on $\mathcal{E}$, we have
\begin{align*}
\|M - C\|_F & = 2\mu\|\mathcal{A}^*(\mathbf{r})\|_F \leq 2\mu B \|\mathcal{A}\|,
\end{align*}
where $\|\mathcal{A}\|$ is defined in~\eqref{eq:normofA}.
As a result, $M$ lies in a ball of center $C$ and radius $2 \mu B\|\mathcal{A}\|$ in an affine subspace of dimension $\operatorname{rank}(\mathcal{A})$. A unit-ball in Frobenius norm in $d$ dimensions admits an $\varepsilon$-net of $(1+2/\varepsilon)^d$ points~\citep[Cor.~4.2.13]{vershynin2016high}. Thus, we can pick a net with
$\left( 1 + \frac{4 \mu B\|\mathcal{A}\|}{\sigma_G} \sqrt{\frac{4c_0 n}{k^2}} \right)^{\operatorname{rank}(\mathcal{A})}$ points in such a way that, independently of $\mathbf{r}$, there exists a point $\bar M$ in the net satisfying:
\begin{align}
\| \bar M - M \|_F \leq \sqrt{\frac{k^2}{4c_0 n}} \sigma_G = \frac{k}{2\sqrt{c_0 n}}\sigma_G.
\label{eq:epscover}
\end{align}
Let $T \colon \Sym{n\times n} \to \mathbb{R}^{k}$ be defined by $T_q(A) = (\sigma_{n-q+1}(A), \ldots, \sigma_n(A))^T$, that is: $T$ extracts the $q$ smallest singular values of $A$, in order. Then,
\begin{align*}
\| \bar M - M \|_F & = \| (\bar M+G) - (M+G) \|_F \\
& \geq \| T_n(\bar M+G) - T_n(M + G) \|_2 \\
& \geq \| T_k(\bar M+G) - T_k(M + G) \|_2 \\
& \geq \| T_k(\bar M+G) \|_2 - \| T_k(M + G) \|_2,
\end{align*}
where the first inequality follows from~\citep[Ex.~IV.3.5]{bhatia2013matrix}. Hence,
\begin{align}
\sqrt{\sum_{i=1}^{k}\sigma_{n-(i-1)}(M+G)^2} \geq \sqrt{\sum_{i=1}^{k}\sigma_{n-(i-1)}(\bar M+G)^2} - \| \bar M - M \|_F. \label{eq:foo}
\end{align}
Now, taking a union bound for $\mathcal{E}$ and for Lemma~\ref{lem:eigenvalue_main} over each $\bar M$ in the net, we get~\eqref{eq:epscover} and
\begin{align}
\sqrt{ \sum_{i=1}^{k} \sigma_{n-(i-1)}\left(\bar M+G\right)^2 } \geq \frac{k}{\sqrt{c_0 n}} \sigma_G
\label{eq:bar}
\end{align}
with probability at least
$$
1 - \exp \left( - \frac{k^2}{8}\log(8\pi) + k\log(n) + \operatorname{rank}(\mathcal{A}) \cdot \log\left( 1 + \frac{4 \mu B\|\mathcal{A}\|}{\sigma_G} \sqrt{\frac{4c_0 n}{k^2}} \right) \right) - \delta.
$$
Inside the log, we can safely replace $k$ with 1, as this only hurts the probability. Then, the result holds with probability at least
$$
1 - \exp \left( - \frac{k^2}{8}\log(8\pi) + k\log(n) + \operatorname{rank}(\mathcal{A}) \cdot \log\left( 1 + \frac{8 \mu B\|\mathcal{A}\|}{\sigma_G} \sqrt{c_0 n} \right) \right) - \delta.
$$
We aim to pick $k$ so as to ensure
\begin{align*}
\exp \left( - \frac{k^2}{8}\log(8\pi) + k\log(n) + \operatorname{rank}(\mathcal{A}) \cdot \log\left( 1 + \frac{8 \mu B\|\mathcal{A}\|}{\sigma_G} \sqrt{c_0 n} \right) \right) \leq \delta'.
\end{align*}
This is a quadratic condition of the form
\begin{align*}
-ak^2 + bk + c \leq \log(\delta')
\end{align*}
for some $a, b > 0$, $c \geq 0$. Since $k$ is positive we get, $k \geq \frac{b+\sqrt{a (c+\log(1/\delta'))}}{a}$, which is satisfied for, $$ k \geq 3\left[\log\left(\frac{n}{\delta'}\right) + \sqrt{ \operatorname{rank}(\mathcal{A}) \log\left( 1 + \frac{8 \mu B\|\mathcal{A}\| \sqrt{c_0 n}}{\sigma_G } \right) } \right].$$
Combining~\eqref{eq:keyboundsigmak},~\eqref{eq:epscover},~\eqref{eq:foo} and~\eqref{eq:bar}, we find:
\begin{align*}
\sigma_k(U) \leq \frac{ \epsilon}{\sigma_G } \frac{2\sqrt{c_0 n}}{k}
\end{align*}
with probability at least $1-\delta-\delta'$.
\end{proof}
\begin{proof}[Proof of Lemma \ref{lem:residues_compact}]
If $U = 0$, the bounds clearly hold: assume $U \neq 0$ in what follows.
Using $\nabla \tilde L_\mu(U) = 2( C + 2\mu\tilde \mathcal{A}^*(\tilde \mathbf{r}) )U$, the definition of $\epsilon$-FOSP reads:
\begin{align*}
\frac{\epsilon}{2} \geq \left\| \left( C + 2\mu\tilde \mathcal{A}^*(\tilde \mathbf{r}) \right) U \right\|_F.
\end{align*}
Combining this with $\|A\|_F \geq \frac{1}{\|B\|_F} \ip{A}{B}$ for $B\neq 0$ (Cauchy--Schwarz) gives:
\begin{align*}
\frac{\epsilon}{2} \geq \frac{1}{\|U\|_F} \ip{\left( C + 2\mu\tilde \mathcal{A}^*(\tilde \mathbf{r}) \right) U}{U}.
\end{align*}
This can be further developed as:
\begin{align}
\frac{\epsilon \|U\|_F}{2} & \geq \ip{C + 2\mu\tilde \mathcal{A}^*(\tilde \mathbf{r})}{UU^T} \nonumber\\
& = \ip{C}{UU^T} + 2\mu \ip{\tilde\mathbf{r}}{\tilde\mathcal{A}(UU^T)} \nonumber\\
& = \ip{C}{UU^T} + 2\mu \ip{\tilde \mathcal{A}(UU^T) - \tilde \mathbf{b}}{\tilde \mathcal{A}(UU^T)}. \label{eq:residueboundintermediate}
\end{align}
At this point, we separate the constraint $(A_0, b_0)$ from the rest, using the usual definition for $(\mathcal{A}, \mathbf{b})$ which capture constraints $1, \ldots, m$:
\begin{align*}
\frac{\epsilon \|U\|_F}{2} & \geq \ip{C}{UU^T}+2\mu\left( \ip{\mathcal{A}(UU^T)-\mathbf{b}}{\mathcal{A}(UU^T)}+ \left(\ip{A_0}{UU^T}-b_0\right)\ip{A_0}{UU^T} \right) \\
& \geq \ip{C}{UU^T} + 2\mu\left( \|\mathcal{A}(UU^T)\|_2^2-\|\mathbf{b}\|_2 \|\mathcal{A}(UU^T)\|_2 + \left(\ip{A_0}{UU^T}-b_0\right)\ip{A_0}{UU^T} \right).
\end{align*}
Let $y =\|\mathcal{A}(UU^T)\|_2$. Then the above inequality holds when
$$
y^2 -\|\mathbf{b}\|_2 y +\frac{1}{2\mu}\left( \ip{C}{UU^T}-\frac{\epsilon \|U\|_F}{2} \right)+ \left(\ip{A_0}{UU^T}-b_0\right)\ip{A_0}{UU^T} \leq 0.
$$
For this to happen we need the above quadratic to have real roots. This requires:
\begin{align*}
\frac{1}{4}\|\mathbf{b}\|_2^2 & \geq \frac{1}{2\mu}\left( \ip{C}{UU^T}-\frac{\epsilon \|U\|_F}{2} \right)+ (\ip{A_0}{UU^T}-b_0)\ip{A_0}{UU^T} \\
& \geq\frac{1}{2\mu}\left( -\|CU\|_F \|U\|_F-\frac{\epsilon \|U\|_F}{2} \right)+ \lambda_{\min}(A_0)^2 \|U\|_F^4-b_0 \lambda_{\max}(A_0) \|U\|_F^2 \\
& \geq \lambda_{\min}(A_0)^2 \|U\|_F^4 -\frac{\|C\|_2}{2\mu}\|U\|_F^2 - b_0 \lambda_{\max}(A_0) \|U\|_F^2 - \frac{\epsilon}{4\mu}\|U\|_F,
\end{align*}
where we used that for any two matrices $A$ and $B$, it holds that $\|AB\|_F \leq \|A\|_2 \|B\|_F$.
Focus on the last two terms of the last inequality. We distinguish two cases. Either
\begin{align*}
b_0 \lambda_{\max}(A_0) \|U\|_F^2 + \frac{\epsilon}{4\mu}\|U\|_F \geq \frac{3}{2}b_0 \lambda_{\max}(A_0)\|U\|_F^2,
\end{align*}
in which case $\|U\|_F \leq \frac{\epsilon}{2\mu b_0 \lambda_{\max}(A_0)}$ (assuming $b_0 > 0$). Or the opposite holds, and:
\begin{align*}
\frac{1}{4} \|\mathbf{b}\|_2^2 & \geq \lambda_{\min}(A_0)^2 \|U\|_F^4 - \left(\frac{\|C\|_2}{2\mu} + \frac{3}{2}b_0 \lambda_{\max}(A_0)\right)\|U\|_F^2.
\end{align*}
This is a quadratic inequality in $y = \|U\|_F^2$ of the form $ay^2 - by - c \leq 0$ with coefficients $a> 0$ and $b, c \geq 0$. Such a quadratic always has at least one real root, so that $y \leq \frac{b + \sqrt{b^2 + 4ac}}{2a}$. Furthermore, $\sqrt{b^2 + 4ac} \leq \sqrt{b^2 + (\sqrt{4ac})^2 + 2b\sqrt{4ac}} = b + \sqrt{4ac}$. Hence, $y \leq \frac{b}{a} + \sqrt{\frac{c}{a}}$, which means:
\begin{align*}
\|U\|_F^2 & \leq \frac{1}{\lambda_{\min}(A_0)^2} \left(\frac{\|C\|_2}{2\mu} + \frac{3}{2}b_0 \lambda_{\max}(A_0)\right) + \frac{\|\mathbf{b}\|_2}{2\lambda_{\min}(A_0)}.
\end{align*}
Accounting for the two distinguished cases, we find:
\begin{align*}
\|U\|_F^2 & \leq \max\left\{ \left(\frac{\epsilon}{2\mu b_0 \lambda_{\max}(A_0)}\right)^2, \frac{1}{\lambda_{\min}(A_0)^2} \left(\frac{\|C\|_2}{2\mu} + \frac{3}{2}b_0 \lambda_{\max}(A_0)\right) + \frac{\|\mathbf{b}\|_2}{2\lambda_{\min}(A_0)} \right\}.
\end{align*}
We now bound the residues (generically) in terms of $\|U\|_F$, using submultiplicativity for $\|UU^T\|_F \leq \|U\|_F^2$ and the definition of $\|\mathcal{A}\|$~\eqref{eq:normofA}:
\begin{align*}
\|\mathbf{r}\|_2 = \| \mathcal{A}(UU^T) - \mathbf{b} \|_2 \leq \|\mathcal{A}\| \|UU^T\|_F + \|\mathbf{b}\|_2 \leq \|\mathcal{A}\| \|U\|_F^2 + \|\mathbf{b}\|_2.
\end{align*}
Evidently, the same bound holds for $\tilde\mathcal{A}, \tilde \mathbf{b}, \tilde \mathbf{r}$.
\end{proof}
\begin{proof}[Proof of Theorem \ref{thm:optimal_approx_compact}]
By Lemma~\ref{lem:residues_compact}, for a problem perturbed with $G$, the residues of all $\epsilon$-FOSPs, $\|\tilde \mathbf{r}\|_2$, are bounded as:
\begin{align*}
\|\tilde \mathcal{A}\| \max\left\{ \left(\frac{\epsilon}{2\mu b_0 \lambda_{\max}(A_0)}\right)^2, \frac{1}{\lambda_{\min}(A_0)^2} \left(\frac{\|C+G\|_2}{2\mu} + \frac{3}{2}b_0 \lambda_{\max}(A_0)\right) + \frac{\|\mathbf{b}\|_2}{2\lambda_{\min}(A_0)} \right\} + \|\tilde \mathbf{b}\|_2
\end{align*}
With probability at least $1 - \delta$, $\|C + G\|_2 \leq \|C\|_2 + 3\sigma_G\left(\sqrt{n} + \sqrt{2\log(1/\delta)}\right)$. Hence, Theorem~\ref{thm:compact_eps_fosp} applies with this $\delta$ and
\begin{align*}
B = \|\tilde \mathcal{A}\| \max\left\{ \left(\frac{\epsilon}{2\mu b_0 \lambda_{\max}(A_0)}\right)^2, \frac{1}{\lambda_{\min}(A_0)^2} \left(\frac{\|C\|_2 + 3\sigma_G\sqrt{n}}{2\mu} + \frac{3}{2}b_0 \lambda_{\max}(A_0)\right) + \frac{\|\mathbf{b}\|_2}{2\lambda_{\min}(A_0)} \right\} + \|\tilde \mathbf{b}\|_2.
\end{align*}
Hence, with $k$ as prescribed in that theorem for a given $\delta' =\delta \in (0, 1)$, with probability at least $1 - 2\delta$, it holds that
\begin{align*}
\sigma_k(U) \leq \frac{ 2\epsilon}{\sigma_G } \frac{\sqrt{c_0 n}}{k}
\end{align*}
for any $\epsilon$-FOSP. Lemma~\ref{lem:compact_optimal_approx} requires $\sigma_k^2(U) \leq \frac{\gamma \sqrt{\epsilon}}{8 \mu\|\mathcal{A}\|^2}$. Hence, we choose: $\epsilon \leq \left(\frac{\gamma k^2 \sigma_G^2 }{ 32c_0 n \mu \|\mathcal{A}\|^2}\right)^{\sfrac{2}{3}}$, and with probability at least $1-2\delta$ hypothesis of Lemma \ref{lem:compact_optimal_approx} is satisfied. Let $\tilde X$ be a global optimum for $\tilde F_\mu$, then the optimality gap obeys:
\begin{align*}
\tilde F_\mu(UU^T) - \tilde F_\mu(\tilde X) & \leq \gamma \sqrt{\epsilon} \operatorname{Tr}(\tilde X) + \frac{1}{2}\epsilon \|U\|_F.
\end{align*}
\end{proof}
\subsection{Proof of section 4.2}
\begin{proof}[Proof of Lemma \ref{lem:residues}]
With probability at least $1-\delta$, $\sigma_1(G) \leq 3\sigma_G\sqrt{n} $. In that event, for $\sigma_G \leq \frac{\lambda_{n}(C)}{6\sqrt{n \log(n/\delta)}}$, we have $C+G \succeq \frac{\lambda_{n}(C)}{2}I$.
$U$ is an $\epsilon$-FOSP of \eqref{eq:smoothed} implies $\|2(C+G+2\mu \mathcal{A}^*(\mathbf{r}))U\|_F \leq \epsilon$. \begin{align*}
\frac{\epsilon}{2} &\geq \left\| \left(C+G+2\mu \mathcal{A}^*(\mathbf{r}) \right)U \right\|_F \\
&\geq \frac{1}{\|U\|_F} \ip{C+G+2\mu \mathcal{A}^*(\mathbf{r})}{UU^T} .
\end{align*} Hence, \begin{align*}
\frac{\epsilon \|U\|_F}{2} &\geq \ip{C+G}{UU^T} + 2\mu\ip{ \mathcal{A}^*(\mathbf{r})}{UU^T} \\
&\geq \frac{\lambda_n(C)}{2}\|U\|_F^2+2\mu\ip{\mathbf{r}}{\mathcal{A}(UU^T)} \\
&\geq \frac{\lambda_n(C)}{2}\|U\|_F^2+2\mu( \|\mathcal{A}(UU^T)\|_2^2 - \|\mathbf{b}\|_2\|\mathcal{A}(UU^T)\|_2).
\end{align*}
The above inequality is a quadratic in $y=\|\mathcal{A}(UU^T)\|_2$: $y^2 -y \|\mathbf{b}\|_2 + \frac{1}{2\mu} \left(\frac{\lambda_n(C)}{2}\|U\|_F^2 -\frac{\epsilon \|U\|_F}{2}\right) \leq 0$. If $\frac{\epsilon \|U\|_F}{2} \geq \frac{\lambda_n(C)}{4}\|U\|_F^2$, then $\|U\| _F \leq \frac{2\epsilon} {\lambda_n(C)}$. Else, for the above inequality to hold we need the quadratic to have real roots.
\begin{align*}
\|\mathbf{b}\|_2^2 &\geq 4 \cdot 1 \cdot \frac{1}{2\mu} \left( \frac{\lambda_n(C)}{2}\|U\|_F^2 -\frac{\epsilon \|U\|_F}{2} \right) \\
&\geq \frac{2}{\mu} \frac{\lambda_n(C)}{4}\|U\|_F^2.
\end{align*}
The last inequality follows from $\frac{\epsilon \|U\|_F}{2} \leq \frac{\lambda_n(C)}{4}\|U\|_F^2$. Hence, $\|U\|_F^2 \leq \max \left \{ \left( \frac{2\epsilon} {\lambda_n(C)}\right)^2, \frac{2\mu}{\lambda_n(C)} \|\mathbf{b}\|_2^2 \right \}$. Hence,
\begin{multline*}
\|\mathbf{r}\|_2 = \| \mathcal{A}(UU^T) -\mathbf{b}\|_2 \leq \|\mathcal{A}(UU^T)\|_2 +\|\mathbf{b}\|_2 \leq \|\mathcal{A}\| \|UU^T\|_F +\|\mathbf{b}\|_2 \\ \leq \|\mathcal{A}\| \max \left \{ \left( \frac{2\epsilon} {\lambda_n(C)}\right)^2, \frac{2\mu}{\lambda_n(C)} \|\mathbf{b}\|_2^2 \right \}+\|\mathbf{b}\|_2.
\end{multline*}
\end{proof}
\section{Applications}\label{sec:applications}
In this section, we present applications of our results to two SDPs: Max-Cut and matrix completion, both of which are important problems in the learning domain and have been studied extensively. Interest has grown to develop efficient solvers for these SDPs~\citep{arora2007combinatorial, pmlr-v65-mei17a, hardt2013understanding, bandeira2016low}.
This work differs from previous efforts in at least two ways. First, we aim to demonstrate that Burer--Monteiro-style approaches, which are often used in practice, can indeed lead to provably efficient algorithms for general SDPs. We believe that building upon this work, it should be possible to improve the time-complexity guarantees of such factorization-based algorithms. Second, we note that several problems formulated as SDPs in fact necessitate low-rank solutions, for example because of memory concerns (as is the case in matrix completion), and factorization approaches provide a natural means to control rank.
\subsection{Max-Cut}
We first consider the popular Max-Cut problem which finds applications in clustering related problems. In a seminal paper, \cite{goemans1995improved} defined the following SDP to solve the Max-Cut problem: $\min_{X\in \mathbb{R}^{n\times n}} \ip{C}{X}, \mbox{s.t. } X_{ii} = 1 \; \forall \; 1 \leq i \leq n, X \succeq 0 $, where $n$ is the number of vertices in the given graph and $C$ is its adjacency matrix. Since the constraint set also satisfies $\trace{X}=n$, we consider the following penalized, non-convex version of the problem.
\begin{align}
\widehat{L}_{\mu}(U) \triangleq \ip{C+G}{U\trans{U}} + \mu\left(\left(\ip{I}{U\trans{U}}-n\right)^2 + \sum_{i=1}^{n}\left(\ip{e_i \trans{e_i}}{U\trans{U}}-1\right)^2\right),\label{eqn:maxcut}
\end{align}
where $G$ is a random symmetric Gaussian matrix. Let $\widehat F_{\mu}(UU^T) = \widehat L_{\mu} (U)$. After some simplifying computations, we have the following corollary of Theorem~\ref{thm:optimal_approx_compact}.
\begin{corollary}\label{cor:maxcut}
There exists an absolute numerical constant $c_1$ such that the following holds. With probability greater than $1-\delta$,
every $(\epsilon, \gamma)$-SOSP $U$ of the perturbed Max-Cut problem $\widehat{L}_{\mu}(U)$~\eqref{eqn:maxcut} with:
\begin{align*}\epsilon \leq \frac{1}{c_1} \left(\frac{\gamma \sigma_G^2}{\mu n}\right)^{2/3},~~ \text{ and } ~~ k = \tilde{\Omega} \left( \sqrt{n \log\left(\frac{\mu^2 \sqrt{n}}{\sigma_G}\right)}\right),
\end{align*}
satisfies $ \widehat{F}_{\mu}(UU^T) - \widehat{F}_{\mu}(X^*) \leq \gamma \sqrt{\epsilon} \trace{X^*} +\frac{1}{2} \epsilon \frob{U}$, where $X^*$ is a global optimum of $\widehat{F}_{\mu}(X)$.
\end{corollary}
The above result states that for the penalized version of the perturbed Max-Cut SDP, the Burer--Monteiro approach finds an approximate global optimum as soon as the factorization rank $k = \tilde{\Omega}(\sqrt{n})$. Existing results for Max-Cut using this approach either only handle exact SOSPs~\citep{boumal2016non}, or require $k=n+1$~\citep{boumal2016globalrates}, or require $k$ that is dependent on $\frac{1}{\epsilon}$~\citep{pmlr-v65-mei17a}. Moreover, complexity per iteration scales only linearly with the number of edges in the graph.
\subsection{Matrix Completion}
In this section we specialize our results for the matrix completion problem \cite{candes2009exact}. The goal of a matrix completion problem is to find a low-rank matrix $M$ using only a small number of its entries, with applications in recommender systems. To ensure that the computed matrix is low-rank and generalizes well, one typically imposes nuclear-norm regularization which leads to the following SDP:
\begin{minipage}{0.2\linewidth}
\begin{align*}
\min &\quad \trace{W_1} + \trace{W_2}\\ \text{s. t. }&\quad X_{ij} =M_{ij}, (i,j) \in \mathcal{S} \\ &\quad \begin{bmatrix}W_1 & X \\ X^T & W_2\end{bmatrix} \succeq 0.
\end{align*}
\end{minipage}
\begin{minipage}{0.05\linewidth}
\begin{align*}
\equiv \\
\end{align*} \break
\end{minipage}
\begin{minipage}{0.6\linewidth}
\begin{align*}
\min & \quad \ip{I}{Z} \nonumber \\ \text{s. t. }&\quad \frac{1}{2}\ip{e_{i+n}e_{j+n}^T + e_{j+n} e_{i+n}^T}{Z} = M_{ij}, (i,j) \in \mathcal{S} \nonumber \\ &\quad Z \succeq 0.
\end{align*}
\end{minipage}
\noindent Here $\mathcal{S}$ is the set of observed indices of $M$ and $Z\triangleq \begin{bmatrix}W_1 & X \\ X^T & W_2\end{bmatrix}$.
Let
\begin{align}
\widehat{L}_{\mu}(U) = \ip{I+G}{UU^T} + \mu \sum_{i=1}^m \left(\frac{1}{2}\ip{e_{i+n}e_{j+n}^T + e_{j+n} e_{i+n}^T}{UU^T} - M_{ij} \right)^2 \label{eq:matcomp}
\end{align}
be the corresponding penalty objective. Let $\widehat F_{\mu}(UU^T) = \widehat L_{\mu} (U)$. The objective is positive definite with $\lambda_1(C)=\lambda_n(C)=1$. Also, since $\mathcal{A}$ is a sub-sampling operator, $\|\mathcal{A}\| \leq 1$. Finally, for $\epsilon^2 \leq \frac{\mu}{2}\sqrt{\sum_{(i,j) \in \mathcal{S}} M_{ij}^2}$, the residues are bounded by: \begin{align*} B&=\|\mathcal{A}\| \max \left \{ \left( \frac{2\epsilon} {\lambda_n(C)}\right)^2, \frac{2\mu}{\lambda_n(C)} \|\mathbf{b}\|_2^2 \right \}+\|\mathbf{b}\|_2 \leq \max 3\mu \sqrt{\sum_{(i,j) \in \mathcal{S}} M_{ij}^2}. \end{align*}
\noindent Applying Theorem~\ref{thm:optimal_approx} for this setting gives the following corollary.
\begin{corollary}\label{cor:mc_optimal}There exists an absolute numerical constant $c_2$ such that the following holds. With probability greater than $1-\delta$,
every $(\epsilon, \gamma)$-SOSP $U$ of the perturbed matrix completion problem $\widehat{L}_{\mu}(U)$~\eqref{eq:matcomp} with:
\begin{align*}\sigma_G \leq \frac{1}{4\sqrt{n \log(n/ \delta)}},~~ \epsilon \leq \frac{1}{c_2}\left(\frac{\gamma \abs{\mathcal{S}} \sigma_G^2 }{ n \mu }\right)^{\sfrac{2}{3}}, ~\text{ and }~ k = \tilde{\Omega} \left( \sqrt{ \abs{\mathcal{S}} \log\left(\frac{\mu^2 \sqrt{n} \sqrt{\sum_{(i,j) \in \mathcal{S}} M_{ij}^2}}{\sigma_G}\right) } \right),\end{align*} satisfies $\widehat{F}_{\mu}(UU^T) - \widehat F_{\mu}(X^*) \leq \gamma \sqrt{\epsilon} \trace{X^*} + \frac{1}{2} \epsilon \|U\|_F$, where $X^*$ is a global optimum of $\widehat{F}_{\mu}(X)$.
\end{corollary}
\noindent This result shows that for the matrix completion problem with $m$ observations, for rank $\tilde{\Omega}(\sqrt{m})$, any approximate local minimum of the factorized and penalized problem is an approximate global minimum.
Most of the existing results on matrix completion either require strong distribution assumptions on $\mathcal{S}$ and incoherence assumptions on $M$ to recover a low-rank solution \citep{candes2009exact, jain2013low}. The standard nuclear norm minimization algorithms are not guaranteed to converge to low-rank solutions without these assumptions, which implies that the entire matrix would need to be stored for prediction which is infeasible in practice. Similarly, generalization error bounds \citep{foygel2011concentration} as well as differential privacy guarantees depend on recovery of a low-rank solution.
Our result guarantees finding a rank -$\tilde{\Omega}(\sqrt{m})$ solution without any statistical assumptions on the sampling or the matrix. The tradeoff is our results do not guarantee finding a lower (potentially a constant) rank solution, even if one exists for a given problem.
\section{Proofs of results in Section~\ref{sec:pd}}
\section{Counterexample for the constrained case}
Fix dimension $n$, number of constraints $m = n-1$ and rank $k= n-2$. Define the following matrices:
\begin{align*}
C &= \begin{bmatrix}
\mathbf{I}_{n-2 \times n-2} & \mathbf{1}_{n-2 \times 2} \\
\mathbf{1}_{2 \times n-2} & \begin{array}{cc}
2n & 0 \\ 0 & 0
\end{array}
\end{bmatrix},
\mbox{ and } \\
A_i &= \begin{bmatrix}
\mathbf{0}_{n-2\times n-2} & \begin{array}{c}
\mathbf{0}_{i-1 \times 2} \\ \mathbf{1}_{1 \times 2} \\ \mathbf{0}_{n-2-i \times 2}
\end{array} \\
\begin{array}{ccc}
\mathbf{0}_{2 \times i-1} & \mathbf{1}_{2 \times 1} & \mathbf{0}_{2 \times n-2-i } \end{array} & \begin{array}{cc}
0 & 0 \\ 0 & 1
\end{array}
\end{bmatrix}, \mbox{ for } i = 1,\cdots, n-2,
\end{align*}
where $\mathbf{0}, \mathbf{1}, \mathbf{I}$ represent all zeros, all ones and identity matrix respectively of appropriate sizes. The counter example problem is
\begin{align}
&\min_{U \in \mathbb{R}^{n\times k}} \trace{\trans{U} C U} \nonumber \\
& \mbox{ s.t. } \trace{\trans{U} A_i U} = 0 \mbox{ for } i = 1,\cdots, n-2 \nonumber \\
&\qquad \trace{U \trans{U}} = n-2. \label{eq:counter-constrained}
\end{align}
The following lemma shows that on the constraint manifold, $U = \mathbf{I}_{n \times k}$ is a suboptimal second order optimal point.
\begin{lemma}
Let $k=n-2$, then $U = \mathbf{I}_{n \times k}$ satisfies second order optimality on the constraint manifold and is suboptimal for problem \eqref{eq:counter-constrained}.
\end{lemma}
\begin{proof}
\noindent \textbf{Suboptimality of $U$}: For $U = \mathbf{I}_{n \times k}$, $UU^T$ is a $n\times n$ matrix with a $k \times k$ Identity block. Since the first $n-2$ constraints have $0$ in the top $k \times k$ block, we get that $\ip{A_i}{UU^T}=0, 1 \leq i \leq n-2$. Also $\trace{UU^T}$ is $k=n-2$. Hence, $UU^T$ is a feasible point for the above SDP.
Computing the objective value of~\eqref{eq:counter-constrained} at $U$, we see that it is equal to $n-2$. Define $w \triangleq \trans{\begin{bmatrix}
\mathbf{1}_{1\times n-2} & 0 & -1
\end{bmatrix}}$. Consider now a different matrix $\displaystyle X_0 \triangleq \frac{n-2}{n} \left(w \trans{w} + \begin{bmatrix} \mathbf{0}_{n-1 \times n-1} & \mathbf{0}_{n-1 \times 1} \\ \mathbf{0}_{1 \times n-1} & 1 \end{bmatrix}\right)$. It is easy to see that $X_0$ is PSD and satisfies all the constraints in~\eqref{eq:counter-constrained}. Furthermore, we see that the objective value at $X_0$, $$\displaystyle \ip{C}{X_0} = \frac{n-2}{n} \cdot \trans{w}Cw = \frac{(n-2)^2}{n} < n-2 =\ip{C}{UU^T}.$$ This proves that $UU^T$ is suboptimal to the above SDP.\\
\noindent \textbf{Second order optimality:} The space orthogonal to the constraint manifold at $U$ is given by $\displaystyle \mathscr{P} \triangleq \linspan{U, A_i U; i\in[n-2]}$. The first order optimality conditions are satisfied since the gradient of the objective, $CU = U + \sum_{i=1}^{n-2} A_i U,$ is in $\mathscr{P}$, and is orthogonal to the constraint manifold.
We will now show that for any perturbation along the tangent space at $U$, the objective value strictly increases, thereby showing that $U$ satisfies second order optimality conditions. Any perturbation $\triangle U$ in the tangent space at $U$, by definition is orthogonal to $\mathscr{P}$ ($\triangle U \perp \mathscr{P}$). Let $\triangle U$ be given by $$\triangle U \triangleq \begin{bmatrix} {\triangle \overline{U}}_{n-2 \times n-2} \\ \triangle u_1 \; \triangle u_2 \; \cdots \; \triangle u_{n-2} \end{bmatrix},$$ where each $\triangle u_i$ is a $2\times1$ vector. Since $\triangle u \perp A_i U$ for every $i$, we see that $\trans{\mathbf{1}_{2\times 1}}\triangle u_i = 0$ for every $i \in [n-2]$. Hence for any point $U+\triangle U$ on the constraint manifold,
\begin{align}
&\trace{\trans{\left(U + \triangle U\right)} A_i \left(U + \triangle U\right)} = \trace{\trans{U} A_i U} \nonumber \\
\Rightarrow & 2 \trace{\trans{\triangle U} A_i U} + \trace{\trans{\triangle U} A_i \triangle U} = 0. \label{eq:constraints-unchanged}
\end{align} Similarly the $\trace{UU^T}=n-2$ constraint gives us, $2\trace{\trans{\triangle U}U}+\trace{\trans{\triangle U} \triangle U}=0$.
Further, the change in objective value is,
\begin{align*}
\trace{\trans{\left(U + \triangle U \right)} C \left(U + \triangle U \right)} - \trace{\trans{U}C U} &= 2 \trace{\trans{\triangle U} C U} + \trace{\trans{\triangle U} C \triangle U} \\
&= 2 \trace{\trans{\triangle U} \left(U + \sum_i A_i U\right) } + \trace{\trans{\triangle U} C \triangle U} \\
&\stackrel{\zeta_1}{=} -\trace{\trans{\triangle U} \left(\triangle U + \sum_i A_i \triangle U\right) } + \trace{\trans{\triangle U} C \triangle U} \\
&= \trace{\trans{\triangle U} \left(C - \sum_i A_i - \mathbf{I} \right) \triangle U} \\
&= \sum_{i=1}^{n-2} \trans{\triangle u}_i D \triangle u_i,
\end{align*}
where $D\triangleq \begin{bmatrix} 2n-1 & 0 \\ 0 & -(n-1) \end{bmatrix}$. $\zeta_1$ follows from \eqref{eq:constraints-unchanged}. Since all perturbations in the tangential space satisfy $\trans{\mathbf{1}_{2 \times 1}}\triangle u_i=0$, we see that $\triangle u_i \in \linspan{\begin{bmatrix}
1 \\ -1
\end{bmatrix}}$. Since $\begin{bmatrix}
1 & -1
\end{bmatrix} D \begin{bmatrix}
1 \\ -1
\end{bmatrix} = n > 0$, this shows that objective value strictly increases for any perturbation along the tangential space at $U$.
\end{proof}
\section{Gradient Descent}\label{sec:gd}
In previous sections we have seen that for the perturbed penalty objective~\eqref{eq:smoothed}, under some technical conditions on the SDP, with high probability upon appropriate choice of the parameters, every approximate SOSP is approximately optimal. Second-order methods such as cubic regularization and trust regions~\citep{nesterov2006cubic,cartis2012complexity} converge to an approximate SOSP in polynomial time.
While gradient descent with random initialization can take exponential time to converge to an SOSP~\citep{du2017gradient}, a recent line of work starting with~\citet{ge2015escaping} has established that perturbed gradient descent (PGD)\footnote{This is vanilla gradient descent but with additional random noise added to the updates when the gradient magnitude becomes smaller than a threshold.} converges to an SOSP as efficiently as second-order methods in the worst case, with high probability. In particular we have the following \emph{almost dimension free} convergence rate for PGD from~\citep{jin2017escape}.
\begin{theorem}[Theorem 3 of \citet{jin2017escape}]
Let $f$ be $l$-smooth (that is, its gradient is $l$-Lipschitz) and have a $\rho$-Lipschitz Hessian. There exists an absolute constant $c_{\max}$ such that, for any $\delta \in (0, 1)$, $\epsilon \leq \frac{l^2}{\rho}$, $\Delta_f \geq f(X_0) -f^*$, and constant $c \leq c_{\max}$, $PGD(X_0,l,\rho,\epsilon,c,\delta,\Delta_f)$ applied to the cost function $f$ outputs a $(\rho^2,\epsilon)$ SOSP with probability at least $1-\delta$ in
$$O \left( \frac{(f(X_0)-f^*)l}{\epsilon^2} \log^4 \left( \frac{nkl \Delta_f}{\epsilon^2 \delta} \right) \right)$$
iterations.
\end{theorem}
The above theorem requires the function $f$ to be smooth and Hessian-Lipschitz. The next lemma states that the perturbed penalty objective~\eqref{eq:smoothed} satisfies these requirements---proof in Appendix~\ref{apdx:gd}.
\begin{lemma}\label{lem:gd_param}
In the region $\{U \in \mathbb{R}^{n\times k} : \|U\|_F \leq \tau \}$ for some $\tau > 0$, the cost function $\hat L_\mu(U)$ in~\eqref{eq:smoothed} is $l$-smooth and its Hessian is $\rho$-Lipschitz with:
\begin{itemize}
\item $l \leq 2\|C+G\|_2 + 4 \mu \|\mathcal{A}\| \|\mathbf{b}\|_2 + 12 \mu \tau^2 \|\mathcal{A}\|^2$, and
\item $\rho \leq 16\mu \tau \|\mathcal{A}\|^2$.
\end{itemize}
Here, $\|\mathcal{A}\|$ is as defined in~\eqref{eq:normofA}. Notice furthermore that, with high probability, $\|G\|_2 \leq 3\sigma_G\sqrt{n}$. In that event, $\|C+G\|_2 \leq \|C\|_2 + 3\sigma_G\sqrt{n}$.
\end{lemma}
Combining this lemma with the above theorem shows that the perturbed gradient method converges to an $(\epsilon, \rho^2)$ SOSP in $\widetilde{O}(\frac{1}{\epsilon^2})$ steps (ignoring all other problem parameters). This can be improved to $\widetilde{O}(\frac{1}{\epsilon^{1.75}})$ using a variant of Nesterov's accelerated gradient descent~\citep{jin2017accelerated}.
Moreover, if the objective function is (restricted) strongly convex in the vicinity of the local minimum, then we can further improve the rates to $\textrm{poly} \log\left(\frac{1}{\epsilon}\right)$~\citep{jin2017escape}. This property is satisfied for problems where $\mathcal{A}$ meets either restricted isometry conditions or when $\mathcal{A}$ pertains to a uniform sampling of incoherent matrices~\citep{agarwal2010fast, negahban2012restricted,sun2014guaranteed}. See~\citep{bhojanapalli2016dropping} for more discussions on restricted strong convexity close to the global optimum.
The complexity of the algorithm is given by Gradient-Computation-Time $\times $ Number of iterations. Computing the gradient in each iteration requires $O\left(Zk+nk^2 + mnk \right)$ arithmetic operations where $Z$ is the number of non-zeros in $C$ and the constraint matrices. For dense problems this becomes $O\left( mn^2k \right)$. However, most practical problems tend to have a certain degree of sparsity in the constraint matrices so that the computational complexity of such a method can be significantly smaller than the worst-case bound.
\subsection{Main results}
The main contributions of this work are:
\begin{itemize}
\item We propose a simple penalty version of the factored SDP~\eqref{eq:factored} and show that, for almost all cost matrices $C$, any exact SOSP of the rank-constrained formulation~\eqref{eq:penalty_factored} is a global optimum for rank ${\Omega}(\sqrt{m})$---see Corollary~\ref{cor:exactpenaltyfactorized}. This result removes the smooth manifold requirement of~\citep{boumal2016non}, though it applies to~\eqref{eq:penalty_sdp}, not~\eqref{eq:sdp}.
\item We show that there indeed exists a compact, feasible SDP with a worst-case $C$ for which the penalized, factorized problem admits a suboptimal SOSP (see Theorem~\ref{thm:bad_sdp}), even for rank almost as big as the dimension.
\item We show that by perturbing the objective function slightly and by performing a smoothed analysis on the resulting problem, we can guarantee every approximate SOSP of the perturbed problem is an approximate global optimum of the perturbed and penalized SDP. Hence, we can use standard techniques~\citep{cartis2012complexity,ge2015escaping} to find approximate SOSPs and guarantee global optimality---see Theorem~\ref{thm:optimal_approx_compact}.
\end{itemize}
In summary, we show that for a class of SDPs with bounded solutions, we can find a low-rank solution that is close to the global optimum of the penalty objective. We believe that the factorization technique can be leveraged to design faster SDP solvers, and any looseness in the current bounds is an artifact of our proof, which hopefully can be tightened in future works.
\subsection{Prior work}
Fast solvers for SDPs have garnered interest in the optimization and in the theoretical computer science communities for a long time. Most of the existing results for SDP solvers can be categorized into direct (convex) methods and factorization methods. \\
\noindent \textbf{Convex methods:}
Classical techniques such as interior point methods~\citep{ nesterov1989self, nesterov1988polynomial, alizadeh1995interior} and cutting plane methods~\citep{anstreicher2000volumetric,krishnan2003properties} enjoy geometric convergence, but their computational complexity per iteration is high. As a result, it is hard to scale these methods to SDPs with a large number of variables.
With the goal of speeding up the computation, many works have considered: i) a specific and important class of SDPs, namely, SDPs with a trace constraint ($\trace{X}=1$), and ii) methods with sub-linear convergence. For these SDPs, \citet{arora2005fast} proposed a multiplicative weights method which provides faster techniques for some graph problems, with running time depending on $O(\frac{1}{\epsilon^2})$ and the \textit{width} of the problem. \citet{hazan2008sparse} proposed a Frank--Wolfe-type algorithm with a complexity of $\tilde{O}( \frac{Z}{\epsilon^{3.5}})$ where $Z$ is the sparsity of $C$ and the $A_i$'s. \citet{garber2016sublinear, garber2016faster} proposed faster methods that either remove the dependence on $Z$ (sub-linear time), or improve the dependence on $\epsilon$. While these methods improve the per iteration complexity, they still need significant memory as the rank of solutions for these methods is not bounded, and scales at least at the rate of $O(\frac{1}{\epsilon})$. An exception to this is the work by \citet{yurtsever2017sketchy}, which uses sketching techniques in combination with conditional gradient method to maintain a low rank representation. However this method is guaranteed to find a low rank optimum only if the conditional gradient method converges to a low rank solution. \\
\noindent \textbf{Factorization methods:}
\citet{burer2003nonlinear, burer2005local} proposed a different approach to speed up computations, namely by searching for solutions with smaller rank. Even though all feasible compact SDPs have at least one solution of rank $O(\sqrt{m})$ \citep{barvinok1995problems, pataki1998rank}, it is not an easy task to optimize directly on the rank-constrained space because of non-convexity. However, \citet{burer2003nonlinear, burer2005local} showed that any \emph{rank-deficient local minimum} is optimal for the SDP; \citet{journee2010low} extended this result to any rank-deficient SOSP under restrictive conditions on the SDP. However, these results cannot guarantee that SOSPs are rank deficient, or at least that rank-deficient SOSPs can be computed efficiently (or even exist). \citet{boumal2016non} address this issue by showing that for a particular class of SDPs satisfying some regularity conditions, and for almost all cost matrices $C$, any SOSP of the rank-constrained problem with $k = \Omega(\sqrt{m})$ is a global optimum. Later, \citet{pmlr-v65-mei17a} showed that for SDPs with elliptic constraints (similar to the Max-Cut SDP), any rank-$k$ SOSP gives a $(1-\frac{1}{k-1})$ approximation to the optimum value. Both these results are specific to particular classes of SDPs and do not extend to general problems.
In a related setup, \citet{keshavan2010matrix, jain2013low} have showed that rank-constrained matrix completion problems can be solved using smart initialization strategies followed by local search methods. Following this, many works have identified interesting statistical conditions under which certain rank-constrained matrix problems have no spurious local minima \citep{ sun2016geometric, bandeira2016low, ge2016matrix, bhojanapalli2016global, park2017non, ge2017no, zhu2017global, ge2017optimization}. These results are again for specific problems and do not extend to general SDPs.
In contrast, our result holds for a large class of SDPs in penalty form, without strong assumptions on the constraint matrices $A_i$ and for a large class of cost matrices $C$. We avoid degenerate SDPs with spurious local minima by perturbing the problem and then using a smoothed analysis, which is one of the main contribution of the work.
\subsection*{Notation}
For a smooth function $f(X)$, we refer to first-order stationary points $X$ as FOSPs. Such points satisfy $\nabla f(X) = 0$ (zero gradient). We refer to second-order stationary points at SOSPs. Such points are FOSPs and furthermore satisfy $\nabla^2 f(X) \succeq 0$, i.e., the Hessian is positive semidefinite. The set of symmetric matrices of size $n$ is $\Sym{n\times n}$. $\sigma_i()$ and $\lambda_i()$ denote the $i$th singular- and eigenvalues respectively, in decreasing order.
\subsection{SDPs with positive definite cost}\label{sec:pd}
We now consider a second class of SDPs: ones where the cost matrix $C$ is positive definite. The feasible set of these SDPs need not be compact. However, FOSPs for these SDPs are bounded, hence we will be able to show similar results as in Section~\ref{sec:compact}. Consider the penalty formulation of the perturbed problem,
\begin{align}
\underset{U \in \mathbb{R}^{n \times k}}{\text{minimize}} ~ \widehat L_{\mu}(U) = \ip{C+G}{UU^T}+\mu \sum_{i=1}^m \left(\ip{A_i}{UU^T} - b_i\right)^2,
\label{eq:smoothed}
\end{align}
where $G$ is a symmetric random matrix with $G_{ij} \stackrel{i.i.d.}{\sim} \mathcal{N}(0,\sigma_G^2)$ for $i\leq j$. Let $\widehat F_{\mu}(UU^T) = \widehat L_{\mu} (U)$. To prove an optimality result for this problem, we first show a residue bound for any $\epsilon$-FOSP of $\widehat L_{\mu}(U)$.
\begin{lemma}\label{lem:residues}
Consider~\eqref{eq:smoothed} with a positive definite cost matrix $C$. Let $\sigma_G \leq \frac{\lambda_{\min}(C)}{6\sqrt{n \log(n/ \delta)}}$. Then, with probability at least $1-\delta$, at any $\epsilon$-FOSP $U$ of~\eqref{eq:smoothed}, the residue obeys:
$$
\|\mathbf{r}\|_2 =\|\mathcal{A}(UU^T) -\mathbf{b}\|_2 \leq \|\mathcal{A}\| \max \left \{ \left( \frac{2\epsilon} {\lambda_{\min}(C)}\right)^2, \frac{2\mu}{\lambda_{\min}(C)} \|\mathbf{b}\|_2^2 \right \}+\|\mathbf{b}\|_2.
$$
\end{lemma}
Using this, we get the following result from Lemma~\ref{lem:compact_optimal_approx} and Theorem \ref{thm:compact_eps_fosp} along same lines as that of Theorem \ref{thm:optimal_approx_compact}.
Let $$B \triangleq \|\mathcal{A}\| \max \left \{ \left( \frac{2\epsilon} {\lambda_{\min}(C)}\right)^2, \frac{2\mu}{\lambda_{\min}(C)} \|\mathbf{b}\|_2^2 \right \}+\|\mathbf{b}\|_2.$$
\begin{theorem}[Global optimality.]\label{thm:optimal_approx}
Let $\delta \in (0, 1)$ and $c_0$ be a universal constant. Given an SDP \eqref{eq:sdp} with positive definite objective matrix $C$, let $\tilde X $ be a global optimum of the perturbed problem \eqref{eq:smoothed}, and let $\sigma_G \leq \frac{\lambda_{\min}(C)}{4\sqrt{n \log(n/ \delta)}}$. Let $U$ be an $(\epsilon, \gamma)$-SOSP of the perturbed problem \eqref{eq:smoothed} with:
\begin{align*}
\epsilon \leq \left(\frac{\gamma k^2 \sigma_G^2 }{ 32c_0 n \mu \|\mathcal{A}\|^2}\right)^{\sfrac{2}{3}} ~\text{ and }~ k \geq 3\left[\log\left(\frac{n}{\delta}\right) + \sqrt{ \operatorname{rank}(\mathcal{A}) \log \left(1 +\frac{8 \mu B\|\mathcal{A}\|\sqrt{c_0 n} }{\sigma_G } \right) } \right].
\end{align*}
Then, with probability at least $1-O(\delta)$,
\begin{align*}
\widehat F_{\mu}(UU^T) - \widehat F_{\mu}(\tilde X) \leq \gamma \sqrt{\epsilon} \operatorname{Tr}(\tilde X) +\frac{1}{2}\epsilon \|U\|_F.
\end{align*}
\end{theorem}
This result shows that even though the feasible set of SDP is not compact, as long as the objective is positive definite, all approximate SOSPs of the perturbed objective are approximately optimal. Without the positive definite condition, SDPs can have unbounded solutions (see Section 2.4 of \citet{gartner2012approximation}). We also require a bound on the magnitude of the perturbation ($\sigma_G$), as otherwise the objective ($C+G$) can be indefinite with (too) high probability, which may result in unbounded solutions.
\section{Introduction}
\label{sec:intro}
\input{intro_reorg}
\section{Exact second-order points typically are optimal}
\label{sec:exact}
\input{exact_optimal_reorg}
\section{Exact second-order points sometimes are suboptimal}
\label{sec:exact_sub}
\input{exact_suboptimal_reorganized}
\section{Approximate second-order points: smoothed analysis}
\label{sec:smooth}
\input{smoothed_analysis_reorganized}
\subsection{Compact SDPs} \label{sec:compact}
\input{compact_SDP_reorganized}
\input{pd_reorganized}
\input{applications}
\input{gradient_descent}
\section{Conclusions and perspectives}\label{sec:conc}
In this paper we considered the Burer--Monteiro factorization to solve SDPs~\eqref{eq:factored}. In addition to dimensionality reduction, one advantage of such formulations is that algorithms for them necessarily produce positive semidefinite solutions of rank at most $k$. An ideal theorem would state that some polynomial-time algorithm computes approximate optima for~\eqref{eq:factored} in all cases with reasonably small $k$. In this regard, we now review what we achieved, what seems impossible and what remains to be done.
Because problem~\eqref{eq:factored} has nonlinear constraints, our first step was to move to a penalized formulation~\eqref{eq:penalty_factored}. For simplicity, we chose to work with a quadratic penalty. Quadratic penalties may require pushing $\mu$ to infinity to achieve constraint satisfaction at the optimum. Taking $\mu$ large may prove challenging numerically. In practice, it is known that augmented Lagrangian formulations (ALM) behave better in this respect~\citep{birgin2014ALM}. Thus, a first direction of improvement for the present work is to tackle ALM formulations instead.
Second, we established in Section~\ref{sec:exact} that for almost all SDPs, all exact SOSPs of~\eqref{eq:penalty_factored} are global optima which map to global optima of the penalized SDP~\eqref{eq:penalty_sdp} provided $\frac{k(k+1)}{2} > m$, where $m$ is the number of constraints. It should not be possible to improve the dependence on $k$ by much since certain SDPs admit a unique solution of rank $r$ such that $\frac{r(r+1)}{2} = m$. We showed in Section~\ref{sec:exact_sub} that for certain SDPs the penalty formulation~\eqref{eq:penalty_factored} admits suboptimal SOSPs. This suggests that even in the ideal statement stated above one may need to exclude some SDPs.
Third, we showed in Section~\ref{sec:smooth} that upon perturbing the cost matrix $C$ randomly (to avoid pathological cases), with high probability and provided $k = \tilde \Omega(\sqrt{m})$ (which is the right order though constants and dependence on other parameters could certainly be improved), when SOSPs have bounded residues (which is the case for positive definite cost matrices and for compact SDPs up to a technical modification), all SOSPs of the factored, penalized and perturbed problem are approximately optimal for that problem. This is achieved through smoothed analysis, which we believe is an appropriate tool to deal with the pathological cases exhibited above. These results can be further improved by deducing approximate constraint satisfaction and optimality for the original SDP~\eqref{eq:sdp}---which we currently do not do---and by further relaxing conditions on the SDP.
Finally, we studied the applicability of our results to two applications: Max-Cut and matrix completion. While these particularizations do not always improve over the specialized solvers for these problems, we believe that the work done here in studying low-rank parameterization of SDPs will be a helpful step towards building up to faster methods.
\section*{Acknowledgment}
NB thanks Dustin Mixon for many interesting conversations on the applicability of smoothed analysis to low-rank SDPs. NB was supported in part by NSF award DMS-1719558.
\bibliographystyle{abbrvnat}
| {'timestamp': '2018-03-02T02:05:59', 'yymm': '1803', 'arxiv_id': '1803.00186', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00186'} | arxiv |
\section{Proofs} \label{sec:proof}
We first present a lemma for strongly convex functions
that can be used for finding a set of models
when the data values are changed in the interval.
These proofs are mainly based on convex optimization theory.
\begin{lemma} \label{lm:strong-convexity-sphere}
Let $f(\bm{v})$: $S\to\mathbb{R}$ ($S\subseteq\mathbb{R}^k$: a convex set) be $\lambda$-strongly convex. Let $\bm{v}^* := \argmin_{\bm{v}\in S} f(\bm{v})$ be the optimal solution of the minimization problem.
Then, for any $\bar{\bm{v}}\in S$, $\|\bm{v}^* - \bar{\bm{v}}\|_2\leq\sqrt{(2/\lambda)(f(\bar{\bm{v}}) - f(\bm{v}^*))}$ holds.
\end{lemma}
\begin{proof}
The lemma is proved from the fact that $\partial f(\bm{v}^*)^\top (\bar{\bm{v}} - \bm{v}^*)\geq 0$ holds for any subdifferentiable convex function $f: S\to\mathbb{R}$ for any convex domain $S$ (see B.24 in \cite{bertsekas1999nonlinear} for the proof). Then we have
\begin{align*}
& f(\bar{\bm{v}}) - f(\bm{v}^*) \\
\geq& \partial f(\bm{v}^*)^\top (\bar{\bm{v}} - \bm{v}^*) + (\lambda/2)\|\bar{\bm{v}} - \bm{v}^*\|_2^2
\quad\text{(strong convexity)}\\
\geq& (\lambda/2)\|\bar{\bm{v}} - \bm{v}^*\|_2^2.
\end{align*}
\end{proof}
\begin{proof}[Proof of Theorem \ref{th:interval-primal-solution}]
For any $X^{\prime\prime}\in[\underline{X}, \overline{X}]$,
let $\bm{w}^{\prime\prime} := \argmin_{\bm{w}} P_{X^{\prime\prime}}(\bm{w})$
and $\bm{\alpha}^{\prime\prime} := \argmin_{\bm{\alpha}} D_{X^{\prime\prime}}(\bm{\alpha})$.
Noting that $P_{X^{\prime\prime}}$ is $\lambda$-strongly convex if $\rho$ is $\lambda$-strongly convex,
we have
\begin{align*}
& \|\bm{w}^{\prime\prime} - \bm{w}^\prime \|_2 \\
\leq & \sqrt{2 [ P_{X^{\prime\prime}}(\bm{w}^\prime) - P_{X^{\prime\prime}}(\bm{w}^{\prime\prime}) ]/\lambda}
\quad(\because~\text{Lemma \ref{lm:strong-convexity-sphere}}) \\
= & \sqrt{2 [ P_{X^{\prime\prime}}(\bm{w}^\prime) - D_{X^{\prime\prime}}(\bm{\alpha}^{\prime\prime}) ]/\lambda}
\quad(\because~\text{\eqref{ex:strong-duality}}) \\
\leq & \sqrt{2 [P_{X^{\prime\prime}}(\bm{w}^\prime) - D_{X^{\prime\prime}}(\bm{\alpha}^{\prime})] / \lambda},
\quad(\because~\text{$\bm{\alpha}^{\prime\prime}$ is a maximizer of $D_{X^{\prime\prime}}$}).
\end{align*}
Therefore we can build a superset of $\cW^*$ as
\begin{align}
& {\cW}^* = \{ \bm{w}^{\prime\prime} \mid X^{\prime\prime}\in[\underline{X}, \overline{X}] \}
\quad(\because \text{\eqref{eq:set_of_parameter}}) \nonumber \\
\subseteq & \bigcup_{X^{\prime\prime}\in[\underline{X}, \overline{X}]}
\left\{ \bm{w} \mid \|\bm{w} - \bm{w}^\prime \|_2 \leq \sqrt{2 [P_{X^{\prime\prime}}(\bm{w}^\prime) - D_{X^{\prime\prime}}(\bm{\alpha}^{\prime})] / \lambda} \right\} \nonumber \\
= & \bigl\{ \bm{w} \mid \|\bm{w} - \bm{w}^\prime \|_2 \leq \max_{X^{\prime\prime}\in[\underline{X}, \overline{X}]} \sqrt{2 [P_{X^{\prime\prime}}(\bm{w}^\prime) - D_{X^{\prime\prime}}(\bm{\alpha}^{\prime})] / \lambda} \bigr\} \label{eq:bound-spot2region} \\
& (\text{the union of concentric hyperspheres}) \nonumber \\
\subseteq & \{ \bm{w} \mid \|\bm{w} - \bm{w}^\prime \|_2 \leq \sqrt{2 \Delta / \lambda} \} =: \cW. \label{eq:bound-spot2region-separated}
\end{align}
Thus we know that $\cW$ in \eqref{eq:cW} is a superset of $\cW^*$.
Note that the relationship between \eqref{eq:bound-spot2region} and \eqref{eq:bound-spot2region-separated}
can be proved from the following fact:
\begin{align}
& \max_{X^{\prime\prime}\in[\underline{X}, \overline{X}]} [P_{X^{\prime\prime}}(\bm{w}^\prime) - D_{X^{\prime\prime}}(\bm{\alpha}^{\prime})] \nonumber \\
\leq & \max_{X^{\prime\prime}\in[\underline{X}, \overline{X}]} P_{X^{\prime\prime}}(\bm{w}^\prime) - \min_{X^{\prime\prime}\in[\underline{X}, \overline{X}]} D_{X^{\prime\prime}}(\bm{\alpha}^{\prime}) =: \Delta. \nonumber
\end{align}
\end{proof}
\begin{proof}[Proof of Theorem \ref{th:interval-primal-computation}]
In the setting of the theorem, the following \eqref{ex:max-primal-in-interval} and \eqref{ex:max-dual-in-interval} hold.
Then we have \eqref{eq:duality-gap-upper-bound-limited} by $P_{X^\prime}(\bm{w}^\prime) = D_{X^\prime}(\bm{\alpha}^\prime)$ ($\because$ \eqref{ex:strong-duality}) and Theorem \ref{th:interval-primal-solution}.
\begin{align}
& \max_{X^{\prime\prime}\in[\underline{X}, \overline{X}]} P_{X^{\prime\prime}}(\bm{w}^\prime) - P_{X^\prime}(\bm{w}^\prime) \nonumber\\
= & \frac{1}{n} \sum_{i\in\cI} [\max\{ \ell(y_i, p^-_i), \ell(y_i, p^+_i) \} - \ell(y_i, \bm{w}^{\prime\top}\bm{x}^\prime_{i\cdot})]. \label{ex:max-primal-in-interval}\\
& \min_{X^{\prime\prime}\in[\underline{X}, \overline{X}]} D_{X^{\prime\prime}}(\bm{\alpha}^\prime) - D_{X^\prime}(\bm{\alpha}^\prime) \nonumber\\
= & \sum_{j\in\cJ} \Bigl[ \rho^*_j\left(\frac{1}{n}\bm{\alpha}^{\prime\top}\bm{x}^\prime_{\cdot j}\right) - \max\Bigl\{ \rho^*_j\Bigl(\frac{1}{n} q^-_j \Bigr), \rho^*_j\Bigl(\frac{1}{n} q^+_j \Bigr) \Bigr\} \Bigr]. \label{ex:max-dual-in-interval}
\end{align}
We only present the proof of \eqref{ex:max-primal-in-interval} here;
the counterpart proof for \eqref{ex:max-dual-in-interval} can be similarly derived.
\begin{align}
& \max_{X^{\prime\prime}\in[\underline{X}, \overline{X}]} P_{X^{\prime\prime}}(\bm{w}^\prime) - P_{X^\prime}(\bm{w}^\prime) \nonumber\\
=& \max_{X^{\prime\prime}\in[\underline{X}, \overline{X}]} \frac{1}{n} \sum_{i\in[n]} \ell(y_i, \bm{w}^{\prime\top}\bm{x}^{\prime\prime}_{i\cdot})
- \frac{1}{n} \sum_{i\in[n]} \ell(y_i, \bm{w}^{\prime\top}\bm{x}^\prime_{i\cdot}) \nonumber\\
=& \frac{1}{n} \sum_{i\in[n]} \max_{\bm{x}^{\prime\prime}_{i\cdot}\in[\underline{\bm{x}_{i\cdot}}, \overline{\bm{x}_{i\cdot}}]} \ell(y_i, \bm{w}^{\prime\top}\bm{x}^{\prime\prime}_{i\cdot})
- \frac{1}{n} \sum_{i\in[n]} \ell(y_i, \bm{w}^{\prime\top}\bm{x}^\prime_{i\cdot}) \label{eq:bound-primal-decomposed-raw}\\
=& \frac{1}{n} \sum_{i\in\cI} \max_{\bm{x}^{\prime\prime}_{i\cdot}\in[\underline{\bm{x}_{i\cdot}}, \overline{\bm{x}_{i\cdot}}]} \ell(y_i, \bm{w}^{\prime\top}\bm{x}^{\prime\prime}_{i\cdot})
- \frac{1}{n} \sum_{i\in\cI} \ell(y_i, \bm{w}^{\prime\top}\bm{x}^\prime_{i\cdot})
\label{eq:bound-primal-decomposed} \\
=& \frac{1}{n} \sum_{i\in\cI} \max\{ \ell(y_i, p^-_i), \ell(y_i, p^+_i) \}
- \frac{1}{n} \sum_{i\in\cI} \ell(y_i, \bm{w}^{\prime\top}\bm{x}^\prime_{i\cdot}).
\label{eq:bound-primal-decomposed-maximized}
\end{align}
The expression \eqref{eq:bound-primal-decomposed-raw} is rewritten as \eqref{eq:bound-primal-decomposed} (fewer terms in the summation) because, if $i\not\in\cI$, then $\underline{\bm{x}_{i\cdot}} = \overline{\bm{x}_{i\cdot}}$ and therefore $\bm{x}^{\prime\prime}_{i\cdot} = \bm{x}^\prime_{i\cdot}$.
The first term in \eqref{eq:bound-primal-decomposed} can be computed as that in \eqref{eq:bound-primal-decomposed-maximized} since $\ell(y, t)$ is a one-variable convex function with respect to $t$; it is maximized at either end of the domain of $t$, that is,
\begin{align*}
t = p^-_i = \min_{\bm{x}^{\prime\prime}_{i\cdot}\in[\underline{\bm{x}_{i\cdot}}, \overline{\bm{x}_{i\cdot}}]} \bm{w}^{\prime\top}\bm{x}^{\prime\prime}_{i\cdot} \quad
\text{or}
\quad
t = p^+_i = \max_{\bm{x}^{\prime\prime}_{i\cdot}\in[\underline{\bm{x}_{i\cdot}}, \overline{\bm{x}_{i\cdot}}]} \bm{w}^{\prime\top}\bm{x}^{\prime\prime}_{i\cdot}.
\end{align*}
The fact that $p^-_i = \min_{\bm{x}^{\prime\prime}_{i\cdot}\in[\underline{\bm{x}_{i\cdot}}, \overline{\bm{x}_{i\cdot}}]} \bm{w}^{\prime\top}\bm{x}^{\prime\prime}_{i\cdot}$ is proved as follows.
$p^+_i$ is similarly proved.
\begin{align}
& \min_{\bm{x}^{\prime\prime}_{i\cdot}\in[\underline{\bm{x}_{i\cdot}}, \overline{\bm{x}_{i\cdot}}]} \bm{w}^{\prime\top}\bm{x}^{\prime\prime}_{i\cdot}
= \sum_{j\in[d]}(w^\prime_j > 0 ~?~ w^\prime_j \underline{x_{hj}} : w^\prime_j \overline{x_{hj}})\nonumber\\
= & \bm{w}^{\prime\top}\bm{x}^\prime_{i\cdot} + \sum_{j\in[d]}[(w^\prime_j > 0 ~?~ w^\prime_j \underline{x_{hj}} : w^\prime_j \overline{x_{hj}}) - w^\prime_j x^\prime_{ij}] \label{eq:loss-lower-bound-decomposed}\\
= & \bm{w}^{\prime\top}\bm{x}^\prime_{i\cdot} + \sum_{j\in\cV\cJ(i)}[(w^\prime_j > 0 ~?~ w^\prime_j \underline{x_{hj}} : w^\prime_j \overline{x_{hj}}) - w^\prime_j x^\prime_{ij}] \label{eq:loss-lower-bound-decomposed-reduced} \\
= & p^-_i. \nonumber
\end{align}
The expression \eqref{eq:loss-lower-bound-decomposed} is rewritten as
\eqref{eq:loss-lower-bound-decomposed-reduced} following a similar approach to \eqref{eq:bound-primal-decomposed-raw} and \eqref{eq:bound-primal-decomposed} above.
\end{proof}
\begin{proof}[Proof of Corollary \ref{co:bound-inner-product}]
Because we assume $g$ is monotonically non-decreasing,
we only have to prove
\begin{align}
\inf_{\bm{w}\in\cW}\bm{w}^\top\bm{x} = \bm{w}^{\prime\top}\bm{x} - \|\bm{x}\|_2 \sqrt{2 \Delta / \lambda},
\label{ex:inner-product-inf} \\
\sup_{\bm{w}\in\cW}\bm{w}^\top\bm{x} = \bm{w}^{\prime\top}\bm{x} + \|\bm{x}\|_2 \sqrt{2 \Delta / \lambda}.
\label{ex:inner-product-sup}
\end{align}
\eqref{ex:inner-product-inf} is proved as follows.
\eqref{ex:inner-product-sup} is similarly proved.
\begin{align*}
&\inf_{\bm{w}\in\cW}\bm{w}^\top\bm{x}
= \inf_{\bm{w}: \|\bm w - \bm w^\prime\|_2 \le \sqrt{2 \Delta / \lambda}}\bm{w}^\top\bm{x} \\
=& \inf_{\bm{u}: \|\bm u\|_2 \le \sqrt{2 \Delta / \lambda}}(\bm{w}^\prime + \bm{u})^\top\bm{x}
= \bm{w}^{\prime\top}\bm{x} + \inf_{\bm{u}: \|\bm u\|_2 \le \sqrt{2 \Delta / \lambda}}\bm{u}^\top\bm{x}.
\end{align*}
Because the second term in the last expression is an inner product,
it is minimized when $\|\bm{u}\|_2 = \sqrt{2 \Delta / \lambda}$ and
$\bm{u}$ is directed opposite to $\bm{x}$,
that is, $\bm{u} = -\frac{\bm{x}}{\|\bm{x}\|_2} \sqrt{2 \Delta / \lambda}$
and thus $\bm{u}^\top\bm{x} = - \|\bm{x}\|_2 \sqrt{2 \Delta / \lambda}$.
Therefore, we have \eqref{ex:inner-product-inf}.
\end{proof}
\section{Preprocesses of the datasets for experiments} \label{ch:data-setups}
How to prepare datasets in Section \ref{sec:experiment} is as follows:
\begin{description}
\item[Separation of datasets into training and test sets]
For each of {\tt default} and {\tt drive} datasets, we took 10\% of instances at random
as the test set, and the rest as the training set.
For {\tt HIGGS} dataset, which has 11,000,000 instances in total,
we took 0.1\% as the test set and 10\% as the training set without overlaps at random.
\item[Outlier removal] For each diversed numerical feature $j$, let $\pi^{(j)}_{0.5}$ be its
0.5-percentile of the values in the feature of the training dataset.
Then we replaced all values in feature $j$ of both the training and the test datasets
smaller than $\pi^{(j)}_{0.5}$ with $\pi^{(j)}_{0.5}$.
We did the similar for the values in feature $j$ larger than $\pi^{(j)}_{99.5}$
(99.5-percentile).
\item[Normalization] For each feature, we normalized the values via a linear transformation
so that the smallest and the largest values in the training dataset are 0 and 1, respectively.
\end{description}
\section*{Acknowledgment}
This work was partially supported by MEXT KAKENHI (17H00758, 16H06538), JST CREST (JPMJCR1302, JPMJCR1502), RIKEN Center for Advanced Intelligence Project, and JST support program for starting up innovation-hub on materials research by information integration initiative.
\section{Introduction} \label{sec:overview}
\begin{figure*}[t]
\includegraphics[width=\hsize,clip]{Concept-Interval-Imputation.eps}
\caption{Schematic diagram of prediction uncertainty evaluation. (a) Given a training set with missing values, the goal is to evaluate the uncertainty in a prediction result. (b) MI constructs multiple ($T>1$) training sets by randomly imputing values based on a probabilistic model, and combines the prediction results of $T$ trained models. (c) The IPUB method represents the uncertainty in the missing entries as intervals, and estimates the prediction uncertainty by efficiently computing the lower and upper bounds of the prediction result.}
\label{fig:Concept-Interval-Imputation}
\end{figure*}
In this paper we study the problem of learning prediction models, such as regression and classification models, from incomplete data with missing values.
This problem arises in a variety of fields ranging from traditional statistical analysis of empirical data in biomedical and social sciences to modern machine learning tasks such as natural language processing and web analytics.
Many statistical and machine learning approaches for handling missing values have been developed and explored in the literature~\cite{schafer1997analysis,little2002statistical}.
The simplest way of dealing with missing values is to discard them.
The obvious drawback of this naive approach is that the size of the training set decreases.
Furthermore, discarding instances with missing values leads to serious biases in the prediction results unless certain simplified assumptions about the missing mechanism such as {\it the missing at random (MAR) assumption}~\cite{little2002statistical} are known to be met, which is rarely the case in practice.
Another common approach to handling missing values is {\it single imputation}, where missing values are simply populated with specific fixed values prior to prediction modeling.
A variety of single imputation methods ranging from simple mean value imputation to advanced low-rank matrix completion~\cite{candes2009exact,candes2010power,keshavan2010matrix,cai2010singular,mazumder2010spectral} have been studied in the literature.
A principal concern with these commonly used approaches is that they cannot adequately evaluate the {\it prediction uncertainty} stemming from the uncertainty due to missing entries.
The {\it multiple imputation (MI)} approach has been developed for evaluating prediction uncertainty~\cite{rubin1978multiple,tanner1987calculation,little1993pattern,van1999flexible,raghunathan2001multivariate,king2001analyzing,rubin2003nested,van2007multiple}.
The basic idea of MI is to introduce probabilistic models of true values in the missing entries.
Using probabilistic models, multiple ($T > 1$) sets of values are sampled at random, and $T$ complete training sets are synthetically constructed by imputing these values to the missing entries.
Then, $T$ prediction models are separately trained using these $T$ training sets.
The prediction uncertainty is evaluated by combining the prediction results of these $T$ models.
In MI, the performance of prediction uncertainty evaluations crucially depends on the choice of probabilistic models.
Because the mechanisms of missing values are generally unknown, it is often difficult to select appropriate probabilistic models.
Another difficulty with MI is that $T$ must be sufficiently large to adequately evaluate the prediction uncertainty.
When the size of the training set is large, the computational cost of training multiple model can be problematic.
In this paper, we propose a novel approach, called the {\it Interval-based Prediction Uncertainty Bounding (IPUB)} method, for evaluating the prediction uncertainty for learning prediction models such as regression or classification models with missing values.
The IPUB method represents the uncertainty in the true value of a missing entry as an interval.
For example, if there is a missing entry for the age of a person, the IPUB method represents the uncertainty in the missing entry, e.g., as
``{\it the missing age is in the interval $[20, 40]$}''.
Then, for a given test input, the IPUB method also represents the uncertainty in the prediction result in the form of an interval.
For example, if the model is trained to predict the income of a person, IPUB evaluates the prediction uncertainty, e.g., as
``{\it the predicted income is in the interval [80K, 120K]}''.
The IPUB method can be applied to a class of linear prediction models whose learning algorithm can be formulated as a certain form of penalized empirical risk minimization problem (see \eq{eq:problem-primal}) .
This class contains many popular prediction model learning algorithms (see Table~\ref{tb:example-loss-penalty}).
The IPUB method has two advantages.
The first is that it does not rely on probabilistic models of the true values of the missing entries.
To evaluate the prediction uncertainty, the IPUB method computes lower and upper bounds for the predicted value when all possible training sets constructed by imputing arbitrary values in the intervals are considered.
The second advantage is that, unlike MI methods, the IPUB method does not require multiple model training computations.
Specifically, using the IPUB method, a gauge of prediction uncertainty in the form of an interval can be computed only with the cost of training a single prediction model and $O(M)$ additional computations, where $M$ is the number of missing entries in the training set.
\figurename~\ref{fig:Concept-Interval-Imputation} illustrates the difference between the MI approach and the proposed IPUB method.
\subsection{Related works and our contributions}
The most popular MI approach is Bayesian MI~\cite{rubin1978multiple,tanner1987calculation,little1993pattern,van1999flexible,raghunathan2001multivariate}.
In Bayesian MI, using observed entries in a training set, probabilistic models of the true values of the missing entries in the form of $p(X_u \mid X_o)$ are constructed, where $X_u$ is the set of unobserved values in the missing entries and $X_o$ is the set of observed values in the training set.
Bayesian MI methods proceed by generating multiple ($T > 1$) imputed training sets through randomly sampling $X_u$ from $p(X_u \mid X_o)$.
Then, using each of the $T$ training sets, $T$ prediction models are trained, and the prediction uncertainty for a test input is modeled by combining the $T$ prediction results of these $T$ models.
The main contribution of this paper is to introduce a {\it sensitivity analysis} framework for evaluating prediction uncertainty.
Sensitivity analysis has been used for analyzing the stability of solutions to optimization problems when some parameters are perturbed \cite{saltelli2000sensitivity,bertsekas1999nonlinear}.
Our basic idea is to compute how the prediction model (which is the optimal solution of a convex optimization problem) changes when the true values of the missing entries change.
We developed a novel sensitivity analysis technique for efficiently computing the interval of prediction results when the true values in the missing entries change within the intervals.
Our sensitivity analysis framework is motivated by the recent development of convex optimization techniques for sparse modeling \cite{ghaoui2012safe,wang2013lasso,wang2013scaling,ogawa2013safe,liu2014safe,wang2014safe,xiang2014screening,fercoq2015mind,ndiaye2015gap,Zimmert2015,okumura2015quick,shibagaki2015regularization,nakagawa2016safe,shibagaki2016simultaneous,Hanada2018AAAI-Modification}.
In the numerical analysis literature, so-called \emph{interval analysis} (IA) \cite{moore2009interval} has been studied, where the main goal is to evaluate the rounding error of floating point operations.
In IA, the input and output for every operation is an interval.
Therefore, some of the existing IA methods can be used similarly to the IPUB method for prediction uncertainty evaluation.
However, the output intervals for IA tend to be much wider than required because IA computes intervals for every operation, i.e., when the number of operations is large, the final intervals are much wider than the optimal ones.
In Section \ref{sec:experiment}, we compare the IPUB method with an extant IA method~\cite{hansen2003IA}, and demonstrate that the former can provide tighter bounds than the latter in most cases.
In addition, the IPUB method is much faster than the IA method because interval computations must be repeated many times in the latter.
\paragraph{Notations}
For any natural number $k$, we define $[k] := \{1, \ldots, k\}$.
The $L_p$-norm of $\bm{v}\in\RR^k$ is denoted as $\|\bm{v}\|_p := [\sum_{j\in[k]} v_j^p ]^{1/p}$.
For two vectors $\bm v, \bm u \in \RR^k$, inequality notation such as $\bm v \le \bm u$ indicates elementwise inequalities,i.e. $\bm v \le \bm u \Leftrightarrow (\forall i \in [k]) v_i \le u_i$.
In addition, interval notation such as $[\bm v, \bm u]$ indicates a set of elementwise intervals $\{[v_i, u_i]\}_{i \in [k]}$.
We also use these notations for matrices.
For a condition $c$ and two statements $s_1$ and $s_2$, the notation $(c ~?~ s_1 : s_2)$ indicates ``if $c$ is true then $s_1$, otherwise $s_2$''.
For a convex function $\phi: \RR^k\to\RR$, $\phi^*(\bm{v}) := \sup_{\bm{u}\in\RR^k}\{ \bm{u}^\top\bm{v} - \phi(\bm{u}) \}$ is called the {\em convex conjugate} of $\phi$.
\section{Problem Setup and Technical Preliminaries}
In this section we configure the problem and provide technical preliminaries for convex analysis.
\subsection{Problem Setup} \label{subsec:problem_setup}
Consider learning a linear prediction model $f$ that maps a $d$-dimensional input vector $\bm x \in \cX \subseteq \RR^d$ to a scalar output $y \in \cY \subseteq \RR$ where $\cX$ and $\cY$ are the input and output domain, respectively.
The prediction model is written as
\begin{align*}
y = g(\bm w^\top \bm x),
\end{align*}
where $g: \RR \to \cY$ is a monotonically non-decreasing function that maps the linear model output in $\RR$ to the output in $\cY$, and $\bm w \in \RR^d$ is the vector of linear model parameters.
For example, $\cY = \RR$ and $g$ is the identity function in the case of least-squares regression, $\cY = \{\pm 1\}$ and $g$ is the sign function in the case of SVM, and $\cY = [0, 1]$ and $g$ is the sigmoid function in the case of logistic regression\footnote{
In logistic regression, the domain of the training output $y_i$ is $\{\pm 1\}$ as in SVM, while the domain of the prediction results $g(\bm w^\top \bm x)$ can be considered as $[0, 1]$ when we use logistic regression model for predicting the probability of the class label being $+1$.
}.
Let $(X, \bm y)$ be the training set, where $X$ is an $n$-by-$d$ input matrix and $\bm y$ is an $n$-dimensional output vector.
The $i$-th row, the $j$-th column and the $(i, j)$-th element of $X$ are respectively written as $\bm x_{i \cdot}$, $\bm x_{\cdot j}$ and $x_{ij}$, and the $i$-th element of $\bm y$ is written as $y_i$ for $i \in [n]$ and $j \in [d]$.
In this paper, we consider a situation where some of the elements in $X$ are missing.
The set of missing elements is denoted as $\cM \subset \{(i, j)\}_{i \in [n], j \in [d]}$, and its size is written as $M=|\cM|$.
We denote the true input matrix as $X^*$, and its $i$-th row, $j$-th column, $(i,j)$-th element are similarly written as $\bm x^*_{i \cdot}$, $\bm x^*_{\cdot j}$, $x^*_{ij}$, respectively.
Note that we cannot actually observe $x^*_{ij}, (i, j) \in \cM$, while the remaining elements of $X^*$ are the same as the corresponding elements of $X$, i.e., $x^*_{ij} = x_{ij} \text{ if } (i, j) \notin \cM$.
For now, consider a hypothetical situation where we can observe $X^*$.
We use a class of learning algorithms formulated as a penalized empirical risk minimization problem in the form of
\begin{align}
\label{eq:problem-primal}
\bm w^* := \argmin_{\bm w \in \RR^d} \frac{1}{n} \sum_{i \in [n]} \ell(y_i, \bm w^\top \bm x^*_i) + \rho(\bm w),
\end{align}
where $\ell: \cY \times \RR \to \RR_+$ is a convex loss function, and $\rho: \RR^d \to \RR_+$ is a convex penalty function.
The class \eq{eq:problem-primal} contains many well-known learning algorithms.
When the training input matrix $X$ contains missing entries, we cannot obtain the optimal model parameters $\bm w^*$.
A commonly taken heuristic approach for circumventing this difficulty is to construct a synthetic input matrix $\hat{X}$ either by discarding instances that contain missing entries or by imputing fixed values to the missing entries, and then solve the problem in \eq{eq:problem-primal} by using $(\hat{X}, \bm y)$ as the training set instead of $(X^*, \bm y)$.
As discussed in Section \ref{sec:overview}, this heuristic approach completely ignores the effect of the uncertainty in missing entries.
As noted, in this paper, we represent the uncertainty in a missing entry as an interval.
For a missing entry $(i, j) \in \cM$, let $[\underline{x_{ij}}, \overline{x_{ij}}]$ represent the interval in which the true value $x^*_{ij}$ is located, where $\underline{x_{ij}} < \overline{x_{ij}}$ are the smallest and largest possible value that $x^*_{ij}$ takes, respectively.
We also denote the uncertainty in missing entries in the entire input matrix $X$ as $[\underline{X}, \overline{X}]$, where, for an observed element $(i, j) \notin \cM$, $\underline{x_{ij}} = \overline{x_{ij}} = x_{ij}$.
When we write $X^\prime \in [\underline{X}, \overline{X}]$, $X^\prime$ represents an arbitrary matrix such that all the elements satisfy $x^\prime_{ij} \in [\underline{x_{ij}}, \overline{x_{ij}}]$.
Our goal is to fully incorporate the uncertainty in missing entries for evaluating the uncertainty in prediction results.
To this end, let us consider a set of trained model parameters
\begin{align}
\label{eq:set_of_parameter}
\cW^* := \{\argmin_{\bm w \in \RR^d} \frac{1}{n} \ell(y_i, \bm w^\top {\bm x}^\prime_{i \cdot}) + \rho(\bm w) \mid X^\prime \in [\underline{X}, \overline{X}]\}.
\end{align}
Then, for a test input $\bm x \in \cX$, the uncertainty in the prediction result is also represented as an interval
\begin{align*}
g(\bm w^{*\top} \bm x) \in [\underline{g(\bm w^{*\top} \bm x)}, \overline{g(\bm w^{*\top} \bm x)}],
\end{align*}
where
\begin{subequations}
\label{eq:prediction_bounds}
\begin{align}
\underline{g(\bm w^{*\top} \bm x)} &:= \mathop{\rm inf}_{\bm w \in \cW^*} g(\bm w^\top \bm x), \\
\overline{g(\bm w^{*\top}\bm x)} &:= \mathop{\rm sup}_{\bm w \in \cW^*} g(\bm w^\top \bm x).
\end{align}
\end{subequations}
Namely,
the set of parameters $\cW^*$ in \eq{eq:set_of_parameter} represents the collection of all possible solutions of the penalized empirical risk minimization problems in \eq{eq:problem-primal} when the input matrix $X^\prime$ is arbitrarily chosen from the interval $[\underline{X}, \overline{X}]$,
while
$\underline{g(\bm w^{*\top} \bm x)}$
and
$\overline{g(\bm w^{*\top} \bm x)}$
in \eq{eq:prediction_bounds}
respectively indicate the smallest and largest possible prediction result when the uncertainty in missing entries is incorporated.
Unfortunately, it is not possible to obtain $\cW^*$ in practice because, by definition, it requires us to solve infinitely many penalized empirical risk minimization problems.
Our fundamental approach to tackling this difficulty involves developing a computationally feasible method that can efficiently compute
\begin{subequations}
\begin{align}
\label{eq:bound_prediction_L}
&L(\underline{g(\bm w^{*\top} \bm x)}) \le \underline{g(\bm w^{*\top} \bm x)} \text{ and }\\
\label{eq:bound_prediction_U}
&U(\overline{g(\bm w^{*\top} \bm x)}) \ge \overline{g(\bm w^{*\top} \bm x)},
\end{align}
\end{subequations}
where $L(\underline{g(\bm w^{*\top} \bm x)})$ and $U(\overline{g(\bm w^{*\top} \bm x)})$ are a lower bound of the smallest possible prediction result and an upper bound of the largest possible prediction result, respectively.\footnote{
In the case of binary classification, e.g., by SVM, the uncertainty in the prediction results for the output domain $\cY = \{\pm 1\}$ is given by considering a lower and an upper bound of the linear discriminant function from
$L(\underline{\bm w^{*\top} \bm x})$
and
$U(\overline{\bm w^{*\top} \bm x})$.
The uncertainty in the predicted labels in $\{\pm 1\}$ is then given by
\begin{align*}
g(\bm w^{*\top} \bm x) = \mycase{
+1 & \text{ if } L(\underline{\bm w^{*\top} \bm x)}) > 0, \\
-1 & \text{ if } U(\overline{\bm w^{*\top} \bm x)}) < 0, \\
\text{unknown} & \text{ otherwise}.
}
\end{align*}
}
If these bounds are sufficiently tight, we can use them for evaluating the uncertainty in the prediction results.
\subsection{Technical Preliminaries for Convex Analysis} \label{subsec:technice_preliminaries}
Here, we present technical preliminaries for convex analysis which are used for constructing the proposed method in the next section.
For a comprehensive introduction to convex analysis, see, e.g., \cite{Boyd04a}.
In this subsection, for notational simplicity, we denote the input matrix as $X$, and assume that there are no missing entries in $X$.
Let us denote the objective function of the empirical risk minimization problem in \eq{eq:problem-primal} as
\begin{align}
P_{X}(\bm w) := \frac{1}{n} \sum_{i \in [n]} \ell(y_i, \bm w^\top \bm x_i) + \rho(\bm w).
\end{align}
The method proposed in the next section can be applied to the problem in \eq{eq:problem-primal}
when
the loss function
$\ell$
and
the penalty function
$\rho$
satisfy certain conditions.
The {\em dual problem} of
\eq{eq:problem-primal} is written,
by using the convex conjugates $\ell^*$ and $\rho^*$\footnote{For $\ell$, we take the convex conjugate with respect to the second argument.},
as
\begin{align}
& \textstyle
\bm \alpha^*
:=
\argmax_{\bm \alpha \in {\rm dom} \ell^*, \frac{1}{n} X^\top \bm \alpha \in {\rm dom} \rho^*}
D_X(\bm \alpha),
\quad
\text{where}
\nonumber \\
& \textstyle
D_X(\bm \alpha)
:= - \frac{1}{n} \sum_{i \in [n]} \ell^*(y_i, -\alpha_i) - \rho^*(\frac{1}{n} X^\top \bm \alpha),
\label{eq:problem-dual}
\end{align}
where ${\rm dom}\cdot$ denotes the domain of the function.
See, for example, Corollary 31.2.1 in \cite{rockafellar1970convex} for the details of dual problem derivation.
Between the primal optimal solution
$\bm w^*$
and the dual optimal solution
$\bm \alpha^*$,
the following relationships are known to hold under certain regularity conditions:
\begin{align}
& \bm{w}^* \in \left.
(\partial/\partial \bm {v})\rho^*(\bm{v})\right|_{\bm{v} = \frac{1}{n}X^\top\bm{\alpha}^*},&&\text{({\em KKT condition})} \label{ex:KKT-primal}\\
& \alpha^*_i \in -\left.(\partial/\partial \bm {v})\ell(y_i, v)\right|_{v = \bm{w}^{*\top}\bm{x}_{i\cdot}},&&\text{({\em KKT condition})} \label{ex:KKT-dual}\\
& D_X(\bm \alpha^*) = P_X(\bm{w}^*). &&\text{({\em strong duality})} \label{ex:strong-duality}
\end{align}
The method proposed in the next section can be applied to any convex loss functions such as the squared loss function for regression, the hinge loss function for SVM, and the logistic loss function for logistic regression.
See Table~\ref{tb:example-loss-penalty} for these loss function specifications, their convex conjugates, and their subderivatives.
On the other hand, the penalty function $\rho$ must satisfy the following properties.
\begin{definition}[$\lambda$-strongly convex decomposable penalty] \label{df:strongly-convex-decomposable penalty}
A penalty function
$\rho$
is said to be
\emph{$\lambda$-strongly convex} for a
$\lambda > 0$
if
$\rho(\bm{w}_1) - \rho(\bm{w}_2)
\geq
\partial \rho(\bm{w}_1)^\top (\bm{w}_1 - \bm{w}_2) +
(\lambda/2)\|\bm{w}_1 - \bm{w}_2\|_2^2$
holds for any
$\bm{w}_1, \bm{w}_2 \in \RR^d$.
%
Furthermore,
it is said to be \emph{decomposable}
if it is written as
\begin{align*}
\rho(\bm w) = \sum_{j \in [d]} \rho_j(w_j),
\end{align*}
where $\rho_j: \RR \to \RR$, $j \in [d]$, is a convex function.
\end{definition}
Definition \ref{df:strongly-convex-decomposable penalty} includes the $L_2$ penalty, the elastic net penalty, and some other popular penalties.
See Table~\ref{tb:example-loss-penalty} for these penalty function specifications, their convex conjugates, and their subderivatives.
\begin{table*}[tp]
\caption{Examples of loss functions $\ell$ and penalty functions $\rho$ for which the proposed IPUB method is applicable}
\label{tb:example-loss-penalty}
\begin{center}
{\small
\begin{tabular}{ccc}
\hline
\hline
Loss function $\ell(y_i, \bm w^\top\bm x_{i\cdot} )$ & $\ell^*(y_i, -\alpha_i )$ & $\displaystyle \left.\frac{\partial}{\partial v}\ell(y_i, v)\right|_{v = \bm{w}^{*\top}\bm{x}_{i\cdot}}$ \\
\hline
\hline
$\displaystyle \begin{matrix}
(y_i - \bm w^\top \bm x_{i\cdot})^2 \\
(\text{{\em Squared loss}};\\
y_i\in\RR)
\end{matrix}$
& $\displaystyle \frac{1}{4} \alpha_i(\alpha_i - 4 y_i)$\quad($\displaystyle \alpha_i\in\RR$)
& $\displaystyle 2(\bm{w}^{*\top}\bm{x}_{i\cdot} - y_i)$
\\
\hline
$\displaystyle \begin{matrix}
[1 - y_i \bm w^\top \bm x_{i\cdot}]_+~{}^{\text{*1}} \\
(\text{{\em Hinge loss}};\\
y_i\in\{-1, +1\})
\end{matrix}$
& $\displaystyle -\frac{\alpha_i}{y_i}$\quad($\displaystyle 0\leq \frac{\alpha_i}{y_i}\leq 1$)
& $\begin{cases}
0 & (\text{if $y_i \bm{w}^{*\top}\bm{x}_{i\cdot} > 1$}) \\
[-y_i, 0]~{}^{\text{*2}} & (\text{if $y_i \bm{w}^{*\top}\bm{x}_{i\cdot} = 1$}) \\
-y_i & (\text{if $y_i \bm{w}^{*\top}\bm{x}_{i\cdot} < 1$})
\end{cases}$
\\
\hline
$\displaystyle \begin{matrix}
\log(1 + \exp(- y_i \bm w^\top \bm x_{i\cdot} )) \\
(\text{{\em Logistic loss}};\\
y_i\in\{-1, +1\})
\end{matrix}$
& $\displaystyle \begin{matrix}
\displaystyle \left(1 - \frac{\alpha_i}{y_i}\right)\log|y_i - \alpha_i|
\\ \displaystyle + \frac{\alpha_i}{y_i}\log|\alpha_i| - \log|y_i|
\\ \text{($\displaystyle 0\leq \frac{\alpha_i}{y_i}\leq 1$)~${}^{\text{*3}}$}
\end{matrix}$
& $\displaystyle -\frac{y_i}{1 + \exp(y_i\bm{w}^{*\top}\bm{x}_{i\cdot})}$
\\
\hline
\hline
\\
\hline
\hline
Penalty function $\rho(\bm{w})$ & $\displaystyle \rho^*(\frac{1}{n} X^\top \bm \alpha)$ & $\displaystyle \left.\frac{\partial}{\partial\bm{v}}\rho^*(\bm{v})\right|_{\bm{v} = \frac{1}{n}X^\top\bm{\alpha}^*}$\\
\hline
\hline
$\displaystyle \begin{matrix}
\displaystyle\frac{\lambda}{2}\|\bm w\|_2^2$~${}^{\text{*4}} \\
(\text{$L_2$~{\em penalty}})
\end{matrix}$
& $\displaystyle \frac{1}{2\lambda n^2}\|X^\top \bm \alpha\|_2^2$
& $\displaystyle \frac{1}{\lambda n}X^\top \bm \alpha^*$
\\
\hline
$\displaystyle \begin{matrix}
\displaystyle \frac{\lambda}{2}\|\bm w\|_2^2 + \kappa\|\bm w\|_1~{}^{\text{*4}} \\
(\text{{\em Elastic net penalty}})
\end{matrix}$
& $\displaystyle \begin{matrix}
\displaystyle \frac{1}{2\lambda n^2}\times \\
\displaystyle \sum_{j\in[d]}([|\bm \alpha^\top\bm{x}_{\cdot j}| - n\kappa]_+)^2$~${}^{\text{*1}}
\end{matrix}$
& $\displaystyle \begin{matrix}
\displaystyle \left[ \frac{[F_j]_+ - [G_j]_+}{\lambda n}\right]_{j\in[d]}~{}^{\text{*1}}
\\ (F_j = \bm{\alpha}^{*\top}\bm{x}_{\cdot j} - n\kappa,
\\ G_j = -\bm{\alpha}^{*\top}\bm{x}_{\cdot j} - n\kappa)
\end{matrix}$
\\
\hline
\hline
\end{tabular}
\\
\begin{minipage}[c]{1.0\textwidth}
*1: $[t]_+ := \max\{0, t\}$.
\quad
*2: If $y_i = -1$, replace $[-y_i, 0]$ with $[0, -y_i]$.
\quad
*3: If $\frac{\alpha_i}{y_i} = 0$ or $1$, treat $\ell^*(y_i, -\alpha_i ) = 0$.
\quad
*4: $\lambda, \kappa > 0$ are tuning parameters.
\end{minipage}
\end{center}
\end{table*}
\section{Proposed Method} \label{sec:interval-privacy-convex}
In this section, we present our main results.
Proofs of the theorems and the corollary in this section are all presented in Appendix \ref{sec:proof}.
Given a test input $\bm x \in \cX$, our goal is to evaluate the prediction uncertainty in the form of an interval
\begin{align*}
g(\bm w^{*\top} \bm x) \in [L(\underline{g(\bm w^{*\top} \bm x)}), U(\overline{g(\bm w^{*\top} \bm x)})],
\end{align*}
where
$L(\underline{g(\bm w^{*\top} \bm x)})$
and
$U(\overline{g(\bm w^{*\top} \bm x)})$
are the lower bound of the smallest possible prediction result
and
the upper bound of the largest possible prediction result,
respectively.
Our approach with the proposed IPUB method involves the following two steps:
\\
\noindent
{\bf step 1}. Compute a superset $\cW \supseteq \cW^*$ from $\underline{X}$, $\overline{X}$ and $\bm y$.
\\
\noindent
{\bf step 2}. Compute $L(\underline{g(\bm w^{*\top} \bm x)})$ and $U(\overline{g(\bm w^{*\top} \bm x)})$ from $\cW$.
\\
\noindent
As described below, the computational cost of step 1 is the cost of solving a single penalized empirical risk minimization problem in \eq{eq:problem-primal} and $O(M)$ additional computations where $M$ is the number of missing entries.
Once we compute a superset $\cW \supseteq \cW^*$, the computational cost of step 2 is $O(d)$ for each test input $\bm x \in \cX \subseteq \RR^d$.
\subsection{Step 1}
\begin{algorithm}[tp]
\caption{Step 1}
\label{alg:compute-duality-gap}
\begin{algorithmic}[1]
\STATE {\bf Input} $\underline{X}, \overline{X}, \bm y$
\STATE
Select an arbitrary $X^\prime \in [\underline{X}, \overline{X}]$
\STATE
Compute $\bm w^\prime$, $\bm \alpha^\prime$ as in \eq{eq:sol} by using $X^\prime$
\STATE
$\Delta \gets 0$.
\FORALL{$i\in{\cI}$}
\STATE $p^-_i\gets \bm w^{\prime \top}\bm x^\prime_{i\cdot}$,
$p^+_i\gets \bm w^{\prime \top}\bm x^\prime_{i\cdot}$.
\FORALL{$j\in\cJ_\cM(i)$}
\STATE $p^-_i\gets p^-_i + (w^\prime_j > 0 ~?~ w^\prime_j \underline{x_{ij}} : w^\prime_j \overline{x_{ij}}) - w^\prime_jx^\prime_{ij}$.
\STATE $p^+_i\gets p^+_i + (w^\prime_j > 0 ~?~ w^\prime_j \overline{x_{ij}} : w^\prime_j \underline{x_{ij}}) - w^\prime_jx^\prime_{ij}$.
\ENDFOR
\STATE $\Delta\gets\Delta+\frac{1}{n}[\max\{ \ell(y_i, p^-_i), \ell(y_i, p^+_i) \} - \ell(y_i, \bm w^{\prime\top}\bm x^\prime_{i\cdot})]$
\ENDFOR
\FORALL{$j\in{\cJ}$}
\STATE $q^-_j\gets \bm \alpha^{\prime \top}\bm x^\prime_{\cdot j}$,
$q^+_j\gets \bm \alpha^{\prime \top}\bm x^\prime_{\cdot j}$.
\FORALL{$i\in\cI_\cM(j)$}
\STATE $q^-_j\gets q^-_j + (\alpha^\prime_i > 0 ~?~ \alpha^\prime_i \underline{x_{ij}} : \alpha^\prime_i \overline{x_{ij}}) - \alpha^\prime_ix^\prime_{ij}$
\STATE $q^+_j\gets q^+_j + (\alpha^\prime_i > 0 ~?~ \alpha^\prime_i \overline{x_{ij}} : \alpha^\prime_i \underline{x_{ij}}) - \alpha^\prime_ix^\prime_{ij}$
\ENDFOR
\STATE $\Delta\gets\Delta + \max\{ \rho^*_j(\frac{1}{n} q^-_j), \rho^*_j(\frac{1}{n} q^+_j) \} - \rho^*_j(\frac{1}{n}\bm \alpha^{\prime \top}\bm x^\prime_{\cdot j})$
\ENDFOR
\STATE
{\bf Return} $\cW$, i.e., the center $\bm w^\prime$ and the radius $\sqrt{2 \Delta/\lambda}$
\end{algorithmic}
\end{algorithm}
The pseudo-code for step 1 is presented in Algorithm~\ref{alg:compute-duality-gap}.
First, we select an arbitrary input matrix $X^\prime$ from the interval, i.e.,
\begin{align*}
X^\prime \in [\underline{X}, \overline{X}].
\end{align*}
Next, we compute the primal and dual solutions by solving the penalized empirical risk minimization problem in \eq{eq:problem-primal} by using $(X^\prime, \bm y)$ as the training set, i.e.,
\begin{subequations}
\label{eq:sol}
\begin{align}
\label{eq:sol_primal}
\bm w^\prime &= \argmin_{\bm w} P_{X^\prime}(\bm w),
\\
\label{eq:sol_dual}
\bm \alpha^\prime &= \argmax_{\bm \alpha} D_{X^\prime}(\bm \alpha).
\end{align}
\end{subequations}
Then, we compute a superset $\cW \supseteq \cW^*$ as
\begin{align}
\label{eq:cW}
\cW := \{\bm w \in \RR^d \mid \|\bm w - \bm w^\prime \|_2 \le \sqrt{2 \Delta/\lambda }\},
\end{align}
where
\begin{align}
\label{eq:duality_gap}
\Delta
:=
\max_{X^{\prime \prime} \in [\underline{X}, \overline{X}]} P_{X^{\prime \prime}}(\bm w^\prime)
-
\min_{X^{\prime \prime} \in [\underline{X}, \overline{X}]} D_{X^{\prime \prime}}(\bm \alpha^\prime).
\end{align}
The following theorem formally states that $\cW$ in \eq{eq:cW} is actually a superset of $\cW^*$ in \eq{eq:set_of_parameter}.
\begin{theorem} \label{th:interval-primal-solution}
Suppose that the penalty function $\rho$ satisfies the properties in Definition~\ref{df:strongly-convex-decomposable penalty}.
Let $X^\prime \in [\underline{X}, \overline{X}]$ be any input matrix in the interval.
Furthermore,
let
$\bm{w}^\prime$
and
$\bm{\alpha}^\prime$
be the primal and dual solutions of the problem in \eq{eq:problem-primal}
when the input matrix is $X^\prime$
as defined in
\eq{eq:sol_primal} and
\eq{eq:sol_dual}, respectively.
Then,
the set of model parameters $\cW$
defined in
\eq{eq:cW}
is a superset of
$\cW^*$,
i.e.,
$\cW \supseteq \cW^*$.
\end{theorem}
Theorem \eqref{th:interval-primal-solution} is based on the strong convexity
(Definition~\ref{df:strongly-convex-decomposable penalty}) of the primal objective function $P$.
By strong convexity, for any $X^{\prime\prime}\in[\underline{X}, \overline{X}]$,
the difference between two optimal solutions $\|\bm{w}^\prime - \bm{w}^{\prime\prime}\|_2$
can be bounded from above by the difference between the objective function values
$P_{X^{\prime\prime}}(\bm{w}^\prime) - P_{X^{\prime\prime}}(\bm{w}^{\prime\prime})$,
which can be bounded by $\Delta$.
See Lemma \ref{lm:strong-convexity-sphere} in Appendix \ref{sec:proof} for details.
Next, we observe that, given the solution $\bm w^\prime$, the cost of computing the superset $\cW$ in \eq{eq:cW} is only $O(M)$.
Specifically, in the following theorem we state that $\Delta$ in \eq{eq:duality_gap} can be computed with a cost of $O(M)$ if some relevant quantities have already been computed.
\begin{theorem} \label{th:interval-primal-computation}
Suppose that the same condition as Theorem \ref{th:interval-primal-solution} holds.
Furthermore, assume that the following values have already been computed:
\begin{subequations}
\label{eq:precomputed}
\begin{align}
\label{eq:precomputed1}
&
\bm w^{\prime \top} \bm x^\prime_{i \cdot} ~ \forall i \in [n],
~
\bm \alpha^{\prime \top} \bm x^\prime_{\cdot j} ~ \forall j \in [d],
\\
\label{eq:precomputed2}
&
\cI := \{i \in [n] \mid (i, j) \in \cM\},
\\
\label{eq:precomputed3}
&
\cJ := \{j \in [d] \mid (i, j) \in \cM\},
\\
\label{eq:precomputed4}
&
\cI_{\cM}(j) := \{i \in [n] \mid (i, j) \in \cM\} ~ \forall j \in \cJ,
\\
\label{eq:precomputed5}
&
\cJ_{\cM}(i) := \{j \in [d] \mid (i, j) \in \cM\} ~ \forall i \in \cI.
\end{align}
\end{subequations}
Then $\Delta$ in \eq{eq:duality_gap} is computed with a cost $O(M)$ as
\begin{align}
\Delta = & \frac{1}{n} \sum_{i\in{\cI}} [ \max\{ \ell(y_i, p^-_i), \ell(y_i, p^+_i) \} - \ell(y_i, \bm{w}^{\prime \top}\bm x^\prime_{i\cdot}) ]
\nonumber
\\
& \! \! + \sum_{j\in{\cJ}} [ \textstyle \max\{ \rho^*_j(\frac{1}{n} q^-_j), \rho^*_j(\frac{1}{n} q^+_j) \} - \rho^*_j(\frac{1}{n} \bm{\alpha}^{\prime \top}\bm x^\prime_{\cdot j}) ],
\label{eq:duality-gap-upper-bound-limited}
\end{align}
where
\begin{align*}
p^-_i := & \bm w^{\prime\top}\bm x^\prime_{i\cdot} + \sum_{j\in\cJ_{\cM}(i)}[(w^\prime_j > 0 ~?~ w^\prime_j \underline{x_{ij}} : w^\prime_j \overline{x_{ij}}) - w^\prime_j x^\prime_{ij}], \\
p^+_i := & \bm w^{\prime\top}\bm x^\prime_{i\cdot} + \sum_{j\in\cJ_{\cM}(i)}[(w^\prime_j > 0 ~?~ w^\prime_j \overline{x_{ij}} : w^\prime_j \underline{x_{ij}}) - w^\prime_j x^\prime_{ij}], \\
q^-_j := & \bm \alpha^{\prime\top}\bm x^\prime_{\cdot j} + \sum_{i\in\cI_{\cM}(j)}[(\alpha^\prime_i > 0 ~?~ \alpha^\prime_i \underline{x_{ij}} : \alpha^\prime_i \overline{x_{ij}}) - \alpha^\prime_i x^\prime_{ij}], \\
q^+_j := & \bm \alpha^{\prime\top}\bm x^\prime_{\cdot j} + \sum_{i\in\cI_{\cM}(j)}[(\alpha^\prime_i > 0 ~?~ \alpha^\prime_i \overline{x_{ij}} : \alpha^\prime_i \underline{x_{ij}}) - \alpha^\prime_i x^\prime_{ij}].
\end{align*}
\end{theorem}
\noindent
Note that
the assumption that the values in \eq{eq:precomputed} have been precomputed is not problematic
because
the quantities in \eq{eq:precomputed1} must have been computed when solving the optimization problem for computing $\bm w^\prime$ and $\bm \alpha^\prime$, while the quantities in \eq{eq:precomputed2} to \eq{eq:precomputed5} can be known beforehand because they are merely lists of the positions in the missing entries.
In addition, the memory required to store all these values is only $O(n + d + M)$.
\subsection{Step 2}
Because the superset $\cW \subseteq \cW^*$ in step 1 is a sphere in $\RR^d$, it is straightforward to compute
a lower bound
$L(\underline{g(\bm w^{*\top} \bm x)})$
and
an upper bound
$U(\overline{g(\bm w^{*\top} \bm x)})$
as in the following corollary.
\begin{corollary} \label{co:bound-inner-product}
Assume that a set of model parameters $\cW$ is a superset of $\cW^*$ and is represented as a sphere with a center $\bm w^\prime$ and a radius $\sqrt{2 \Delta/\lambda}$, then
the prediction result
$g(\bm w^{*\top} \bm x)$
for a test input
$\bm x \in \cX \subseteq \RR^d$
is guaranteed to be within the following interval
\begin{align}
\label{eq:prediction_interval}
g(\bm w^{*\top} \bm x) \in [L(\underline{g(\bm w^{*\top} \bm x)}), U(\overline{g(\bm w^{*\top} \bm x)})],
\end{align}
where
\begin{align*}
L(\underline{g(\bm w^{*\top} \bm x)}) &= \inf_{\bm w \in \cW} g(\bm w^\top \bm x) = g(\bm w^{\prime \top} \bm x - \|\bm x\|_2 \sqrt{2 \Delta/\lambda}), \\
U(\overline{g(\bm w^{*\top} \bm x)}) &= \sup_{\bm w \in \cW} g(\bm w^\top \bm x) = g(\bm w^{\prime \top} \bm x + \|\bm x\|_2 \sqrt{2 \Delta/\lambda}).
\end{align*}
\end{corollary}
\noindent
The cost of computing the prediction interval in \eq{eq:prediction_interval} is $O(d)$.
\section{Experiment} \label{sec:experiment}
We explored the performance of the proposed IPUB method by comparing it with the Interval Newton (INewton) method \cite{hansen2003IA}.
We applied the two methods to three datasets taken from the UCI machine learning repository \cite{Asuncion07}, where approximately 90\% of each dataset was used for the training set, while the remaining 10\% was used as the test set (see Table \ref{tb:datasets-info}). Detailed setups are presented in Appendix \ref{ch:data-setups}.
For brevity, we only present results for the logistic regression in which we predict the probability of the class label being $+1$ by using the sigmoid function $g(\bm w^{*\top} \bm x) = 1/(1 + \exp(-\bm w^{*\top} \bm x))$.
We compared the performance of the two methods in terms of prediction uncertainty interval length and computation time.
The former is evaluated as the difference between the upper bound and the lower bound of the predicted probability, i.e., $U(\overline{g(\bm w^{*\top} \bm x)}) - L(\underline{g(\bm w^{*\top} \bm x)})$.
All the computations were carried out with an Intel Xeon CPU (3.10GHz clock) and 256GB RAM.
\begin{table}[t]
\caption{Datasets used for experimentation. All are taken from the UCI Machine Learning Repository \cite{Asuncion07}.}
\label{tb:datasets-info}
\begin{center}
\begin{tabular}{cccc}
\hline
& \multicolumn{2}{c}{Number of} & \\
& \multicolumn{2}{c}{instances} & Number of \\
\cline{2-3}
Dataset & Training & Test & features \\
\hline
{\tt default} {\scriptsize (default of credit card clients)} & 27,000 & 3,000 & 28 \\
{\tt drive} {\scriptsize (Sensorless Drive Diagnosis)} & 52,658 & 5,851 & 48 \\
{\tt HIGGS} & 1,100,000 & 11,000 & 28 \\
\hline
\end{tabular}
\end{center}
\end{table}
\subsection{Settings}
\paragraph{Experimental Setting Parameters}
We considered various experimental settings by adjusting three parameters.
The first parameter is the missing-value proportion $b \in \{0.01, 0.001\}$; we randomly chose $n \times d \times b$ elements of the input matrix and regard them as missing entries.
The second parameter is the missing value interval length $\alpha \in \{0.5, 0.9\}$; we set the interval for each missing element to [$(1-\alpha)/2$-quantile, $(1+\alpha)/2$-quantile] of the original values in the element.
The third parameter is the penalty parameter $\lambda \in \{0.1, 1.0\}$.
\paragraph{Implementation of IPUB}
In the implementation of Algorithm \ref{alg:compute-duality-gap},
$X^\prime$ is chosen as $(\underline{X} + \overline{X})/2$,
$\bm{w}^\prime$ is computed using the trust region Newton method
implemented in LIBLINEAR \cite{Fan08b}, and
$\bm{\alpha}^\prime$ is computed from $\bm{w}^\prime$ by \eqref{ex:KKT-dual}.
\paragraph{Interval Newton (INewton) Method}
We compared the performances of the proposed IPUB method with an interval analysis method called the Interval Newton (INewton) method \cite{hansen2003IA}.
In the INewton method, every operation in each Newton step is conducted for parameters and data represented as intervals.
The computational cost of the INewton method is $O(Knd^3)$, where $K$ is the number of Newton iteration steps; the cost is proportional to $d^3$ due to the matrix inverse operation in each Newton step.
\subsection{Results}
\paragraph{Prediction Uncertainty Interval Length}
Figure~\ref{fig:uncertainty-histogram} shows results pertaining to the prediction uncertainty interval length.
Each plot contains a green histogram of prediction uncertainty interval lengths $U(\overline{g(\bm w^{*\top} \bm x)}) - L(\underline{g(\bm w^{*\top} \bm x)})$ by the IPUB method, and a purple histogram of the counterpart prediction uncertainty interval lengths obtained using the INewton method for each test input $\bm x$.
In most cases, the prediction uncertainty interval lengths associated with the IPUB method are much smaller than those for the INewton method.
Because both methods guarantee that the predicted values are within the intervals, the results testify to the superiority of the IPUB method.
\begin{figure*}[tp]
\begin{center}
\includegraphics[width=\hsize,clip]{summaryKDDdefault.eps}\\
(a) {\tt default} dataset \\
\includegraphics[width=\hsize,clip]{summaryKDDdrive.eps} \\
(b) {\tt drive} dataset \\
\includegraphics[width=\hsize,clip]{summaryKDDHIGGS.eps} \\
(c) {\tt HIGGS} dataset \\
\caption{
Normalized histograms of prediction uncertainty interval lengths obtained using the IPUB method (green) and the INewton method (purple) for test inputs in three datasets.
Since both methods guarantee that the prediction values are within the intervals, shorter interval lengths indicate better performance.
}
\label{fig:uncertainty-histogram}
\end{center}
\end{figure*}
\paragraph{Computation Time}
Table~\ref{tb:times} lists the ratios of the IPUB to INewton computation times.
In all cases, the IPUB method is more than 100 times faster than the INewton method.
\begin{table}[t]
\caption{The ratio of computation times of the IPUB method to those of the INewton method.
}
\label{tb:times}
\begin{center}
{\tabcolsep=1mm {\small
\begin{tabular}{lc|cc|cc}
\hline
& & \multicolumn{2}{c}{$\lambda=0.1$} & \multicolumn{2}{c}{$\lambda=1$} \\
\multicolumn{1}{c}{Dataset} & $a$ & $b=1/100$ & $b=1/1000$ & $b=1/100$ & $b=1/1000$ \\
\hline
{\tt default} & $0.5$ & 5.16e$-$03 & 5.39e$-$03 & 3.41e$-$03 & 2.40e$-$03 \\
($n=$27,000, $d=$28) & $0.9$ & 4.96e$-$03 & 5.63e$-$03 & 3.27e$-$03 & 2.64e$-$03 \\
\hline
{\tt drive} & $0.5$ & 2.60e$-$03 & 2.67e$-$03 & 1.33e$-$03 & 1.67e$-$03 \\
($n=$52,658, $d=$48) & $0.9$ & 2.80e$-$03 & 2.89e$-$03 & 1.32e$-$03 & 1.48e$-$03 \\
\hline
{\tt HIGGS} & $0.5$ & 4.74e$-$03 & 5.10e$-$03 & 1.02e$-$03 & 9.34e$-$04 \\
($n=$1,100,000, $d=$28) & $0.9$ & 4.70e$-$03 & 5.06e$-$03 & 9.68e$-$04 & 8.61e$-$04 \\
\hline
\end{tabular}
} }
\end{center}
\end{table}
\section{Conclusion}
In this paper, we proposed a new method for evaluating prediction uncertainty for learning with missing values.
The proposed IPUB method is developed based on a novel sensitivity analysis technique for convex optimization problems, and can be applied to a wide class of commonly used machine learning algorithms.
The IPUB method is associated with less prediction uncertainty and lower computational cost than existing methods.
| {'timestamp': '2018-03-02T02:06:40', 'yymm': '1803', 'arxiv_id': '1803.00218', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00218'} | arxiv |
\section{RF-EHSN with 5G technology }
\label{sec:5G}
In this section, we study the potential of applying 5G technology into RF-EHSN for the animals' health monitoring. According to the measurement reported in \cite{pinuela2013ambient}, the density of ambient RF signals in urban and semi-urban environments is between $0.18$ and $84$\, nW/cm$^2$ on DTV, GSM 900/1800, 3G and WiFi frequencies on average, which is considerably thin to replenish an EHN in a short period of time.
The 5G mobile technology provides an opportunity to solve the thin energy problem. By operating in the millimeter wave (mmWave) band, the size of a transceiver can be significantly reduced, which makes a dense deployment of femtocells with massive antennas possible~\cite{buzzi2016survey}. By utilizing the femtocell as APs in an RF-EHSN, a highly directional beamforming can be steered to the direction of the desired EHN, which increases the directive gain and enables a quick energy charge.
The challenge of directional charging is the tight time synchronization across the antennas of a femtocell and accurate channel state information (CSI) between EHN and femtocell. These requirements can be achieved with the assistance of positioning technologies in 5G mobile networks, which can provide the location and energy status of active femtocells to EHNs. With such information, an EHN can receive RF signals from the most appropriate femtocell at the right time to optimize the efficiency of energy charge.
Compared with passive energy harvesting from ambient RF signals, an RF-EHSN with the 5G technology allows EHNs to request energy from femtocells on-demand. The advantage of proactive energy requests is the improved efficiency of power management. Specifically, the majority of existing transmission scheduling in RF-EHSN works in an offline scenario, assuming that the amount of energy harvested by an EHN at a given time is known in advance~\cite{ulukus2015energy}. Such assumption may not be true in the ambient RF environment, where the amount and the time of energy arrival are both random. By contrast, requesting energy from femtocell actively can guarantee that the energy received by an EHN is controllable and predictable to a certain extent, thereby making offline strategies more realistic in real applications.
When supplying energy to RF-EHSNs with 5G technology, the sensitivity of mmWave to the blockage needs to be taken into account. RF signals have weak ability to diffract around obstacles of sizes significantly larger than the wavelength. For the EHN implanted inside a moving animal, the mmWave link will become intermittent. Therefore, maintaining a reliable connection between an RF-EHSN and femtocells in a 5G network is a challenge for both energy charging and data transmission in animal healthcare applications.
\section{Network Architecture}
\label{sec:arch}
Due to the size and the energy constraint of the wearable EHNs, their communication range is short (usually less than one feet)~\cite{kurup2012body}. We propose a 3-tier network architecture to deliver the sensing data collected from animals in a large area to a far located health center, as illustrated in Fig.\,\ref{fig:scenario}.
\begin{figure}[htb]
\centerline{\includegraphics[width=8.8cm]{figures/scenario}}
\caption{The 3-tier architecture of RF-EHSNs for health monitoring of animals in a zoo.}\label{fig:scenario}
\end{figure}
In the Tier 1 RF-EHSN, EHNs that carry biosensors implanted inside animals' body form an ad-hoc body area network (BAN). Each BAN is associated with a sink node, which is a special EHN embedded in a necklet, earring, or leg band of an animal. It is exposed in vitro and thus can have a relatively larger size and better channel quality for mid-range (hundreds of feet) data communications.
After gathering information from the associated BANs, sink nodes forwards the data to an access point (AP), forming a local area healthcare network (LAHN), which is the Tier 2 RF-EHSN. For animals like birds that live in a hutch or an aviary enclosing with an iron net, a Faraday cage is formed and blocks the electromagnetic waves. In this circumstance, an AP needs to be placed inside the cage acting as a dedicated energy source to power EHNs; the corresponding network is a closed-access LAHN. If APs are deployed in an open area, such as a wild animal zoo or a dairy farm, an open-access LAHN is established, where EHNs can harvest energy from both ambient RF environment and APs.
Eventually, a wide area healthcare network (WAHN), the Tier 3 RF-EHSN, is developed by connecting the APs in LAHNs to Ethernet. The operator in a health center can process the information sent from APs to monitor the health status of animals in real-time. This 3-tier RF-EHSN enables a timely diagnosis to prevent diseases like bird flu and mad cow disease, thereby saving the lives of animals for dairy cattle, poultry farms, and wildlife parks.
\section{Conclusions}
\label{sec:Con}
In this article, we give a tutorial on the RF-EHSN for the healthcare of pets, livestock, and wildlife. A three-tier architecture is proposed to create an online heal monitoring network. Several unique features, such as the interaction between data transmission and energy harvest, the balance issue between a data flow and an energy flow, and dynamic of network topology, are introduced. How those features challenge the design of an RF-EHSN on different layers are discussed to shed light on the resilient RF-EHSN design. We believe RF-EHSN is a promising technology for the health monitoring and disease control of animals.
\section{Introduction}
\label{sec:introduction}
Harvesting energy from radio environment has been considered as a promising technique to drive the next-generation wireless sensor networks~\cite{shaikh2016energy}. Not only is RF energy harvesting self-sustaining and pollution-free, but an added advantage is its ability to enable perpetual monitoring in a wide spectrum of applications (e.g., healthcare, emergency management, and fitness). Recently, considerable efforts have been made to provide smart health services for human beings using the radio frequency energy harvesting sensor networks (RF-EHSNs)~\cite{hu2017wireless}; the pets, livestock and wildlife, however, have received limited benefits from this favorable technique.
Studies reveal that animals usually hide their illness and pretend to be well even when they are sick. This masking comes from animals' instinct for survival. An obvious example would be the case of a predator who targets the weakest member of a group during a hunt. This masking feature makes it difficult for veterinarians to save animals' lives once clear illness symptoms appear. Therefore, it is important to frequently check animals' health status and behaviors for a timely treatment.
However, it is highly inefficient to hire manpower to examine the health of animals, especially when the number is large. For instance, the Noble Foods Ltd is the largest free-range egg supplier in the U.K. It owns around 100 farms with an average flock size of 5,000-6,000. How to monitor the health of so many hens for disease control is a critical problem. Another example is the Owens Aviary in the San Diego Zoo, which is the home of around 200 tropical birds. It is almost impossible to monitor the health status of each bird in such a large aviary.
The wearable RF-EHSN provides a cost-effective and affordable solution to monitor the health of pets and animals. Current biosensors developed for animals have been able to conduct physiological measurement (e.g., body temperature, heartbeat, and respiratory rate), behavior tracking, and pathogen detection~\cite{neethirajan2017recent}, and provide credible information about health conditions of the carrier. By ``capturing'' renewable RF energy from surrounding environment, an energy harvesting node (EHN) can perform sensing and communication for a long period of time without battery replacement; which is an attractive advantage to provide the health service for a large number of animals in a wide area.
Current research on RF-EHSN based smart healthcare, such as the body area network (BAN), wearable internet of things (IoT), and implantable biomedical devices, mainly focus on the human beings~\cite{salayma2017wireless, sun2016edgeiot}. Limited knowledge is known about the performance of applying an RF-EHSN into the health monitoring of animals and no attempt has been made in this research direction. To fill the gap, we attempt to investigate this new and exciting area, which can have a significant impact on disease prevention and behavioral surveillance for animals in farms and zoos.
This article gives a tutorial on the healthcare of animals with the RF-EHSN technology. A multi-tier architecture is proposed to provide long-range communications between biosensors and a health center. Afterward, the opportunity of applying the fifth-generation (5G) mobile technology to replenish EHNs for high-speed communications is discussed. Compared with conventional wireless sensor networks, RF-ENSN has some unique features. For instance, the data packet from an EHN not only carries information for communication but also contains energy that can charge neighboring EHNs; in addition to the data transmissions, EHNs also require to reserve the time and channel for the energy harvesting process; the relative positions of implanted biosensors change repetitively with the body movement of an animal. How those features challenge the design of an RF-ENSN at the physical layer, link layer, and network layer is analyzed carefully. Eventually, some potential solutions that utilize the unique features of RF-ENSN to improve the quality of health service for animals are introduced.
\section{Challenges on Link Layer}
\label{sec:MAC}
In addition to coordinating the channel access among multiple EHNs, the link layer of an RF-EHSN also needs to schedule the energy harvesting process. When an EHN sends data, neighboring EHNs are able to harvest energy from the overhead signal. As a consequence, the data flow is entangled with the energy flow, which is a unique feature of RF-EHSNs. In this section, we analyze how this feature challenges the implementation of energy and medium access control (EMAC) at the link layer of RF-EHSNs.
\subsection{Efficient Information and Power Transfer}
\label{subsec:Eff}
In a healthcare network, the data generation rates of different biosensors can be different. For example, a sensor monitoring the heartbeat of an animal has much higher sampling rate than the one detecting the presence of pathogens. Due to the heterogeneous traffic loads, EHNs in a network may consume energy at distinct rates. As a result, a node with heavy traffic may not capture sufficient energy from ambient RF signals for extensive data transmission. By contrast, an idle node may harvest superfluous energy that overflows its energy storage gradually, which causes a waste. How to reallocate the energy resource among EHNs is a critical issue.
To balance the energy among EHNs, an available solution is the multi-hop energy transfer. More specifically, given the short distances among nodes, an EHN can harvest substantial amount of energy from its neighbor
~\cite{mishra2015smart}. For instance, the typical stocking density of broilers in Europe is between 11 to 25 birds per square meter. Accordingly, the space among EHNs carried by neighboring chickens is less than 1 feet. If an EHN transmits data at 0.1\,mW, the neighbors 25\,cm away can harvest 12.7\, nW/cm$^2$ of energy, which is comparable to the energy density of ambient RF signals in a semi-urban area~\cite{pinuela2013ambient}.
Through the multi-hop energy transfer, an EMAC can arrange the EHN with a high residual energy but light traffic to charge its neighbors during the data transmission. However, fast information delivery and efficient energy transfer may not be able to achieve at the same time. It has been studied in \cite{zhang2013mimo} that there exists a trade-off between the maximal data rate and the optimal energy transfer. Furthermore, unlike conventional MAC protocols that consider the signal to unintended receivers as interference degrading the communication reliability, the co-channel noises in RF-EHSNs are beneficial from the viewpoint of energy harvesting. Therefore, the EMAC protocols in RF-EHSNs not only need to avoid collisions among data packets but also seek for effective channel and energy allocations among EHNs for the efficient information delivery and energy transfer.
\subsection{Balance between Energy Cycle and Data Cycle}
\label{subsec:Bal}
Due to the size constraint, the EHN implanted inside animals is commonly equipped with a single antenna switching between energy harvesting (i.e., energy cycle) and data communication (i.e., data cycle). If an EHN is scheduled to receive energy over frequently, it will be less likely to send the data in time, which is unacceptable in applications requiring a real-time health monitoring. In addition, continuous energy harvesting with less consumption leads to a high residual energy and a low charge efficiency, as depicted in Fig.\,\ref{fig:Nonlinear}. However, if an EHN sends packets freely without considering the residual energy, it may fail to harvest enough energy, resulting in a low throughput performance. Therefore, EHNs need to balance the cycles for data transmission and energy reception.
How to schedule the energy cycle and the data cycle for an EHN is not trivial; many factors, such as the length of data queue, residual energy, power density in the environment, and future data arrivals, need to be considered comprehensively. Taking the long data queue as an instance, the EMAC tends to initiate a data cycle when the residual energy is sufficient, thus mitigating the queuing delay. If the residual energy is low and the data queue is short, cumulating energy in the current period for the future data transmission is apparently a wise choice.
In most cases, however, the scenario is not as simple as the above two examples. Take an EHN with a long data queue as an example. If current RF environment has a temporally high energy density, switching to energy cycle may harvest more energy but at the cost of higher latency for data communications. By contrast, continuing on data cycle loses the opportunity to receive a substantial amount of energy but reduces the queuing delay. The balance between energy harvest and data transmission will need a careful calculation. Moreover, the values of residual energy, data queue and energy density in a real application cannot be simply represented by a binary (high or low) but change continuously with time, which makes the coordination between the data cycle and the energy cycle more complicated.
In addition, the network traffic load also affects the scheduling of data communication and energy harvesting. In an RF-EHSN with light traffic, assume the optimal ratio of energy cycles to data cycles is $8\!:\!2$. When the network traffic becomes heavy, the EHN may fail to access the channel in its data cycle to prevent the potential interference with the neighborhood. Consequently, the data cycle arranged for the information transfer is forced into an energy cycle for energy harvesting, which may cause superfluous energy harvest and descended throughput. To tackle this problem, the EMAC needs to adjust the duty cycle of each EHN adaptively according to the network traffic, thereby maintaining an optimal duty cycle in real-time.
\subsection{Optimal Energy Request}
\label{subsec:Opt}
In some applications like the one illustrated in Fig.\,\ref{fig:scenario}, it is promising to deploy a dedicated energy source (e.g., AP in a closed-access LAHN or femtocell in a 5G network) if the surrounding ambient RF signals are too weak. EHNs carried by animals are allowed to request energy from the associated facilities on demand. The energy replenishment thus can be scheduled based on the energy consumption of each EHN. How an EHN requests energy from the dedicated energy source intelligently to minimize the overall energy consumption while guaranteeing successful data transmission for the efficient healthcare is an interesting problem.
Intuitively, the EHN needs to pay a cost for the transmission of energy requests, thereby producing considerable energy overhead if a node requests over frequently. By contrast, requesting a large amount of energy each time reduces the overhead, but leads to energy inefficiency due to the nonlinear charge characteristic of EHNs, as discussed in Section\,\ref{sec:PHY}. An optimal strategy is necessary for EHNs to request an appropriate amount of energy at the right time. To solve this problem, a path-oriented method is a feasible solution~\cite{luo2017optimal}.
\begin{figure}[htb]
\centerline{\includegraphics[width=8.3cm]{figures/ShPath}}
\caption{The shortest path based method for the optimal energy request, where a vertex at coordinates $(i, j)$ is denote by $V_{i, j}$.}\label{fig:ShPath}
\end{figure}
\begin{figure*}[htb]
\centerline{\includegraphics[width=14cm]{figures/movement}}
\caption{Topology changes of RF-EHSN resulting from animal movement, where the green dots represent biosensors and the red ones are the sink nodes.}\label{fig:movement}
\end{figure*}
In the path-oriented method, an EHN first calculates the least transmission power it required for a timely delivery of data collected from biosensors. Afterward, an energy tunnel is formed as shown in Fig.\,\ref{fig:ShPath}. The lower bound of the tunnel is determined by the least required energy accumulated with time, and the upper bound is in parallel with but $E_m$ above the lower bound, where $E_m$ is the maximum energy can be stored in an EHN. The accumulation of harvested energy (red arrow lines in Fig.\,\ref{fig:ShPath}) is subject to the two bounds, otherwise the harvested energy will either be insufficient for a timely data transmission (below the lower bound) or overflow from the energy storage (over the upper bound).
To find the optimal way for energy requesting, the energy tunnel in Fig.\,\ref{fig:ShPath} is divided into multiple grids, forming a graph with a set of ``vertices'' and ``edges''. The vertical edge indicates an energy replenishment, which generates an associate charging cost at the energy source. The cost consists of two parts: a constant overhead, and a nonlinear charge cost. The latter is determined by both the residual energy of the EHN, which is the vertical distance to the lower bound, and the amount of energy requested, which is the length of the vertical edge. A horizontal edge means no energy charging and generates no cost at the energy source. Eventually, the optimal energy requesting strategy is converted to find the route between the start point and destination that has the minimum sum-cost along the path. In Fig.\,\ref{fig:ShPath}, the path is not allowed to move backward or downward since the cumulation of harvested energy increases monotonically with time.
Consequently, the dynamic programming methods like Dijkstra's algorithm can be applied to schedule the optimal energy request. However, such solution can only work in the scenario where the destination is specified initially. The scenarios include the regular health examination, in which the lower bound of energy tunnel is predictable since biosensors collect data periodically from the animal and the EHN transmits the data in a prescheduled pattern. However, in an event-driven based application, such as detecting viruses and pathogens, the presence of an event is random; therefore an EHN cannot arrange its data transmission in advance. In this case, the energy requesting strategy needs to run in an online mode, which is still an open issue.
\section{Challenges at physical layer}
\label{sec:PHY}
Although energy harvesting can provide perpetual energy, it is critical to intelligently utilize harvested energy to achieve optimal networking performance and boost energy utilization efficiency. In this section, we identify the challenges at the physical layer of RF-EHSN and propose a new feedback-based energy harvesting model.
\begin{figure}[htb]
\centerline{\includegraphics[width=8.3cm]{figures/Mod}}
\caption{Energy harvesting models before and after taking the nonlinear charge characteristic of an EHN into account: (a) The conventional one, and (b) the new feedback-based model.}\label{fig:Mod}
\end{figure}
Fig.~\!\ref{fig:Mod}\,(a) demonstrates the conventional energy harvesting model, where the amount of harvested energy is modeled as an independent random process. Although the dependency of energy harvesting efficiency on the concurrent charge state (i.e., residual energy) of batteries is a well-known fact~\cite{boshkovska2015practical, biason2016effects}, it is not taken into account in the power management on EHNs. It was suggested that EHNs would harvest an equivalent amount of energy as long as the arrived energy is the same, regardless of the residual energy on EHNs~\cite{ulukus2015energy}.
Unfortunately, this assumption may not be true in the real world. Due to the nonlinear charge characteristic of batteries, the harvested energy is also significantly affected by the residual energy of an EHN, as illustrated in Fig.~\!\ref{fig:Mod}\,(b). To further evaluate the accuracy of the nonlinear charging feature, an indoor experiment is conducted using Powercast P2110 development kit, and Micro850 programmable logical controller (PLC). In the test, an EHN is scheduled to receive RF energy radiated from a dedicated ES, TX91501 transmitter, which was placed 6 feet away. A supercapacitor with a series resistance is selected as the battery. Since the TX91501 is non-programmable, the on/off time of the transmitter is manipulated via the Micro850 controller to direct the charging time, $T$.
\begin{figure}[htb]
\centerline{\includegraphics[width=7.7cm]{figures/Nonlinear}}
\caption{Nonlinear energy harvesting with respect to the residual energy of a commercial EHN.}\label{fig:Nonlinear}
\end{figure}
Fig.\,\ref{fig:Nonlinear} shows the experimental results that how harvested energy, $E_h$, changes nonlinearly with respect to the residual energy, $E_r$, for different charging time. To be specific, when $E_r$ changes, $E_h$ is not a constant but a concave and non-monotonic function of $E_r$.
Therefore, it is crucial to retain an appropriate amount of energy to maximize the efficiency of energy harvesting. Since residual energy is determined by data transmission, this means that the power management on EHNs influences harvested energy. To capture this important interplay between the energy harvest and the data transmission, a new feedback-based EH model is proposed, as illustrated in Fig.\,\ref{fig:Mod}(b). In the new model, an energy feedback loop from data transmission to harvested energy is established that captures this important interplay between the process of energy harvest and the power management.
The feedback loop in Fig.\,\ref{fig:Mod}(b) poses a challenge to the design of the optimal strategy for power management. The existing work of power management on EHNs is to seek an energy consumption curve within a fixed energy tunnel so that a pre-defined objective is optimized (e.g., maximizing throughput). In the new energy harvesting model, however, the feasible energy tunnel is not fixed: its bounds are impacted by the residual energy of EHN.This indicates that the energy tunnel, which determines the optimal strategy for power management, is in turn affected by the power management. In other words, an EHD cannot estimate what amount of energy it can harvest from an energy packet before scheduling its transmissions, and we call it as the \emph{causality of energy harvest}. How to manage the power under the feedback loop effect should be considered carefully.
\section{Challenges at Network Layer}
\label{sec:Routing}
Due to the severe energy constraint on EHNs, a well-designed multi-hop routing protocol plays a more important role in RF-EHSN than in traditional sensor networks to transmit data reliably and efficiently. In this section, we identify the unique features, challenges and potential solutions of routing design in RF-EHSNs for the healthcare of animals.
\subsection{Dynamic Changes of Network Topology}
\label{subsec:Eff}
RF-EHSNs and mobile ad hoc networks share the feature of highly dynamic topology. However, the topology change in RF-EHSN is caused not only by the mobility of animals carrying biosensors but also by the body movement of an individual and frequent state switching of EHNs.
\textbf{Body Movement:}
Fig.\,\ref{fig:movement} illustrates that in an ad-hoc BAN, how the optimal routing path from biosensor A to sink node S varies in running animals. As shown in the snapshot (a) for a lion, the information at $A$ needs to go through nodes $B$, $C$, and $D$ to reach the destination, $S$. However, after a short period of time, the network topology is changed with the body movement of the lion, as shown in the snapshot (c). At this moment, node $A$ can reach the destination through $D$ directly, which is two hops shorter than that in the snapshot (a).
An inherent feature of such a dynamic topology revealed in Fig.\,\ref{fig:movement} is the \emph{repetition}. Particularly, different from nodes in a mobile network, which may move randomly, the relative positions of biosensors in an ad-hoc BAN change repeatedly depending on an animal's behavior (e.g., walking, running, and sleeping). For each behavior, the changes of network topology follow a corresponding pattern and are predictable at a certain level. For a routing protocol, the discovery of optimal paths from biosensors to the destination can be fast if the current gesture of an animal is known to the network. The gesture recognition using the three-dimensional accelerometer and inertial sensors has been well studied in recent years \cite{chen2017survey}.
In addition to the repetition, another critical feature of the topology change in Fig.\,\ref{fig:movement} is the species-dependent discrepancy. Intuitively, different animals may have completely different postures for moving and sleeping, which can be observed from the running sequence of a lion and a gorilla in the figure. To minimize the end-to-end delay, the deployment of biosensors and sink node should take the appearance and motion characteristic of animals into account, and the optimal path from an EHN to the sink node can be pre-arranged once the species and the current gesture of an animal are determined through the gesture recognition.
\textbf{Frequent State Switching:} Different from traditional wireless sensor nodes, which consume energy monotonically without battery replenishment, the energy level of an EHSN could even rise after a data transmission and sensing process due to newly harvested energy. Consequently, the sensor node in an EHN will not ``die'' permanently but comes alive after a short break as a perpetual wireless equipment.
Due to the thin density of the renewable RF energy, a small EHN usually consumes energy much faster than energy harvest rate~\cite{pinuela2013ambient}. In other words, an EHN might fail quickly and lose connections with its neighbors after continuous data transmissions, and then be resurrected after energy harvest.
The state switch of nodes between live and dead causes frequent and unpredictable changes in the network topology, which poses grand challenges on the routing design. Although there has been a tremendous amount of routing protocols and topology management methods developed for wireless sensor networks~\cite{younis2014topology, pantazis2013energy}, they may not work efficiently in RF-EHSNs due to the \emph{intermittent connections} among nodes. How to sustain the reliable network connectivity for a successive packet delivery is a crucial problem for the routing design in RF-EHSNs. Different from the network carried by a moving animal, the topology change caused by the intermittent connections can even happen in a static network, e.g., ad-hoc BAN carried by a resting or sleeping wildlife, which challenges the reliability of routing protocols.
\subsection{Integration of Energy Flow and Data Flow }
\label{subsec:Int}
In an RF-EHSN, EHNs can harvest energy from data transmitted by the neighborhood. The amount of harvested energy will vary depending on routes. This adds a new dimension to the innovative routing protocol design by considering the interplay between the energy flow and data flow. For instance, a desired route might be selected from the perspective of total energy harvested from neighboring EHNs along the route.
\begin{figure}[htb]
\centerline{\includegraphics[width=8.8cm]{figures/EngFlow}}
\caption{Integration of energy flow and data flow for the route selection.}\label{fig:EngFlow}
\end{figure}
Fig.\,\ref{fig:EngFlow} illustrates an example on how the energy flow affects the route selection, where two sources, $S_1$ and $S_2$, plan to send data to a common destination, $D$. Assume $S_1$ generates and transmits data prior to $S_2$. From Fig.\,\ref{fig:EngFlow}\,(a), it can be observed that if $S_1$ selects the Path 1 as the route, then $S_2$ will use Path 2 since node $N$ is unavailable. However, if $S_1$ chooses Path 3 as shown in Fig.\,\ref{fig:EngFlow}\,(b), node $N$ will get charged by the data transmission from node $M$, and thus $S_2$ can use Path 4 for information delivery. In Fig.\,\ref{fig:EngFlow}\,(b), the sum of hop count from $S_1$ and $S_2$ to $D$ is $13$, which is four hops less than that in Fig.\,\ref{fig:EngFlow}\,(a). This example provides insights into demands that the energy flow in an RF-EHSN should be integrated with data flow in a routing design.
| {'timestamp': '2018-03-02T02:03:31', 'yymm': '1803', 'arxiv_id': '1803.00106', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00106'} | arxiv |
\section{Introduction}
Autonomous Learning for Robotics aims to endow (robotic) agents with the capability to learn from and act in their environment, so that it can adapt to previously unseen situations.
In order to be able to learn from this interaction, an agent has to build compact representations of the environments, using information captured from a high dimensional raw input.
Current approaches favor the learning of representations using Deep Neural Networks (\cite{Goodfellow-et-al-2016}, \cite{lecunreview}, \cite{DBLP:journals/corr/Schmidhuber14}). Supervised learning extracts representations from the data to solve a classification task, providing the agent with hierarchical compact representations of different sensory streams (~\cite{krizhevsky2012imagenet}, \cite{he2016deep}). However, these state-of-the-art machine learning algorithms are not suitable for autonomous learning, as they rely on labeled data, which are costly to acquire, and are constraining the representations on the classes they were trained on.
Unsupervised learning allows to learn hierarchical compression for different data streams (\cite{hinton2006reducing}, \cite{tenenbaum2000global}, \cite{radford2015unsupervised}). These representations, based on the statistics of the data, are very efficient to reduce the dimensionality of the sensory stream. However, these representations fail to inform the agent on the modalities of its potential actions in its environment. This is related to the problem of grounding knowledge in the experience of an agent \cite{harnad}.
More recently, Deep Reinforcement Learning proposed to learn sensory representations together with a policy to act in an environment \cite{mnih-dqn-2015} in order to solve a set of tasks. However, the learning depends on the external reward provided to the agent, itself dependent on the task to solve. We don't use Reinforcement Learning because we don't want to influence the sensory representations with guided exploration.
Mainstream approaches to learning representations are not sufficient for open-ended learning.
Several works are exploring new theories to propose mechanisms for an autonomous agent to learn representations from its environment. In particular, sensorimotor prediction states that an agent learns the structure of its world by learning how to predict the consequences of its actions (\cite{o2001sensorimotor}, \cite{friston2010free}). This sensorimotor approach tries to bring together sensor representations and motor representations by identifying the regularities in the sensorimotor stream.
However, these regularities are hard to capture: a robotic agent acts and perceives in an environment which is usually partially observable (limited field of view), noisy and ambiguous. The sensory information, or observation, is not sufficient to know the exact state of the agent in its environment (similar sensory states can originate from different situations in the environment). This is in particular true for navigation tasks where an agent can observe several occurrences of very similar portions of the scenes (wall, corners) at different locations in the environment ( e.g. in a maze).
For these reasons, we need representations that can help disambiguate the observations and the state of the agent.
If we take inspiration from biology, animals, in particular rats, have the ability to localize and navigate in complex mazes, which constitute partially observable and ambiguous environments. They rely on high-level representations of their environment which they learn through experience: place cells and grid cells \cite{moser2015place}. Grid cells are encoding information about the ego-motion of the rat, and place cells are activated when the rats finds itself in very particular locations of the environments.
Even though many works have studied their role in cognition, the emergence of these cells are not yet completely understood. However, their nature tends to confirm that an agent should rely on a combination of sensory information, motor information and memory to help learning representations that it can use to infer its situation in an environment.
In this paper, we propose to learn sensory representations using principles from sensorimotor prediction. We show that using motor information as well as a form of memory allows an agent to learn representations which lead to more accurate sensorimotor prediction, and that the representations learned are transferable across different environments. We show the benefits of this sensorimotor approach on a navigation scenario, where an agent equipped with distance sensors moves into an ambiguous maze.
\section{Related Work}
Our work is closely related to the literature about forward internal models \cite{wolpert1998internal}, which involve the learning of models to predict the sensory consequences of actions. For instance a forward model of physics is learned for a real-world robotic platform in \cite{agrawal2016learning}. Nonetheless, our contribution is not to build a forward internal model, but to show that doing so forces the emergence of good sensory representations. \\
Many works are involved with the learning of representations, especially with recent advances in Deep Learning and Representation Learning (\cite{Goodfellow-et-al-2016}, \cite{lecunreview}, \cite{DBLP:journals/corr/Schmidhuber14}). For conciseness, we focus on those that involve the emergence of representations from sensorimotor prediction in the case of an agent moving in a fixed environment.
In \cite{agrawal2015learning}, the authors assume that a good image representation is one that allows to predict the ego-motion between two images. Siamese networks extract features from two images, and these features correspond to the sensory representations. They are used to predict the motor command corresponding to the change from one image to the other. This instance of sensorimotor learning shows that prediction can be used as a mechanism to build representations, but lacks a form of memory in the representation, which we believe is necessary to disambiguate between states that correspond to similar observations, but different localizations in the world.
In \cite{stachenfeld2017hippocampus}, the authors propose to learn a model of the environment of an agent by encoding the prediction of its future states into cells, which correspond to a form of sensorimotor representations. They showed that decomposing the state transition matrix leads to spatial representations akin to grid cells. This approach is very relevant, however they use the localization of the agent as input to extract higher level spatial representations, whereas in our case, these representations have to be built based on distance sensor data.
In \cite{antonelo2009unsupervised}, the authors show that slowness principle allows an agent equipped with laser sensors, moving in a maze, to develop representations akin to place cells. In \cite{schonfeld2015modeling}, the authors also propose to use slowness to extract spatial representations from visual input. In both cases, motor commands are not taken into account for representation learning, and the environment is simple compared to the dimensionality of the sensors, rendering the problem non ambiguous. Additionally, the environment is one-dimensional, and their approach is very dependent on a good exploratory behavior. For these reasons, we believe that the approach doesn't scale to ambiguous, multidimensional, partially observable environments.
In \cite{jonschkowski2015learning}, the authors propose to learn a mapping from an RGB image to a representation space constrained by different priors (repeatability, proportionality with respect to the motor commands, causality and temporality), for a planar agent moving in a simple environment. They observe that the learned representation space corresponds to the position of the agent in the environment. This paper is very relevant, as the authors learn representations based on motor and sensors. However, the definition of their priors require having an external reward, which is not suitable for open-ended learning. Also, their environment is non-ambiguous, and the motor commands used are discrete very simple.
We present a representation learning method based on sensorimotor prediction which allows an agent to make use of memory and sensorimotor streams to create representations of its environment.
\section{Sensorimotor predictive model as representational learning framework}
Representation Learning methods are usually based on the minimization of the distance between an input and its reconstruction from the encoding of the input \cite{Goodfellow-et-al-2016}. We argue that reconstruction error alone doesn't capture important properties of the environment. Objects might be very close in $\mathcal{L}_2$ distance but very different in nature.
For example, an agent perceiving with range sensors will consider that a wall and a corner at the same distance from the agent are very similar, whereas 2 walls at different distances from the agents might be considered as very dissimilar. We propose to learn representations based on a prior inspired from sensorimotor theories of perception (\cite{o2001sensorimotor}, \cite{friston2010free} ) : an agent acquires knowledge about its environment by building a sensorimotor predictive model. This model takes as inputs raw sensor and motor values.
\subsection{Recurrent Sensorimotor Encoder}
We propose a model named Recurrent Sensorimotor Encoder (abbreviated Recurrent-SM-encoder), for representation learning using sensorimotor prediction and memory.
It is shown in Fig.\ref{fig:lstmsm_architecture} and it is composed of three subnetworks : \\
(i) A sensory encoding subnetwork takes as input the sensory state $s_{t}$ and outputs an encoded sensory state $z_{t}^{s}$. It is composed of hidden layers followed by a stacked LSTM network, which role is to provide a form of memory about the previous sensor states.
(ii) A motor encoding subnetwork, which is a classical dense network composed of hidden layers, taking as input the motor command $m_{t}$ and outputting the encoded motor command $z_{t}^{m}$.
(iii) $z_{t}^{s}$ and $z_{t}^{m}$ are concatenated to form the encoded sensorimotor vector $z_{t}^{sm}$, used as an input for a dense network, which outputs a prediction of the next sensory state $\hat{s}_{t+1}$
\begin{figure}[h!]
\centering
\includegraphics[width=0.4\textwidth]{images/architectures/lstmSM_architecture.eps}
\caption{Recurrent Sensorimotor Encoder}
\label{fig:lstmsm_architecture}
\end{figure}
This deep network is trained end-to-end with a sensorimotor prediction loss on the output space (see Eq.\ref{eq:loss}).
\begin{equation}
Loss \left( (s_{t},m_{t})_{t=1}^{T} \right) = \sum_{t=1}^{T-1} \left( \hat{s}_{t+1} - s_{t+1} \right) ^2
\label{eq:loss}
\end{equation}
We chose to separate sensory and motor representations, because ultimately these representations might be shared to solve different tasks.
\subsection{Baselines}
In order to evaluate the effect of sensorimotor prediction and the use of a memory (through LSTM) on the quality of the sensory representation learned, we introduce several baselines to compare our system.
The first one, called Sensorimotor Encoder (abbreviated SM-encoder), doesn't have a memory. The second one, named Recurrent Sensory Encoder (abbreviated Recurrent-S-encoder), doesn't take into account the motors. The third baseline, the Sensory Encoder (abbreviated S-encoder), encodes the raw sensory input, without memory or motors.
These baselines are presented in Fig.\ref{fig:baselines_architectures}.
\begin{figure}[h!]
\noindent
\centering
\begin{minipage}[t]{0.3\textwidth}
\centering
\includegraphics[width=0.8\textwidth]{images/architectures/encoderS_architecture.eps}
\caption*{(a) Sensory Encoder}
\label{fig:encoders_architecture}
\end{minipage}
\vspace{\baselineskip}
\begin{minipage}[t]{0.37\textwidth}
\centering
\includegraphics[width=0.8\textwidth]{images/architectures/lstmS_architecture.eps}
\caption*{(b) Recurrent Sensory Encoder}
\label{fig:lstms_architecture}
\end{minipage}
\vspace{\baselineskip}
\begin{minipage}[t]{0.32\textwidth}
\centering
\includegraphics[width=0.8\textwidth]{images/architectures/encoderSM_architecture.eps}
\caption*{(c) Sensorimotor Encoder}
\label{fig:encodersm_architecture}
\end{minipage}
\caption{Architectures of the baselines}
\label{fig:baselines_architectures}
\end{figure}
\section{Experimental setup}
We developed a simulation of an agent equipped with laser sensors in partially observable environments, in order to build a database with sequences of sensory states and motor commands. The simulation is simple enough so that it can be easily reproduced.
\subsection{Agent}
Our simulated agent is loosely inspired from the Thymio-II robot \cite{riedo2012two}. It is equipped with 5 distance sensors, evenly separated between -0.6 and 0.6 radians, and their range is limited to 10 units of distance.
The agent has one motor command controlling the translation forward (direction of the middle laser), the second one controls the rotation. One motor command $(d,r)$ is the succession of a translation $d$ and a rotation $r$.
It is a planar agent moving without friction, and there is no noise on its distance sensors.
\subsection{Environments}
We created 3 environments of size 50 units, shown on Fig.\ref{fig:environments}.
The first environment, named Square, is a square without walls or obstacles. The second environment, named Rooms1, contains one vertical wall and one horizontal wall.
The second environment, named Rooms2, contains one horizontal and three vertical walls.
\begin{figure}[h]
\centering
\begin{minipage}{0.125\textwidth}
\centering
\includegraphics[width=\textwidth]{images/square.eps}
\\ (a) Square
\label{fig:env1}
\end{minipage}
\hspace{\stretch{1}}
\begin{minipage}{0.125\textwidth}
\centering
\includegraphics[width=\textwidth]{images/env2.eps}
\\ (b) Rooms1
\label{fig:env2}
\end{minipage}
\hspace{\stretch{1}}
\begin{minipage}{0.125\textwidth}
\centering
\includegraphics[width=\textwidth]{images/env3.eps}
\\ (b) Rooms2
\label{fig:env3}
\end{minipage}
\caption{The different environments created.}
\label{fig:environments}
\end{figure}
\subsection{Behavior}
\label{sec:behavior}
The agent moves by a random translation forward and a random small rotation at each time-step. To avoid collisions with the walls, when one of its distance sensors gets below a threshold, it turns around.
Formally, at each timestep, if one distance sensor value is smaller than 1 unit, the agent rotates by $r \sim\ \mathbf{U}(\pi - \frac{\pi}{10}, \pi + \frac{\pi}{10})$ radians ($\mathbf{U}$ denoting the uniform distribution.) If not, the agent moves forward by $ d \sim\ \mathbf{U}(0,1)$ units, and rotates by $r \sim\ \mathbf{U}(-\frac{\pi}{6},\frac{\pi}{6})$ radians. This allows to simplify the sensorimotor modalities we are studying, by preventing collisions during the exploration.
\subsection{Databases}
Our databases are generated sequences of 1 000 000 points (each point has 5 distance sensors values and 2 motor commands), which we have separated as such : the first 80\% for training, the next 10\% for validation, and the last 10\% for testing. In Fig.\ref{fig:database_screenshots} we reconstructed, for different situations, what the agent perceives based on its sensors. Note that the agent doesn't have access to the position and angles of its distance sensors, it only receives as input a 5-dimensional real vector. Fig.\ref{fig:trajectories} displays the trajectory of the agent during 10 000 steps in the different proposed environments: Square, Rooms1 and Rooms2. We can see that the chosen behavior allows a complete exploration of each environment.
\begin{figure}[h!]
\noindent
\begin{subfigure}{0.15\textwidth}
\centering
\includegraphics[width=\textwidth]{images/trajectory_square_10000points.eps}
\captionof{figure}{Square}
\label{fig:trajectory_square}
\end{subfigure}
\hspace{\stretch{1}}
\begin{subfigure}{0.15\textwidth}
\centering
\includegraphics[width=\textwidth]{images/trajectory_env2_10000points.eps}
\captionof{figure}{Rooms1}
\label{fig:trajectory_env2}
\end{subfigure}
\hspace{\stretch{1}}
\begin{subfigure}{0.15\textwidth}
\centering
\includegraphics[width=\textwidth]{images/trajectory_env3_10000points.eps}
\captionof{figure}{Rooms2}
\label{fig:trajectory_env3}
\end{subfigure}
\caption{Trajectories in the environments (10 000 points)}
\label{fig:trajectories}
\end{figure}
\begin{figure*}[h!]
\noindent
\begin{minipage}[t]{0.15\textwidth}
\centering
\includegraphics[width=\textwidth]{images/database_screenshot_nothing_sensors.eps}
\\ (a) Agent perceiving nothing
\label{fig:database_screenshot_nothing}
\end{minipage}
\hspace{\stretch{1}}
\begin{minipage}[t]{0.15\textwidth}
\centering
\includegraphics[width=\textwidth]{images/database_screenshot_line_sensors.eps}
\\ (b) Agent in front of a line
\label{fig:database_screenshot_line}
\end{minipage}
\hspace{\stretch{1}}
\begin{minipage}[t]{0.15\textwidth}
\centering
\includegraphics[width=\textwidth]{images/database_screenshot_corner_sensors.eps}
\\ (c) Agent in front of a corner
\label{fig:database_screenshot_corner}
\end{minipage}
\hspace{\stretch{1}}
\begin{minipage}[t]{0.15\textwidth}
\centering
\includegraphics[width=\textwidth]{images/database_screenshot_wallleft_sensors.eps}
\\ (d) Agent with a wall at its left
\label{fig:database_screenshot_wallleft}
\end{minipage}
\hspace{\stretch{1}}
\begin{minipage}[t]{0.15\textwidth}
\centering
\includegraphics[width=\textwidth]{images/database_screenshot_endwall_sensors.eps}
\\ (e) Agent in front of a wall's end
\label{fig:database_screenshot_together}
\end{minipage}
\caption{Examples from the databases. The 5 red dots represent the distance perceived by the agent, projected in top-view.}
\label{fig:database_screenshots}
\end{figure*}
\begin{figure*}[h!]
\centering
\noindent
\begin{subfigure}[t]{.15\textwidth}
\centering
\includegraphics[height=2.5cm]{images/sensoryspace.png}
\caption{\centering Sensory}
\label{fig:sensoryspace}
\end{subfigure}
\hspace{\stretch{10}}
\begin{subfigure}[t]{.15\textwidth}
\centering
\includegraphics[height=2.5cm]{images/encoder_sm_nomotors.png}
\caption{\centering Sensory encoder}
\label{fig:encoder_sm_nomotors}
\end{subfigure}
\hspace{\stretch{10}}
\begin{subfigure}[t]{.15\textwidth}
\centering
\includegraphics[height=2.5cm]{images/lstm_sm_nomotors.png}
\caption{\centering Recurrent sensory encoder}
\label{fig:lstm_sm_nomotors}
\end{subfigure}
\label{fig:comparisonRepresentationSpacesSquare}
\hspace{\stretch{10}}
\begin{subfigure}[t]{.15\textwidth}
\centering
\includegraphics[height=2.5cm]{images/encoder_sm.png}
\caption{\centering Sensorimotor encoder}
\label{fig:encoder_sm}
\end{subfigure}
\hspace{\stretch{10}}
\begin{subfigure}[t]{.15\textwidth}
\centering
\includegraphics[height=2.5cm]{images/lstm_sm.png}
\caption{\centering Recurrent sensorimotor encoder}
\label{fig:lstm_sm}
\end{subfigure}
\hspace{\stretch{10}}
\begin{subfigure}[t]{.05\textwidth}
\centering
\includegraphics[height=2.5cm]{images/reprspaces_colorbar.png}
\end{subfigure}
\caption{Representation spaces learned on Square, colored by the minimum value of the lasers}
\label{fig:comparisonRepresentationSpacesSquare}
\end{figure*}
\section{Results}
\subsection{Numerics}
Our models are trained with the Adam optimizer (learning rate of 0.001) and early stopping. The training is stopped if the loss on the validation set doesn't decrease by 5\% for 10 consecutive epochs. We use a batch size of 64, and ReLUs for the activation functions. We choose arbitrarily the sensory representation space to be 10-dimensional and the motor representation space to be 5-dimensional. The number and size of layers in the different architectures are as follow:
\subsubsection{SM-encoder} The sensory encoding and motor encoding subnetworks have 3 hidden layers of size 16, 32 and 64, while the prediction subnetwork has one layer of size 128.
\subsubsection{S-encoder} It is identical to the the sensory encoder, without the motor encoding subnetwork.
\subsubsection{Recurrent-SM-encoder} The sensory encoding and motor encoding subnetworks have 1 hidden layer of size 16, while the prediction subnetwork has one layer of size 128. The (stacked) LSTM has 3 layers with 32 units at each layer, and a truncation horizon of 20.
\subsubsection{Recurrent-S-encoder} It is identical to the Recurrent sensorimotor encoder, without the motor encoding subnetwork.
\subsection{Sensorimotor prediction results}
We report in Tab.\ref{table:square_results} the sensorimotor prediction $\mathcal{L}_2$ error of the models trained on
the Square environment, and tested on the three environments. We verified that the errors when training on Rooms1 and Rooms2 are comparatively the same for the different models, although obviously the error of each model increases as the environment becomes more difficult. For the sake of conciseness, we don't report them. We observe that models with motors largely outperform those without, which makes sense because motors are necessary to predict the next sensory state. We also see that models using a memory (with the LSTM) perform better compared to their memoryless counterpart, suggesting that a memory is useful for accurate sensorimotor prediction. Finally, we note that the Recurrent-SM-encoder model performs best, not only on the environment it is trained on, but also when tested on other environments, suggesting that the benefits of the memory provided by the LSTM isn't specific to the training environment.
\begin{table}[h!]
\centering
\begin{tabular}{| l | c | c |c |}
\hline
Model & Square & Rooms1 & Rooms2 \\
\hline
S-encoder & 0.03735 & 0.04299 & 0.07290 \\
SM-encoder & 0.005576 & 0.01453 & 0.02572\\
Recurrent-S-encoder & 0.03587 & 0.04068 & 0.06971\\
Recurrent-SM-encoder & \textbf{0.002404} & \textbf{0.01054} & \textbf{0.01809}\\
\hline
\end{tabular}
\caption{Sensorimotor prediction $\mathcal{L}_2$ error of the models trained on Square tested on the test dataset of the three environments}
\label{table:square_results}
\end{table}
\subsection{Representation spaces}
In this illustrative section we propose to gain insight on what the sensory representations learned by our models represent.
We plot on Fig.\ref{fig:comparisonRepresentationSpacesSquare} the representation spaces learned by our models. Because those spaces are 10-dimensional we plot the 2D projection to the first two principal components extracted with PCA. For visualization purposes we color those spaces by the minimum value of the 5 lasers, because this gives information about the distance to the wall the agent perceives.
We observe that the models without motors group states where the agent doesn't see anything with states where the agent sees a wall from a very short distance. This makes sense, as the agent turns around when it is too close from a wall (\ref{sec:behavior}), and therefore goes with just one transition from seeing a wall very close to seeing nothing. Without access to motor commands, the model brings those states close to each other, while in reality those states are fundamentally different.
We see that the portion of the representation space corresponding to the agent perceiving nothing is bigger with the Recurrent-SM-encoder than with the Recurrent-S-encoder. This suggests that memory and the information about motor commands help creating different states for points where the agent doesn't see anything.
\begin{figure*}[h!]
\centering
\includegraphics[width=\textwidth]{images/encoderS_square_square.eps}
\caption{S-encoder representation space clusters}
\label{fig:encoderS_square_square}
\end{figure*}
Interpreting qualitatively the distribution of the representation space gives us hints about the behavior of the models, and what they learn. In the following section, we propose other qualitative evaluations of our proposed systems.
\subsection{Clusters extraction}
We propose to cluster the sensory representation spaces, and to visualize the activation of the different clusters in space, in order to estimate if the sensory encoding learns spatial features. The clustering is done only for visualization purposes, in order to gain further insight on what the representations learned contain. We use a kMeans algorithm on the Sensory Representations to extract 20 clusters from each representation space.
We plot on separate subplots for each cluster the ground truth position and orientation of 500 data points of this cluster randomly sampled from the whole cluster data points.
We show on Fig.\ref{fig:encoderS_square_square} the 20 clusters extracted from the S-encoder representation space. We see that there are clusters corresponding to different distances/angles to the wall. As there is no memory in this model all of the configurations when the agent doesn't perceive anything are in the same cluster. The clusters are on the whole the same as those obtained when clustering directly the sensory space, for that reason we don't show the latter.
We observe on Fig.\ref{fig:encoderSM_square_square}, by comparing S-encoder and SM-encoder, that using motors allows the emergence of a cluster corresponding to corners of the environment. This is remarkable because the agent observes few corners (less than 1\% of the database). It suggests that sensorimotor prediction is a good prior for representation learning because it might allow to create representation for rare occurances, which are different from the sensorimotor point of view, i.e. if the interaction with them is different. This wouldn't be possible with a reconstruction loss, because a corner and a wall seen from the same distance are too close in $\mathcal{L}_2$ norm. We actually observed empirically that clustering the sensory space directly didn't permit the emergence of the cluster corresponding to corners.
We see on Fig.\ref{fig:lstmSM_square_square} that the clusters extracted from the Recurrent-SM-encoder representation space also contain a cluster corresponding to corners. There are also clusters corresponding to different distances/angles to walls. We observe that we have different clusters corresponding to the agent perceiving nothing. These clusters correspond for instance to having a wall just behind, to having a wall behind at distance 10, and having a wall behind at the left at distance 5. This shows that the LSTM provides the agent with a memory of previous events, and that it contains a form of spatial information. However this memory is short-term as it is relative to the previous wall that has been seen, and there is no global notion of position in the environment.
We verified that when extracting clusters from the Recurrent-S-encoder representation space, no cluster corresponding to corners emerges, and we observed that there is also some memory but it is much less accurate than the one of the same model with motors. For the sake of conciseness, we decide not to show them.
\begin{figure*}[h!]
\centering
\includegraphics[width=\textwidth]{images/lstmSM_square_square.eps}
\caption{Recurrent-SM-encoder representation space clusters}
\label{fig:lstmSM_square_square}
\end{figure*}
\subsection{Robustness to training environment}
In this experiment we evaluate the robustness of our approach when training on a more complex environment: Rooms1. We show on Fig.\ref{fig:lstmSM_env2_env2} the clusters extracted from the Recurrent-SM-encoder model trained on this environment. We observe that in addition to clusters similar to those appearing in Square environment, there is now a cluster corresponding to wall's ends. This shows that our model is robust to the training environment as it identified in this new environment that there is another interaction possibility with the environment, corresponding to wall's ends.
We saw however that when training on Rooms2, the latter cluster corresponding to wall's ends didn't emerge. We hypothesize that this is due to the fact that Rooms2 contains more walls, causing the agent's blocking in the different rooms for a long period of time, and therefore making the appearance of wall's ends in the database occasional.
\begin{figure*}[h!]
\centering
\includegraphics[width=\textwidth]{images/encoderSM_square_square.eps}
\caption{SM-encoder representation space clusters}
\label{fig:encoderSM_square_square}
\end{figure*}
\begin{figure*}[h!]
\centering
\includegraphics[width=\textwidth]{images/lstmSM_env2_env2.eps}
\caption{Recurrent sensorimotor encoder representation space clusters, trained on Rooms1}
\label{fig:lstmSM_env2_env2}
\end{figure*}
\subsection{Robustness to testing environment}
In this experiment, we evaluate if the representations learned in one environment transfer to other environments. We train our Recurrent-SM-encoder as well as our clustering algorithm on one environment,
then apply the learned representations and clusters in other environments. We show the transfer of some clusters learned on Square on Fig.\ref{fig:knowledgetransfer_square}. Note that the memory clusters and the corner cluster transfer well to other environments, and adapts to the new configuration of the walls. We show on Fig.\ref{fig:knowledgetransfer_env2} the transfer of a few clusters learned on Rooms1 to other environments. We observe that the knowledge is transferred well across environments. We see that the end-of-wall cluster is not transferred to square, as expected.
This shows that our model learns representations that are independent of the environment layout. This also means that the memory of the LSTM only captures short-term information, which allows the model to transfer to environments
with similar objects (wall, corners, ends of walls), but different spatial layouts.
\begin{figure}
\centering
\noindent
\begin{subfigure}[t]{.15\textwidth}
\centering
\includegraphics[width=\textwidth]{knowledgetransfer_square/square_cl1.eps}
\end{subfigure}
\hspace{\stretch{1}}
\begin{subfigure}[t]{.15\textwidth}
\centering
\includegraphics[width=\textwidth]{knowledgetransfer_square/env2_cl1.eps}
\end{subfigure}
\hspace{\stretch{1}}
\begin{subfigure}[t]{.15\textwidth}
\centering
\includegraphics[width=\textwidth]{knowledgetransfer_square/env3_cl1.eps}
\end{subfigure}
\begin{subfigure}[t]{.15\textwidth}
\centering
\includegraphics[width=\textwidth]{knowledgetransfer_square/square_cl6.eps}
\end{subfigure}
\hspace{\stretch{1}}
\begin{subfigure}[t]{.15\textwidth}
\centering
\includegraphics[width=\textwidth]{knowledgetransfer_square/env2_cl6.eps}
\end{subfigure}
\hspace{\stretch{1}}
\begin{subfigure}[t]{.15\textwidth}
\centering
\includegraphics[width=\textwidth]{knowledgetransfer_square/env3_cl6.eps}
\end{subfigure}
\begin{subfigure}[t]{.15\textwidth}
\centering
\includegraphics[width=\textwidth]{knowledgetransfer_square/square_cl12.eps}
\caption{\centering Clusters in Square}
\label{fig:square_cl12}
\end{subfigure}
\hspace{\stretch{1}}
\begin{subfigure}[t]{.15\textwidth}
\includegraphics[width=\textwidth]{knowledgetransfer_square/env2_cl12.eps}
\caption{\centering Transferred to Rooms1}
\label{fig:env2_cl12}
\end{subfigure}
\hspace{\stretch{1}}
\begin{subfigure}[t]{.15\textwidth}
\centering
\includegraphics[width=\textwidth]{knowledgetransfer_square/env3_cl12.eps}
\caption{\centering Transferred to Rooms2}
\label{fig:env3_cl12}
\end{subfigure}
\caption{Transferring some Square clusters}
\label{fig:knowledgetransfer_square}
\end{figure}
\begin{figure}
\begin{minipage}[t]{.15\textwidth}
\includegraphics[width=\textwidth]{knowledgetransfer_env2/env2_1.eps}
\end{minipage}
\hfill
\begin{minipage}[t]{.15\textwidth}
\includegraphics[width=\textwidth]{knowledgetransfer_env2/square_1.eps}
\end{minipage}
\hfill
\begin{minipage}[t]{.15\textwidth}
\includegraphics[width=\textwidth]{knowledgetransfer_env2/env3_1.eps}
\end{minipage}
\begin{subfigure}[t]{.15\textwidth}
\centering
\includegraphics[width=\textwidth]{knowledgetransfer_env2/env2_3.eps}
\end{subfigure}
\hspace{\stretch{1}}
\begin{subfigure}[t]{.15\textwidth}
\centering
\includegraphics[width=\textwidth]{knowledgetransfer_env2/square_3.eps}
\end{subfigure}
\hspace{\stretch{1}}
\begin{subfigure}[t]{.15\textwidth}
\centering
\includegraphics[width=\textwidth]{knowledgetransfer_env2/env3_3.eps}
\end{subfigure}
\begin{subfigure}[t]{.15\textwidth}
\centering
\includegraphics[width=\textwidth]{knowledgetransfer_env2/env2_16.eps}
\caption{\centering Clusters in Rooms1}
\label{fig:square_cl12}
\end{subfigure}
\hspace{\stretch{1}}
\begin{subfigure}[t]{.15\textwidth}
\centering
\includegraphics[width=\textwidth]{knowledgetransfer_env2/square_16.eps}
\caption{\centering Transferred to Square}
\label{fig:env2_cl12}
\end{subfigure}
\hspace{\stretch{1}}
\begin{subfigure}[t]{.15\textwidth}
\centering
\includegraphics[width=\textwidth]{knowledgetransfer_env2/env3_16.eps}
\caption{\centering Transferred to Rooms2}
\label{fig:env3_cl12}
\end{subfigure}
\caption{Transferring some Rooms1 clusters}
\label{fig:knowledgetransfer_env2}
\end{figure}
\section{Conclusion}
In this paper we proposed an unsupervised learning method based on sensorimotor prediction. This method allows an agent to acquire sensory representations by integrating sensorimotor information using recurrent neural networks.
We observed that our model is indeed better at predicting the future values of sensors compared to the proposed baselines. It extracts classes of interaction with the environment that seem qualitatively more meaningful, and which contain temporal information through short-term memory of previous experiences. In particular we saw that the motor commands are very beneficial to learn representation through prediction. We also note that the cells extracted from clustering the sensory representation are similar to particular cells observed in mammals, such as distance, orientation, and border cells. More importantly, we noticed that the representation learned on an environment transfers well to others. Namely, our model doesn't remember the whole environment but learns local sensorimotor transitions.
The approach we proposed is generic, and inspired from recent proposals about the nature and emergence of autonomy and intelligence through sensorimotor prediction (\cite{friston2010free}). It uses only raw data, and requires (in our limited experiment) very few engineering biases. In future works we want to investigate whether our approach scales to more complex environment and sensory streams. Additionally, we plan to apply the presented approach in an experiment on real robotic platforms, and in a real human environment.
One interesting possible extension would be to use the cells extracted from the sensory representation in order to learn a map of the environment. We plan to investigate how to build a graph where the nodes would correspond to activations of those cells, and the edges would correspond to motor commands. Also, we want to study the compression of such a graph of transition to obtain compact spatial representations.
In general, the proposed approach deals with very low level processing of sensorimotor streams in order to build meaningful representations. The usefulness of these representations, and how they can integrate in a cognitive architecture, would have to be demonstrated. We plan to use the learned representations in a Reinforcement Learning task. On the one hand, the success rate at the task gives a clear quantitative evaluation. On the other hand, it will allow us to evaluate the benefits of learning representations in terms of generalization, abstraction, and transfer of knowledge across different environments.
\bibliographystyle{IEEEtran}
| {'timestamp': '2018-04-27T02:04:59', 'yymm': '1803', 'arxiv_id': '1803.00268', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00268'} | arxiv |
\section{Introduction} \label{sec:intro}
\textbf{Background}: Using low-precision numerics is a
promising approach to lower compute and memory
requirements of convolutional deep-learning
workloads.
Operating in lower precision mode reduces computation as
well as data movement and storage requirements.
Due to such efficiency benefits, there are many existing works
which propose
low-precision deep neural networks (DNNs)~\cite{NN-FewMult,
LogNN, StochasticRounding, GoogleLowPrecision, TTQ,
BNN, DoReFa, XNORNET}. However, a majority of existing works
in low-precision DNNs sacrifice accuracy over
the baseline full-precision models.
Furthermore, most prior works target reducing the precision of model
parameters (network weights). This primarily benefits inference
when batch sizes are small.
We observe that activation maps (neuron outputs) occupy
more memory compared to model
parameters for typical batch sizes during training.
This observation holds even
during inference when batch size is around 16 or more.
\begin{figure}[!htb]
\begin{center}
\includegraphics[width=1.0\linewidth]{MemoryFootprintFig.pdf}
\end{center}
\caption{Memory footprint of weights and
activations during training/inference (left plot), and inference with
batch sizes 1 and 8 (right plot).}
\label{fig:MemoryFootprint}
\end{figure}
\noindent\textbf{Motivation}: Figure~\ref{fig:MemoryFootprint} shows memory
footprint of
activation maps and filter maps for
4 different networks -- AlexNet, Inception-Resnet-v2,
ResNet-50 and ResNet-101. The left plot in this figure shows the memory
footprint occupied by weights and activations during the training and
inference phase with a (modestly large) batch size of 32.
When batch-size is large, because of filter reuse across batches of
inputs, activation maps occupy significantly
larger fraction of memory compared to the filter weights.
The right plot in this figure shows the memory footprint during inference
with batch sizes of 1 and 8. With small batch size, the weights in the
model occupy more memory compared to activations.
During training large batch sizes are typical, so lowering
activation memory is more beneficial. It is the same case with large
batch inference which is a common scenario for cloud based systems.
On the other hand, for real-time (low latency) inference deployments,
batch-sizes are relatively small
and lowering memory requirements of weights is more beneficial.
\noindent\textbf{Our proposal}: Based on this observation, we study schemes for
training and inference using low-precision DNNs
where we reduce the precision of activation maps as well as the model
parameters without sacrificing the network accuracy.
To this end, we investigate three software/algorithm-based schemes where
the precision of weights and activations are lowered without hurting
network accuracy.
The next section elaborates on each of these proposals. To take
advantage of our software-based optimizations, we also
developed an accelerator to handle low-precision numerics. We discuss the details
of this accelerator and conclude with some discussions on next steps and trade-offs
between low-precision and sparsity (which is another knob to lower memory
and compute cost).
Overall, the contributions of this paper are a few techniques to obtain
low-precision DNNs without sacrificing model accuracy.
Each of our schemes produces a low-precision model that surpasses
the accuracy of the equivalent low-precision model published to date. One of our schemes
also helps a low-precision model converge faster.
\section{Training and inference using low-precision}
\noindent \textbf{Wide reduced-precision networks (WRPN)~\cite{mishra2018wrpn}}:
Based on the observation that activations occupy more memory
footprint compared to weights, we lower the precision of activations
more aggressively than weights to speed up training and inference
steps as well as cut down on
memory requirements. However, a straightforward reduction
in precision of activation maps leads to significant reduction in
model accuracy~\cite{DoReFa, XNORNET}.
\begin{table}[!htb]
\begin{center}
\caption{ ResNet-44 and ResNet-56 top-1 validation set error \%
as precision of activations (A) and weight (W)
changes. All results are with end-to-end training
of the network from scratch.} \label{fig:1xwide-baseline}
\includegraphics[width=0.90\linewidth]{1xwide-baseline.pdf}
\end{center}
\end{table}
To highlight this aspect, Table~\ref{fig:1xwide-baseline} shows a sensitivity study
where we reduce precision of
activation maps and model weights for two ResNet topologies running CIFAR-10
dataset and train the network from scratch.\footnote{
\noindent \textbf{ResNet topology on CIFAR-10} -- Our implementation of ResNet
for CIFAR-10 closely follows the configuration
in~\cite{ResNet}.
The first layer is a 3$\times$3
convolutional layer
followed by a stack of 6$n$ layers with 3$\times$3 convolutions
on feature map sizes 32, 16 and 8;
with 2$n$ layers for each feature map size. The numbers of
filters are 16, 32 and 64 in each set of 2$n$ layers.}
32b weights (W) and 32b activations (A) corresponds to a baseline network
with full-precision numerics.
We find that, in general, reducing the precision of activation maps
and weights hurts model accuracy.
Further, reducing precision of activations hurts model accuracy much more
than reducing precision of the filter parameters. For ResNet-44, with
2b weights and 8b activations,
there is a 0.9\% degradation in accuracy from baseline full-precision
network (7.4\% vs. 6.5\%). For ResNet-56, this degradation is 1\% (7.2\% vs. 6.2\%).
To re-gain the model accuracy while working with reduced-precision
operands, we increase the number of filter maps in a layer and find that
this scheme compensates or surpasses the
accuracy of the baseline full-precision network.
We call our approach \texttt{WRPN} (wide reduced-precision networks).
For both the ResNet configurations on CIFAR-10, we found that we can match accuracy of
a 2b weight and 8b activation model by \textit{doubling} the number of
filters of the entire network.
Table~\ref{fig:1_3xwide-wrpn} shows the effect on accuracy as precision is lowered
and filters widened by a smaller factor than 2x -- only the filters in the
first 1/3rd of the layers are doubled, the remaining layers have the same number of filters
as baseline network. With this setting, the accuracy with 2b weights
and 8b activations is within 0.5\% of baseline full-precision accuracy.
Using \texttt{WRPN} with a technique that we will describe next, the accuracy of the network
at this precision knob matches with that of baseline.
\begin{table}[!htb]
\begin{center}
\caption{ ResNet-44 and ResNet-56 top-1 validation set error \%
as precision of activations (A) and weight (W)
changes. The number of filters in the first 30\% of the layers are doubled.
All results are with end-to-end training
of the network from scratch. }
\label{fig:1_3xwide-wrpn}
\includegraphics[width=0.90\linewidth]{1_3xwide-wrpn.pdf}
\end{center}
\end{table}
In practice, we find \texttt{WRPN} scheme to be very simple and effective
- starting with a baseline network architecture, one can change the
width of each filter map without changing any other
network design parameter or hyper-parameters.
Reducing precision and simultaneously
widening filters keeps the total compute cost of the network
under or at-par with baseline cost.\footnote{Compute cost is the
product of the number of FMA operations
and the sum of width of the activation and weight operands.}
Thus, although the number of raw compute operations increase
with widening the filter maps in a layer,
the bits required per compute operation is now a fraction of
what is required when using full-precision operations.
As a result, with appropriate hardware support, one can significantly
reduce the dynamic memory requirements, memory bandwidth,
computational energy and speed up the training and inference process.
\noindent \textbf{Apprentice~\cite{mishra2018apprentice}}: With this scheme we combine network quantization schemes
with model compression techniques
and show that the accuracies of low-precision networks can be significantly improved by
using knowledge distillation techniques.
Previous studies on
model compression use a large network as the teacher network
and a small network as the student network. The small student network learns from the
teacher network using a technique called knowledge distillation~\cite{Hinton-distill, Compression-Caruana, 2016arXiv160305691U}.
The network architecture of the student network
is typically different from that of the teacher network --
for e.g.~\cite{Hinton-distill} investigate a student
network that has fewer number of neurons in the hidden layers compared to the
teacher network. In our work, the student network has similar
topology as that of the teacher network, except that the
student network has low-precision
neurons compared to the teacher network which has neurons
operating at full-precision.
\begin{figure}[!htb]
\begin{center}
\includegraphics[width=0.85\linewidth]{apprentice.pdf}
\end{center}
\caption{ Schematic of the knowledge distillation setup.}
\label{fig:apprentice}
\end{figure}
We call our approach \texttt{Apprentice} where
a low-precision (student/apprentice) network is learning (and attempting to mimic)
the knowledge of a
high precision (teacher) network. With this scheme, we start with a
full-precision trained (teacher) network and transfer knowledge from
this trained network continuously to train a low-precision (student)
network from scratch. The knowledge transfer process consists of matching
the logits of the teacher network with the softmax scores of the student network.
This is included as an addition term in the cost function while training.
Figure~\ref{fig:apprentice} shows a schematic of the training setup.
We find that the low-precision network converges faster and to better accuracy (compared
to the student network being trained alone) when a trained complex network
guides its training.
\begin{table}[!htb]
\begin{center}
\caption{ ResNet-44 and ResNet-56 top-1 validation set error \%
as precision of activations (A) and weight (W)
changes. The networks are trained under the supervision of a full-precision
ResNet-101 network using distillation based technique.}
\label{fig:1xwide-apprentice}
\includegraphics[width=0.90\linewidth]{1xwide-apprentice.pdf}
\end{center}
\end{table}
Table~\ref{fig:1xwide-apprentice} shows the impact of lowering precision
when a low-precision (student) network is paired with a full-precision
(ResNet-101) network. \textit{We find the Apprentice scheme to improve the
baseline full-precision
accuracy}. The scheme also helps close the gap between the new improved
baseline accuracy and the accuracy when lowering
the precision of the weights and activations.
The gap between 2b weight and 8b activation ResNet-44 is
now 0.2\%. For ResNet-56, this gap is 0.6\%.
\begin{table}[!htb]
\begin{center}
\caption{ ResNet-44 and ResNet-56 top-1 validation set error \%
as precision of activations (A) and weight (W)
changes. The networks are trained under the supervision of a full-precision
ResNet-101 network using distillation based technique.
The filters in the first 30\% of the layers are doubled. }
\label{fig:wrpn-apprentice}
\includegraphics[width=0.90\linewidth]{wrpnAndApprentice.pdf}
\end{center}
\end{table}
\noindent \textbf{WRPN+Apprentice}: This scheme combines widening of filters with
distillation scheme. The training process is the same as the \texttt{Apprentice}
scheme. Table~\ref{fig:wrpn-apprentice} shows the results with this scheme on ResNet.
With 2b weights and 8b activations, ResNet-44 is 0.3\% better than the
baseline we started with (6.2\% now vs. 6.5\% baseline). Similarly, ResNet-56 is
0.6\% better than the baseline (5.6\% now vs. 6.2\% baseline).
Overall, each of the three schemes described above improve the
accuracy of the low-precision network configuration compared to baseline as well as
prior proposals.
\begin{figure}[!htb]
\begin{center}
\includegraphics[width=0.80\linewidth]{lowp-accelerator.pdf}
\end{center}
\caption{ Accelerator for 8b activations and 2b weights.}
\label{fig:accel}
\end{figure}
\section{Low-precision GEMM accelerator} \label{sec:accelerator}
To take advantage of the low-precision numerics, we developed an accelerator
optimized for 2b$\mathrm{x}$8b matrix multiplication (convolution operation can be mapped
as a series of small GEMMs). Figure~\ref{fig:accel} shows the schematic of
the accelerator (organized as a systolic array) and the processing engine in each
of the systolic cross-points.
The accelerator
consists of 64 processing engines organized in 8 rows and 8 columns.
In the figure, $A$ matrix corresponds to activation tensor and consists of unsigned integer values (since
post-ReLU only positive values are significant).
With 2b operand, we do not need a
floating-point or integer multiplier. With 2b weights
(corresponding to $B$ matrix in the figure),
the possible weight values are \{-1, 0, 1\}. Thus, to multiply an 8b integer ($A$)
with a weight value ($B$), we compare the sign of $B$ operand and append this to the
$A$ operand or make it zero. The accumulator is a 32b signed integer.
Compared to a full-precision accelerator,
at the same technology process node, our low-precision accelerator is
15$\mathrm{x}$ smaller in area and 12$\mathrm{x}$ efficient in power.
\section{Conclusions} \label{sec:conclusions}
With vendors packing more and more compute (FLOPs) on a die, bandwidth is becoming
a key issue that affects scaling in large-scale systems. Low-precision
techniques help
in these scenarios.
While low-precision networks have system-level benefits, the
drawback of such models is degraded accuracy when compared to
full-precision models.
We present schemes to improve the accuracy
of low-precision networks and close the gap between the accuracy of
these models and full-precision models. Each of the schemes
improve the accuracy of the low-precision
network configuration compared to prior proposals. We motivate the
need for a smaller model size
in low batch, real-time and resource constrained inference deployment systems.
For large batch mode, we discuss benefits of lowering the
precision of activation maps as opposed
filter weights. Finally, we discuss the
design of an accelerator optimized for ternary-precision.
\bibliographystyle{IEEEtranS}
\renewcommand{\baselinestretch}{0.20}
| {'timestamp': '2018-03-02T02:06:49', 'yymm': '1803', 'arxiv_id': '1803.00227', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00227'} | arxiv |
\section{Introduction}
There are many different types of active and spontaneous cell motion, e.g., swimming, gliding, crawling and swarming, detected in both prokaryotic and eukaryotic cells \cite{prokaryotes, eukaryoticreview}. The favour of one mechanism over another depends on the environment and the balance of achieved displacement and energy expenditure. Cell motility and migration is essential in many biological processes including the development, morphogenesis and regeneration of multicellular organisms, wound healing, tissue repair and angiogenesis \cite{Scarpa143,kurosaka08,AMAN201020,FRANZ2002153,li13,Lamalice782}. Anomalous cell migration can cause developmental abnormalities, tumour growth, neuronal migration disorders and the progression of metastatic cancer \cite{developmentabnormalities,Friedl03,Friedl12}.
Unconstrained cell migration on a plane \textit{in vitro} can often be described as a two-dimensional random walk \cite{Codling}. The simplest random walk, the Brownian motion, is uncorrelated (the current direction of movement is independent of the last) and unbiased (the direction of each step is random). Correlated random walks (CRWs) involve a directional bias; there is a preference for the direction of the next step to be related to that in the previous step. It is common for cells in the absence of external biases to migrate as CRWs: the migration of amoeboids \cite{CRWamoeboid}, mammary epithelial cells \cite{CRWepithelial} and mouse fibroblasts \cite{CRWfibroblasts} have all been modelled as CRWs.
Adaptations in cell morphology facilitate migration. Some eukaryotic cells achieve motion through the coordinated and cyclic reorganisation of the actin cytoskeleton, which determines their speed, direction and trajectory \cite{FilopodiaTentacles}. Several types of protrusive pseudopodia structures have been characterised, which mainly differ in the organisation of actin \cite{molecularbio}. Analysis of the formation of pseudopods has shown that cells extending pseudopodia which then split into two to allow a change of direction exhibit strong persistence and small turning angles \cite{CRWpseudopodia, CRWpseudopodia2}.
Understanding the form of cell trajectories provides important insights into diverse cell motility modes and helps to design and interpret experiments. For example, understanding the role of cell migration in metastatic cancer has led to new treatments which modify signalling pathways and alter cell morphology to reduce cell motility \cite{cancer1, cancer2}. A thorough understanding of the mechanisms underlying cell migration will not only deepen our understanding of many integral biological processes but also facilitate the development of therapies for treating migration-related disorders.
In this work we analyse the migration of human embryonic stem cells (hESCs) \textit{in vitro} on a homogenous two-dimensional matrix. Due to the promises of clinical applications of hESCs and hiPSCs (human induced pluripotent stem cells) and the discovery of new engineered substrates for cell growth, data presented in this paper is of prime importance \cite{LamininE8, NDND,SCtherapy}. Surface-engineered substrates provide an attractive cell culture platform for the production of clinically relevant factor-free reprogrammed cells from patient tissue samples and facilitate the definition of standardised scale-up methods for disease modelling and cell therapeutic applications \cite{Saha15112011}. Because the clinical application of stem cells may require as many as $10^10$ cells per patient and disease modelling efforts typically require more than $10^6$ cells to make a single differentiated cell type, robust methods of producing cells under conditions that accelerate proliferation could be particularly valuable \cite{pmid21960724,pmid21757228}. Feeder-free systems represent key progress in simplifying hESC/hiPSC production but most of these systems (synthetic polymers, peptide-modified surfaces, embryonic extra-cellular matrix (ECM) laminin isoforms, fibronectin from ECM with a small molecule mixture, and various vitronectin proteins) provide only modest gains in scaling-up hESC/hiPSC production because they still require seeding at a suitably high cell density and passaging through multicellular clumps. Even for the defined systems that support clonal growth \cite{pmid21478862,pmid21266967, pmid20729850}, mass production of synthetic polymers, recombinant proteins, or small molecule mixtures may be a challenge, particularly when considering the number of cells needed for disease modelling and clinical application. These matters highlight the need to understand the factors that may facilitate clonal expansion of hESCs and hiPSCs for clinical needs. Current efforts are focused on optimising differentiation protocols in order to generate homogenous populations of cells of interest, hence an understanding of the features that charcaterise the starting cell population is essential for informing these protocols.
Unfortunately, the motion and dynamics of single and pairs of hESCs/hiPSCs has received limited attention. In culture, hESCs are anchorage-dependent and migrate through actin cytoskeleton reorganisation \cite{adherentcells}. The main structures that define the leading edge on a migrating hESC are referred to as pseuodpodia. Motility is an intrinsic property of hESCs, and they perform an unbiased random walk when they are farther than $150\,\mu$m apart with cells closer to one another exhibiting coordinated motion \cite{Li}. Our previous work \cite{me} investigated how the kinematics of single and pairs of hESCs impact colony formation. We performed statistical analysis on cell mobility characteristics (speed, directionality, distance travelled and diffusivity) from the time-lapse imaging. We demonstrated that single and pairs of hESCs migrate as a diffusive random walk for at least 7 hours of evolution. We showed that for the cell pairs mutual interactions of closely positioned cells strongly affect the migration, and we identify two distinct behavioural regimes for cells resulting from a division. Also, the cell pair as a whole is shown to undergo a random walk with characteristic diffusivity \cite{me}.
Here we focus on the migration of single and pairs of hESCs by examining more subtle and yet significant aspects of migration as a further step towards understanding cell group formation from a single cell. We consider how the direction of the motion is related to the cell morphology and analyse how the separation of cells affects their coordinated movements.
\section{Methods}
We follow the methods used to prepare and plate, and then image and track hESCs described in our previous work \cite{me}. In brief, hESCs (WiCell, Madison WI) were plated at a density of 1500 cells/cm$^2$ onto 6-well plates pre-coated with Matrigel\textsuperscript{\textregistered} Basement Membrane Matrix (Corning Inc.), in the presence of mTeSR\textsuperscript{TM}1 media (STEMCELL Technologies). ROCKi (10$\mu$M, Chemdea) was present for the first hours after plating, and removed before time-lapse imaging.
After 1 hour, the plates were imaged with time-lapse microscopy (Nikon Eclipse Ti-E microscope) images taken every 15 minutes over 66 hours at a resolution of 0.62\,$\mu$m/pixel. From these images, we selected 26 single hESCs and 50 pairs of hESCs. Single (isolated) hESCs are defined as those that initially have no neighbour within a 150$\,\mu$m radius; interactions of hESCs are negligible beyond this distance \cite{Li}. The lineage trees for these cells are provided in Ref. \cite{me}. We define the time variable $t$ as zero at the start of the image recording. The pairs of hESCs are those where the separation of two cells is less than $150\,\mu$m from each other and more than that from other cells. The cells either exist as pairs at the start of the imaging, or form a pair when a single isolated cell divides.
Each cell in our analysis was manually tracked throughout its motion, and its position in each image frame was defined as the location of its geometrical centre by eye, or `centre of mass' if the mass within the cell density is considered constant. For the single cell considered in Section 3.2, the cell boundary and geometrical centre was tracked using ImageJ \cite{fiji, imageJ2}. Comparison of this to the previous coordinates taken by eye showed no significant difference. Tracking of a single cell ceased when the cell died; cell pairs were tracked until one of them died or divided. We did not follow cell triples even when they were formed by division of a cell in a pair. Formation of a pair from convergence of two unrelated cells is rare since the individual random walks lead, on average, to the divergence of cell trajectories provided sufficient space is available.
The instantaneous velocity of a cell was obtained from its displacement between two consecutive frames. Circular statistics calculations were performed as described in Ref. \cite{circstats} using Matlab and its Circular Statistics Toolbox (Directional Statistics) \cite{toolbox}.
\section{Results}
Figure \ref{fig:fb}(a) shows images of one of the cells during its migration; its full trajectory is shown in Figure \ref{fig:fb}(b). This cell is elongated in the instantaneous direction of motion, with a pseudopodia protrusion leading its next movement. The relation between motion and morphology is discussed in Section \ref{sec:morph}. The single cell shape can vary between approximately circular, with diameter of around 20$\,\mu$m, to more elongated with length of up to 70$\,\mu$m. In comparison, hESCs in colonies tend to be circular and considerably smaller, with diameters typically about $10\,\mu$m \cite{Li, Phadnis15}.
The cells can, and often do, change their direction of motion by up to $\pi$. An example is shown in Figure~\ref{fig:fb}(a). The cell moves in the direction of its persistent pseudopodia protrusion, before contracting and moving in the direction of a new pseudopodia, resulting in a change of direction by approximately $\pi$. The whole manoeuver in this example takes about 6 hours.
The lineage trees for the 26 single cells can be found in Ref. \cite{me}. Death rates are low, with only two cells dying before dividing. The remaining cells have divided by $t=20\,$h, with division occurring at a mean time interval of $t_{\scriptsize \textrm{d}}=7\,$h. The median speed of the cells is $16\,\mu$m/h, with the average of 23$\,\mu$m/h and with no noticeable differences in the migration behaviour between single cells which eventually die or divide.
\begin{figure}[h]
\centering
\includegraphics[width=\textwidth]{xy15.png}
\caption{\label{fig:fb} (a) Images of a migrating single hESC. The frames are taken at $t=15\,$min, 6$\,$h$\,$45$\,$min and 14$\,$h$\,$15$\,$min. The blue dot shows the cell nucleus and the black arrow the direction of instantaneous velocity. The scale bars are 30$\,\mu$m in length. (b) Trajectory of the cell with the initial position (black dot) and final position (red square) shown.}
\end{figure}
\subsection{Single cells: correlated random walk}
First we seek to test for a bias in the direction of the single cell movements. We measured the turning angle, that is, the change in direction of the cell from one time frame to the next, denoted $\theta$ and illustrated in Figure~\ref{fig:theta}(a). As well as the turning angle with respect to the earlier direction of motion, we also considered the angle $\phi$ between the cell displacement and the global frame that does not change with time.
Figure ~\ref{fig:theta}(b) shows the polar histogram of $\theta$ for 26 single cells, while Figure~\ref{fig:theta}(c) presents the corresponding linear histogram. It is evident that the distribution has maxima at $\theta=0$ and $\theta=\pi$: the cell preferentially moves directly forwards or directly backwards with a roughly equal frequency between the two directions. The bias is robust, remaining even if small steps ($< 7 \mu$m) are removed from the dataset. The mean axis of movement, shown in Figure~\ref{fig:theta}(b), is approximately along the $\theta=0$ or $\theta=\pi$ (with the standard deviation of $\sigma_{\theta}=0.19$). In this manner, the motion represents a quasi-one-dimensional random walk. Both the $\chi^2$ and V tests reject the null hypothesis that the probability density of the turning angle $\theta$ is uniform at the 99.5\% confidence level. The probability density distribution can be approximated by $p=a+b \cos (2\theta)$ with $a=0.16$, $b=0.04$ and the $R^2$ value of 0.55. This fit suggests a symmetric spread of the distribution about $\theta=0$ and $\theta=\pi$.
\begin{figure}[b]
\centering
\includegraphics[width=\textwidth]{exp1_theta2.png}
\caption{\label{fig:theta}(a) The definition of the turning angle $\theta$, the change in the cell's direction of motion from one time frame to the next. Green dots illustrate the positions of the cell in consequtive images with arrows representing the displacement vectors. (b) Polar histogram of $\theta$ for 26 single cells, over 18 hours, with 30 angular bins and 829 measurements. Overlaid the mean value of $0.026$ (red line) and one standard deviation ($0.19$) obtained by mapping the data to the range $0\leq\theta\leq\pi$ (pink shaded region). (c) The probability density of $\theta$ binned into 20 intervals. The least-squares fit $0.16+0.04\cos(2\theta)$ is shown in red.}
\end{figure}
\begin{figure}[b]
\centering
\includegraphics[width=\textwidth]{theta_timesplit_nomeans.png}
\caption{\label{fig:thetatime}Polar histograms for $\theta$ for all 26 single cells in the time intervals (a) 0--5\,h (26--12 cells, 20 bins and 404 measurements), (b) 5--10\,h (12--8 cells, 20 bins and 197 measurements) and (c) 10--18\,h (8--3 cells, 20 bins and 228 measurements). There are fewer cells at later times due to cell divisions and deaths.}
\end{figure}
The distribution of the turning angles has a distinct temporal pattern. Figure~\ref{fig:thetatime} shows the polar histograms of $\theta$ at early (0--5\,h), intermediate (5--10\,h) and late times (10--18\,h). At early times, the distribution is slightly biased towards $\theta=\pi$, indicating a weak dominance of the back-and-forth motion over a systematic forward motion. However, this effect is weak and the distribution is approximately uniform over angles. This is consistent with our previous observations that the motion of hESCs is close to an isotropic random walk at early times \cite{me}. By late times, however, the distribution is strongly biased towards $\theta=0$, that is, persistent forward motion. What we see on average for all times is a mixture of persistent and back-and-forth motions. This feature can be characterised with the temporal autocorrelation function, $C_{\theta}(\tau)$, for two-hourly moving averages of the angle $\theta$. For each cell, $C_{\theta}(\tau)$ is calculated as the circular correlation for $\theta$ with itself, delayed by a time lag of $\tau$. The average autocorrelation over all single cells, $\overline{C_{\theta}(\tau)}$, with least-squares fitting $\overline{C_{\theta}(\tau)}=e^{-\tau/\tau_c}$, $\tau_c=0.8$, is shown in Figure~\ref{fig:autocorr}(a). We see a temporal correation in $\theta$, with an average correlation time of $\tau_c=0.8\,$h.
We find no significant correlation in the global direction of movement, $\phi$, when individual steps are considered. We attribute this to the dominance of the back-and-forth motion over short periods of time. However, considering two-hourly moving averages we again find a systematic trend. The average autocorrelation over all single cells, $\overline{C_{\phi}(\tau)}$, is shown in Figure~\ref{fig:autocorr}(b). We see a temporal correlation in $\phi$, with least-squares fitting $\overline{C_{\phi}(\tau)}=e^{\tau/\tau_c}$, $\tau_c=0.7$ shown in Figure~\ref{fig:autocorr} and hence a correlation time of $\tau_c=0.7\,$h, similar to that found considering the change in direction $\theta$. Notably there is significant anticorrelation in $\phi$ for the time interval $[2\,$h$<\delta t<5\,$h], in agreement with the biased nature of the random walk. For comparison, unbiased random walk has no such anticorrelation.
\begin{figure}
\centering
\includegraphics[width=1\textwidth]{autocorrelationfigurefitting.png}
\caption{Average autocorrelation for (a) $\overline{C_{\theta}(\tau)}$ of $\theta$ and (b) $\overline{C_{\phi}(\tau)}$ of $\phi$ for single cells, with standard deviation error bars. The least squares fit (red line) is $\overline{C(\tau)}=e^{\tau/\tau_c}$ with (a) $\tau_{c}=0.8\pm0.1\,$h and (b) $\tau_{c}=0.7\pm0.2\,$h for $\theta$ and $\phi$, respectively. Cells are included in the average up to a lag of $N/3$. Note that onwards from a time lag of 5\,h, there is only one cell observed, hence the lack of error bars. Each lag corresponds to a time frame (15\,min). \label{fig:autocorr}}
\end{figure}
\newpage
\subsection{Single cells: direction of motion and cell elongation}
\label{sec:morph}
It is evident, from the images in Figure~\ref{fig:fb} in particular, that the direction of motion appears to be aligned with the elongation axis of the cell structure including its pseudopodia. A further example is shown in Figure~\ref{fig:cellframe}. This is unsurprising as cell branching and elongation has been shown to be involved in cell motion and directional persistence, although it has not been fully quantified \cite{LamellipodiumReview}.
\begin{figure}[b]
\centering
\includegraphics[width=\textwidth]{celloutline7_new.png}
\caption{\label{fig:cellframe}(a) Example of the directed cell walk showing the outline of the cell (blue) and the geometric centre velocity (red arrow). (b) Microscopy image of the cell showing the geometric centre (blue dot), illustrating the definitions of the alignment angle $\alpha$ and the distance from the geometric centre to the edge of the cell $\mathbf{R}(\alpha)$. The scale bar is 30$\,\mu$m. (c) Polar histogram of the alignment angle $\alpha$ (red) and the direction of travel $\phi$ (blue, shaded) for the cell over a period of 17.5 hours, with 70 measurements in 20 bins. The mean values are shown for $\phi$ (blue, $0.72\pm0.35$) and $\alpha$ (red, $0.79\pm0.34$) with the 95\% confidence intervals for the mean shown as dashed lines.}
\end{figure}
To analyse quantitatively the alignment of the direction of motion and the elongation of the cell we measure the alignment angle of the cell, $\alpha$, with respect to a global reference frame. Consider $\mathbf{R}(\alpha)$, the vector from the geometric centre to the boundary of the cell and $\mathbf{R}_\mathrm{max}$ corresponding to the maximum magnitude of $\mathbf{R}$. The alignment angle $\alpha$ is defined as the angle between $\mathbf{R}_\mathrm{max}$ and the horizontal, as shown in Figure~\ref{fig:cellframe}(b). The polar histograms of $\alpha$ and the direction of travel on the plate, $\phi$, both in the same global reference frame, are shown in Figure~\ref{fig:cellframe}(c). Their mean values are $\overline{\alpha}=0.79\pm0.34$ and $\overline{\phi}=0.72\pm0.35$. The difference is insignificant as the Watson--Williams and Kuiper's tests provide no evidence to reject the null hypothesis that $\overline{\alpha}$ and $\overline{\phi}$ are from the same distribution at the 99\% confidence level.
The speed of migration, $v$, and the measure of elongation of the cell, $R_\mathrm{max}/R_\mathrm{min}$, where $R_\mathrm{max}=\mathrm{max}|\mathbf{R}|$ and $R_\mathrm{min}=\mathrm{min}|\mathbf{R}|$, are shown as functions of time in Figure~\ref{fig:vralphaphi}. The hourly moving averages of $R_\mathrm{max}/R_\mathrm{min}$ and the cell speed $v$ have a Pearson correlation coefficient of 0.53 suggesting a slight positive correlation between the elongation of the cell and its speed. Hourly moving averages of $\alpha$ and $\phi$ are shown in Figure~\ref{fig:vralphaphi}(c). This shows that directed movement is in the direction of the pseudopodia and suggests that the cell moves faster when it is more elongated.
\begin{figure}[t]
\centering
\includegraphics[width=0.5\textwidth]{V_R_alpha_phi_new.png}
\caption{\label{fig:vralphaphi}Hourly moving average of (a) the cell migration speed, $v$, and (b) $R_\mathrm{max}/R_\mathrm{min}$ over time. The solid lines show the mean values of $\overline{v}=27.8\,\mu$m/h and $\overline{R_\mathrm{max}/R_\mathrm{min}}=9.98$, with dashed lines one standard deviation from the mean ($\sigma_{v}=16.7$ and $\sigma_{R_\mathrm{max}/R_\mathrm{min}}=6.2$). Insets show the cell at 4.5 and 11.5\,h with a red arrow indicating the two-hourly average direction of the velocity with white dashed lines $\pm 1$ standard deviation. (c) Hourly moving average of $\alpha$ (red, dashed) and $\theta$ (blue, solid) versus time.}
\end{figure}
\newpage
\newpage
\subsection{Pairs of cells}
Wadkin \textit{et al}. \cite{me} considered the movement of cell pairs (two cells within $150\,\mu$m of each other at the start of imaging) as a whole and found that the motion of their geometric centre is approximated by an isotropic random walk for up to around 7 hours of their evolution, albeit with reduced motility compared to that of single cells \cite{me}. The diffusivity is reduced from $80\,\mu$m$^2$/h for single cells, to $60\,\mu$m$^2$/h for pairs. In this section we look in greater detail at the dynamics of pairs of hESCs, in particular the correlations between the individual motions of a pair's cells.
For the cell pairs in the experiment, the mean separation at time $t$, $\overline{r(t)}=\overline{\sqrt{(\delta x(t))^2 +(\delta y(t))^2}}$, where $\delta x$ and $\delta y$ are the distances between two cells in the $x$ and $y$ directions respectively, varies with time as shown in Figure~\ref{fig:sepovertime}. By performing a least-squares fit of the functional form $\overline{r}=\mathrm{A}-\mathrm{B}e^{-t/\mathrm{C}}$, for parameters A, B and C we obtain the line $\overline{r}=(68\pm0.6)-(37\pm3) e^{-t/(2\pm0.03)}$. The asymptotic nature of $\overline{r}$ indicates an optimal separation of pairs at around 70$\,\mu$m.
To quantify the coordination between the movements of the two cells in a pair, we measure the smaller angle between their velocities, $0<\psi<\pi$, illustrated in Figure~\ref{fig:psi}(a). If the cells travel in the same direction on the plate, then $\psi=0$, and if they travel in opposite directions $\psi=\pi$; note that $\psi=\pi$ does not distinguish between the two cells moving exactly towards each other or exactly apart. The polar histogram of $\psi$ for all the pairs is shown in Figure~\ref{fig:psi}(b), with the corresponding linear histogram in Figure~\ref{fig:psi}(c). There is a bias in the distribution towards $\psi=0$, confirmed by the $\chi^2$ test which rejects the null hypothesis that the distribution is uniform at the 95$\,\%$ level, i.e., there is a significant preference towards pair cells moving in the same direction. Example microscopy images of a pair that move in this way are shown in Figure~\ref{fig:pair}.
Binning $\psi$ according to the separation distance, $r$, between two cells shows that this bias primarily occurs at small separations as shown in Figure~\ref{fig:psibysep}. The $\chi ^2$ test provides evidence to reject that each of the histograms in Figure~\ref{fig:psibysep} is uniform at the $95\,\%$ level. However, a measure of the skew is shown in the first moment, i.e., the arithmetic mean, $\overline{\psi}$ (as opposed to the circular mean). For a uniform distribution between 0 and $\pi$ the arithmetic mean would be $\overline{\psi}=\pi/2$ or $90 \degree$. For the $\psi$ distributions for $r<20\,\mu$m, between 20--50$\,\mu$m, between 50--100$\,\mu$m and $r>100\,\mu$m the arithmetic mean values are respectively, $\overline{\psi}=$73$\degree$, 79$\degree$, 89$\degree$ and 88$\degree$, indicating there is bias towards $\psi=0$ at smaller separations. Pearson's moment coefficient of skewness, $\gamma=E[(\psi-\overline{\psi})^3]/\sigma_{\psi}^3$, also provides a measure of the asymmetry in the distributions. For a perfectly symmetrical distribution $\gamma=0$, while for a distribution skewed towards lower values $\gamma>0$ and for skew towards higher values $\gamma<0$. For $\psi$ where $r<20\,\mu$m $\gamma=0.40$, for $20<r<50\,\mu$m $\gamma=0.24$, for $50<r<100\,\mu$m $\gamma=0.04$ and for $r>100\,\mu$m $\gamma=-0.02$, showing reducing skewness towards $\psi=0$. The Kolmogorov-Smirnov test provides no evidence to reject the null hypothesis that the distributions for $r<20\,\mu$m and $20<r<50\,\mu$m are the same. Similarly for $50<r<100\,\mu$m and $r>100\,\mu$m. However the test rejects the null hypothesis that the two smaller separation distributions are the same as the two larger separation distributions. Calculating $\overline{\psi}$ with separations binned more frequently shows the length at which the movement is correlated. By performing a least-squares fit of the form $\overline{\psi}=90(1-e^{-(r+r_0)/m})$, for parameters $r_0$ and $m$, we obtain the line $\overline{\psi}=90(1-e^{-(r+23.0)/25.9)})$ with an $R^{2}$ value of 0.6, shown in Figure~\ref{fig:meanpsi}. The characteristic length of the decay is therefore 26$\,\mu$m, a typical cell diameter, suggesting the pairs only exhibit correlated motion while they are in contact.
We also analysed the motion of the cells in the pair via the pair correlation function. This function was not found to be sensitive to the correlations between the cell motions, and was unable to distinguish the cell motions from from IRWs. This analysis is presented in the Appendix.
\begin{figure}[t]
\centering
\includegraphics[width=0.6\textwidth]{sepovertimefit.png}
\caption{\label{fig:sepovertime}The mean separation, $\overline{r}$, for pairs over time with least-squares line of best fit $\overline{r}=68-35e^{-t/2}$ and $R^2=0.94$. The error bars show the standard error in the mean ($\sigma/\sqrt{N}$).}
\end{figure}
\begin{figure}[t]
\centering
\includegraphics[width=\textwidth]{psi.png}
\caption{\label{fig:psi}(a) Green and orange dots represent a pair of cells with their corresponding velocity vectors $\mathbf{v}_i$ and $\mathbf{v}_j$ together with their connection vector $\mathbf{r}_{ij}$. The angle between the velocity vectors is marked as $\psi$. (b) Polar histogram of $\psi$ for all 50 pairs of cells. There are 15 bins and 3285 observations. (c) Corresponding linear histogram with 20 bins.}
\end{figure}
\begin{figure}[t]
\centering
\includegraphics[width=0.9\textwidth]{pair_following.png}
\caption{\label{fig:pair}Example pair moving together in the same direction. The frames are at 7\,h\,15\,min, 19\,h\,30\,min and 24\,h\,15\,min. The scale bar shows 20$\,\mu$m.}
\end{figure}
\begin{figure}[t]
\centering
\includegraphics[width=\textwidth]{psibysep.png}
\caption{\label{fig:psibysep}The angle between velocity vectors, $\psi$, for separations $r$ (a) $<20\,\mu$m, (b) 20--50$\,\mu$m, (c) 50--100$\,\mu$m and (d) $>100\,\mu$m, with 20 bins and 240, 1480, 974 and 591 measurements, respectively.}
\end{figure}
\newpage
\begin{figure}[h]
\centering
\includegraphics[width=.6\textwidth]{meanpsi_fit.png}
\caption{\label{fig:meanpsi}$\overline{\psi}$ binned according to the separation distance, $r$, between two cells. Error bars show the standard error in the mean ($\sigma/\sqrt{N}$). The red dashed line shows 90$\,\degree$, the value we would expect for uncorrelated motion. The least-squares fit (solid black line) is $\overline{\psi}=90(1-e^{-(r+r_0)/m})$, with $r_0=23.0$ and $m=25.9$ and an $R^{2}$ value of 0.6.}
\end{figure}
\newpage
\section{Discussion}
\begin{figure}[b]
\centering
\includegraphics[width=.58\textwidth]{paper2schematic.jpg}
\caption{\label{fig:schematic}(a) Single hESCs preferentially move along their elongation axis, at speed higher for a stronger elongation. (b) Cells separated by $70\,\mu$m or less move in a coordinated manner, whereas a wider separation implies independent biased random walk \cite{me}.}
\end{figure}
In culture, hESCs are anchorage-dependent: they adhere to the surface and sense external cues by extending lamellipodia and filopodia, referred to in a general way as pseudopodia. For directed movement in response to external factors, cells acquire a defined front-rear polarity extending a protrusive structure at the leading edge before subsequently moving the cell body, and retracting the trailing edge \cite{migration}. The integration of negative and positive chemical feedback loops accounts for the oscillatory behaviour of pseudopodia, i.e. cycles of protrusion and retraction which result in cell movement \cite{eukaryoticreview}. Observations of single cell movement in two-dimensions cultures, in the absence of external cues, indicate a production of pseudopodia structures in random directions, a behaviour observed in other cell types \cite{Reig1999}.
Our results are summarised in Figure~\ref{fig:schematic}. The relative angle of movement, $\theta$, characterises the dynamics of random walks further to the mean-square displacement \cite{DirectionalChange}. Our results show that isolated single cells migrate in an unusual uni-directional walk, moving backwards and forwards along a preferred local axis, with cells becoming more persistent over time. Hence, the longest lived isolated cells show the strongest directional persistence. Broadly, there are a wide range of example cells that exhibit a preferential turning angle; those that can be modelled as a correlated random walk as previously discussed, e.g., \cite{CRWamoeboid, CRWepithelial, CRWfibroblasts}. There are also examples of a biomodal preference for turning angle, similar to the one we see for single hESCs \cite{BimodalTurns1, BimodalTurns2}. The bias in the walk is further shown in the temporal correlation in both the change in direction, and the direction of movement with a correlation time of around 0.8$\,$h. The microscopy images in Figure~\ref{fig:fb} show the elongated morphology of the single cells, with movement in the direction of the leading pseudopodia, leading to this motion along a local axis.
These single cells demonstrate random migratory patterns, travel large distances and do not result in colony formation. Isolated cells seeded at low density display directional migration towards neighbours \cite{Phadnis15}. Perhaps in the absence of neighbours, as in this experiment, the cells employ the uni-directional walk along the local axis in an attempt to locate neighbours. Our quantitative analysis of a directed cell trajectory confirms the axis of cell motion is aligned with the elongation axis of the cell. Increased elongation is also linked to increased speed, corresponding to previous results suggesting that persistence in direction of motion is linked to increased speed as a universal rule for all types of cells \cite{speedpersist}.
An understanding of the migration of single hESCs is integral to colony growth at low-density platings. Their directed, super-diffusive migration can facilitate colony expansion at low-density platings by the finding and joining neighbours, however this re-aggregration is undesirable in experiments which require colonies originating from a single cell to achieve a homogenous clonal population \cite{Li, Andrews}.
For pairs of hESCs their separation over time increases exponentially before approaching an asymptote at a distance of $70\,\mu$m. This shows that, on average, $70\,\mu$m is the optimal separation for pairs of cells. There is a preference for the cells to move in the same direction as each other on the plate at small separations ($<\,70\,\mu$m). At these small separations it can be seen from the microscopy imaging that the cells are physically connected by their pseudopodia, as in Figure~\ref{fig:pair}. This coordinated movement could be due to an external stimulus, but the connection of the cell bodies facilitates this motion. At separations greater than $\approx 70\,\mu$m the motion of each cell in a pair appears uncorrelated. Often there is still a connection between the cell bodies at these distances, but the cells move in independent directions whilst maintaining the connection, and as an isotropic random walk when considered as a whole entity \cite{me}. Neighbouring cells are integral to colony formation as cell survival and cell divisions are highly correlated with the number of neighbouring cells \cite{Phadnis15}.
Another ramification would be an exploration of the effects of stem cell markers, such as NANOG, OCT and KLF, on cell migration. These factors have been shown to affect the migration, invasion and colony formation of various cancer stem cells \cite{pmid22945654, pmid25821200, pmid21242971}. Effects of pluripotency markers on the migration and motility of single hESCs have not been explored. hESCs with NANOG overexpression form colonies efficiently even at very low seeding densities. Cell motility and colony formation affected by stem cell markers are subjects of our future work.
Further experiments need to verify the robustness of these results under different culture conditions. This additional information on low density plated cells will assist in the development of agent-based models, combining the motion of diffusive and super-diffusive cells with their biological states and cell-cell interactions.
\ack
We acknowledge financial support from Newcastle University and European Community (IMI-STEMBANCC, IMI-EBISC, ERC \#614620 and NC3R NC/CO16206/1) and are grateful to the School of Mathematics, Statistics and Physics of Newcastle University (Prof. R. Henderson) for providing partial financial support. AS acknowledges partial financial support of the Leverhulme Trust (Grant RPG-2014-427).
| {'timestamp': '2018-03-02T02:02:07', 'yymm': '1803', 'arxiv_id': '1803.00063', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00063'} | arxiv |
\section*{Introduction}
Linear codes may be endowed with cyclic structures by means of skew polynomial rings. This is the case of Piret cyclic convolutional codes \cite{Piret:1976} and the subsequent generalizations and alternatives (see \cite{Roos:1979}, \cite{Gluesing/Schmale:2004}, \cite{Estrada/alt:2008}, \cite{LopezPermouth/Szabo:2013}, \cite{GLN:2016}, \cite{gln2016new}). Non commutative cyclic structures of this kind have been also considered for block linear codes (\cite{Boucher/Ulmer:2009}, \cite{Boucher/alt:2007}, \cite{Boucher/Ulmer:2011}, \cite{Fogarty/Gluesing:2015}, \cite{Alhamadi/alt:2016}), and for linear codes over commutative rings (\cite{Boucher/alt:2008}, \cite{Jitman/alt:2012}, \cite{Ducoat/Oggier:2016}).
A desirable property of any class of linear codes is to be stable under duals. This property has been already studied in several of the aforementioned references. A common feature of many of these approaches to duality is the presence of a suitable anti-isomorphism of rings that encodes, more or less explicitly, the transfer of the cyclic structure from the code to its dual. Our aim is to present a systematization of this method, besides some relevant examples where it successfully applies.
The strategy is to establish a formal framework, called transpose Hamming ring extension, designed to derive that the dual of every cyclic code is cyclic. Cyclic codes will be, from an algebraic point of view, identified as left ideals of suitable (non-commutative) ring extensions of a given commutative ring $C$, well understood that such an ``identification'' has to be made explicit by an isomorphism of $C$--modules from the ring to $C^m$, where $m$ is the length of the $C$--linear code. The transposition will be an anti-isomorphism of rings which allows to transform annihilators into duals. Details are to be found in Section \ref{DualAnn}
In Section \ref{IdealCodes} we apply our general approach to left ideal convolutional codes in the sense of \cite{LopezPermouth/Szabo:2013}, extending to a more general setting, and improving, results from \cite{LopezPermouth/Szabo:2013} and \cite{GLN:2016} on the description of dual codes in this setting (Theorem \ref{dualidealcode}). The case of a simple word-ambient algebra is analyzed in detail (Theorem \ref{matrixmain}).
Section \ref{sec:constacyclic} is devoted to dual codes of skew constacyclic codes over a commutative ring. Several results from \cite{Boucher/Ulmer:2009}, \cite{Boucher/alt:2008}, \cite{Jitman/alt:2012}, \cite{Ducoat/Oggier:2016} on these codes are covered by our general result (Theorem \ref{dualconstacyclic}).
Finally, in Section \ref{DualsRS}, we compute (Theorem \ref{sRSdual}) the dual of a skew Reed Solomon code over a general field in the sense of \cite{GLNPGZ}, and, as a consequence, these codes are shown to be evaluation codes (Theorem \ref{sRSevaluation}).
\section{Transpose ring extensions and dual codes}\label{DualAnn}
Let $C$ be a commutative ring.
A $C$--linear code of length $m$ is, by definition, a $C$--submodule $\mathcal{C}$ of $C^m$. The \emph{dual} of $\mathcal{C}$ is defined as
\[
\mathcal{C}^\bot = \{ w \in C^m : w\transpose{v} = 0, \forall v \in \mathcal{C} \},
\]
where $\transpose{M}$ denotes the transpose of a matrix $M$ with coefficients in $C$.
\begin{definition}
A \emph{Hamming ring extension of rank $m$} is a three-tuple $(C,R,\mathfrak{v})$, where $R$ is a ring, $C$ is a commutative subring of $R$ and $\mathfrak{v} : R \to C^m$ is an isomorphism of $C$--modules. Here, the $C$--module structure of $R$ is given by left multiplication.
\end{definition}
Hamming ring extensions encode cyclic structures on some $C$--linear codes, according to the following definition. Precise examples will be examined later.
\begin{definition}
Every $f \in R$ leads to a $C$--linear code $\mathcal{C} = \mathfrak{v}(Rf)$. We say then that $\mathcal{C}$ is the \emph{$(C,R,\mathfrak{v})$--cyclic code generated by $f$}. We will also say that $\mathcal{C}$ is \emph{$R$--cyclic}.
\end{definition}
Given an $R$--cyclic code $\mathcal{C} = \mathfrak{v}(Rf)$, we have the multiplication map $\cdot f : R \to R$. There is a unique square matrix $M_R(f) \in \matrixring{m}{C}$ making commute the following diagram of $C$--module morphisms
\[
\xymatrix{
R \ar[r]^{\cdot f} \ar[d]_{\mathfrak{v}} & **[r] R \ar[d]^{\mathfrak{v}} \\
C^m \ar[r]_{\cdot M_R(f)} & **[r] C^m,
}
\]
so \[\mathcal{C} = \operatorname{im}(\cdot M_R(f)).\]
A straightforward computation shows that
\begin{equation}\label{dualker}
\mathcal{C}^\bot = \operatorname{ker}(\cdot \transpose{M_R(f)}).
\end{equation}
The map $M_R : R \to \matrixring{m}{C}$ sending $f$ onto $M_R(f)$ is an injective homomorphism of rings.
\begin{definition}
Two Haming ring extensions $(C,R,\mathfrak{v})$ and $(C,\widehat{R},\widehat{\mathfrak{v}})$ are said to be \emph{transposed} if there exist an anti-isomorphism of rings $\Theta : R \to \widehat{R}$ such that the diagram
\begin{equation*}\label{eq:TC}
\xymatrix{
R \ar[r]^{M_R} \ar[d]^{\Theta} & **[r] \matrixring{m}{C} \ar[d]^{\transpose{(-)}} \\
\widehat{R} \ar[r]^{M_{\widehat{R}}} & **[r] \matrixring{m}{C}
},
\end{equation*}
is commutative. Equivalently if,
\begin{equation*}
M_{\widehat{R}}(\Theta(f)) = \transpose{M_R(f)}, \ \forall f \in R.
\end{equation*}
We say also that $\Theta$ is a \emph{transposition} from $(C,R,\mathfrak{v})$ to $(C,\widehat{R},\widehat{\mathfrak{v}})$.
\end{definition}
Given a subset $X$ of a ring $S$, the \emph{left annihilator} and the \emph{right annihilator} of $X$ are defined, respectively, by
\[
\lann{S}{X} = \{ s \in S : sx = 0, \forall x \in X \}, \quad \rann{S}{X} = \{ s \in S : xs = 0, \forall x \in X \}.
\]
The first of these sets is a left ideal of $S$, while the second one is a right ideal.
\begin{theorem}\label{Dualcyclic}
Let $(C,R,\mathfrak{v})$ and $(C,\widehat{R},\widehat{\mathfrak{v}})$ be transpose Hamming ring extensions with anti-isomorphism $\Theta : R \to \widehat{R}$. Let \(f,h \in R\) and \(\mathcal{C} = \mathfrak{v}(Rf)\). Then \(hR = \rann{R}{Rf}\) if and only if \(\mathcal{C}^\bot = \widehat{\mathfrak{v}}(\widehat{R}\Theta(h))\). In this case, $\mathcal{C}^\bot$ is generated by the rows of $\transpose{M_R(h)}$.
\end{theorem}
\begin{proof}
Assume $\rann{R}{Rf} = hR$. Then we get $\lann{\widehat{R}}{\Theta(f)\widehat{R}} = \widehat{R}\Theta(h)$. This implies that the top row of the commutative diagram
\[
\xymatrix@C=50pt{\widehat{R} \ar^-{\cdot \Theta(h)}[r] \ar_-{\widehat{\mathfrak{v}}}[d]& \widehat{R} \ar^-{\cdot \Theta(f)}[r] \ar_-{\widehat{\mathfrak{v}}}[d] & \widehat{R} \ar_-{\widehat{\mathfrak{v}}}[d] \\
C^m \ar_-{\cdot M_{\widehat{R}}(\Theta(h))}[r] & C^m \ar_-{\cdot M_{\widehat{R}}(\Theta(f))}[r] & C^m}
\]
is exact, so is the bottom row. Therefore,
\[
\widehat{\mathfrak{v}}(\widehat{R}\Theta(h)) = \operatorname{im} (\cdot M_{\widehat{R}}(\Theta(h)) = \operatorname{ker}(\cdot M_{\widehat{R}}(\Theta(f)) = \operatorname{ker}(\cdot \transpose{M_R(f)}) = \mathcal{C}^\bot,
\]
where the last equality is \eqref{dualker}.
Conversely, assume \(\mathcal{C}^\bot = \widehat{\mathfrak{v}}(\widehat{R}\Theta(h))\). Then
\[
\mathcal{C}^\bot = \operatorname{im}(\cdot M_{\widehat{R}}(\Theta(h))) = \operatorname{im}(\cdot \transpose{M_{R}(h)}),
\]
and therefore \(M_R(f) M_R(h) = 0\). So \(fh = 0\) and \(hR \subseteq \rann{R}{Rf}\). Let \(h' \in \rann{R}{Rf}\), i.e. \(fh' = 0\). Then \(M_R(f) M_R(h') = 0\) and so
\[
\transpose{M_R(h')} \transpose{M_R(f)} = 0.
\]
Since \(\transpose{M_R(h')} = M_{\widehat{R}}(\Theta(h'))\) and \(\mathcal{C}^\bot = \ker(\cdot \transpose{M_R(f)})\), it follows that \(\widehat{\mathfrak{v}}(\widehat{R} \Theta(h')) = \operatorname{im}(\cdot M_{\widehat{R}}(\Theta(h'))) \subseteq \mathcal{C}^\bot = \widehat{\mathfrak{v}}(\widehat{R}\Theta(h))\). Hence \(\Theta(h') \in \widehat{R}\Theta(h)\), which implies \(h' \in h R\). Therefore \(\rann{R}{Rf} \subseteq hR\) and the equality holds.
Finally, the equality $\widehat{\mathfrak{v}}(\widehat{R}\Theta(h)) = \operatorname{im}(\cdot \transpose{M_R(h)})$, implies that \(\mathcal{C}^\bot\) is generated by the rows of \(\transpose{M_R(h)}\).
\end{proof}
\begin{corollary}\label{annann}
If $\mathcal{C}^{\bot \bot} = \mathcal{C}$ and $hR = \rann{R}{Rf}$, then $Rf = \lann{R}{hR}$.
\end{corollary}
\begin{proof}
We have $\mathcal{C}^\bot = \widehat{\mathfrak{v}}(\widehat{R}\Theta(h))$. Let $\widehat{\Theta} : \widehat{R} \to R$ be the inverse of $\Theta$. Since
\[
\mathcal{C}^{\bot \bot} = \mathcal{C} = \mathfrak{v}(Rf) = \mathfrak{v}(R\widehat{\Theta}\Theta(f)),
\]
we get from Theorem \ref{Dualcyclic}, applied to the transposition $\widehat{\Theta} : \widehat{R} \to R$, that $\rann{\widehat{R}}{\widehat{R}\Theta (h)} = \Theta(f)\widehat{R}$. But this implies that $\lann{R}{hR} = Rf$.
\end{proof}
\begin{remark}\label{pidFrobenius}
It is well known that, if $C$ is a field, then $\mathcal{C}^{\bot \bot} = \mathcal{C}$ for every $C$--linear code $\mathcal{C}$. This equality also holds true in more general situations of interest. This is the case, for instance, if $C$ is a principal ideal domain and $\mathcal{C}$ is a direct summand of $C^m$, or $\mathcal{C}$ is any $C$--linear code over a Frobenius ring $C$.
\end{remark}
\section{Dual left ideal convolutional codes}\label{IdealCodes}
The method described in Section \ref{DualAnn} is abstracted from the study of the dual of a group convolutional code developed in \cite[Section 4]{LopezPermouth/Szabo:2013}. The ideas from \cite[Section 4]{LopezPermouth/Szabo:2013} were adapted in \cite{GLN:2016} to $\field$--linear cyclic convolutional codes when the word ambient algebra is a matrix algebra $\matrixring{n}{\field}$. The aim of this section is to extend the results on duality from \cite{GLN:2016} to the matrix $\field$--algebra $\matrixring{n}{\mathbb{K}}$, where $\mathbb{K}$ is a finite field extension of $\field$. To this end, we first work, in the spirit of Section \ref{DualAnn}, in a more general setting, and then apply the general results to the more concrete situation.
\subsection{Left ideal convolutional codes of automorphism type.}
Let $A$ be a ring and $\sigma : A \to A$ a ring automorphism. The skew \emph{right} polynomial ring $\rOre{A}{z}{\sigma}$ is defined as the free right $A$--module with basis $\{ z^i : i \in \mathbb{N} \}$ with the multiplication determined by the rules $z^iz^j = z^{i+j}$, and $az = z\sigma(a)$, for all $i, j \in \mathbb{N}$ and $a \in A$. If $A$ is a finite algebra over a finite field $\field$, and $\sigma$ is an $\field$--automorphism, then $R = \rOre{A}{z}{\sigma}$ becomes the sentence ambient algebra for some cyclic convolutional codes as follows. First, observe that $\field{}[z]$, the commutative polynomial ring in the variable $z$, is a subring of $R$. Moreover, each $\field$--basis $B = \{ v_0, v_1, \dots, v_{m-1} \}$ of $A$ leads to the associated coordinate map $\mathfrak{v} : A \to \field^m$. Since $B$ becomes a basis of $R$ as a (left) $\field{}[z]$--module, we get that $\mathfrak{v}$ extends to an $\field{}[z]$--module isomorphism $\mathfrak{v} : R \to \field{}[z]^m$. That is, $(\field{}[z], R, \mathfrak{v})$ becomes a Hamming ring extension of rank $m$.
Convolutional codes may be understood as $\field{}[z]$--submodules of $\field{}[z]^m$, so, they may be considered as $\field{}[z]$--linear codes. The variable $z$ is interpreted as the delay operator \cite{Forney:1970}. Convolutional codes are often required to be, in addition, direct summands of $\field{}[z]^m$.
\begin{definition}\cite{LopezPermouth/Szabo:2013}\label{licc}
A direct summand $\field{}[z]$--submodule $\mathcal{C}$ of $\field{}[z]^m$ is said to be a \emph{left ideal convolutional code} if there exits a left ideal $I$ of $\rOre{A}{z}{\sigma}$ such that $\mathcal{C} = \mathfrak{v}(I)$.
\end{definition}
Our next aim is to prove that, under suitable conditions, it is possible to construct a transpose Hamming ring extension to $R$. For $a \in A$, we use the notation $M_a = M_R(a)$. Observe that $M_a \in \matrixring{m}{\field}$. On the other hand, for every $\field$--linear map $\lambda : A \to A$, let $M_{\lambda} \in \matrixring{m}{\field}$ be the unique matrix such that the diagram
\[
\xymatrix{A \ar^{\lambda}[r] \ar^{\mathfrak{v}}[d] &A \ar^{\mathfrak{v}}[d] \\
\field^m \ar^{\cdot M_{\lambda}}[r] & \field^m}
\]
is commutative. A straightforward computation shows that, if $\lambda$ is an algebra map, then, for all $a \in A$,
\begin{equation}\label{eq:alambda}
M_a M_\lambda = M_\lambda M_{\lambda(a)}
\end{equation}
\begin{proposition}\label{descriptionofM_Rsigma}
For every \(f = \sum_kz^kf_k \in R\) we have:
\[M_R(f) = \sum_k z^k M_{\sigma}^k M_{f_k}.\]
\end{proposition}
\begin{proof}
This proof is adapted and simplified from \cite[Proposition 4.7]{LopezPermouth/Szabo:2013} and \cite[Proposition 2.4]{GLN:2016}.
Since \(\mathfrak{v} : R \to \field{}[z]^m\) is an \(\field{}[z] \)--linear map, we have, for every $g \in R$,
\[
\begin{split}
\mathfrak{v}(g) \textstyle\sum_k z^k M_{\sigma}^k M_{f_k} &= \mathfrak{v}\left(\textstyle\sum_l z^l g_l\right) \textstyle\sum_k z^k M_{\sigma}^k M_{f_k} \\
&= \textstyle\sum_{l,k} z^l z^k \mathfrak{v}(g_l) M_{\sigma^k} M_{f_k} \\
&= \textstyle\sum_{l,k} z^l z^k \mathfrak{v}(\sigma^k(g_l)f_k) \\
&= \mathfrak{v}\left( \textstyle\sum_l z^l \textstyle\sum_k z^k \sigma^k(g_l)f_k \right) \\
&= \mathfrak{v}\left( \textstyle\sum_l z^l \textstyle\sum_k g_l z^k f_k \right) \\
&= \mathfrak{v}(gf).
\end{split}
\]
\end{proof}
Consider now an involution $\theta : A \to A$ (that is, an anti-algebra homomorphism such that $\theta^2 = \identity{A}$). Let us denote $\widehat{\sigma} = \theta \sigma^{-1} \theta$. Define the map
\begin{equation}\label{antimapOre}
\begin{split}
\Theta : \rOre{A}{z}{\sigma} &\to \rOre{A}{z}{\widehat{\sigma}} \\
\textstyle\sum_k z^k a_k &\mapsto \Theta(\textstyle\sum_k z^k a_k) = \sum_k z^k \theta \sigma^{-k}(a_k)
\end{split}
\end{equation}
Note that, as left $\field{}[z]$--modules, both rings are equal, and, once the basis $B$ of $A$ is fixed, we have that $(\field{}[z], \rOre{A}{z}{\widehat{\sigma}}, \mathfrak{v})$ is a Hamming ring extension.
\begin{proposition}\label{FzTranspose}
The map \(\Theta : \rOre{A}{z}{\sigma} \to \rOre{A}{z}{\widehat{\sigma}} \) is an anti-isomorphism of $\field$--algebras. Moreover, if
\(M_{\widehat{\sigma}} = \transpose{M_\sigma}\) and \(M_{\theta(a)} = \transpose{M_a}\) for all \(a \in A\), then $(\field{}[z], \rOre{A}{z}{\sigma}, \mathfrak{v})$ and $(\field{}[z], \rOre{A}{z}{\widehat{\sigma}}, \mathfrak{v})$ are transpose Hamming ring extensions via $\Theta$.
\end{proposition}
\begin{proof}
Since \(\theta\) and \(\sigma\) are \(\field{}\)--linear and bijective, \(\Theta\) is also \(\field{}\)--linear and bijective. Let us check that $\Theta$ is anti-multiplicative. Obviously, the restriction of $\Theta$ to $A$ is just $\theta$. Since $\rOre{A}{z}{\sigma}$ is generated as an $\field$--algebra by $A$ and $z$, it is enough to consider $a \in A$ and compute
\[
\Theta(a)\Theta(z) = \theta(a) z = z \theta \sigma^{-1} \theta \theta(a) = z \theta \sigma^{-1}(a) = \Theta(za)
\]
and
\[
\Theta(az) = \Theta(z \sigma(a)) = z \theta\sigma^{-1}\sigma(a) = z \theta(a) = \Theta(z) \Theta(a).
\]
In order to check that $\Theta$ is a transposition, let us compute
\[
\begin{split}
\transpose{M_R(f)}
&= \transpose{\left[ \sum_k z^k M_{\sigma}^k M_{f_k} \right]} \quad \text{by Proposition \ref{descriptionofM_Rsigma}}\\
&= \transpose{\left[ \sum_k z^k M_{\sigma^{-k}(f_k)} M_{\sigma}^k \right]} \quad \text{by \eqref{eq:alambda}}\\
&= \sum_k z^k \transpose{(M_{\sigma}^k)} \transpose{(M_{\sigma^{-k}(f_k)})} \\
&= \sum_k z^k (\transpose{M_{\sigma}})^k M_{\theta{\sigma^{-k}(f_k)}} \quad \text{by assumption}\\
&= \sum_k z^k (M_{\widehat{\sigma}})^k M_{\theta{\sigma^{-k}(f_k)}} \quad \text{by assumption}\\
&= M_{\widehat{R}}(\Theta({f})) \quad \text{by Proposition \ref{descriptionofM_Rsigma},}
\end{split}
\]
as desired.
\end{proof}
\begin{remark}
If $A = \field G$ is the group algebra of a finite group $G$, and $\theta$ is the involution defined on $G$ as $\theta (g) = g^{-1}$, then Proposition \ref{FzTranspose} gives \cite[Proposition 4.18]{LopezPermouth/Szabo:2013} in the case where the skew derivation used in \cite{LopezPermouth/Szabo:2013} is zero.
\end{remark}
\begin{theorem}\label{dualidealcode}
Assume that
\(M_{\widehat{\sigma}} = \transpose{M_\sigma}\) and \(M_{\theta(a)} = \transpose{M_a}\) for all \(a \in A\). Let $f \in R = \rOre{A}{z}{\sigma}$ such that $\rann{R}{Rf} = hR$ for some $h \in R$. If $\mathcal{C} = \mathfrak{v} (Rf)$, then $\mathcal{C}^\bot = \mathfrak{v}(\widehat{R}\Theta(h))$, and both $\mathcal{C}$ and $\mathcal{C}^\bot$ are left ideal convolutional codes. Moreover, $Rf = \lann{R}{hR}$.
\end{theorem}
\begin{proof}
The equality $\mathcal{C}^\bot = \mathfrak{v}(\widehat{R}\Theta(h))$ follows from Proposition \ref{Dualcyclic} and Proposition \ref{FzTranspose}. As observed in the proof of Theorem \ref{Dualcyclic}, $\widehat{R}\Theta(h) = \lann{\widehat{R}}{\Theta(f)}$. Then $\mathcal{C}^\bot$ is a left ideal convolutional code by \cite[Lemma 2.1]{GLN:2016}. Corollary \ref{annann}, by virtue of Remark \ref{pidFrobenius}, gives the equality $Rf = \lann{R}{hR}$. Therefore, $\mathcal{C}$ is a left ideal convolutional code, by \cite[Lemma 2.1]{GLN:2016}.
\end{proof}
\begin{remark}
If $\field{}[z] \subseteq R$ is a separable ring extension, then every left ideal convolutional code is of the form $\mathfrak{v}(Re)$ for some idempotent $e \in R$ (see \cite{GLN2017IdealCodes}). Therefore, $\rann{R}{Re} = (1-e)R$.
\end{remark}
\begin{remark}
If $A = \field G$, the group algebra of a finite group $G$, then Theorem \ref{dualidealcode} gives, in this particular case, a stronger statement than \cite[Theorem 4.21]{LopezPermouth/Szabo:2013}, for the case where the $\sigma$--derivation considered there is zero.
\end{remark}
\subsection{Convolutional codes with a simple word-ambient algebra.}
In \cite{GLN:2016}, dual codes of left ideal convolutional codes, when \(A\) is the matrix algebra \(\matrixring{n}{\field{}}\), are studied. Concretely, \cite[propositions 2.9 and 2.10]{GLN:2016} provide a transposition of Hamming ring extensions in this special case, and, henceforth, Theorem \ref{dualidealcode} generalizes and improves \cite[Theorem 2.12]{GLN:2016}.
Our next aim is to give sufficient conditions to apply Proposition \ref{FzTranspose} and Theorem \ref{dualidealcode} to \(A = \matrixring{n}{\mathbb{K}}\), where \(\mathbb{K} = \field[q^t]\) is a finite field extension of \(\field{} = \field[q] \) of degree \(t\). Let \(D = \{ \alpha_0, \dots, \alpha_{t-1} \}\) be a basis of \(\mathbb{K}\) as an \(\field{}\)--vector space. We have a monomorphism of $\field$--algebras
\[
\begin{split}
\mathfrak{m} : \mathbb{K} &\to \matrixring{t}{\field{}} \\
\gamma &\mapsto \mathfrak{m}(\gamma),
\end{split}
\]
where $\mathfrak{m}(\gamma)$ is the matrix that represents the multiplication map $\cdot \gamma : \mathbb{K} \to \mathbb{K}$ for $\gamma \in \mathbb{K}$ with respect to $D$.
Let $V, V'$ be finite-dimensional $\mathbb{K}$--vector spaces with bases $B = \{ v_0, \dots, v_{r-1}\}$ and $B' = \{v'_0, \dots, v'_{s-1} \}$, respectively. Define the $\mathbb{F}$--basis \[ B_{\field} = \{ \alpha_iv_j : 0 \leq i \leq t, 0 \leq j \leq r \}\] of $V$ ordered by the condition that $\alpha_i v_j$ is before than $\alpha_k v_{j+1}$ for all $i,j,k$. The $\field$--basis $B'_{\field}$ of $V'$ is defined analogously.
\begin{lemma}\label{matrix_expansion}\label{tomatrix_multiplicative}
Let \(M = (m_{ij}) \in \matrixring{r \times s}{\mathbb{K}}\) be the matrix associated with respect to the bases $B$ and $B'$ to a $\mathbb{K}$--linear map $\lambda : V \to V'$. The matrix associated to $\lambda$ considered as an $\field$--linear map with respect to the bases $B_{\field}$ and $B'_{\field}$ is
\[
\mathfrak{m}(M) = \Big( \mathfrak{m}(m_{ij}) \Big)_{0 \leq i < r \atop 0 \leq j < s} \in \matrixring{rt \times st}{\field{}}.
\]
\end{lemma}
\begin{proof}
Straightforward.
\end{proof}
Consider the $\mathbb{K}$--basis \(\mathcal{B} = \{ E_{ij} ~|~ 0 \leq i,j < n, 0 \leq k < t \}\) of $A = \matrixring{n}{\mathbb{K}}$, where \(E_{ij}\) is the matrix with \(1\) in the position corresponding to \(i\)th row and \(j\)th column, and \(0\) elsewhere. Order $\mathcal{B}$ in such a way that the corresponding coordinate map $\matrixring{n}{\mathbb{K}} \to \mathbb{K}^{n^2}$ writes each matrix as the concatenation of its rows. We thus get the $\field$--basis $\mathcal{B}_{\field} = \{ \alpha_kE_{ij} : 0 \leq k \leq t-1, 0 \leq i, j \leq n-1 \}$ ordered as described above. This last basis leads to a coordinate map $\mathfrak{v} : A \to \mathbb{F}^{tn^2}$ which, for any $\field$--automorphism $\sigma$ of $A$, extends to an $\mathbb{F}[z]$--linear isomorphism $\mathfrak{v} : \rOre{A}{z}{\sigma} \to \mathbb{F}[z]^{tn^2}$. Our aim is to prove that, if the basis $D$ of $\mathbb{K}$ over $\mathbb{F}$ is a normal self-dual basis, then a transposition $\Theta$ fulfilling the hypotheses of Proposition \ref{FzTranspose} can be constructed.
Let \(D^* = \{ \beta_0, \dots, \beta_{t-1} \}\) the dual basis of $D = \{\alpha_0, \dots, \alpha_{t-1} \}$. Recall that \(D\) is normal if there exists \(\alpha \in \mathbb{K}\) such that \(\alpha_k = \alpha^{q^k}\) for all \(0 \leq k < t\). Also recall that \(D \) is self-dual if \(\alpha_k = \beta_k\) for all \(0 \leq k < t\).
The coordinate map with respect to $D$ is given by
\[
\mathbb{K} \to \field{}^t, \quad
\gamma \mapsto \left(\operatorname{Tr}(\beta_0 \gamma), \dots, \operatorname{Tr}(\beta_{t-1} \gamma) \right)
\]
where \(\operatorname{Tr} \) denotes the trace map of the field extension \(\field{} \subseteq \mathbb{K}\).
By the properties of the trace function,
\[
\mathfrak{m}(\gamma) = \Big( \operatorname{Tr}(\beta_i \gamma \alpha_j) \Big)_{0 \leq i,j < t}.
\]
As involution on \(A\), we use the natural one, that is, \(\theta : A \to A\) be the involution given by \(\theta(a) = \transpose{a}\). In order to show how $\theta$ fulfills the Proposition \ref{FzTranspose}, we need to use some properties of the Kronecker product of matrices over a field $L$.
Recall that if \(M \in \matrixring{r \times s}{L}\) and \(N \in \matrixring{r' \times s'}{L}\), the Kronecker product of \(M\) and \(N\) is defined as
\[
M \boxtimes N = \left( \begin{matrix}
m_{0,0} N & m_{0,1} N & \cdots & m_{0,s-1} N \\
m_{1,0} N & m_{1,1} N & \cdots & m_{1,s-1} N \\
\vdots & \vdots & \ddots & \vdots \\
m_{r-1,0} N & m_{r-1,1} N & \cdots & m_{r-1,s-1} N
\end{matrix}\right),
\]
where \(M = \big( m_{i,j} \big)_{0 \leq i < r, 0 \leq j < s}\). Properties of the Kronecker product can be seen in \cite[Chapter 4]{Horn/Johnson:1994}.
\begin{lemma}\label{propertiesofMa}
The following properties hold for all \(a \in A\):
\begin{enumerate}[(i)]
\item \(M_a = \mathfrak{m}(I \boxtimes a)\).
\item If \(B\) is self-dual, \(\transpose{M_a} = M_{\transpose{a}}\).
\end{enumerate}
\end{lemma}
\begin{proof}
(i) follows from Lemma \ref{matrix_expansion} and \cite[Lemma 2.2]{GLN:2016}. If \(D\) is self-dual then \(\mathfrak{m}(\gamma)\) is symmetric for all \(\gamma \in \mathbb{K}\), hence (ii) follows from (i) and \cite[Lemma 2.3(iii)]{GLN:2016}.
\end{proof}
Lemma \ref{propertiesofMa} ensures the first hypothesis of Proposition \ref{FzTranspose}. As for the second one concerns, namely the equality \(M_{\widehat{\sigma}} = \transpose{M_\sigma}\), it will be obtained with the help of a suitable decomposition of $\sigma$. Let \(\tau : \mathbb{K} \to \mathbb{K}\) denote the Frobenius $\mathbb{F}$--automorphism of $\mathbb{K}$, i.e. \(\tau(\gamma) = \gamma^q\). By \cite[Theorem 2.4]{Cauchon/Robson:1978}, for every $\mathbb{F}$--automorphism $\sigma$ of the matrix algebra $A$, there exist a regular matrix \(U \in A\) and \(0 \leq h \leq t-1\) such that \(\sigma = \sigma_U \circ \sigma_{\tau^h}\), where \(\sigma_U\) is the inner automorphism associated to \(U\), i.e. \(\sigma_U(a) = U a U^{-1}\), and \(\sigma_{\tau^h}\) is the componentwise extension of \(\tau^h\) to \(A\), i.e. \(\sigma_{\tau^h}\big( m_{ij} \big) = \big( \tau^h(m_{ij}) \big)\).
We are going to analyze inner automorphisms and extensions of field automorphisms independently, and later we will join both results.
For each regular matrix \(U \in A\), a straightforward computation shows that \(\widehat{\sigma_U} = \theta \sigma_U^{-1} \theta = \sigma_{\transpose{U}}\).
\begin{lemma}\label{propertiesofMsigmaU}
The following properties hold:
\begin{enumerate}[(i)]
\item \(M_{\sigma_U} = \mathfrak{m}(\transpose{U} \boxtimes U^{-1})\).
\item If \(D\) is self-dual, then \(M_{\widehat{\sigma_U}} = \transpose{M_{\sigma_U}}\).
\end{enumerate}
\end{lemma}
\begin{proof}
(i) follows from Lemma \ref{matrix_expansion} and \cite[Lemma 2.3(ii)]{GLN:2016}. If \(D\) is self-dual then \(\mathfrak{m}(\gamma)\) is symmetric for all \(\gamma \in \mathbb{K}\), hence (ii) follows from (i).
\end{proof}
\begin{proposition}\label{TCsigmaU}
Let \(R = \rOre{A}{z}{\sigma_U}\) and \(\widehat{R} = \rOre{A}{z}{\widehat{\sigma_U}}\). If \(D\) is a self-dual basis, then \((\field{}[z],R,\mathfrak{v})\) and \((\field{}[z],\widehat{R},\mathfrak{v})\) are transposed Hamming extensions.
\end{proposition}
\begin{proof}
By Lemma \ref{propertiesofMa}, \(M_{\transpose{a}} = \transpose{M_a}\) for all \(a \in A\). By Lemma \ref{propertiesofMsigmaU}, \(M_{\widehat{\sigma_U}} = \transpose{M_{\sigma_U}}\). Hence the result follows from Proposition \ref{FzTranspose}.
\end{proof}
Now we focus on extensions of field automorphisms.
\begin{lemma}\label{Ph}
Let \(\tau\) be the Frobenius automorphism of $\mathbb{K}$ over $\mathbb{F}$, and let \(0 \leq h < t\). If \(D\) is a normal basis, then the automorphism \(\tau^h\) is represented as \(\field{}\)--linear map by the matrix
\[
P_h = \begin{pmatrix} 0 & I_{t-h} \\ I_h & 0 \end{pmatrix} \in \matrixring{t}{\field{}}.
\]
The automorphism \(\sigma_{\tau^h} : A \to A\) is represented as \(\field{}\)--linear map by the matrix
\[
M_{\sigma_{\tau^h}} = I_{n^2} \boxtimes P_h = \begin{pmatrix} P_h & & \\ & \ddots & \\ & & P_h \end{pmatrix} \in \matrixring{n^2t}{\field{}}.
\]
\end{lemma}
\begin{proof}
Straightforward since \(\tau\) performs a cyclic permutation of one position to the right of the elements of \(D\).
\end{proof}
\begin{lemma}\label{propertiesofMh}
Assume \(D\) to be a normal basis. The following properties hold:
\begin{enumerate}[(i)]
\item \(M_{\sigma_{\tau^h}}^{-1} = M_{\sigma_{\tau^{t-h}}} = \transpose{M_{\sigma_{\tau^h}}}\).
\item \(M_{\widehat{\sigma_{\tau^h}}} = \transpose{M_{\sigma_{\tau^h}}}\),
\end{enumerate}
\end{lemma}
\begin{proof}
(i) is a direct consequence of Lemma \ref{Ph}. Since \(\sigma_{\tau^h}\) acts component-wise, it commutes with \(\theta\), hence \(\widehat{\sigma_{\tau^h}} = \theta \sigma_{\tau^h}^{-1} \theta = \theta^2 \sigma_{\tau^h}^{-1} = \sigma_{\tau^h}^{-1} = \sigma_{\tau^{t-h}}\), hence (ii) follows from (i).
\end{proof}
\begin{proposition}\label{TCsigmah}
Let \(R = \rOre{A}{z}{\sigma_{\tau^h}}\) and \(\widehat{R} = \rOre{A}{z}{\widehat{\sigma_{\tau^h}}}\). If \(D\) is a normal basis then \((\field{}[z],R,\mathfrak{v})\) and \((\field{}[z],\widehat{R},\mathfrak{v})\) are transposed Hamming extensions.
\end{proposition}
\begin{proof}
Again, Lemma \ref{propertiesofMa} implies \(M_{\transpose{a}} = \transpose{M_a}\) for all \(a \in A\). Lemma \ref{propertiesofMh} implies \(M_{\widehat{\sigma_{\tau^h}}} = \transpose{M_{\sigma_{\tau^h}}}\). So Proposition \ref{FzTranspose} gives the result.
\end{proof}
Finally we get to general automorphisms \(\sigma = \sigma_U \sigma_{\tau^h} \in \Aut[\field{}]{A}\) where \(U \in A\) is a regular matrix and \(0 \leq h < t\).
\begin{lemma}\label{propertiesofMsigma}
Let \(\sigma = \sigma_U \sigma_{\tau^h} \in \Aut[\field{}]{A}\). If \(D\) is a self-dual normal basis, we have
\[
M_{\widehat{\sigma}} = \transpose{M_{\sigma}}
\]
\end{lemma}
\begin{proof}
The decomposition \(\sigma = \sigma_U \sigma_{\tau^h}\) implies \(M_\sigma = M_{\sigma_{\tau^h}} M_{\sigma_U}\). Since
\[
\widehat{\sigma} = \widehat{\sigma_U \sigma_{\tau^h}} = \theta \sigma_{\tau^h}^{-1} \sigma_U^{-1} \theta = \theta \sigma_{\tau^h}^{-1} \theta \theta \sigma_U^{-1} \theta = \widehat{\sigma_{\tau^h}} \widehat{\sigma_U},
\]
we get \(M_{\widehat{\sigma}} = M_{\widehat{\sigma_U}} M_{\widehat{\sigma_{\tau^h}}}\). Hence the result follows from Lemma \ref{propertiesofMsigmaU} and Lemma \ref{propertiesofMh}.
\end{proof}
\begin{proposition}\label{TCsigma}
Let \(R = \rOre{A}{z}{\sigma}\) and \(\widehat{R} = \rOre{A}{z}{\widehat{\sigma}}\). If \(D\) is a self-dual normal basis, then \((\field{}[z],R,\mathfrak{v})\) and \((\field{}[z],\widehat{R},\mathfrak{v})\) are transposed Hamming extensions.
\end{proposition}
\begin{proof}
Decompose $\sigma = \sigma_U \sigma_{\tau^h}$ according to \cite[Theorem 2.4]{Cauchon/Robson:1978}. The proof is now completely analogous to Proposition \ref{TCsigmaU} and Proposition \ref{TCsigmah} by using Lemma \ref{propertiesofMa}, Lemma \ref{propertiesofMsigma} and Proposition \ref{FzTranspose}.
\end{proof}
We are now in position to state the main result of this subsection, which is a consequence of Theorem \ref{dualidealcode} and Proposition \ref{TCsigma}. Field extensions which have a self-dual normal basis are characterized by results of Lempel, Weinberger, Seroussi, Imamura and Morii, see \cite{Lempel/Weinberger:1988} and its references.
\begin{theorem}\label{matrixmain}
Let $\sigma$ be any $\mathbb{F}$--automorphism of \(A = \matrixring{n}{\mathbb{K}}\). Assume there exists a self-dual normal basis $D$ of $\mathbb{K}$ over $\mathbb{F}$. Let \(f \in R = \rOre{A}{z}{\sigma}\) such that \(\rann{R}{Rf} = hR\) for some $h \in R$. If $\mathcal{C} = \mathfrak{v} (Rf)$, then $\mathcal{C}^\bot = \mathfrak{v}(\widehat{R}\Theta(h))$, and $\mathcal{C}$ and $\mathcal{C}^\bot$ are both left ideal convolutional codes. Moreover, $Rf = \lann{R}{hR}$.
\end{theorem}
\begin{proof}
The result follows from Proposition \ref{TCsigma} and Theorem \ref{dualidealcode}.
\end{proof}
\begin{remark}
Taking $\mathbb{K} = \mathbb{F}$ in Theorem \ref{matrixmain} leads to a strong form of \cite[Theorem 2.12]{GLN:2016}.
\end{remark}
\begin{remark}
By \cite[Theorems 1 and 2]{Lempel/Weinberger:1988}, if \(t\) is odd, or \(q\) is even and \(t \equiv 2 \mod{4}\), then there exists a self-dual normal basis \(D\) of \(\mathbb{K}\) over \(\field{}\), and Theorem \ref{matrixmain} applies.
\end{remark}
\section{Dual of skew constacyclic codes}\label{sec:constacyclic}
Let $C$ be a commutative ring and $\sigma$ an automorphism of $C$. Assume that $\sigma$ has finite order, and let $n \geq 1$ such that $\sigma^n = \identity{C}$. If $u \in C$ is a unit such that $\sigma(u) = u$, then the both $x^n-u$ and $x^n -u^{-1}$ are central elements in the skew left polynomial ring $\lOre{C}{x}{\sigma}$, where the multiplication rule is now \(x a = \sigma(a) x\). Consider the factor rings
\[
\mathcal{R} = \frac{\lOre{C}{x}{\sigma}}{\langle x^n - u \rangle}, \qquad \widehat{\mathcal{R}} = \frac{\lOre{C}{x}{\sigma}}{\langle x^n - u^{-1} \rangle},
\]
which contain $C$ as a subring.
Since the ideal $\langle x^n-u \rangle$ coincides with the left ideal generated by $x^n - u$, and this polynomial is monic, we easily get that $\{1, x, \dots, x^{n-1} \}$ is a basis of $\mathcal{R}$ as a left $C$--module (we are identifying, as usual, each equivalent class modulo $x^n -u$
with its unique representative of degree less than $n$). We have a Hamming ring extension $(C,\mathcal{R},\mathfrak{v})$, where $\mathfrak{v} : \mathcal{R} \to C^n$ is the coordinate map with respect to the aforementioned basis.
Since $x$ is a unit in both rings, we may define
\[
\Theta : \mathcal{R} \to \widehat{\mathcal{R}}, \qquad \sum_{i = 0}^{n-1}a_ix^i \mapsto \sum_{i = 0}^{n-1}\sigma^{-i}(a_i)x^{-i}.
\]
\begin{lemma}
The map $\Theta$ is an anti-isomorphim of rings.
\end{lemma}
\begin{proof}
Since $\Theta$ is clearly additive, in order to prove that it is an anti-homomorphism of rings, it suffices to check that it is anti-multiplicative on monomials. To this end, let us first observe that, since $x^n = u^{-1}$ in $\widehat{\mathcal{R}}$, we have for all integers $i,j,k$ with $k = in + j$
\begin{equation}\label{xk}
x^{-k} = u^ix^{-j}
\end{equation}
Now, given any integer $k$, write $k = in + j$ for some integers $i, j$ with $0 \leq j < n$. Then, for any $a \in C$, we have
\[
\Theta(ax^k)
= \Theta (au^ix^j) = u^i\sigma^{-j}(a)x^{-j} = \sigma^{-k}(a)x^{-k},
\]
where, in the last equality, we used \eqref{xk} and that $\sigma^n = \identity{C}$. Therefore, for any $a, b \in C$ and integers $i,j$ we have
\[
\Theta(ax^ibx^j) = \Theta(a\sigma^i(b)x^{i+j}) = \sigma^{-i-j}(a\sigma^i(b))x^{-i-j} = \sigma^{-i-j}(a)\sigma^{-j}(b)x^{-i-j},
\]
while
\[
\Theta(bx^j)\Theta(ax^i) = \sigma^{-j}(b)x^{-j}\sigma^{-i}(a)x^{-i} = \sigma^{-j}(b)\sigma^{-j-i}(a)x^{-i-j}.
\]
Therefore, $\Theta$ is anti-multiplicative. The map $\Theta$ is proved to be bijective by defining a map $\widehat{\Theta} : \widehat{\mathcal{R}} \to \mathcal{R}$ analogous to $\Theta$ which turns out to be its inverse.
\end{proof}
The set $\{1, x, \dots, x^{n-1} \}$ provides bases as left $C$--modules of $\mathcal{R} = \lOre{C}{x}{\sigma}/\langle x^n - u\rangle$ and of $\widehat{\mathcal{R}} = \lOre{C}{x}{\sigma}/\langle x^n - u^{-1}\rangle$.
\begin{proposition}\label{constatranspose}
Consider the basis $\{1, x, \dots, x^{n-1} \}$ of $\mathcal{R}$ and $\widehat{\mathcal{R}}$, with corresponding coordinate isomorphisms $\mathfrak{v} : \mathcal{R} \to C^n$ and $\widehat{\mathfrak{v}} : \widehat{\mathcal{R}} \to C^n$. The anti-isomorphism $\Theta : \mathcal{R} \to \widehat{\mathcal{R}}$ is a transposition from $(C,\mathcal{R},\mathfrak{v})$ to $(C,\widehat{\mathcal{R}},\widehat{\mathfrak{v}})$.
\end{proposition}
\begin{proof}
First, observe that if \(f = \sum_{i=0}^{n-1} a_i x^i \in \mathcal{R}\) then
\[
M_{\mathcal{R}}(f) =
\begin{pmatrix}
a_0 & a_1 & \dots & a_{n-1} \\
u \sigma(a_{n-1}) & \sigma(a_0) & \dots & \sigma(a_{n-2}) \\
\vdots & \vdots & \ddots & \vdots \\
u \sigma^{n-1}(a_1) & u \sigma^{n-1}(a_2) & \dots & \sigma^{n-1}(a_0)
\end{pmatrix}.
\]
Now, since $x^{-1} = ux^{n-1} \in \widehat{\mathcal{R}}$, we get that $x^{-i} = ux^{n-i}$ for $i = 0, 1, \dots, n-1$. Hence,
\[
\Theta (f) = \sum_{i=0}^{n-1}\sigma^{n-i}(a_i)ux^{n-i} = a_0 + \sum_{j=1}^{n-1} u \sigma^j(a_{n-j}) x^j.
\]
Therefore,
\[
M_{\widehat{\mathcal{R}}}(\Theta(f)) =
\begin{pmatrix}
a_0 & u\sigma(a_{n-1}) & \dots & u\sigma^{n-1}(a_1) \\
a_1 & \sigma(a_0) & \dots & u\sigma^{n-1}(a_2) \\
\vdots & \vdots & \ddots & \vdots \\
a_{n-1} & \sigma(a_{n-2}) & \dots & \sigma^{n-1}(a_0)
\end{pmatrix} = \transpose{M_{\mathcal{R}}(f)}
\]
because $\sigma^n = \identity{C}$.
\end{proof}
\begin{definition}
Let \((C,\mathcal{R},\mathfrak{v})\) be the Hamming ring extension where \(\mathcal{R} = \frac{\lOre{C}{x}{\sigma}}{\langle x^n - u \rangle}\) with \(\sigma^n = \identity{C}\) and \(u \in C\) is a unit such that \(\sigma(u) = u\). A \((C,\mathcal{R},\mathfrak{v})\)-cyclic code is called \((u,\sigma)\)-constacyclic code.
\end{definition}
\begin{theorem}\label{dualconstacyclic}
Let $f \in \lOre{C}{x}{\sigma}$ be monic such that $x^n - u = fh$ for some $h \in \lOre{C}{x}{\sigma}$. Let $\mathcal{C} = \mathfrak{v}(\mathcal{R}f)$ be the $(u,\sigma)$--constacyclic $C$--linear code generated by $f$. Then $\mathcal{C}^\bot = \widehat{\mathfrak{v}}(\widehat{\mathcal{R}}\Theta(h))$, and it is thus a $(u^{-1},\sigma)$--constacyclic code.
\end{theorem}
\begin{proof}
Let us first check that $\rann{\mathcal{R}}{\mathcal{R} f} = h\mathcal{R}$. By hypotesis, $h \in \rann{\mathcal{R}}{\mathcal{R} f}$ so that $\rann{\mathcal{R}}{\mathcal{R} f}\supseteq h\mathcal{R}$. To see the converse inclusion, let $h' \in \rann{\mathcal{R}}{\mathcal{R} f}$. Then $fh' = (x^n-u)g = fhg$ for some $g \in \lOre{C}{x}{\sigma}$. Since monic polynomials are nonzero divisors in $\lOre{C}{x}{\sigma}$, we get that $h' = hg$ as desired.
By virtue of Proposition \ref{constatranspose} we may apply Theorem \ref{Dualcyclic} and thus get $\mathcal{C}^\bot = \widehat{\mathfrak{v}}(\widehat{\mathcal{R}}\Theta (h))$.
\end{proof}
\begin{remark}\label{u2=1}
If \(u^2 = 1\), we get \(\mathcal{R} = \widehat{\mathcal{R}}\) and \(\Theta\) becomes an involution in \(\mathcal{R}\), i.e. an anti-algebra automorphism such that \(\Theta^2 = \identity{\mathcal{R}}\).
\end{remark}
\begin{corollary}\label{dualu2=1}
If $u^2 = 1$, then $\mathcal{C}^\bot = \mathfrak{v}(\mathcal{R}\Theta(h))$.
\end{corollary}
\begin{example}
Cyclic and negacyclic codes over finite chain rings defined in \cite{Dinh/LopezPermouth:2004} fit in our construction. Let \(C\) be a commutative chain ring and \(\mathcal{C}\) a \(C\)-linear code of length \(n\). Then \(\mathcal{C}\) is cyclic if and only if \(\mathfrak{v}^{-1}(\mathcal{C})\) is an ideal of \(\mathcal{R} = C[x]/\langle x^n-1 \rangle = \widehat{\mathcal{R}}\). The ring \(\mathcal{R}\) is proven to be a principal ideal ring, \cite[Corollary 3.7]{Dinh/LopezPermouth:2004}, and generators \(F\) and \(G\) for a cyclic code \(\mathcal{C}\) and its dual \(\mathcal{C}^\bot\) are computed, \cite[theorems 3.6 and 3.10]{Dinh/LopezPermouth:2004}. Theorem \ref{Dualcyclic} implies that \(\Theta(G)\mathcal{R} = \rann{\mathcal{R}}{\mathcal{R}F}\). The same can be said for negacyclic \(C\)-codes, i.e. ideals of \(C[x]/\langle x^n + 1 \rangle\), if \(F\) and \(G\) are the generators computed in \cite[Theorem 5.7 and 5.12]{Dinh/LopezPermouth:2004} then \(\Theta(G)\) generates the annihilator of \(F\).
\end{example}
\begin{example}
Since, in Theorem \ref{dualconstacyclic}, $x^n - u$ is a central element of $\lOre{C}{x}{\sigma}$, the equality $fh = x^n-u$ implies, by a standard argument, that $hf = x^n -u$. Now, $x$ is a unit in $\widehat{\mathcal{R}}$, which implies that $x^k\Theta(h)$ generates $\widehat{\mathcal{R}} \Theta(h)$ for every integer $k$. Setting $k$ equal to the degree of $h$, we get that $x^k\Theta(h)$ is a generator polynomial of the dual code $\mathcal{C}^\bot$ which takes the form of the given in \cite[Corollary 18]{Boucher/Ulmer:2009} for $\sigma$--codes over a finite field. We also get the generator of the dual of any skew constacyclic code computed in \cite[Theorem 4.4]{Boucher/alt:2008}, \cite[Lemma 3.1]{Jitman/alt:2012} and \cite[Proposition 3]{Ducoat/Oggier:2016} in the realm of codes over finite commutative rings.
\end{example}
\section{Dual of skew Reed-Solomon codes}\label{DualsRS}
Let $\sigma$ be an automorphism of finite order $n$ of a field $L$. Since \(L\) is a field, all left and right ideals in the skew left polynomial ring \(\lOre{L}{x}{\sigma}\) are principal. So greatest common left and right divisors and least common left and right multiples exist and they can be computed with the corresponding versions of the extended Euclidean algorithm, see e.g. \cite{Gomez:2014}. Concretely given \(f,g \in \lOre{L}{x}{\sigma}\), the least common left multiple of \(f\) and \(g\), denoted by \(\lclm{f,g}\), is the monic generator of \(\lOre{L}{x}{\sigma} f \cap \lOre{L}{x}{\sigma} g\), and the greatest common right divisor, denoted by \(\gcrd{f,g}\), is the monic generator of \(\lOre{L}{x}{\sigma} f + \lOre{L}{x}{\sigma} g\). Analogously, the least common right multiple is denoted by \(\lcrm{f,g}\) and the greatest common left divisor by \(\gcld{f,g}\).
The theory developed in Section \ref{sec:constacyclic} can be applied to \(\mathcal{R} = \lOre{L}{x}{\sigma} / \langle x^n-1 \rangle\) with \(u = 1\). In this case, \(\mathcal{R} = \widehat{\mathcal{R}}\) and \((1,\sigma)\)-constacyclic codes are called \(\sigma\)-cyclic codes. Theorem \ref{dualu2=1} says that the dual of a \(\sigma\)-cyclic code is \(\sigma\)-cyclic. In this \(\sigma\)-cyclic setting the morphism \(\Theta\) becomes an involution, i.e.
\[
\Theta : \mathcal{R} \to \mathcal{R}, \qquad \sum_{i = 0}^{n-1}a_ix^i \mapsto \sum_{i = 0}^{n-1}\sigma^{-i}(a_i)x^{-i} = a_0 + \sum_{j=1}^{n-1} \sigma^j(a_{n-j}) x^j,
\]
satisfies \(\Theta^2 = \identity{\mathcal{R}}\).
Skew Reed-Solomon codes are \(\sigma\)-cyclic codes generated by some special polynomials which we describe below. Let \(\{\alpha, \sigma(\alpha), \dots, \sigma^{n-1}(\alpha)\}\) be a normal basis of \(L/K\) where \(K = L^\sigma\) denotes de invariant subfield. Let \(\beta = \sigma(\alpha) \alpha^{-1}\). By \cite[Lemma 3.1]{GLNPGZ},
\begin{equation}\label{eq:fulldecomposition}
x^n-1 = \lclm{x-\beta, x-\sigma(\beta), \dots, x-\sigma^{n-1}(\beta)}.
\end{equation}
Let \(t\) such that \(2t < n\), \(\delta = 2t+1\). Let
\[
g = \lclm{x-\beta, x-\sigma(\beta), \dots, x-\sigma^{\delta-2}(\beta)}.
\]
The code \(\mathcal{C} = \mathfrak{v}(\mathcal{R}g)\) is called a skew RS code of designed distance \(\delta\). If \(k = n - \delta + 1\), \(\mathcal{C}\) is an \([n,k,\delta]\)-code over \(L\), hence it is MDS with respect to the Hamming distance (see \cite[Definition 2, Theorem 3.4]{GLNPGZ}). Skew Reed-Solomon codes can be efficiently decoded, see \cite{GLNPGZ,gln2017sugiyama}
We will prove that the dual of a skew Reed-Solomon code is again a skew Reed-Solomon code, and describe explicitly its generator polynomial as a least common left multiple of linear polynomials. Some preliminary results are needed. Observe that $\sigma$ extends to an automorphism of $\mathcal{R}$, which acts on $x$ as the identity.
\begin{lemma}\label{sigmaTheta}
The morphisms \(\Theta\) and \(\sigma\) commute, i.e. \(\Theta \sigma = \sigma \Theta\).
\end{lemma}
\begin{proof}
It is a straightforward computation.
\end{proof}
Let \(\gamma \in L\) such that $x-\gamma$ left divides $x^n-1$. Then \((x - \gamma) \mathcal{R}\) is a maximal right ideal, and therefore \(\mathcal{R} \Theta(x - \gamma)\) is a maximal left ideal. Hence there exists \(\gamma' \in L\) such that
\[
\mathcal{R}(x - \gamma') = \mathcal{R} \Theta(x - \gamma).
\]
In fact, since $\Theta(x-\gamma) = x^{-1} - \gamma$, we get that
\[
\gamma' = \sigma(\gamma)^{-1}.
\]
\begin{lemma}\label{fromhtoTheta(h)}
If \(h = \lcrm{\{x - \sigma^i(\gamma)~|~0 \leq i \leq k-1\}}\), then $\mathcal{R}\Theta(h) = \mathcal{R}h'$, where
\[
h' = \lclm{\{x - \sigma^i(\gamma')~|~0 \leq i \leq k-1\}}.
\]
\end{lemma}
\begin{proof}
Since \(h = \lcrm{\{x - \sigma^i(\gamma)~|~0 \leq i \leq k-1\}}\),
\[
h \mathcal{R} = \bigcap_{i=0}^{k-1} (x - \sigma^i(\gamma)) \mathcal{R} = \bigcap_{i=0}^{k-1} \sigma^i \left( (x - \gamma) \mathcal{R} \right).
\]
So, by Lemma \ref{sigmaTheta},
\[
\begin{split}
\mathcal{R} \Theta(h) &= \Theta \left( h \mathcal{R} \right) \\
&= \Theta \left( \bigcap_{i=0}^{k-1} \sigma^i \left( (x - \gamma) \mathcal{R} \right) \right) \\
&= \bigcap_{i=0}^{k-1} \Theta \left( \sigma^i \left( (x - \gamma) \mathcal{R} \right) \right) \\
&= \bigcap_{i=0}^{k-1} \sigma^i \left( \Theta \left( (x - \gamma) \mathcal{R} \right) \right) \\
&= \bigcap_{i=0}^{k-1} \sigma^i \left( \mathcal{R} \Theta (x - \gamma) \right) \\
&= \bigcap_{i=0}^{k-1} \sigma^i \left( \mathcal{R} (x - \gamma') \right) \\
&= \bigcap_{i=0}^{k-1} \mathcal{R} (x - \sigma^i (\gamma')) \\
&= \mathcal{R} \lclm{\{x - \sigma^i(\gamma')~|~0 \leq i \leq k-1\}}.
\end{split}
\]
\end{proof}
\begin{lemma}\label{rightleft}
Let \(\gamma \in L\) such that $(x-\gamma) \lclm{x-\sigma(\beta),\ldots,x-\sigma^{n-1}(\beta)}= x^n-1$. Then
\[
\lcrm{x-\gamma, \ldots , x-\sigma^k(\gamma)} \lclm{x-\sigma^{k+1}(\beta),\ldots,x-\sigma^{n-1}(\beta)}=x^n-1
\]
for all \(0 \leq k \leq n-1\).
\end{lemma}
\begin{proof}
Denote $N_i=\lclm{\{x-\sigma^j(\beta)~|~j\neq i\}}$ for each $i=0,\dots , n-1$.
Then $N_i$ has degree $n-1$ by \eqref{eq:fulldecomposition}. So, there exist $\gamma_0,\gamma_1,\ldots ,\gamma_{n-1} \in L$ such that
\[
(x-\gamma_i)N_i=x^n-1
\]
for $i=0,\ldots, n-1$. Let $\gamma=\gamma_0$. Then $(x-\gamma)N_0=x^n-1$, and therefore $(x-\sigma^k(\gamma))\sigma^k(N_0)=x^n-1$ for $k=1,\ldots ,n-1$.
On the other hand, observe that $\sigma^k(N_0) = N_k$ for any $k=1,\ldots ,n-1$. Thus, for $k=1,\ldots ,n-1$, $(x-\sigma^k(\gamma))N_k=(x-\gamma_k)N_k$, and then $\gamma_k=\sigma^k(\gamma)$ for all $k=1,\ldots ,n-1$.
Let us now prove our thesis, i.e.
\[
\lcrm{x-\gamma, \ldots , x-\sigma^k(\gamma)} \lclm{x-\sigma^{k+1}(\beta),\ldots,x-\sigma^{n-1}(\beta)}=x^n-1
\]
for $k=0,\ldots ,n-1$, by induction on \(k\). The case $k=0$ is trivial. Assume that it holds for $j\leq k$ and we prove it for $k+1$. Firstly, the polynomial $\lcrm{x-\gamma, \ldots , x-\sigma^{k+1}(\gamma)}$ has degree $k+2$. Indeed, otherwise, by hypothesis, $\lcrm{x-\gamma, \ldots , x-\sigma^{k}(\gamma)} = \lcrm{x-\gamma, \ldots , x-\sigma^{k+1}(\gamma)}$ and then
$(x-\sigma^{k+1}(\gamma))p= \lcrm{x-\gamma, \ldots , x-\sigma^{k}(\gamma)}$. So,
\[
(x-\sigma^{k+1}(\gamma))p \lclm{x-\sigma^{k+1}(\beta),\ldots,x-\sigma^{n-1}(\beta)} = x^n-1.
\]
In particular, this implies that
\[
p \lclm{x-\sigma^{k+1}(\beta),\ldots,x-\sigma^{n-1}(\beta)} = N_{k+1}
\]
and, consequently, $x-\sigma^{k+1}(\beta)$ right divides $N_{k+1}$, which contradicts
\eqref{eq:fulldecomposition}.
Now, by hypothesis,
\[
\lcrm{x-\gamma, \ldots , x-\sigma^k(\gamma)} \lclm{x-\sigma^{k+1}(\beta),\ldots,x-\sigma^{n-1}(\beta)} = x^n-1
\]
so, applying $\sigma$,
\[
\lcrm{x-\sigma(\gamma), \ldots , x-\sigma^{k+1}(\gamma)} \lclm{x-\sigma^{k+2}(\beta),\ldots,x-\sigma^{n-1}(\beta),x-\beta} = x^n-1
\]
so
\[
\lcrm{x-\sigma(\gamma), \ldots , x-\sigma^{k+1}(\gamma)} q \lclm{x-\sigma^{k+2}(\beta),\ldots,x-\sigma^{n-1}(\beta)} = x^n-1
\]
for some polynomial $q$. That is, if $h$ is the monic polynomial verifying that
\[
h \lclm{x-\sigma^{k+2}(\beta),\ldots,x-\sigma^{n-1}(\beta)} = x^n-1,
\]
then $\lcrm{x-\sigma(\gamma), \ldots , x-\sigma^{k+1}(\gamma)}$ left divides $h$. On the other hand, the case $k=0$ provides that
\[
(x-\gamma) \lclm{x-\sigma(\beta),\ldots,x-\sigma^{n-1}(\beta)} = x^n-1
\]
and therefore
$x-\gamma$ left divides $h$ as well. So $\lcrm{x-\gamma, x-\sigma(\gamma), \ldots , x-\sigma^{k+1}(\gamma)}$ left divides $h$. Since both have degree $k+2$, the result follows.
\end{proof}
\begin{theorem}\label{sRSdual}
Consider a skew RS code \(\mathcal{C} = \mathfrak{v}(\mathcal{R} g)\), where
\[
g = \lclm{x-\beta, x-\sigma(\beta), \dots, x-\sigma^{\delta-2}(\beta)}.
\]
If \(\gamma \in L\) is such that
\[ (x-\gamma) \lclm{x-\sigma(\beta),\ldots,x-\sigma^{n-1}(\beta)}= x^n-1,
\] then $\mathcal{C}^\bot$ is the skew RS code generated by
\[
\lclm{x-\sigma^{\delta}(\gamma)^{-1}, \dots, x-\sigma^{n}(\gamma)^{-1}}.
\]
\end{theorem}
\begin{proof}
By Lemma \ref{rightleft}
\[
\lcrm{x-\gamma, \ldots , x-\sigma^{n-\delta}(\gamma)} \lclm{x-\sigma^{n-\delta+1}(\beta),\ldots,x-\sigma^{n-1}(\beta)}=x^n-1,
\]
and, by applying \(\sigma^{\delta-1}\), we obtain
\[
\lcrm{x-\sigma^{\delta-1}(\gamma), \ldots , x-\sigma^{n-1}(\gamma)} \lclm{x-\beta,\ldots,x-\sigma^{\delta-2}(\beta)}=x^n-1.
\]
Therefore, $hg = x^n-1$, where $h = \lcrm{x-\sigma^{\delta-1}(\gamma), \ldots , x-\sigma^{n-1}(\gamma)}$. A standard argument, which uses that $x^n-1$ is central, proves that $gh = x^n -1$.
By Corollary \ref{dualu2=1}, we get that $\mathcal{C}^\bot = \mathcal{R}\Theta(h)$. Lemma \ref{fromhtoTheta(h)} gives then that $\mathcal{R}\Theta(h)$ is generated by
\[
\lclm{x-\sigma(\sigma^{\delta -1}(\gamma))^{-1}, \ldots, \sigma^{n-\delta+1}(\sigma^{\delta-1}(\gamma))^{-1}},
\]
which finishes the proof.
\end{proof}
We finish by proving that, as a consequence of Theorem \ref{sRSdual}, skew RS codes can be seen as evaluation codes. The right evaluation of a skew polynomial \(f = \sum_i f_i x^i \in \lOre{L}{x}{\sigma}\) by \(a \in L\) is the remainder of the right division of \(f\) by \(x - a\), i.e. the unique element \(f(a) \in L\) such that \(f(x) = q(x) (x-a) + f(a)\). Then
\[
f(a) = \sum_i f_i \norm{i}{a}
\]
where
\[
\norm{i}{a} = a \sigma(a) \dots \sigma^{i-1}(a).
\]
\begin{definition}
Let \(\overline{\alpha} = (\alpha_0, \alpha_1, \dots, \alpha_{m-1}) \in L^m\) and \(\overline{v} = (v_0, v_1, \dots, v_{m-1}) \in (L\setminus\{0\})^m\). The skew Generalized Evaluation code associated to \((\overline{\alpha},\overline{v})\) is
\[
\operatorname{sGE}_{(\overline{\alpha},\overline{v})} = \left\{ (v_0 f(\alpha_0), \dots, v_{m-1} f(\alpha_{m-1})) ~|~ f \in \lOre{L}{x}{\sigma}, \deg f < k \right\}.
\]
\end{definition}
It is straightforward to check that \(\operatorname{sGE}_{(\overline{\alpha},\overline{v})}\) is an \(L\)--linear code. In fact a generator matrix for it is
\begin{multline*}
\left(\begin{matrix}
v_0 & v_1 & \cdots & v_{m-1} \\
v_0 \alpha_0 & v_1 \alpha_1 & \cdots & v_{m-1} \alpha_{m-1} \\
\vdots & \vdots & \ddots & \vdots \\
v_0 \norm{k-1}{\alpha_0} & v_1 \norm{k-1}{\alpha_1} & \cdots & v_{n-1}\norm{k-1}{\alpha_{m-1}}
\end{matrix}\right) \\
=
\left(\begin{matrix}
1 & 1 & \cdots & 1 \\
\alpha_0 & \alpha_1 & \cdots & \alpha_{m-1} \\
\vdots & \vdots & \ddots & \vdots \\
\norm{k-1}{\alpha_0} & \norm{k-1}{\alpha_1} & \cdots & \norm{k-1}{\alpha_{m-1}}
\end{matrix}\right)
\left(\begin{matrix}
v_0 & 0 & \cdots & 0 \\
0 & v_1 & \cdots & 0 \\
\vdots & \vdots & \ddots & \vdots \\
0 & 0 & \cdots & v_{m-1}
\end{matrix}\right)
\end{multline*}
This definition is an extension of \cite[Definition 9]{Liu/etal:2015} to arbitrary fields, including therefore the convolutional case when \(L = \field{}(t)\). A different approach to evaluation codes, where the norms are replaced by powers of the automorphism, can be found in \cite{Augot/etal:2013,Augot/etal:2017}.
Let us now prove that a skew RS code is also a sGE code.
\begin{theorem}\label{sRSevaluation}
Let \(\mathcal{C} = \mathfrak{v}(\mathcal{R} g)\) be a skew RS code where
\[
g = \lclm{x-\beta, \dots, x - \sigma^{\delta-2}(\beta)}.
\]
Then there exist \(\mu, \nu \in L\setminus\{0\}\) such that
\(
\mathcal{C} = \operatorname{sGE}_{(\overline{\mu},\overline{\nu})},
\)
where \(\overline{\mu} = (\mu, \sigma(\mu), \dots, \sigma^{n-1}(\mu))\) and \(\overline{\nu} = (\nu, \sigma(\nu), \dots, \sigma^{n-1}(\nu))\).
\end{theorem}
\begin{proof}
By Theorem \ref{sRSdual} there exists \(\mu \in L\) such that \(\mathcal{C}^\bot = \mathfrak{v}(\mathcal{R} g')\) where
\[
g' = \lclm{x - \mu, \dots, x - \sigma^{n-\delta}(\mu)}.
\]
Since \(\sigma^{i}(\mu)\) is a right root of \(g'\) for \(0 \leq i \leq n-\delta\), it follows that a parity check matrix of \(\mathcal{C}^\bot\) is
\[
\left(\begin{matrix}
1 & 1 & \dots & 1 \\
\mu & \sigma(\mu) & \dots & \sigma^{n-\delta}(\mu) \\
\vdots & \vdots & \ddots & \vdots \\
\norm{n-1}{\mu} & \norm{n-1}{\sigma(\mu)} & \dots & \norm{n-1}{\sigma^{n-\delta}(\mu)}
\end{matrix}\right).
\]
Since \(\mu\) is also a left root of \(x^n-1\), it follows that \(\norm{n}{\mu} = 1\) and, by Hilbert's 90 Theorem, there exists \(\nu \in L\) such that \(\mu = \sigma(\nu)\nu^{-1}\). So, up to multiply each column by the corresponding scalar, a new parity check matrix for \(\mathcal{C}^\bot\) is
\[
H = \left(\begin{matrix}
\nu & \sigma(\nu) & \cdots & \sigma^{n-\delta}(\nu) \\
\sigma(\nu) & \sigma^2(\nu) & \cdots & \sigma^{n-\delta+1}(\nu) \\
\vdots & \vdots & \ddots & \vdots \\
\sigma^{n-1}(\nu) & \nu & \cdots & \sigma^{n-\delta-1}(\nu)
\end{matrix}\right).
\]
Therefore \(\mathcal{C}\) is generated by the rows of the matrix
\[
\transpose{H} = \left(\begin{matrix}
\nu & \sigma(\nu) & \cdots & \sigma^{n-1}(\nu) \\
\sigma(\nu) & \sigma^2(\nu) & \cdots & \nu \\
\vdots & \vdots & \ddots & \vdots \\
\sigma^{n-\delta}(\nu) & \sigma^{n-\delta+1}(\nu) & \cdots & \sigma^{n-\delta-1}(\nu)
\end{matrix}\right).
\]
We have
\[
\begin{split}
\transpose{H} &= \left(\begin{matrix}
\nu & \sigma(\nu) & \cdots & \sigma^{n-1}(\nu) \\
\sigma(\nu) & \sigma^2(\nu) & \cdots & \nu \\
\vdots & \vdots & \ddots & \vdots \\
\sigma^{n-\delta}(\nu) & \sigma^{n-\delta+1}(\nu) & \cdots & \sigma^{n-\delta-1}(\nu)
\end{matrix}\right) \\
&= \left(\begin{matrix}
1 & 1 & \cdots & 1 \\
\sigma(\nu)\nu^{-1} & \sigma^2(\nu)\sigma(\nu)^{-1} & \cdots & \nu \sigma^{n-1}(\nu)^{-1} \\
\vdots & \vdots & \ddots & \vdots \\
\sigma^{n-\delta}(\nu)\nu^{-1} & \sigma^{n-\delta+1}(\nu)\sigma(\nu)^{-1} & \cdots & \sigma^{n-\delta-1}(\nu)\sigma^{n-1}(\nu)^{-1}
\end{matrix}\right) \\
&\qquad \cdot
\left(\begin{matrix}
\nu & 0 & \cdots & 0 \\
0 & \sigma(\nu) & \cdots & 0 \\
\vdots & \vdots & \ddots & \vdots \\
0 & 0 & \cdots & \sigma^{n-1}(\nu)
\end{matrix}\right) \\
&= \left(\begin{matrix}
1 & 1 & \cdots & 1 \\
\mu & \sigma(\mu) & \cdots & \sigma^{n-1}(\mu) \\
\vdots & \vdots & \ddots & \vdots \\
\norm{n-\delta}{\mu} & \norm{n-\delta}{\sigma(\mu)} & \cdots & \norm{n-\delta}{\sigma^{n-1}(\mu)}
\end{matrix}\right) \\
&\qquad \cdot
\left(\begin{matrix}
\nu & 0 & \cdots & 0 \\
0 & \sigma(\nu) & \cdots & 0 \\
\vdots & \vdots & \ddots & \vdots \\
0 & 0 & \cdots & \sigma^{n-1}(\nu)
\end{matrix}\right),
\end{split}
\]
hence \(\mathcal{C} = \operatorname{sGE}_{(\overline{\gamma},\overline{\nu})}.\)
\end{proof}
\bibliographystyle{ams}
| {'timestamp': '2018-03-02T02:07:19', 'yymm': '1803', 'arxiv_id': '1803.00239', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00239'} | arxiv |
\section*{Nomenclature}
\begin{tabular}{@{}lcl}
${\Delta\mathbf{F}_{0}}$ & = & Bow wave disturbance force \tabularnewline
$\Delta{\mathbf{p}}_{\text{dr}}^{\text{e}}$ & = & Drogue position offsets from equilibrium position \tabularnewline
$\Delta{\mathbf{p}}_{\text{dr/pr}}$ & = & Position error between drogue and probe \tabularnewline
$\Delta{\mathbf{p}}_{\text{dr/pr}}\left(T\right)$ & = & Terminal position error \tabularnewline
$\Delta R_{\text{dr/pr}}$ & = & Radial error between hose and drogue \tabularnewline
$F_{\text{T}}$ & = & Tanker joint frame \tabularnewline
{$\mathbf{F}$}$_{\text{r}}$, {$\mathbf{F}$}$_{\text{hd}}$ & = & Disturbance forces on receiver and hose-drogue \tabularnewline
{$\mathbf{F}$}$_{\text{bow}}$ & = & Disturbance force from bow wave effect \tabularnewline
${\mathbf{p}}_{\text{dr}}\left(t\right)$, ${\mathbf{p}}_{\text{pr}}\left(t\right)$ & = & Current positions of drogue and probe \tabularnewline
${\mathbf{p}}_{\text{dr}}\left(T\right)$, ${\mathbf{p}}_{\text{pr}}\left(T\right)$ & = & Terminal positions of drogue and probe \tabularnewline
${\mathbf{p}}_{\text{dr}}^{\text{e0}}$ & = & Drogue initial equilibrium position \tabularnewline
\mathbb{R
$,
\mathbb{R
_{+}$ & = & Real number set and positive real number set \tabularnewline
$R_{\text{C}}$ & = & Threshold radius for a successful docking attempt \tabularnewline
$T$ & = & Terminal time of a docking attempt \tabularnewline
$\mathbf{\hat{u}}_{\text{pr}}$ & = & Reference trajectory for autopilot \tabularnewline
\end{tabular}
\section{Introduction}
Aerial refueling has demonstrated significant benefits to aviation
by extending the range and endurance of aircraft \cite{Nalepka-2005-1}.
The development of autonomous aerial refueling (AAR) techniques for
unmanned aerial vehicles (UAVs) makes new missions and capabilities
possible \cite{Dibley-2007-2}, like the ability for long range or
long time flight. As the most widely used aerial refueling method,
the probe-drogue refueling (PDR) system is considered to be more flexible
and compact than other refueling systems. However, a drawback of PDR
is that the drogue is passive and susceptible to aerodynamic disturbances
\cite{AAR-2014}. Therefore, it is difficult to design an AAR system
to control the probe on the receiver to capture the moving drogue
within centimeter level in the docking stage.
It used to be thought that the aerodynamic disturbances in the aerial
refueling mainly include the tanker vortex, wind gust, and atmospheric
turbulence. According to NASA Autonomous Aerial Refueling Demonstration
(AARD) project \cite{Dibley-2007-2}, the forebody flow field of the
receiver may also significantly affect the docking control of AAR,
which is called ``the bow wave effect'' \cite{Bhandari-2013-8}.
As a result, the modeling and simulation methods for the bow wave
effect were studied in our previous works \cite{dai2016modeling,wei2016drogue}.
Since the obtained mathematical models are somewhat complex and there
may be some uncertain factors in practice, this paper aims to use
a model-free method to compensate for the docking error caused by
aerodynamic disturbances including the bow wave effect.
Most of the existing studies on AAR docking control do not consider
the bow wave effect. In \cite{tandale2006trajectory,zhu2016vision,liu2017modeling},
the drogue is assumed to be relatively static (or oscillates around
the equilibrium) and not affected by the flow field of the receiver
forebody. However, in practice, the receiver aircraft is affected
by aerodynamic disturbances, and the drogue is affected by both the
wind disturbances and the receiver forebody bow wave. As a major difficulty
in the control of AAR, the aerodynamic disturbances, especially the
bow wave effect, attract increasing attention in these years. In \cite{Vortex-1,lee2013estimation},
the wind effects from the tanker vortex, the wind gust, and the atmospheric
turbulence are analyzed, and in \cite{dai2016modeling,wei2016drogue,Khan-2014-9},
the modeling and simulation methods for the receiver forebody bow
wave effect are studied, but no control methods are proposed. In \cite{Bhandari-2013-8},
simulations show that the bow wave effect can be compensated by adding
an offset value to the reference trajectory, but the method for obtaining
the offset value is not given.
Since the accurate mathematical models for the aerodynamic disturbances
are usually difficult to obtain \cite{dai2016modeling}, iterative
learning control (ILC) is a possible choice for the docking control
of AAR. According to \cite{bristow2006survey}, the ILC is a model-free
control method which can improve the performance of a system by learning
from the previous repetitive executions or iterations. ILC methods
have been proved to be effective to solve the control problems for
complex systems with no need for the exact mathematical model \cite{ahn2007iterative}.
For an actual AAR system, the relative position between the probe
and the drogue is usually measured by vision localization methods
\cite{valasek2005vision} whose measurement precision depends on the
relative distance (higher precision in a closer distance). Therefore,
compared with the trajectory data, the terminal positions of the probe
and the drogue are usually easier to measure in practice. As a result,
terminal iterative learning control (TILC) methods are suitable for
AAR systems because TILC methods need only the terminal states or
outputs instead of the whole trajectories \cite{chen1999iterative,chi2014improved}.
This paper studies the model of the probe-drogue aerial refueling
system under aerodynamic disturbances, and proposes a docking control
method based on TILC to compensate for the docking errors caused by
aerodynamic disturbances. In the ATP-56(B) issued by NATO \cite{NATO-2004-3},
chasing the drogue directly is identified as a dangerous operation
which may cause the overcontrol of the receiver. Therefore, the proposed
TILC controller is designed by imitating the docking operations of
human pilots to predict the terminal position of the drogue with an
offset to compensate for the docking errors caused by aerodynamic
disturbances. The designed controller works as an additional unit
for the trajectory generation of the original autopilot system. Simulations
based on our previously published MATLAB/SIMULINK environment \cite{dai2016modeling,wei2016drogue}
show that the proposed control method has a fast learning speed to
achieve a successful docking control under aerodynamic disturbances
including the bow wave effect.
The paper is organized as follows. \textit{Section \ref{Sec-2}} gives
comprehensive problem description and model analysis of a PDR system.
\textit{Section \ref{Sec-3}} describes the details of the TILC controller
design and the convergence analysis. \textit{Section \ref{Sec-4}}
gives simulations with the proposed TILC method. In the end, \textit{Section
\ref{Sec-5}} presents the conclusions.
\section{Problem Formulation}
\label{Sec-2}
\subsection{Frames and Notations}
\begin{figure}[tbh]
\centering \includegraphics[width=0.45\textwidth]{Fig01OverViewAAR}
\caption{Simplified schematic diagram of PDR systems.}
\label{Fig_OverViewAAR}
\end{figure}
Since the tanker moves at a uniform speed in a straight and level
line during the docking stage of AAR, a frame fixed to the tanker
body can be treated as an inertial reference frame to describe the
relative motion between the receiver and the drogue. As shown in Fig.~\ref{Fig_OverViewAAR},
a tanker joint frame $F_{\text{T}}$ is defined with the origin $O_{\text{t}}$
fixed to the joint between the tanker body and the hose. $F_{\text{T}}$
is a right-handed coordinate system, whose $x_{\text{t}}$ horizontally
points to the flight direction of the tanker, $z_{\text{t}}$ vertically
points to the ground, and $y_{\text{t}}$ points to the right. For
simplicity, the following rules are defined:
(i) All position or state vectors are defined under the tanker joint
frame $F_{\text{T}}$, unless explicitly stated.
(ii) The drogue position vector is expressed as ${\mathbf{p}}_{\text{dr}}\triangleq\left[x_{\text{dr}}\;y_{\text{dr}}\;z_{\text{dr}}\right]^{\text{T}}$,
and the probe position vector is ${\mathbf{p}}_{\text{pr}}\triangleq\left[x_{\text{pr}}\;y_{\text{pr}}\;z_{\text{pr}}\right]^{\text{T}}$.
In a similar way, the position error between the probe and the drogue
is expressed as
\begin{equation}
\Delta{\mathbf{p}}_{\text{dr/pr}}\left(t\right)\triangleq{\mathbf{p}}_{\text{dr}}\left(t\right)-{\mathbf{p}}_{\text{pr}}\left(t\right)\label{Eq-1-1}
\end{equation}
whose decomposition form is represented by $\Delta{\mathbf{p}}_{\text{dr/pr}}\triangleq[\Delta x_{\text{dr/pr}}\;\Delta y_{\text{dr/pr}}\;\Delta z_{\text{dr/pr}}]^{\text{T}}$
.
(iii) One docking attempt ends at the terminal time $T\i
\mathbb{R
_{+}$ when the probe contacts with the central plane of the drogue ($\Delta x_{\text{dr/pr}}=0$)
for the first time, which is defined as
\begin{equation}
T=\min_{t}\left\{ \Delta x_{\text{dr/pr}}\left(t\right)=0\right\} .\label{Eq-1-2}
\end{equation}
The value at time $t=T$ is called the terminal value. For example,
${\mathbf{p}}_{\text{dr}}\left(T\right)$ is the terminal position
of the drogue and $\Delta{\mathbf{p}}_{\text{dr/pr}}\left(T\right)$
is the terminal position error.
(iv) The value in the $k^{\text{th}}$ docking attempt is marked by
a right superscript. For example, ${\mathbf{p}}_{\text{dr}}^{\left(k\right)}$
denotes the drogue position ${\mathbf{p}}_{\text{dr}}$ in the $k^{\text{th}}$
docking attempt, $T^{\left(k\right)}$ denotes the $k^{\text{th}}$
terminal time, and ${\mathbf{p}}_{\text{dr}}^{\left(k\right)}\left(T^{\left(k\right)}\right)$
denotes the $k^{\text{th}}$ terminal position of the drogue.
\subsection{System Overview}
The overall structure of the AAR system proposed in this paper is
shown in Fig.~\ref{Fig-InnerCtrl}, where the whole AAR system is
divided into two parts: the mathematical model and the control system.
The AAR Mathematical model contains three components: the aerodynamic
disturbance model, the hose-drogue dynamic model, and the receiver
dynamic model; the control system contains two components: the autopilot
and the TILC controller. The autopilot focuses on stabilizing the
aircraft attitude and tracking the given reference trajectory, and
the TILC controller works as a human pilot that learns from historical
experience and sends trajectory commands to the autopilot. This paper
focuses on the design of the TILC controller.
\begin{figure}[tbh]
\centering \includegraphics[width=0.8\textwidth]{Fig02InnerCtrl}
\caption{Overall structure of the AAR system.}
\label{Fig-InnerCtrl}
\end{figure}
\subsection{Mathematical Model}
\subsubsection{Aerodynamic Disturbance Model}
The aerodynamic disturbances will change the flow field around the
receiver and the drogue, then produce disturbance forces on them to
affect their relative motions. There are mainly two sources of aerodynamic
disturbances: one is from the atmospheric environment such as the
tanker vortex, the wind gust and the atmospheric turbulence \cite{Vortex-1};
the other is from the bow wave flow field of the receiver forebody.
In an AAR system, the receiver mainly suffers the atmospheric disturbance
force {$\mathbf{F}$}$_{\text{r}}\i
\mathbb{R
^{3}$, while the hose-drogue suffers both the atmospheric disturbance force
{$\mathbf{F}$}${_{\text{hd}}}\i
\mathbb{R
^{3}$ and the bow wave disturbance force {$\mathbf{F}$}$_{\text{bow}}\i
\mathbb{R
^{3}$.
The modeling and simulation methods for {$\mathbf{F}$}$_{\text{r}}$
and {$\mathbf{F}$}${_{\text{hd}}}$ have been well studied in the
existing literature, where the detailed mathematical expression for
{$\mathbf{F}$}$_{\text{r}}$ can be found in \cite{Vortex-1},
the detailed mathematical expression for {$\mathbf{F}$}${_{\text{hd}}}$
can be found in \cite{dai2016modeling}\cite{Vortex-1}. The bow wave
disturbance force {$\mathbf{F}$}$_{\text{bow}}$, according to
\cite{dai2016modeling}, is determined by the position error between
the drogue and the probe $\Delta{\mathbf{p}}_{\text{dr/pr}}$, which
can be expressed as
\begin{equation}
{\mathbf{F}}_{\text{bow}}{=\mathbf{f}}_{\text{bow}}\left(\Delta{\mathbf{p}}_{\text{dr/pr}}\right)\label{Eq-1-3}
\end{equation}
where ${\mathbf{f}}_{\text{bow}}\left(\cdot\right)$ is the bow wave
effect function whose expression can be obtained by the method proposed
in \cite{dai2016modeling}.
Among these disturbances, {$\mathbf{F}$}$_{\text{r}}$ and {$\mathbf{F}$}${_{\text{hd}}}$
are independent of the states of the AAR system, and the corresponding
control methods are mature; {$\mathbf{F}$}$_{\text{bow}}$ is strongly
coupled with the system output $\Delta{\mathbf{p}}_{\text{dr/pr}}$,
the control strategy for which is challenging and still lacking. Therefore,
this paper puts more effort on the control of the bow wave effect.
\subsubsection{Hose-drogue Model}
The soft hose can be modeled by a finite number of cylinder-shaped
rigid links based on the finite-element theory \cite{hose-link-model}.
Then, the hose-drogue dynamic equation can be written as
\begin{equation}
\left\{ \begin{array}{l}
{\mathbf{{\dot{x}}}}_{\text{hd}}\left(t\right)={\mathbf{f}{_{\text{hd}}}}\left({{\mathbf{x}_{\text{hd}}}\left(t\right),}\mathbf{F}_{\text{hd}}\left(t\right),\mathbf{F}_{\text{bow}}\left(t\right)\right)\\
{\mathbf{p}_{\text{dr}}}\left(t\right)={\mathbf{g}{_{\text{hd}}}}\left({\mathbf{x}_{\text{hd}}}\left(t\right)\right)
\end{array}\right.\label{Eq_hoseDorgueDyn}
\end{equation}
where ${\mathbf{f}{_{\text{hd}}}}\left(\cdot\right)$ is a nonlinear
vector function{,} $\mathbf{x}_{\text{hd}}$ is the hose-drogue
state vector, and $\mathbf{F}_{\text{hd}}\left(t\right)$ and $\mathbf{F}_{\text{bow}}\left(t\right)$
are the disturbance forces acting on the drogue. The dimensions of
$\mathbf{x}_{\text{hd}}$ and ${\mathbf{f}{_{\text{hd}}}}\left(\cdot\right)$
depend on the number of the links that the hose is divided into.
The most concerned value in the TILC method is the terminal position
of the drogue. Therefore, it is necessary to study the terminal state
of the hose-drogue system (\ref{Eq_hoseDorgueDyn}). According to
\cite{wei2016drogue}, when there is no random disturbance, the drogue
will eventually settle at an equilibrium position marked as ${\mathbf{p}}_{\text{dr}}^{\text{e0}}$.
Then, under the bow wave effect, the drogue will be pushed to a new
terminal position ${\mathbf{p}}_{\text{dr}}\left(T\right)$. The drogue
position offset $\Delta{\mathbf{p}}_{\text{dr}}^{\text{e}}\i
\mathbb{R
^{3}$ is defined as
\begin{equation}
\Delta{\mathbf{p}}_{\text{dr}}^{\text{e}}={\mathbf{p}}_{\text{dr}}\left(T\right)-{\mathbf{p}}_{\text{dr}}^{\text{e0}}\label{Eq-wbow0}
\end{equation}
where $\Delta{\mathbf{p}}_{\text{dr}}^{\text{e}}$ is further determined
by the strength of terminal bow wave disturbance force {$\mathbf{F}$}$_{\text{bow}}\left(T\right)$
as
\begin{equation}
\Delta{\mathbf{p}}_{\text{dr}}^{\text{e}}={\mathbf{f}_{\text{dr}}}\left({\mathbf{F}}_{\text{bow}}\left(T\right)\right).\label{Eq-wbow1}
\end{equation}
Then, substituting Eq.~(\ref{Eq-1-3}) into Eq.~(\ref{Eq-wbow1})
yields
\begin{equation}
\Delta{\mathbf{p}}_{\text{dr}}^{\text{e}}={\mathbf{f}_{\text{dr}}}\left({\mathbf{f}}_{\text{bow}}\left(\Delta{\mathbf{p}}_{\text{dr/pr}}\left(T\right)\right)\right)\triangleq{\mathbf{\bar{f}}}_{\text{dr}}\left(\Delta{\mathbf{p}}_{\text{dr/pr}}\left(T\right)\right).\label{Eq_hoseDrDyn2}
\end{equation}
Noticing that $\Delta{\mathbf{p}}_{\text{dr/pr}}\left(T\right)\approx\mathbf{0}$,
the Taylor Expansion can be applied to Eq.~(\ref{Eq_hoseDrDyn2}),
which results in
\begin{equation}
\Delta{\mathbf{p}}_{\text{dr}}^{e}\approx\mathbf{m}_{0}+\mathbf{M}_{1}\cdot\Delta{\mathbf{p}}_{\text{dr/pr}}\left(T\right)\label{Eq_hoseDrDyn2-1}
\end{equation}
where
\begin{equation}
\mathbf{m}_{0}\triangleq{\mathbf{\bar{f}}}_{\text{dr}}\left(\mathbf{0}\right),\;\mathbf{M}_{1}\triangleq\left.\frac{\partial{\mathbf{\bar{f}}}_{\text{dr}}\left(\mathbf{x}\right)}{\partial\mathbf{x}}\right\vert _{\mathbf{x=0}}.\label{Eq_hoseDrDyn2-2}
\end{equation}
In practice, the drogue is sensitive to the aerodynamic disturbances,
and the actual terminal position of the drogue always oscillates around
its stable position. Therefore, a bounded disturbance term $\mathbf{v}_{\text{dr}}\i
\mathbb{R
^{3}$ should be added to Eq.~(\ref{Eq_hoseDrDyn2}) as
\begin{equation}
\Delta{\mathbf{p}}_{\text{dr}}^{\text{e}}=\mathbf{m}_{0}+\mathbf{M}_{1}\cdot\Delta{\mathbf{p}}_{\text{dr/pr}}\left(T\right)+\mathbf{v}_{\text{dr}}\label{Eq_hoseDrDyn2-3}
\end{equation}
where $\left\Vert \mathbf{v}_{\text{dr}}\right\Vert \leq B_{\text{dr}}$
represents the position fluctuation of the drogue due to random disturbances
such as atmospheric turbulence. According to Eq.~(\ref{Eq_hoseDrDyn2-3}),
there is a functional relationship between the terminal docking error
$\Delta{\mathbf{p}}_{\text{dr/pr}}\left(T\right)$ and the drogue
bow wave offset $\Delta{\mathbf{p}}_{\text{dr}}^{\text{e}}$. Therefore,
it is possible to use TILC methods to compensate for the bow wave
position offset $\Delta{\mathbf{p}}_{\text{dr}}^{\text{e}}$ with
the terminal docking error $\Delta{\mathbf{p}}_{\text{dr/pr}}\left(T\right)$.
The detailed mathematical expression of ${\mathbf{\bar{f}}}_{\text{dr}}\left(\cdot\right)$
can be obtained through methods in \cite{dai2016modeling}, then the
Jacobian matrix $\mathbf{M}_{1}$ can be obtained from Eq.~(\ref{Eq_hoseDrDyn2-2}).
Since ${\mathbf{\bar{f}}}_{\text{dr}}\left(\cdot\right)$ is monotonically
decreasing along each axial direction, for the receiver aircraft with
symmetrical forebody layout, it is easy to verify that $\mathbf{M}_{1}$
is a negative definite matrix.
\subsubsection{Receiver Aircraft Model}
As previously mentioned, in the docking stage, the tanker joint frame
$F_{\text{T}}$ can be simplified as an inertial frame. Under this
situation, the commonly used aircraft modeling methods as presented
in \cite{AirContrl} can be applied to the receiver aircraft with
the following form
\begin{equation}
\left\{ \begin{array}{l}
{\mathbf{{\dot{x}}}}_{\text{r}}\left(t\right)={\mathbf{f}}_{\text{r}}\left({\mathbf{x}}_{\text{r}}{\left(t\right),\mathbf{F}}_{\text{r}}{\left(t\right),}\boldsymbol{u}_{\text{r}}\left(t\right)\right)\\
\mathbf{p}{_{\text{pr}}}\left(t\right)={\mathbf{g}_{\text{pr}}}\left({\mathbf{x}}_{\text{r}}\left(t\right)\right)
\end{array}\right.\label{Eq-rec}
\end{equation}
where ${\mathbf{f}}_{\text{r}}\left(\cdot\right)$ is a nonlinear
function, ${\mathbf{x}}_{\text{r}}$ is the state of the receiver
and $\mathbf{u}_{\text{r}}$ is the control input of the receiver
aircraft.
Since the nonlinear model (\ref{Eq-rec}) is too complex for controller
design, a linearization method \cite{AirContrl} is applied to Eq.~(\ref{Eq-rec})
to simplify the receiver dynamic model. Assume the receiver equilibrium
state is $\mathbf{x}_{\text{r0}}$ and the trimming control is $\boldsymbol{u}_{\text{r0}}$,
then the linear model can be expressed as
\begin{equation}
\left\{ \begin{array}{l}
\Delta{\mathbf{{\dot{x}}}}_{\text{r}}\left(t\right)=\mathbf{A}_{\text{r}}\cdot\Delta{\mathbf{x}_{\text{r}}\left(t\right)}+\mathbf{B}_{\text{r}}\cdot\Delta\boldsymbol{u}_{\text{r}}\left(t\right)+\mathbf{G}_{\text{r}}\cdot{\mathbf{F}_{\text{r}}\left(t\right)}\\
\Delta\mathbf{p}{_{\text{pr}}}\left(t\right)=\mathbf{C}_{\text{r}}\cdot\Delta{\mathbf{x}_{\text{r}}}\left(t\right)
\end{array}\right.\label{Eq-rec1}
\end{equation}
where $\Delta{\mathbf{x}_{\text{r}}\triangleq\mathbf{x}_{\text{r}}-}\mathbf{x}_{\text{r0}}$
is the state vector of the linearized system, $\Delta\boldsymbol{u}_{\text{r}}\triangleq\boldsymbol{u}_{\text{r}}-\boldsymbol{u}_{\text{r0}}$
is the linearized control input vector and $\Delta\mathbf{p}${$_{\text{pr}}$}$\triangleq\mathbf{p}${$_{\text{pr}}$}$-\mathbf{p}{_{\text{pr0}}}$
is the probe position offset from the initial probe position $\mathbf{p}{_{\text{pr0}}}$.
\subsection{Control System}
\subsubsection{Autopilot}
Based on the linear model (\ref{Eq-rec1}), the autopilot can be simplified
as a state feedback controller \cite{lee2013estimation} in the form
as
\begin{eqnarray}
\Delta\boldsymbol{u}_{\text{r}}\left(t\right) & = & -\mathbf{K}_{\text{P}}\cdot\Delta{\mathbf{x}_{\text{r}}\left(t\right)}-\mathbf{K}_{\text{I}}\cdot\mathbf{e}_{\text{I}}\left(t\right)\label{Eq-rec2}\\
\mathbf{\dot{e}}_{\text{I}}\left(t\right) & = & \mathbf{p}{_{\text{pr}}\left(t\right)}-\mathbf{\hat{u}}_{\text{pr}}\left(t\right)\label{Eq-rec3}
\end{eqnarray}
where $\mathbf{\hat{u}}_{\text{pr}}\left(t\right)\i
\mathbb{R
^{3}$ is the reference trajectory vector of the probe, $\mathbf{K}_{\text{P}}$
and $\mathbf{K}_{\text{I}}$ are the gain matrices. Essentially, Eq.~(\ref{Eq-rec2})
is a PI controller, where $-\mathbf{K}_{\text{P}}\cdot\Delta{\mathbf{x}_{\text{r}}}\left(t\right)$
is the state feedback control term for stabilizing the aircraft, and
${-}\mathbf{K}_{\text{I}}\cdot\mathbf{e}_{\text{I}}\left(t\right)$
is the integral control term for tracking the given trajectory. Since
it is very convenient to obtain $\mathbf{K}_{\text{P}}$ and $\mathbf{K}_{\text{I}}$
through LQR function in MATLAB, the procedures are omitted here. In
practice, a saturation function is required for $\mathbf{e}_{\text{I}}\left(t\right)$
in Eq.~(\ref{Eq-rec2}) to slow down the response speed and resist
integral saturation. For instance, the approaching speed should be
constrained within a reasonable range about 0.5m/s$\sim$1m/s, because
the probe should have enough closure speed to open the valve on the
drogue safely \cite{Dibley-2007-2}.
As analyzed in \cite{lee2013estimation,AirContrl}, when the autopilot
(\ref{Eq-rec2}) is well designed and the disturbance force {$\mathbf{F}$}${_{\text{r}}\left(t\right)}\equiv\mathbf{0}$,
the tracking error can converge to zero
\begin{equation}
\mathbf{\hat{u}}_{\text{pr}}\left(t\right)-\mathbf{p}{_{\text{pr}}}\left(t\right)\rightarrow\mathbf{0},\text{ as }t\rightarrow\infty.\label{Eq-rec2-1}
\end{equation}
However, in practice, the disturbance force {$\mathbf{F}$}${_{\text{r}}\left(t\right)}\neq\mathbf{0}$
and the terminal time $T\ll\infty$, then the tracking error cannot
reach zero at terminal time $T$. Therefore, an error term should
be added to Eq.~(\ref{Eq-rec2-1}) at $T$ as
\begin{equation}
\mathbf{\hat{u}}_{\text{pr}}\left(T\right)-\mathbf{p}{_{\text{pr}}}\left(T\right)=\mathbf{v}_{\text{pr}}\label{Eq-rec5}
\end{equation}
where $\mathbf{v}_{\text{pr}}\i
\mathbb{R
^{3}$ is a bounded random disturbance term with $\left\Vert \mathbf{v}_{\text{pr}}\right\Vert \leq B_{\text{pr}}$.
The random disturbance $\mathbf{v}_{\text{pr}}$ may come from the
unrepeatable disturbances such as atmospheric turbulence.
\subsubsection{Objective of Docking Control}
\begin{figure}[tbh]
\centering \includegraphics[width=0.45\textwidth]{Fig03CaptureMissCriterion1}
\caption{Success and failure criteria of a docking attempt \cite{Dibley-2007-2}.}
\label{Fig_CaptureMissCriterion}
\end{figure}
According to \cite{Dibley-2007-2}, in each docking attempt, the receiver
should follow the drogue for seconds until the hose-drogue levels
off. Then, the receiver starts to drive the probe to approach the
drogue with a slow constant speed, until the probe hits the central
plane of the drogue as shown in Fig.~\ref{Fig_CaptureMissCriterion}.
The basic requirement for the AAR system is that the relative position
between the probe and the drogue (represented by the docking error
$\Delta{\mathbf{p}}_{\text{dr/pr}}$) can reach zero at the terminal
time $T$. In practice, the radial error $\Delta R_{\text{dr/pr}}\i
\mathbb{R
_{+}$ is an important evaluation index for the docking performance which
defined in \textit{oyz} plane as
\begin{equation}
\Delta R_{\text{dr/pr}}\left(t\right)\triangleq\sqrt{\Delta y_{\text{dr/pr}}^{2}\left(t\right)+\Delta z_{\text{dr/pr}}^{2}\left(t\right)}.
\end{equation}
Since the docking error is inevitable due to disturbances, a threshold
radius (criterion radius) $R_{\text{C}}\i
\mathbb{R
_{+}$ should be defined as
\begin{equation}
\Delta R_{\text{dr/pr}}\left(T\right)<R_{\text{C}}.\label{Eq-LearnCtrl0}
\end{equation}
If criterion (\ref{Eq-LearnCtrl0}) is satisfied, a success docking
is declared for this docking attempt \cite{Dibley-2007-2}. Otherwise,
a failure or miss is declared. In fact, according to the previous
definition, there is $\Delta x_{\text{dr/pr}}\left(T\right)\equiv0$.
Therefore, the terminal radial error $\Delta R_{\text{dr/pr}}\left(T\right)$
always equals to the terminal docking error $\Delta{\mathbf{p}}_{\text{dr/pr}}\left(T\right)$.
\section{TILC Design}
\label{Sec-3}
As shown in Fig.\ \ref{Fig-InnerCtrl}, the role of the TILC controller
in AAR system is the same as the human pilot in manned aerial refueling
system. The inputs of the TILC controller are the historical terminal
positions of the probe ${\mathbf{p}}_{\text{pr}}\left(T\right)$ and
the drogue ${\mathbf{p}}_{\text{dr}}\left(T\right)$, and the output
is the reference tracking trajectory $\mathbf{\hat{u}}_{\text{pr}}\left(t\right)$
which is further sent to the autopilot.
\subsection{TILC Controller}
The docking errors of the AAR system are mainly caused by two factors:
the drogue offset caused by the bow wave effect as described in Eq.~(\ref{Eq-wbow0});
and the tracking error caused by the response lag of the receiver
as described in Eq.~(\ref{Eq-rec5}). In order to compensate for
these docking errors, a simple and safe control strategy is letting
the probe always aims at a predicted fixed position $\mathbf{\hat{u}}_{\text{pr}}^{\left(k\right)}\left(t\right)\equiv\mathbf{\hat{u}}_{\text{pr}}^{\left(k\right)}$
during the docking stage. The predicted position $\mathbf{\hat{u}}_{\text{pr}}^{\left(k\right)}$
for the autopilot should have the following form
\begin{equation}
\mathbf{\hat{u}}_{\text{pr}}^{\left(k\right)}={\mathbf{p}}_{\text{dr}}^{\text{e0,}\left(k\right)}+\mathbf{u}_{\text{de,dr}}^{\left(k\right)}+\mathbf{u}_{\text{e,pr}}^{\left(k\right)}\label{Eq-Stg1-0}
\end{equation}
where ${\mathbf{p}}_{\text{dr}}^{\text{e0,}\left(k\right)}\i
\mathbb{R
^{3}$ is the original stable position of the drogue, $\mathbf{u}_{\text{de,dr}}^{\left(k\right)}\i
\mathbb{R
^{3}$ is an estimation term for the drogue position offset, and $\mathbf{u}_{\text{e,pr}}^{\left(k\right)}\i
\mathbb{R
^{3}$ is an ILC term to compensate for the tracking error of the probe.
Note that, since ${\mathbf{p}}_{\text{dr}}^{\text{e0,}\left(k\right)}$
can be directly measured during the flight, it is treated as a known
parameter here. Then, $\mathbf{u}_{\text{de,dr}}^{\left(k\right)}$
and $\mathbf{u}_{\text{e,pr}}^{\left(k\right)}$ should be updated
in each iteration, and the updating laws are given below.
(1) the updating law of $\mathbf{u}_{\text{de,dr}}^{\left(k\right)}$
is given by
\begin{equation}
\mathbf{u}_{\text{de,dr}}^{\left(k\right)}=\mathbf{K}_{\alpha}\cdot\mathbf{u}_{\text{de,dr}}^{\left(k-1\right)}+\left(\mathbf{I}-\mathbf{K}_{\alpha}\right)\cdot\Delta{\mathbf{p}}_{\text{dr}}^{\text{e,}\left(k-1\right)}\label{Eq-Stg2-0}
\end{equation}
where $\mathbf{K}_{\alpha}=\text{diag}\left(k_{\alpha_{1}},k_{\alpha_{2}},k_{\alpha_{3}}\right)$
with $k_{\alpha_{1}},k_{\alpha_{2}},k_{\alpha_{3}}\in\left(0,1\right)$
is a constant diagonal matrix, and $\Delta{\mathbf{p}}_{\text{dr}}^{\text{e}}$
is the drogue terminal offset position as defined in Eq.~(\ref{Eq-wbow0})
whose iterative feature can be written as
\begin{equation}
\Delta{\mathbf{p}}_{\text{dr}}^{\text{e,}\left(k\right)}\triangleq\mathbf{p}{_{\text{dr}}^{(k)}}\left(T^{\left(k\right)}\right)-{\mathbf{p}}_{\text{dr}}^{\text{e0,}\left(k\right)}.\label{Eq-Stg2-1}
\end{equation}
(2) the updating law of $\mathbf{u}_{\text{e,pr}}^{\left(k\right)}$
is given by
\begin{equation}
\mathbf{u}_{\text{e,pr}}^{\left(k\right)}=\mathbf{u}_{\text{e,pr}}^{\left(k-1\right)}+\mathbf{K}_{p}\cdot\mathbf{e}_{\text{pr}}^{(k-1)}\label{Eq-Stg2-3}
\end{equation}
where $\mathbf{K}_{p}=\text{diag}\left(k_{p_{1}},k_{p_{2}},k_{p_{3}}\right)$
is a constant diagonal matrices with $k_{p_{1}},k_{p_{2}},k_{p_{3}}\in\left(0,1\right)$
and $\mathbf{e}_{\text{pr}}$ represents the probe terminal tracking
error with the $k^{\text{th}}$ iterative feature defined as
\begin{equation}
\mathbf{e}_{\text{pr}}^{(k)}\triangleq{\mathbf{p}}_{\text{dr}}^{\text{e0,}\left(k\right)}+\mathbf{u}_{\text{de,dr}}^{\left(k\right)}-\mathbf{p}{_{\text{pr}}^{(k)}}\left(T^{\left(k\right)}\right).\label{Eq-Stg2-4}
\end{equation}
\subsection{Convergence Analysis }
The following theorem provides the convergence condition under which
one can conclude the convergence property of the designed TILC controller
in Eq.\ (\ref{Eq-Stg1-0}).
\textbf{Theorem 1}. Consider the AAR system described by Eqs.~(\ref{Eq_hoseDorgueDyn})(\ref{Eq-rec})(\ref{Eq-rec2})
with the structure shown in Fig.~\ref{Fig-InnerCtrl}. Suppose (i)
the autopilot of the receiver aircraft in Eq.~(\ref{Eq-rec2}) is
well designed, and the probe terminal position satisfies Eq.~(\ref{Eq-rec5});
(ii) the TILC controller is designed as Eq.~(\ref{Eq-Stg1-0}), and
its parameters satisfy
\begin{equation}
0\leq k_{\alpha_{i}}<1,\text{ }0<k_{p_{i}}\leq1,\text{ }i=1,2,3.\label{Eq-Stg2-5}
\end{equation}
Then, through the repetitive docking attempts, the docking error $\Delta{\mathbf{p}}_{\text{dr/pr}}^{\left(k\right)}\left(T^{\left(k\right)}\right)$
will converge to a bound
\begin{equation}
\lim_{k\rightarrow\infty}\left\Vert \Delta{\mathbf{p}}_{\text{dr/pr}}^{\left(k\right)}\left(T^{\left(k\right)}\right)\right\Vert \leq B_{\text{dr/pr}}\label{Eq-Stg2-6}
\end{equation}
where
\begin{equation}
B_{\text{dr/pr}}=2\sqrt{B_{\text{pr}}^{2}+B_{\text{dr}}^{2}}\label{Eq-Stg2-7}
\end{equation}
in which $B_{\text{dr}}$ is the random disturbance bound of the drogue
position fluctuation as defined in Eq.~(\ref{Eq_hoseDrDyn2-3}) and
$B_{\text{pr}}$ is the random disturbance bound of the probe tracking
error as defined Eq.~(\ref{Eq-rec5}). In particular, if the random
disturbances are negligible, i.e., $B_{\text{dr}}=0$, $B_{\text{pr}}=0$,
then the docking error will converge to zero as
\begin{equation}
\left\Vert \Delta{\mathbf{p}}_{\text{dr/pr}}^{\left(k\right)}\left(T^{\left(k\right)}\right)\right\Vert \rightarrow0\text{, as }k\rightarrow\infty.\label{Eq-Stg2-8}
\end{equation}
\textbf{Proof.} See \textit{Appendix A}. $\square$
\subsection{Discussion}
Essentially, the term $\mathbf{u}_{\text{de,dr}}^{\left(k\right)}$
works as a low-pass filter, which is expected to provide a smooth
and robust estimation of the drogue offset caused by disturbances.
Then, with this term in $\mathbf{\hat{u}}_{\text{pr}}^{\left(k\right)}$,
the drogue offset can be compensated. The low-pass filter is adopted
instead of using the drogue offset position directly, which is because
the drogue is sensitive to disturbances.
The initial value for the proposed TILC method in Eq.\ (\ref{Eq-Stg1-0})
should be set to zero ($\mathbf{u}_{\text{de,dr}}^{\left(0\right)}=\mathbf{0}$,
$\mathbf{u}_{\text{e,pr}}^{\left(0\right)}=\mathbf{0}$) when there
is no historical learning data. In practice, $\mathbf{u}_{\text{de,dr}}^{\left(0\right)}$
has physical significance, namely the drogue position offset caused
by the receiver forebody flow field. Therefore, the initial value
for $\mathbf{u}_{\text{de,dr}}^{\left(0\right)}$ can be estimated
according to the historical learning data, the experience of human
pilots, or the calculation result from the hose-drogue model \cite{hose-link-model}
and the bow wave effect model \cite{dai2016modeling}. With the pre-estimated
initial value, the iteration speed of the proposed TILC method can
be improved.
Unlike other conventional ILC methods, the proposed TILC method does
not require the exact value of the terminal time $T$ and does not
require $T$ to be the same between iterations. It only requires the
terminal positions of the drogue and the probe, which is practical
for an actual AAR system.
\section{Simulation and Verification}
\label{Sec-4}
\subsection{Simulation Configuration}
A MATLAB/SIMULINK-based simulation environment has been developed
to simulate the docking stage of the AAR. The detailed introduction
of the modeling methods and the simulation parameters can be found
in the authors' previous work \cite{dai2016modeling}. A video has
also been released to introduce the AAR simulation environment and
demonstrate the TILC simulation results. The URL of the video is \url{https://youtu.be/VoplDA6D5fA}.
\subsection{TILC Simulation Results}
\subsubsection{Iterative Learning Process}
In order to verify the effectiveness of the proposed TILC method,
all the initial values in Eq.~(\ref{Eq-Stg1-0}) are set zeroes as
$\mathbf{u}_{\text{de,dr}}^{\left(0\right)}=\mathbf{0}$, $\mathbf{u}_{\text{e,pr}}^{\left(0\right)}=\mathbf{0}$,
and the learning procedures are shown in Fig.~\ref{Fig_LearnProc}.
\begin{figure}[tbh]
\centering \includegraphics[width=0.45\textwidth]{Fig04LearningProc}
\caption{Learning process with the proposed TILC method.}
\label{Fig_LearnProc}
\end{figure}
In Fig.~\ref{Fig_LearnProc}, there are four docking attempts performed
in sequence (the four docking attempts start at time 50s, 100s, 150s
and 200s respectively), where the first two docking attempts fail,
and the following two attempts both succeed. In each attempt, the
probe moves close to until contact with the drogue at $T^{\left(k\right)}$
(marked by the vertical dotted lines), then the probe returns to the
standby postilion and gets ready for the next docking attempt.
In the first docking attempt as shown in Fig.~\ref{Fig_LearnProc},
the receiver remains at the standby position (5m behind the drogue,
with simulation time from 50s to 60s) to observe the drogue movement
and estimate the equilibrium position of the drogue. Then, the receiver
approaches the drogue to perform a docking attempt during the simulation
time from 60s to 71s in Fig.~\ref{Fig_LearnProc}. The docking control
ends at the terminal time $T^{\left(1\right)}=71s$, and this docking
attempt is declared as a failure because the radial error $\Delta R_{\text{dr/pr}}^{\left(1\right)}=0.5m$
is larger than the desired radial error threshold $R_{C}=0.15\text{m}$.
With more docking attempts (not presented in Fig.\ \ref{Fig_LearnProc})
are simulated, a docking success rate over 90\% will be obtained under
the given threshold $R_{C}=0.15\text{m}$. According to the Monte
Carlo simulations, the success rate depends on many factors including
the docking error threshold $R_{C}$, the strength of the atmospheric
turbulence, and other random disturbances. The simulation results
are consistent with results in \cite{Dibley-2007-2}\cite{Bhandari-2013-8}.
When the aerodynamic disturbances are strong, both the drogue position
oscillation and the receiver tracking error will be significant, then
the success rate will be low.
\subsubsection{Aerodynamic Disturbance Simulations}
Fig.~\ref{Fig_totalAeroDisOnDro} presents the total aerodynamic
disturbance force $\mathbf{F}_{\text{total}}=\left[\Delta F_{\text{x}},\Delta F_{\text{y}},\Delta F_{\text{z}}\right]^{\text{T}}$
applied on the drogue during the first docking attempt (50s$\sim$71s)
in Fig.\ \ref{Fig_LearnProc}. In this simulation, the tanker vortex
disturbance comes from the model presented in \cite{Vortex-1}, the
wind gust and the atmospheric turbulence come from the MATLAB/SIMULINK
Aerospace Blockset based on the mathematical representations from
Military Specification MIL-F-8785C, and the bow wave effect disturbance
comes from the authors' previous work \cite{wei2016drogue}. When
the receiver remains at the standby position (50s$\sim$60s in Fig.~\ref{Fig_totalAeroDisOnDro}),
the drogue is far away from the receiver and the disturbance forces
mainly come from the tanker vortex and the atmospheric turbulence
as illustrated on the left half of Fig.~\ref{Fig_totalAeroDisOnDro}.
As the receiver moves closer to the drogue, the receiver bow wave
starts to cause a large disturbance force on the drogue as illustrated
on the right half of Fig.~\ref{Fig_totalAeroDisOnDro}.
\begin{figure}[tbh]
\centering \includegraphics[width=0.45\textwidth]{Fig05TotalWindEffect}
\caption{Total aerodynamic disturbing force applied on the drogue.}
\label{Fig_totalAeroDisOnDro}
\end{figure}
A comprehensive simulation is performed to verify the performance
of the proposed TILC method with the initial value from the previous
learning results. In addition to the atmospheric turbulence and the
bow wave disturbance as shown in Fig.~\ref{Fig_totalAeroDisOnDro},
a wind gust ($5m/s$ in the lateral direction and vertical direction
respectively) is added at 100s to verify the control effect of the
proposed method under aerodynamic disturbances. The simulation results
are presented in Fig.~\ref{Fig_compSim}.
It can be observed from Fig.~\ref{Fig_compSim} that, with a good
initial value, the docking control succeeds at the first attempt.
Then, the second docking attempt (115s in Fig.~\ref{Fig_compSim})
fails due to the addition of a strong wind gust at 100s. In the next
two docking attempts (165s and 215s in Fig.~\ref{Fig_compSim}),
the controller can rapidly recover and achieve successful docking
control without being much affected by the wind gust disturbance.
The simulation results demonstrate that the proposed TILC method has
a certain ability to resist the aerodynamic disturbances.
\begin{figure}[tbh]
\centering \includegraphics[width=0.45\textwidth]{Fig06TheFinalRefueling}
\caption{Simulation with the initial value and the wind gust disturbance.}
\label{Fig_compSim}
\end{figure}
\section{Conclusions}
\label{Sec-5}
This paper studies the model of the probe-drogue aerial refueling
system under aerodynamic disturbances, and proposes a docking control
method based on terminal iterative learning control to compensate
for the docking errors caused by aerodynamic disturbances. The designed
controller works as an additional unit for the trajectory generation
function of the original autopilot system. Simulations based on our
previously published simulation environment show that the proposed
control method has a fast learning speed to achieve a successful docking
control under aerodynamic disturbances including the bow wave effect.
\section*{Acknowledgments}
This work was supported by the National Key Project of Research and
Development Plan under Grant 2016YFC1402500 and the National Natural
Science Foundation of China under Grant 61473012.
\section*{Appendices}
\subsection{Proof of Theorem 1}
\label{App-1}First, define the $\mathbf{p}{_{\text{pr}}^{\left(k\right)}}\left(T^{\left(k\right)}\right)$
as the probe terminal position in the $k^{\text{th}}$ docking attempt.
Then, according to Eq.~(\ref{Eq-rec5}), one has
\begin{equation}
\mathbf{p}{_{\text{pr}}^{\left(k\right)}}\left(T^{\left(k\right)}\right)=\mathbf{\hat{u}}_{\text{pr}}^{\left(k\right)}-\mathbf{v}_{\text{pr}}^{\left(k\right)}\label{Eq-convAna1}
\end{equation}
where, $\mathbf{\hat{u}}_{\text{pr}}^{\left(k\right)}$ can be further
expressed by Eq.~(\ref{Eq-Stg1-0}), which yields
\begin{equation}
{\mathbf{p}}_{\text{dr}}^{\text{e0,}\left(k\right)}+\mathbf{u}_{\text{de,dr}}^{\left(k\right)}-\mathbf{p}{_{\text{pr}}^{\left(k\right)}}\left(T^{\left(k\right)}\right)=\mathbf{v}_{\text{pr}}^{\left(k\right)}-\mathbf{u}_{\text{e,pr}}^{\left(k\right)}.\label{Eq-convAna2}
\end{equation}
Meanwhile, according to the definition of $\mathbf{e}_{\text{pr}}^{(k)}$
in Eq.~(\ref{Eq-Stg2-4}), one has
\begin{equation}
\mathbf{e}_{\text{pr}}^{(k)}=\mathbf{v}_{\text{pr}}^{\left(k\right)}-\mathbf{u}_{\text{e,pr}}^{\left(k\right)}.\label{Eq-convAna3}
\end{equation}
Thus, substituting Eq.\ (\ref{Eq-Stg2-3}) into Eq.~(\ref{Eq-convAna3})
gives
\begin{equation}
\mathbf{e}_{\text{pr}}^{(k)}=\left(\mathbf{I}-\mathbf{K}_{p}\right)\cdot\mathbf{e}_{\text{pr}}^{(k-1)}+\mathbf{\tilde{v}}_{\text{pr}}^{\left(k-1\right)}\label{Eq-convAna6}
\end{equation}
where
\begin{equation}
\mathbf{\tilde{v}}_{\text{pr}}^{\left(k-1\right)}\triangleq\mathbf{v}_{\text{pr}}^{\left(k\right)}-\mathbf{v}_{\text{pr}}^{\left(k-1\right)}.\label{eq:Vpr}
\end{equation}
Second, according to Eq.~(\ref{Eq-wbow0}), the drogue terminal position
$\mathbf{p}{_{\text{dr}}^{(k)}}\left(T^{\left(k\right)}\right)$ in
the $k^{\text{th}}$ docking attempt is given by
\begin{equation}
\mathbf{p}{_{\text{dr}}^{(k)}}\left(T^{\left(k\right)}\right)={\mathbf{p}}_{\text{dr}}^{\text{e0,}\left(k\right)}+\Delta{\mathbf{p}}_{\text{dr}}^{\text{e,}\left(k\right)}\label{Eq-convAna8}
\end{equation}
where ${\mathbf{p}}_{\text{dr}}^{\text{e0,}\left(k\right)}$ is the
drogue original equilibrium position, and $\Delta{\mathbf{p}}_{\text{dr}}^{\text{e,}\left(k\right)}$
is the terminal position offset. According to Eq.~(\ref{Eq_hoseDrDyn2-3}),
$\Delta{\mathbf{p}}_{\text{dr}}^{\text{e,}\left(k\right)}$ comes
from the bow wave effect and can be expressed
\begin{equation}
\Delta{\mathbf{p}}_{\text{dr}}^{\text{e,}\left(k\right)}=\mathbf{m}_{0}+\mathbf{M}_{1}\cdot\Delta{\mathbf{p}}_{\text{dr/pr}}^{\left(k\right)}\left(T^{\left(k\right)}\right)+\mathbf{v}_{\text{dr}}^{\left(k\right)}.\label{Eq-convAna7-1}
\end{equation}
Thus, the docking error along the iteration axis is given by
\begin{equation}
\Delta{\mathbf{p}}_{\text{dr/pr}}^{\left(k\right)}\left(T^{\left(k\right)}\right)=\mathbf{p}{_{\text{dr}}^{\left(k\right)}}\left(T^{\left(k\right)}\right)-\mathbf{p}{_{\text{pr}}^{\left(k\right)}}\left(T^{\left(k\right)}\right).\label{Eq-convAna9}
\end{equation}
Substituting Eqs.~(\ref{Eq-convAna8})(\ref{Eq-convAna7-1})(\ref{Eq-convAna9})
into Eqs.~(\ref{Eq-Stg2-0})(\ref{Eq-Stg2-1}) gives
\begin{equation}
\Delta{\mathbf{p}}_{\text{dr/pr}}^{\left(k\right)}\left(T^{\left(k\right)}\right)=\mathbf{A}_{1}\cdot\Delta{\mathbf{p}}_{\text{dr/pr}}^{\left(k-1\right)}\left(T^{\left(k-1\right)}\right)+\mathbf{A}_{2}\cdot\mathbf{e}_{\text{pr}}^{(k-1)}+\mathbf{\tilde{v}}_{\text{dr}}^{\left(k-1\right)}\label{Eq-convAna10}
\end{equation}
where
\begin{eqnarray}
\mathbf{A}_{1} & \triangleq & \left(\mathbf{M}_{1}-\mathbf{I}\right)^{-1}\left(\mathbf{M}_{1}-\mathbf{K}_{\alpha}\right)=\mathbf{I-}\left(\mathbf{I-M}_{1}\right)^{-1}\left(\mathbf{I}-\mathbf{K}_{\alpha}\right)\label{Eq-convAna11-1}\\
\mathbf{A}_{2} & \triangleq & \left(\mathbf{M}_{1}-\mathbf{I}\right)^{-1}\left(\mathbf{K}_{p}+\mathbf{K}_{\alpha}-\mathbf{I}\right)\label{Eq-convAna11-2}\\
\mathbf{\tilde{v}}_{\text{dr}}^{\left(k-1\right)} & \triangleq & \left(\mathbf{M}_{1}-\mathbf{I}\right)^{-1}\left(\mathbf{v}_{\text{dr}}^{\left(k-1\right)}-\mathbf{v}_{\text{dr}}^{\left(k\right)}\right).\label{Eq-convAna11-3}
\end{eqnarray}
For simplicity, an augmented system is defined as
\begin{equation}
\mathbf{X}^{\left(k\right)}=\mathbf{A\cdot X}^{\left(k-1\right)}+\mathbf{v}^{\left(k-1\right)}\label{Eq-convAna13}
\end{equation}
where
\begin{eqnarray}
\mathbf{X}^{\left(k\right)} & \triangleq & \left[\begin{array}{c}
\Delta{\mathbf{p}}_{\text{dr/pr}}^{\left(k\right)}\left(T^{\left(k\right)}\right)\\
\mathbf{e}_{\text{pr}}^{(k)}
\end{array}\right],\mathbf{v}^{\left(k\right)}\triangleq\left[\begin{array}{c}
\mathbf{\tilde{v}}_{\text{dr}}^{\left(k\right)}\\
\mathbf{\tilde{v}}_{\text{pr}}^{\left(k\right)}
\end{array}\right]\label{Eq-convAna12-0}\\
\mathbf{A} & \triangleq & \left[\begin{array}{cc}
\mathbf{A}_{1} & \mathbf{A}_{2}\\
\mathbf{0}_{3\times3} & \mathbf{A}_{3}
\end{array}\right],\;\mathbf{A}_{3}\triangleq\mathbf{I}-\mathbf{K}_{p}.\label{Eq-convAna12}
\end{eqnarray}
Furthermore, Eq.\ (\ref{Eq-convAna12-0}) can be written into the
following form
\begin{equation}
\mathbf{X}^{\left(k\right)}=\mathbf{A}^{k}\cdot\mathbf{X}^{\left(0\right)}+\sum_{i=0}^{k-1}\mathbf{A}^{i}\mathbf{v}^{\left(k-i\right)}.\label{eq:xkak}
\end{equation}
Since $\mathbf{M}_{1}$ is a negative definite matrix, according to
Eqs.\ (\ref{Eq-convAna11-1})(\ref{Eq-convAna11-1})(\ref{Eq-convAna12-0}),
it is easy to verify that the spectral radius of $\mathbf{A}$ is
smaller than 1 ($\rho\left(\mathbf{A}\right)<1$) when the following
constraint is satisfied
\begin{equation}
0\leq k_{\alpha_{i}}<1,\text{ }0<k_{p_{i}}\leq1\text{, }i=1,2,3.\label{Eq-convAna17-2}
\end{equation}
Moreover, since the disturbances $\mathbf{v}_{\text{pr}}^{\left(k\right)}$
and $\mathbf{v}_{\text{dr}}^{\left(k\right)}$ are both bounded with
$\left\Vert \mathbf{v}_{\text{pr}}^{\left(k\right)}\right\Vert \leq B_{\text{pr}}$
and $\left\Vert \mathbf{v}_{\text{dr}}^{\left(k\right)}\right\Vert \leq B_{\text{dr}}$,
it is easy to obtain from Eqs.\ (\ref{eq:Vpr})(\ref{Eq-convAna11-1})(\ref{Eq-convAna12-0})
that $\mathbf{v}^{\left(k\right)}$ is also bounded with
\begin{equation}
\left\Vert \mathbf{v}^{\left(k\right)}\right\Vert \leq2\sqrt{B_{\text{pr}}^{2}+B_{\text{dr}}^{2}}.\label{eq:vBr}
\end{equation}
Then, substituting Eq.\ (\ref{eq:vBr}) into Eq.\ (\ref{eq:xkak})
gives
\begin{equation}
\begin{array}{ll}
\left\Vert \mathbf{X}^{\left(k\right)}\right\Vert & \leq\left\Vert \mathbf{A}\right\Vert ^{k}\left\Vert \mathbf{X}^{\left(0\right)}\right\Vert +\sum_{i=0}^{k-1}\left\Vert \mathbf{A}\right\Vert ^{i}\left\Vert \mathbf{v}^{\left(k-i\right)}\right\Vert \\
& \leq\left\Vert \mathbf{A}\right\Vert ^{k}\left\Vert \mathbf{X}^{\left(0\right)}\right\Vert +2\sqrt{B_{\text{pr}}^{2}+B_{\text{dr}}^{2}}\sum_{i=0}^{k-1}\left\Vert \mathbf{A}\right\Vert ^{i}\\
& =\left\Vert \mathbf{A}\right\Vert ^{k}\left\Vert \mathbf{X}^{\left(0\right)}\right\Vert +2\sqrt{B_{\text{pr}}^{2}+B_{\text{dr}}^{2}}\left(1-\left\Vert \mathbf{A}\right\Vert ^{k}\right).
\end{array}\label{eq:xka}
\end{equation}
When the constraint in Eq.\ (\ref{Eq-convAna17-2}) is satisfied,
one has
\begin{equation}
\rho\left(\mathbf{A}\right)<1\Rightarrow\lim_{k\rightarrow\infty}\left\Vert \mathbf{A}\right\Vert ^{k}=0
\end{equation}
which yields from Eq.\ (\ref{eq:xka}) that
\begin{equation}
\lim_{k\rightarrow\infty}\left\Vert \mathbf{X}^{\left(k\right)}\right\Vert \leq2\sqrt{B_{\text{pr}}^{2}+B_{\text{dr}}^{2}}.\label{eq:xk46}
\end{equation}
According to the definition of $\mathbf{X}^{\left(k\right)}$ in Eq.\ (\ref{Eq-convAna12-0}),
one has
\begin{equation}
\left\Vert \Delta{\mathbf{p}}_{\text{dr/pr}}^{\left(k\right)}\left(T^{\left(k\right)}\right)\right\Vert \leq\left\Vert \mathbf{X}^{\left(k\right)}\right\Vert .\label{eq:xk47}
\end{equation}
Combining Eq.\ (\ref{eq:xk46}) and (\ref{eq:xk47}) gives
\begin{equation}
\lim_{k\rightarrow\infty}\left\Vert \Delta{\mathbf{p}}_{\text{dr/pr}}^{\left(k\right)}\left(T^{\left(k\right)}\right)\right\Vert \leq2\sqrt{B_{\text{pr}}^{2}+B_{\text{dr}}^{2}}=B_{\text{dr/pr}}.\label{eq:kwuqiong}
\end{equation}
Thus, the docking error $\Delta{\mathbf{p}}_{\text{dr/pr}}^{\left(k\right)}\left(T^{\left(k\right)}\right)$
will converge to a bound $B_{\text{dr/pr}}$ as $k\rightarrow\infty$.
In particular, by substituting $B_{\text{dr}}=0\text{, }B_{\text{pr}}=0$
into Eq.\ (\ref{eq:kwuqiong}), one has $\lim_{k\rightarrow\infty}\left\Vert \Delta{\mathbf{p}}_{\text{dr/pr}}^{\left(k\right)}\left(T^{\left(k\right)}\right)\right\Vert =0$.
\section*{References}
\bibliographystyle{aiaa}
| {'timestamp': '2018-03-02T02:07:31', 'yymm': '1803', 'arxiv_id': '1803.00247', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00247'} | arxiv |
\subsubsection{Upper Bound for Support Coverage Estimation}
\label{sec:coverage-ub}
Let $\prfi{i}$ be the number of symbols that appear $i$ times in $X_1^{\ns}$. We will use the following non-private support coverage estimator from~\cite{OrlitskySW16}:
\[
\hat{S}_m(X_1^{\ns}) = \sum_{i=1}^{n}\prfi{i}\Paren{1+(-t)^i\cdot \probof{Z\ge i}},
\]
where $Z$ is a Poisson random variable with mean $r$ (which is a parameter to be instantiated later), and $t=(m-n)/n$.
Our private estimator of support coverage is derived by adding Laplace noise to this non-private estimator with the appropriate noise parameter, and thus the performance of our private estimator, is analyzed by bounding the sensitivity and the bias of this non-private estimator according to Lemma~\ref{lem:main-sensitivity}.
The sensitivity and bias of this estimator is bounded in the following lemmas.
\begin{lemma} \label{lem:sensitivity-coverage}
Suppose $m>2n$, then the maximum coefficient of $\prfi{i}$ in $\hat{S}_m(p)$ is at most $1+e^{r(t-1)}$.
\end{lemma}
\begin{proof}
By the definition of $Z$, we know $\probof{Z\ge i} = \sum_{k = i}^{\infty} e^{-r}\frac{r^k}{k!}$, hence we have:
\begin{align}
|1+(-t)^i\cdot \probof{Z\ge i}| &\le 1+ t^i \sum_{k = i}^{\infty} e^{-r}\frac{r^k}{k!} \nonumber \\
&\le 1 + e^{-r} \sum_{k = i}^{\infty}\frac{(rt)^k}{k!} \nonumber \\
&\le 1 + e^{-r} \sum_{k = 0}^{\infty}\frac{(rt)^k}{k!} \nonumber \\
&= 1 + e^{r(t-1)} \nonumber
\end{align}
\end{proof}
\noindent The bias of the estimator is bounded in Lemma 4 of~\cite{AcharyaDOS17}:
\begin{lemma}\label{lem:bias-coverage}
Suppose $m>2n$, then
\[
\absv{\expectation{\hat{S}_m(X_1^{\ns})} - S_m(\pi)} \le 2+2e^{r(t-1)}+\min(m, S(p))\cdot e^{-r}.
\]
\end{lemma}
Using these results, letting $r = \log (1/\alpha)$,~\cite{OrlitskySW16} showed that there is a constant $C$, such that with $n = C\frac{m}{\log m}\log(1/\alpha)$ samples, with probability at least 0.9,
\[
\absv{\frac{\hat{S}_m(X_1^{\ns})}m- \frac{S_m(\pi)}m} \le \alpha.
\]
Our upper bound in Theorem~\ref{thm:supportcoverage} is derived by the following analysis of the sensitivity of $\frac{\hat{S}_m(X_1^{\ns})}m$.
If we change one sample in $X_1^{\ns}$, at most two of the $\prfi{j}$'s change. Hence by Lemma~\ref{lem:sensitivity-coverage}, the sensitivity of the estimator satisfies
\begin{align}
\Delta\Paren{\frac{\hat{S}_m(X_1^{\ns})}m} \le & \frac2m\cdot\Paren{1+e^{r(t-1)}}.\label{eqn:bound-sen-cov}
\end{align}
By Lemma~\ref{lem:main-sensitivity}, there is a private algorithm for support coverage estimation as long as
\[
\Delta\Paren{\frac{\hat{S}_m(X_1^{\ns})}m} \le \alpha\varepsilon,
\]
which by~\eqref{eqn:bound-sen-cov} holds if
\begin{align}
2(1 + \exp(r(t-1))) \le \alpha\varepsilon m.
\end{align}
Let $r = \log (3/\alpha)$, note that $t-1 = \frac m{n} -2$. Suppose $\alpha\varepsilon m>2$, then, the condition above reduces to
\[
\log \Paren{\frac{3}{\alpha}} \cdot \Paren{\frac mn-2} \le \log \Paren{\frac12\alpha\varepsilon m -1}.
\]
This is equivalent to
\begin{align}
n & \ge \frac{m \log (3/\alpha)}{\log (\frac12\alpha \varepsilon m - 1) + 2 \log (3/\alpha)} \nonumber \\
&= \frac{m \log (3/\alpha)}{\log ( \frac32 \varepsilon m - 3 / \alpha) + \log (3/\alpha)} \nonumber
\end{align}
Suppose $\alpha\varepsilon m >2$, then the condition above reduces to the requirement that
\[
n = O\Paren{\frac{m\log (1/\alpha)}{\log (\varepsilon m)}}.
\]
\subsubsection{Lower Bound for Support Coverage Estimation}
\label{sec:coverage-lb}
We now prove the lower bound described in Theorem~\ref{thm:supportcoverage}.
Note that the first term in the lower bound is the sample complexity of non-private support coverage estimation, shown in~\cite{OrlitskySW16}.
Therefore, we turn our attention to prove the latter term in the sample complexity.
Consider the following two distributions. $u_1$ is uniform over $[m(1+\alpha)]$. $u_2$ is distributed over $m+1$ elements $[m] \cup \{\triangle\}$ where $u_2[i] = \frac{1}{m(1+\alpha)} \forall i \in [m]$ and $u_2[\triangle] = \frac{\alpha}{1+\alpha}$. Moreover, $\triangle \notin [m(1+\alpha)]$. Then,
\[
S_m(u_1) = m(1+\alpha)\cdot \Paren {1- \Paren{1-\frac1{m(1+\alpha)}}^m},
\]
and
\begin{align}
&S_m(u_2) = \nonumber \\
&~~m\cdot \Paren {1- \Paren{1-\frac1{m(1+\alpha)}}^m} + \Paren {1- \Paren{1-\frac\alpha{1+\alpha}}^m} \nonumber
\end{align}
hence,
\begin{align}
&S_m(u_2) - S_m(u_1) \nonumber \\
& = m\alpha \cdot \Paren {1- \Paren{1-\frac1{m(1+\alpha)}}^m} - \Paren {1- \Paren{1-\frac\alpha{1+\alpha}}^m} \nonumber \\
& = \Omega(\alpha m) \nonumber
\end{align}
Hence we know there support coverage differs by $\Omega(\alpha m)$. Moreover, their total variation distance is $\frac{\alpha}{1+\alpha}$.
The following lemma is folklore, based on the coupling interpretation of total variation distance, and the fact that total variation distance is subadditive for product measures.
\begin{lemma} \label{lem:min_coupling}
For any two distributions $\pi$, and $q$, there is a coupling between $n$ iid samples from the two distributions with an expected Hamming distance of $d_{\mathrm {TV}}(\pi,q)\cdotn$.
\end{lemma}
Using Lemma~\ref{lem:min_coupling} and $d_{\mathrm {TV}}(u_1,u_2) = \frac{\alpha}{1+\alpha}$, we have
\begin{lemma} \label{lem:coupling_coverage}
Suppose $u_1$ and $u_2$ are as defined before, there is a coupling between $u_1^n$ and $u_2^n$ with expected Hamming distance equal to $\frac{\alpha}{1+\alpha} n$.
\end{lemma}
Moreover, given $n$ samples, we must be able to privately distinguish between $u_1$ and $u_2$ given an $\alpha$ accurate estimator of support coverage with privacy considerations. Thus, according to Lemma~\ref{lem:coupling} and~\ref{lem:coupling_coverage}, we have:
\[
\frac\alpha{1+\alpha} n\ge \frac1{\varepsilon}\Rightarrow n = \Omega\Paren{\frac1{\varepsilon\alpha}}.
\]
\subsubsection{Upper Bound for Entropy Estimation: The Empirical Estimator}
\label{sec:entropy-ub-empirical}
Let $\hat{\p}_\ns$ be the empirical distribution, and let $H(\emp)$ be the entropy of the empirical distribution.
\begin{theorem}\label{thm:empirical}
\[
C(H, \alpha, \varepsilon) = O\Paren{\frac{k}{\alpha}+\frac{\log^2(\min\{k,n\})}{\alpha^2}+\frac{1}{\alpha\varepsilon}\log\Paren{\frac1{\alpha\varepsilon}}}.
\]
\end{theorem}
\begin{proof}
We present the entire argument for completeness. We will show that the theorem is implied by the following three results.
\begin{align}
&\absv{\entp{\pi}-\expectation{H(\emp)}} =O\Paren{\frac{k}{n}},\label{eq:bias-emp}\\
&\variance{H(\emp)} =O\Paren{\frac{\log^2(\min\{k,n\})}{n}},\label{eq:variance-emp}\\
&\Delta(H(\emp)) = O\Paren{\frac{\logn}{n}}.\label{eqn:sensitivity-emp}
\end{align}
Using these three equations, we are done.
\end{proof}
\paragraph{Proof of~\eqref{eq:bias-emp}.} By the concavity of entropy function, we know that
\[
\expectation{\entp{\hat{\p}_\ns}} \le \entp{\pi}.
\]
Therefore,
\begin{align}
\expectation{\absv{\entp{\pi}-\entp{\hat{\p}_\ns}}} &= \entp{\pi}-\expectation{{\entp{\hat{\p}_\ns}}}\nonumber\\
&= \expectation{\sum_{x}\Paren{\emp(\smb)\log \emp(\smb)-\p(\smb)\log\p(\smb)}} \nonumber\\
&= \expectation{\sum_{x}\emp(\smb)\log \frac{\emp(\smb)}{\p(\smb)}}+\expectation{\sum_{x}(\emp(\smb)-\p(\smb))\log\p(\smb)}\nonumber\\
&= \expectation{\kldist{\hat{\p}_\ns}{\pi}}\label{eqn:kl-exp}\\
&\leq \expectation{\chisquare{\hat{\p}_\ns}{\pi}}\label{eqn:kl-chisq}\\
&= \expectation{\sum_{x}\frac{(\emp(\smb)-\p(\smb))^2}{\p(\smb)}}\nonumber\\
&\le {\sum_{x}\frac{(\p(\smb)/n)}{\p(\smb)}}\label{eqn:var-bin}\\
&= \frackn.
\end{align}
\paragraph{Proof of~\eqref{eqn:sensitivity-emp}.}
The largest change in any $N_{\smb}$ when we change one symbol is one. Moreover, at most two $N_{\smb}$ changes. Therefore,
\begin{align}
\Delta(H(\emp)) &\leq 2\cdot \max_{j=1\ldots n-1} \absv{ \frac{j+1}{n}\log\frac{n}{j+1}-\frac{j}{n}\log\frac{n}{j}}\nonumber\\
&= 2\cdot \max_{j=1\ldots n-1}\absv{\frac{j}{n}\log \frac{j}{j+1}+\frac1{n}\log \frac{n}{j+1}}\label{eqn:sum-one}\\
&\leq 2 \cdot \max_{j=1\ldots n-1}\max\left\{\absv{\frac{j}{n}\log \frac{j}{j+1}}, \absv{ \frac1{n}\log \frac{n}{j+1}}\right\}\label{eqn:sum-two}\\
&\leq 2\cdot \max\left\{\frac 1n, \frac{\log n}{n}\right\},\nonumber\\
& = 2\cdot \frac{\log n}{n}.
\end{align}
\paragraph{Proof of~\eqref{eq:variance-emp}.}The variance bound of $\frac{\log k}{n}$ is given precisely in~\cite[Lemma 15]{JiaoVHW17}.
To obtain the other half of the bound of, we apply the bounded differences inequality.
\begin{lemma}[BLM-Cor 3.2]
\label{lem:bdd-diff-var}
Let $f:\Omega^{n}\rightarrow\mathbb{R}$ be a function. Suppose further that
\[
\max_{z_1,\ldots, z_n, z_{i}^{'}} \absv{f(z_1,\ldots,z_n) - f(z_1,\ldots, z_{i-1}, z_i^{'},\ldots,z_n)}\le c_i.
\]
Then for independent variables $Z_1,\ldots,Z_{n}$,
\[
\mbox{\bf Var}\Paren{f(Z_1,\ldots,Z_{n})} \le \frac14\sum_{i=1}^{n} c_i^2.
\]
\end{lemma}
Therefore, using Lemma~\ref{lem:bdd-diff-var} and Equation~\eqref{eqn:sensitivity-emp}
\[
\variance{H(\emp)}\le n\cdot\Paren{\frac{4\log^2n}{n^2}} = \frac{4\log^2n}{n}.
\]
\subsubsection{Upper Bound for Entropy Estimation: The Empirical Estimator}
\label{sec:entropy-ub-empirical}
Our first private entropy estimator is derived by adding Laplace noise into the empirical estimator. The parameter of the Laplace distribution is $\frac{ \Delta(H(\emp))}{\varepsilon}$, where $\Delta(H(\emp))$ denotes the sensitivity of the empirical estimator. By analyzing its sensitivity and bias, we prove an upper bound on the sample complexity for private entropy estimation and get the first upper bound in Theorem~\ref{thm:entropy}.
Let $\hat{\p}_\ns$ be the empirical distribution, and let $H(\emp)$ be the entropy of the empirical distribution.
The theorem is based on the following three facts:
\begin{align}
&\Delta(H(\emp)) = O\Paren{\frac{\logn}{n}}.\label{eqn:sensitivity-emp}\\
&\absv{\entp{\pi}-\expectation{H(\emp)}} =O\Paren{\frac{k}{n}},\label{eq:bias-emp}\\
&\variance{H(\emp)} =O\Paren{\frac{\log^2(\min\{k,n\})}{n}},\label{eq:variance-emp}
\end{align}
With these three facts in hand, the sample complexity of the empirical estimator can be bounded as follows.
By Lemma~\ref{lem:main-sensitivity},
we need $\Delta(H(\emp)) \le \alpha \varepsilon$, which gives $n=O\Paren{\frac1{\alpha \varepsilon} \log(\frac1{\alpha \varepsilon})}$. We also need $\absv{\entp{\pi}-\expectation{H(\emp)}} = O\Paren{\alpha}$ and $\variance{H(\emp)} = O\Paren{\alpha^2}$, which gives $n = O\Paren{\frac{k}{n}+ \frac{ \log^2(\min\{k,n\})}{\alpha^2}}$.
\paragraph{Proof of~\eqref{eqn:sensitivity-emp}.}
The largest change in any $N_{\smb}$ when we change one symbol is one. Moreover, at most two $N_{\smb}$ change. Therefore,
\begin{align}
\Delta(H(\emp)) &\leq 2\cdot \max_{j=1\ldots n-1} \absv{ \frac{j+1}{n}\log\frac{n}{j+1}-\frac{j}{n}\log\frac{n}{j}}\nonumber\\
&= 2\cdot \max_{j=1\ldots n-1}\absv{\frac{j}{n}\log \frac{j}{j+1}+\frac1{n}\log \frac{n}{j+1}}\label{eqn:sum-one}\\
&\leq 2 \cdot \max_{j=1\ldots n-1}\max\left\{\absv{\frac{j}{n}\log \frac{j}{j+1}}, \absv{ \frac1{n}\log \frac{n}{j+1}}\right\}\label{eqn:sum-two}\\
&\leq 2\cdot \max\left\{\frac 1n, \frac{\log n}{n}\right\},\nonumber\\
& = 2\cdot \frac{\log n}{n}.
\end{align}
\paragraph{Proof of~\eqref{eq:bias-emp}.} By the concavity of entropy function, we know that
\[
\expectation{\entp{\hat{\p}_\ns}} \le \entp{\pi}.
\]
Therefore,
\begin{align}
&\expectation{\absv{\entp{\pi}-\entp{\hat{\p}_\ns}}} = \entp{\pi}-\expectation{{\entp{\hat{\p}_\ns}}}\nonumber\\
&= \expectation{\sum_{x}\Paren{\emp(\smb)\log \emp(\smb)-\p(\smb)\log\p(\smb)}} \nonumber\\
&= \expectation{\sum_{x}\emp(\smb)\log \frac{\emp(\smb)}{\p(\smb)}}+\expectation{\sum_{x}(\emp(\smb)-\p(\smb))\log\p(\smb)}\nonumber\\
&= \expectation{\kldist{\hat{\p}_\ns}{\pi}}\label{eqn:kl-exp}\\
&\leq \expectation{\chisquare{\hat{\p}_\ns}{\pi}}\label{eqn:kl-chisq}\\
&= \expectation{\sum_{x}\frac{(\emp(\smb)-\p(\smb))^2}{\p(\smb)}}\nonumber\\
&\le {\sum_{x}\frac{(\p(\smb)/n)}{\p(\smb)}}\label{eqn:var-bin}\\
&= \frackn.
\end{align}
\paragraph{Proof of~\eqref{eq:variance-emp}.}The variance bound of $\frac{\log^2 k}{n}$ is given precisely in Lemma 15 of~\cite{JiaoVHW17}.
To obtain the other half of the bound of, we apply the bounded differences inequality in the form stated in Corollary 3.2 of~\cite{BoucheronLM13}.
\begin{lemma}
\label{lem:bdd-diff-var}
Let $f:\Omega^{n}\rightarrow\mathbb{R}$ be a function. Suppose further that
\[
\max_{z_1,\ldots, z_n, z_{i}^{'}} \absv{f(z_1,\ldots,z_n) - f(z_1,\ldots, z_{i-1}, z_i^{'},\ldots,z_n)}\le c_i.
\]
Then for independent variables $Z_1,\ldots,Z_{n}$,
\[
\mbox{\bf Var}\Paren{f(Z_1,\ldots,Z_{n})} \le \frac14\sum_{i=1}^{n} c_i^2.
\]
\end{lemma}
Therefore, using Lemma~\ref{lem:bdd-diff-var} and Equation~\eqref{eqn:sensitivity-emp}
\[
\variance{H(\emp)}\le n\cdot\Paren{\frac{4\log^2n}{n^2}} = \frac{4\log^2n}{n}.
\]
\subsubsection{Upper Bound for Entropy Estimation: Best-Polynomial Approximation}
\label{sec:entropy-ub-poly}
We prove an upper bound on the sample complexity for private entropy estimation if one adds Laplace noise into best-polynomial estimator
This will give us the second upper bound in Theorem~\ref{thm:entropy}.
In the non-private setting the optimal sample complexity of estimating $H(\pi)$ over $\Delta_k$ is given by Theorem 1 of~\cite{WuY16}
\[
\Theta\Paren{\frac{k}{\alpha\logk}+\frac{\log^2(\min\{k,n\})}{\alpha^2}}.
\]
However, this estimator can have a large sensitivity.~\cite{AcharyaDOS17} designed an estimator that has the same sample complexity but a smaller sensitivity. We restate Lemma 6 of~\cite{AcharyaDOS17} here:
\begin{lemma}
Let $\lambda>0$ be a fixed small constant, which may be taken to be any value between $0.01$ and $1$. Then there is an entropy estimator with sample complexity
\[
\Theta\Paren{\frac1{\lambda^2}\cdot\frac{k}{\alpha\logk}+\frac{\log^2(\min\{k,n\})}{\alpha^2}},
\]
and has sensitivity $n^\lambda/n$.
\end{lemma}
We can now invoke Lemma~\ref{lem:main-sensitivity}
on the estimator in this lemma to obtain the upper bound on private entropy estimation.
\subsubsection{Lower Bound for Entropy Estimation}
\label{sec:entropy-lb}
We now prove the lower bound for entropy estimation.
Note that any lower bound on privately testing two distributions $\pi$, and $q$ such that $H(\pi)-H(q)= \Theta(\alpha)$ is a lower bound on estimating entropy.
We analyze the following construction for Proposition 2 of~\cite{WuY16}. The two distributions $\pi$, and $q$ over $[k]$ are defined as:
\begin{align}
p(1) = \frac23,& p(i) = \frac{1-p(1)}{k-1}, \text{for $i=2,\ldots,k$},\\
q(1) = \frac{2-\eta}3,& q(i) = \frac{1-q(1)}{k-1}, \text{for $i=2,\ldots,k$}.
\end{align}
Then, by the grouping property of entropy,
\[
H(\pi) = h(2/3) + \frac13\cdot \log (k-1), \text{ and } H(q) = h((2-\eta)/3) + \frac{1+\eta}3\cdot \log (k-1),
\]
which gives
\[
H(\pi)-H(q) = \Omega(\eta\log k).
\]
For $\eta = \alpha/\logk$, the entropy difference becomes $\Theta(\alpha)$.
The total variation distance between $\pi$ and $q$ is $\eta/3$. By Lemma 5 in the paper,
there is a coupling over $X_1^{\ns}$, and $Y_1^{\ns}$ generated from $\pi$ and $q$ with expected Hamming distance at most $d_{\mathrm {TV}}(\pi,q)\cdot n$.
This along with Lemma 2 in the paper
gives a lower bound of $\Omega\Paren{\log k/\alpha\varepsilon}$ on the sample complexity.
\section{Experiments}
\label{sec:exp}
We evaluated our methods for entropy estimation and support coverage on both synthetic and real data.
Overall, we found that privacy is quite cheap: private estimators achieve accuracy which is comparable or near-indistinguishable to non-private estimators in many settings.
Our results on entropy estimation and support coverage appear in Sections~\ref{sec:exp-entropy} and~\ref{sec:exp-coverage}, respectively.
Code of our implementation is available at \url{https://github.com/HuanyuZhang/INSPECTRE}.
\subsection{Entropy}
\label{sec:exp-entropy}
We compare the performance of our entropy estimator with a number of alternatives, both private and non-private.
Non-private algorithms considered include the plug-in estimator (\texttt{plug-in}), the Miller-Madow Estimator (\texttt{MM})~\cite{Miller55}, the sample optimal polynomial approximation estimator (\texttt{poly}) of~\cite{WuY16}.
We analyze the privatized versions of plug-in, and \texttt{poly}\ in Sections~\ref{sec:entropy-ub-empirical} and~\ref{sec:entropy-ub-poly}, respectively.
The implementation of the latter is based on code from the authors of~\cite{WuY16}\footnote{See \url{https://github.com/Albuso0/entropy} for their code for entropy estimation.}.
We compare performance on different distributions including uniform, a distribution with two steps, Zipf(1/2), a distribution with Dirichlet-1 prior, and a distribution with Dirichlet-$1/2$ prior, and over varying support sizes.
While \texttt{plug-in}, and \texttt{MM}\ are parameter free, \texttt{poly}\ (and its private counterpart) have to choose the degree $L$ of the polynomial to use, which manifests in the parameter $\lambda$ in the statement of Theorem~\ref{thm:entropy}.~\cite{WuY16} suggest the value of $L=1.6\log k$ in their experiments. However, since we add further noise, we choose a single $L$ as follows: (i) Run privatized \texttt{poly}\ for different $L$ values and distributions for $k=2000$, $\varepsilon=1$, (b) Choose the value of $L$ that performs well across different distributions (See Figure~\ref{fig:Lcomparison}). We choose $L=1.2\cdot \log k$ from this, and use it for all other experiments.
To evaluate the sensitivity of \texttt{poly}, we computed the estimator's value at all possible input values, computed the sensitivity, (namely, $\Delta = \max_{\ham{X_1^{\ns}}{Y_1^{\ns}}\le 1}|\texttt{poly}(X_1^{\ns})-\texttt{poly}(Y_1^{\ns})|$), and added noise distributed as $\text{Lap}\left(0,\frac{\Delta}{\varepsilon}\right)$.
\begin{figure*}[h]
\centering
\captionsetup[subfigure]{labelformat=empty}
\subfigure{
\includegraphics[width=0.18\textwidth]{plot/entropy_eps1k2000Ldistribution0.pdf}
}
\subfigure{
\includegraphics[width=0.18\textwidth]{plot/entropy_eps1k2000Ldistribution1.pdf}
}
\subfigure{
\includegraphics[width=0.18\textwidth]{plot/entropy_eps1k2000Ldistribution2.pdf}
}
\subfigure{
\includegraphics[width=0.18\textwidth]{plot/entropy_eps1k2000Ldistribution4.pdf}
}
\subfigure{
\includegraphics[width=0.18\textwidth]{plot/entropy_eps1k2000Ldistribution5.pdf}
}
\caption{RMSE comparison for private Polynomial Approximation Estimator with various values for degree $L$, $k=2000$, $\varepsilon=1$.}
\label{fig:Lcomparison}
\end{figure*}
The RMSE of various estimators for $k=1000$, and $\varepsilon=1$ for various distributions are illustrated in Figure~\ref{fig:entropy_k1000}.
The RMSE is averaged over 100 iterations in the plots.
\begin{figure*}[h]
\centering
\captionsetup[subfigure]{labelformat=empty}
\subfigure{
\includegraphics[width=0.18\textwidth]{plot/entropy_eps1k1000distribution0.pdf}
}
\subfigure{
\includegraphics[width=0.18\textwidth]{plot/entropy_eps1k1000distribution1.pdf}
}
\subfigure{
\includegraphics[width=0.18\textwidth]{plot/entropy_eps1k1000distribution2.pdf}
}
\subfigure{
\includegraphics[width=0.18\textwidth]{plot/entropy_eps1k1000distribution4.pdf}
}
\subfigure{
\includegraphics[width=0.18\textwidth]{plot/entropy_eps1k1000distribution5.pdf}
}
\caption{Comparison of various estimators for the entropy, $k=1000$, $\varepsilon =1$.}
\label{fig:entropy_k1000}
\end{figure*}
We observe that the performance of our private-\texttt{poly}\ is near-indistinguishable from the non-private \texttt{poly}, particularly as the number of samples increases.
It also performs significantly better than all other alternatives, including the non-private Miller-Madow and the plug-in estimator.
The cost of privacy is minimal for several other settings of $k$ and $\varepsilon$, for which results appear in Section~\ref{sec:supp-experiments}.
\subsection{Support Coverage}
\label{sec:exp-coverage}
We investigate the cost of privacy for the problem of support coverage.
We provide a comparison between the Smoothed Good-Toulmin estimator (SGT) of~\cite{OrlitskySW16} and our algorithm, which is a privatized version of their statistic (see Section~\ref{sec:coverage-ub}).
Our implementation is based on code provided by the authors of~\cite{OrlitskySW16}.
As shown in our theoretical results, the sensitivity of SGT is at most $2 (1+e^r(t-1))$, necessitating the addition of Laplace noise with parameter $2 (1+e^{r(t-1)})/\varepsilon$.
Note that while the theory suggests we select the parameter $r = \log(1/\alpha)$, $\alpha$ is unknown.
We instead set $r = \frac{1}{2t} \log_{e} \frac{n(t+1)^2}{t-1}$, as previously done in~\cite{OrlitskySW16}
\subsubsection{Evaluation on Synthetic Data}
In our synthetic experiments, we consider different distributions over different support sizes $k$. We generate $n = k/2$ samples, and then estimate the support coverage at $m=n \cdot t$. For large $t$, estimation is harder.
Some results of our evaluation on synthetic are displayed in Figure~\ref{fig:synthetic_k20000}.
We compare the performance of SGT, and privatized versions of SGT with parameters $\varepsilon = 1, 2,$ and $10$.
For this instance, we fixed the domain size $k = 20000$.
We ran the methods described above with $n = k/2$ samples, and estimated the support coverage at $m = nt$, for $t$ ranging from $1$ to $10$.
The performance of the estimators is measured in terms of RMSE over 1000 iterations.
\begin{figure*}[h]
\centering
\subfigure{
\includegraphics[width=0.18\textwidth]{plot/synthetic_plots3_total_eps_k20000distribution0.pdf}
}
\subfigure{
\includegraphics[width=0.18\textwidth]{plot/synthetic_plots3_total_eps_k20000distribution1.pdf}
}
\subfigure{
\includegraphics[width=0.18\textwidth]{plot/synthetic_plots3_total_eps_k20000distribution2.pdf}
}
\subfigure{
\includegraphics[width=0.18\textwidth]{plot/synthetic_plots3_total_eps_k20000distribution4.pdf}
}
\subfigure{
\includegraphics[width=0.18\textwidth]{plot/synthetic_plots3_total_eps_k20000distribution5.pdf}
}
\caption{Comparison between the private estimator with the non-private SGT when $k=20000$}
\label{fig:synthetic_k20000}
\end{figure*}
We observe that, in this setting, the cost of privacy is relatively small for reasonable values of $\varepsilon$.
This is as predicted by our theoretical results, where unless $\varepsilon$ is extremely small (less than $1/k$) the non-private sample complexity dominates the privacy requirement.
However, we found that for smaller support sizes (as shown in Section~\ref{sec:supp-exp-coverage}), the cost of privacy can be significant.
We provide an intuitive explanation for why no private estimator can perform well on such instances.
To minimize the number of parameters, we instead argue about the related problem of support-size estimation.
Suppose we are trying to distinguish between distributions which are uniform over supports of size $100$ and $200$.
We note that, if we draw $n = 50$ samples, the ``profile'' of the samples (i.e., the histogram of the histogram) will be very similar for the two distributions.
In particular, if one modifies only a few samples (say, five or six), one could convert one profile into the other.
In other words, these two profiles are almost-neighboring datasets, but simultaneously correspond to very different support sizes.
This pits the two goals of privacy and accuracy at odds with each other, thus resulting in a degradation in accuracy.
\subsubsection{Evaluation on Census Data and Hamlet}
We conclude with experiments for support coverage on two real-world datasets,
the 2000 US Census data and the text of Shakespeare's play Hamlet, inspired by investigations in~\cite{OrlitskySW16} and~\cite{ValiantV17b}.
Our investigation on US Census data is also inspired by the fact that this is a setting where privacy is of practical importance, evidenced by the proposed adoption of differential privacy in the 2020 US Census~\cite{DajaniLSKRMGDGKKLSSVA17}.
The Census dataset contains a list of last names that appear at least 100 times.
Since the dataset is so oversampled, even a small fraction of the data is likely to contain almost all the names.
As such, we make the task non-trivial by subsampling $m_{total} = 86080$ individuals from the data, obtaining $20412$ distinct last names.
We then sample $n$ of the $m_{total}$ individuals without replacement and attempt to estimate the total number of last names.
Figure~\ref{fig:name} displays the RMSE over 100 iterations of this process. We observe that even an exceptionally stringent privacy budget of $\varepsilon = 0.5$, the performance is almost indistinguishable from the non-private SGT estimator.
\begin{figure}[h]
\centering
\includegraphics [scale=0.3]{plot/appc_total_total_eps.pdf}
\caption{Comparison between our private estimator with the SGT on Census Data}
\label{fig:name}
\end{figure}
The Hamlet dataset has $m_{total} = 31,999$ words, of which 4804 are distinct.
Since the distribution is not as oversampled as the Census data, we do not need to subsample the data.
Besides this difference, the experimental setup is identical to that of the Census dataset.
Once again, as we can see in Figure~\ref{fig:hamlet}, we get near-indistinguishable performance between the non-private and private estimators, even for very small values of $\varepsilon$.
Our experimental results demonstrate that privacy is realizable in practice, with particularly accurate performance on real-world datasets.
\begin{figure}[h]
\centering
\includegraphics [scale=0.3]{plot/hamlet_total_totaleps.pdf}
\caption{Comparison between our private estimator with the SGT on Hamlet}
\label{fig:hamlet}
\end{figure}
\section{Introduction}
How can we infer a distribution given a sample from it?
If data is in abundance, the solution may be simple -- the empirical distribution will approximate the true distribution.
However, challenges arise when data is scarce in comparison to the size of the domain, and especially when we wish to quantify ``rare events.''
This is frequently the case: for example, it has recently been observed that there are several very rare genetic mutations which occur in humans, and we wish to know how many such mutations exist~\cite{KeinanC12,TennessenBOFKGMDLJKJLGRAANBSBBABSN12,NelsonWEKSVSTBFWAZLZZLLLWTHNWACZWCNM12}.
Many of these mutations have only been seen once, and we can infer that there are many which have not been seen at all.
Over the last decade, a large body of work has focused on developing theoretically sound and effective tools for such settings~\cite{OrlitskySW16} and references therein, including the problem of estimating the frequency distribution of rare genetic variations~\cite{ZouVVKCSLSDM16}.
However, in many settings where one wishes to perform statistical inference, data may contain sensitive information about individuals.
For example, in medical studies, where the data may contain individuals' health records and whether they carry some disease which bears a social stigma.
Alternatively, one can consider a map application which suggests routes based on aggregate positions of individuals, which contains delicate information including users' residence data.
In these settings, it is critical that our methods protect sensitive information contained in the dataset.
This does not preclude our overall goals of statistical analysis, as we are trying to infer properties of the population $p$, and not the samples which are drawn from said population.
That said, without careful experimental design, published statistical findings may be prone to leaking sensitive information about the sample.
As a notable example, it was recently shown that one can determine the identity of some individuals who participated in genome-wide association studies~\cite{HomerSRDTMPSNC08}.
This realization has motivated a surge of interest in developing data sharing techniques with an explicit focus on maintaining privacy of the data~\cite{JohnsonS13,UhlerSF13,YuFSU14,SimmonsSB16}.
Privacy-preserving computation has enjoyed significant study in a number of fields, including statistics and almost every branch of computer science, including cryptography, machine learning, algorithms, and database theory -- see, e.g.,~\cite{Dalenius77,AdamW89,AgrawalA01,DinurN03,Dwork08,DworkR14} and references therein.
Perhaps the most celebrated notion of privacy, proposed by theoretical computer scientists, is \emph{differential privacy}~\cite{DworkMNS06}.
Informally, an algorithm is differentially private if its outputs on neighboring datasets (differing in a single element) are statistically close (for a more precise definition, see Section~\ref{sec:prelim}).
Differential privacy has become the standard for theoretically-sound data privacy, leading to its adoption by several large technology companies, including Google and Apple~\cite{ErlingssonPK14, AppleDP17}.
Our focus in this paper is to develop tools for privately performing several distribution property estimation tasks.
In particular, we study the tradeoff between statistical accuracy, privacy, and error rate in the sample size.
Our model is that we are given sample access to some unknown discrete distribution $p$, over a domain of size $k$, which is possibly unknown in some tasks.
We wish to estimate the following properties:
\begin{itemize}
\item {\bf Support Coverage}: If we take $m$ samples from the distribution, what is the expected number of unique elements we expect to see?
\item {\bf Support Size}: How many elements of the support have non-zero probability?
\item {\bf Entropy}: What is the Shannon entropy of the distribution?
\end{itemize}
For more formal statements of these problems, see Section~\ref{sec:probs}.
We require that our output is $\alpha$-accurate, satisfies $(\varepsilon, 0)$-differential privacy, and is correct with probability $1 - \beta$.
The goal is to give an algorithm with minimal sample complexity $n$, while simultaneously being computationally efficient.
{\bf Theoretical Results.} Our main results show that privacy can be achieved for all these problems at a very low cost.
For example, if one wishes to privately estimate entropy, this incurs an additional additive cost in the sample complexity which is very close to linear in $1/\alpha\varepsilon$.
We draw attention to two features of this bound.
First, this is independent of $k$.
All the problems we consider have complexity $\Theta(k/\log k)$, so in the primary regime of study where $k \gg 1/\alpha\varepsilon$, this small additive cost is dwarfed by the inherent sample complexity of the non-private problem.
Second, the bound is almost linear in $1/\alpha\varepsilon$.
We note that performing even the most basic statistical task privately, estimating the bias of a coin, incurs this linear dependence.
Surprisingly, we show that much more sophisticated inference tasks can be privatized at almost no cost.
In particular, these properties imply that the additive cost of privacy is $o(1)$ in the most studied regime where the support size is large.
In general, this is not true -- for many other problems, including distribution estimation and hypothesis testing, the additional cost of privacy depends significantly on the support size or dimension~\cite{DiakonikolasHS15,CaiDK17,AcharyaSZ17,AliakbarpourDR17}.
We also provide lower bounds, showing that our upper bounds are almost tight.
A more formal statement of our results appears in Section~\ref{sec:results}.
{\bf Experimental Results.} We demonstrate the efficacy of our method with experimental evaluations.
As a baseline, we compare with the non-private algorithms of~\cite{OrlitskySW16} and~\cite{WuY18}.
Overall, we find that our algorithms' performance is nearly identical, showing that, in many cases, privacy comes (essentially) for free.
We begin with an evaluation on synthetic data.
Then, inspired by~\cite{ValiantV13,OrlitskySW16}, we analyze text corpus consisting of words from Hamlet, in order to estimate the number of unique words which occur.
Finally, we investigate name frequencies in the US census data.
This setting has been previously considered by~\cite{OrlitskySW16}, but we emphasize that this is an application where private statistical analysis is critical.
This is proven by efforts of the US Census Bureau to incorporate differential privacy into the 2020 US census~\cite{DajaniLSKRMGDGKKLSSVA17}.
{\bf Techniques.} Our approach works by choosing statistics for these tasks which possess bounded sensitivity, which is well-known to imply privacy under the Laplace or Gaussian mechanism.
We note that bounded sensitivity of statistics is not always something that can be taken for granted.
Indeed, for many fundamental tasks, optimal algorithms for the non-private setting may be highly sensitive, thus necessitating crucial modifications to obtain differential privacy~\cite{AcharyaDK15, CaiDK17}.
Thus, careful choice and design of statistics must be a priority when performing inference with privacy considerations.
To this end, we leverage recent results of~\cite{AcharyaDOS17}, which studies estimators for non-private versions of the problems we consider.
The main technical work in their paper exploits bounded sensitivity to show sharp cutoff-style concentration bounds for certain estimators, which operate using the principle of best-polynomial approximation.
They use these results to show that a single algorithm, the Profile Maximum Likelihood (PML), can estimate all these properties simultaneously.
On the other hand, we consider the sensitivity of these estimators for purposes of privacy -- the same property is utilized by both works for very different purposes, a connection which may be of independent interest.
We note that bounded sensitivity of a statistic may be exploited for purposes other than privacy.
For instance, by McDiarmid's inequality, any such statistic also enjoys very sharp concentration of measure, implying that one can boost the success probability of the test at an additive cost which is logarithmic in the inverse of the failure probability.
One may naturally conjecture that, if a statistical task is based on a primitive which concentrates in this sense, then it may also be privatized at a low cost.
However, this is not true -- estimating a discrete distribution in $\ell_1$ distance is such a task, but the cost of privatization depends significantly on the support size~\cite{DiakonikolasHS15}.
One can observe that, algorithmically, our method is quite simple: compute the non-private statistic, and add a relatively small amount of Laplace noise.
The non-private statistics have recently been demonstrated to be practical~\cite{OrlitskySW16, WuY18}, and the additional cost of the Laplace mechanism is minimal.
This is in contrast to several differentially private algorithms which invoke significant overhead in the quest for privacy.
Our algorithms attain almost-optimal rates (which are optimal up to constant factors for most parameter regimes of interest), while simultaneously operating effectively in practice, as demonstrated in our experimental results.
{\bf Related Work.} Over the last decade, there have been a flurry of works on the problems we study in this paper by the computer science and information theory communities, including Shannon and R\'enyi entropy estimation~\cite{Paninski03, ValiantV17b, JiaoVHW17, AcharyaOST17, ObremskiS17, WuY18}, support coverage and support size estimation~\cite{OrlitskySW16, WuY18}.
A recent paper studies the general problem of estimating functionals of discrete distribution from samples in terms of the smoothness of the functional~\cite{FukuchiS17}.
These have culminated in a nearly-complete understanding of the sample complexity of these properties, with optimal sample complexities (up to constant factors) for most parameter regimes.
Recently, there has been significant interest in performing statistical tasks under differential privacy constraints.
Perhaps most relevant to this work are~\cite{CaiDK17, AcharyaSZ17, AliakbarpourDR17}, which study the sample complexity of differentialy privately performing classical distribution testing problems, including identity and closeness testing.
Other works investigating private hypothesis testing include~\cite{WangLK15,GaboardiLRV16,KiferR17,KakizakiSF17,Rogers17,GaboardiR17}, which focus less on characterizing the finite-sample guarantees of such tests, and more on understanding their asymptotic properties and applications to computing p-values.
There has also been study on private distribution learning~\cite{DiakonikolasHS15,DuchiJW17,KarwaV18}, in which we wish to estimate parameters of the distribution, rather than just a particular property of interest.
A number of other problems have been studied with privacy requirements, including clustering~\cite{WangWS15,BalcanDLMZ17}, principal component analysis~\cite{ChaudhuriSS13,KapralovT13,HardtP14b}, ordinary least squares~\cite{Sheffet17}, and much more.
\subsubsection{Lower Bound for Entropy Estimation}
\begin{theorem}\label{lb:all}
\[
C(H, \alpha, \varepsilon) =\Omega\Paren{\frac{k}{\alpha\logk}+\frac{\log^2(\min\{k,n\})}{\alpha^2}+\frac{\logk}{\alpha\varepsilon}}.
\]
\end{theorem}
\begin{proof}
The first two terms in the lower bound follows from the entropy estimation lower bounds, even without privacy requirements. For the final term, we will invoke the lower bound arguments from~\cite{AcharyaSZ17}.\todo{Do we need to state the lemma here?} Consider the two distributions below (which are also used in~\cite{WuY16}). The first distribution assigns probability $2/3$ to the first element, and is uniform over the remaining $k-1$ elements, and the second distribution assigns probability $(2-\eta)/3$ to the first element, and is uniform over the rest. Then, the entropy of the two distributions differ by $\Theta(\eta\logk)$. Therefore, when $\eta = \alpha/\logk$, the entropy of the two distributions differ by $\Theta(\alpha)$. There is a coupling between the two distributions with expected Hamming distance $\expectation{D} = {\etan}/3$. Therefore,
\[
\etan\ge\frac1\varepsilon \Rightarrow n\ge\frac1{\eta\varepsilon}.
\]
Substituting, $\eta = \alpha/\logk$, gives
\[
n\ge \frac{\logk}{\alpha\varepsilon}.
\]
\end{proof}
\subsubsection{Upper Bound for Entropy Estimation: Best-Polynomial Approximation}
The upper bound should be straightforward from the sensitivity bound in Lemma 2 of~\cite{AcharyaDOS17}.
The optimal sample complexity of estimating $\entp{\pi}$ to $\pm \alpha$ is~\cite{WuY16}
\[
O\Paren{\frac{k}{\alpha\logk}+\frac{\log^2(\min\{k,n\})}{\alpha^2}}.
\]
However, \todo{which two papers?}both these papers propose estimators that can have a high sensitivity.~\cite{AcharyaDOS17} propose technical modifications to these approaches to obtain an estimator that has the following properties. We denote their estimator with $H^\beta$, where $\beta>0$ is a fixed constant (say 0.01 or something). Then the estimator satisfies the followings:
\begin{itemize}
\item
The sample complexity of the estimator is at most a factor $1/\beta^2$ of the optimal, which is sample order-optimal for any constant $\beta$.
\item
The sensitivity of $H^{\beta}$ is at most $O(n^{\beta}/n)$.
\end{itemize}
This shows the following bound on the sample complexity of estimating $\entp{\pi}$ under $\varepsilon$-differential privacy.
\begin{theorem}
Let $\beta>0$ be a small fixed constant. Then,
\[
C(H, \alpha, \varepsilon) = O\Paren{\frac{k}{\beta^2\alpha\logk}+\frac{\log^2(\min\{k,n\})}{\alpha^2} + \Paren{\frac1{\alpha\varepsilon}}^{1+\beta}}.
\]
which can estimate $\entp{\pi}$ up to $\pm \alpha$ with success probability of 2/3.
\end{theorem}
\section{Preliminaries}
We will start with some definitions.
Let $\Delta{\hfill\blksquare}\medskip \{(p(1),\ldots, p(k)):p(i)\ge0, \sum_{i=1}^k p(i) = 1, 1\le k\le\infty\}$ be the set of discrete distributions over a countable support. Let $\Delta_{\ab}$ be the set of distributions in $\Delta$ with at most $k$ non-zero probability values. A \emph{property} $f(p)$ is a mapping from $\Delta\rightarrow\mathbb{R}$. We now describe the classical distribution property estimation problem, and then state the problem under differential privacy.
\paragraph{Property Estimation Problem.} Given $\alpha,\beta$, $f$, and independent samples $X_1^{\ns}$ from an unknown distribution $\pi$, design an estimator $\hat f:X_1^{\ns}\rightarrow\mathbb{R}$ such that with probability at least $1-\beta$, $\absv{\hat{f}(X_1^{\ns})-f(\pi)}<\alpha$. The \emph{sample complexity} of $\hat f$, is
$
C_{\hat{f}}(f, \alpha, \beta) {\hfill\blksquare}\medskip \min\{n: \probof{\absv{\hat{f}(X_1^{\ns})-f(\pi)}>\alpha}<\beta\}
$ is the smallest number of samples to estimate $f$ to accuracy $\alpha$, and error $\beta$. We study the problem for $\beta = 1/3$, and by the median trick, we can boost the error probability to $\beta$ with an additional multiplicative $\log (1/\beta)$ more samples: $C_{\hat f}(f,\alpha) {\hfill\blksquare}\medskip C_{\hat{f}}(f, \alpha, 1/3)$.
The sample complexity of estimating a property $f(\pi)$ is the minimum sample complexity over all estimators: $C(f,\alpha) = \min_{\hat f} C_{\hat{f}}(f, \alpha)$.
An estimator $\hat{f}$ is $\varepsilon$-differentially private (DP)~\cite{DworkMNS06} if for any $X_1^{\ns}$ and $Y_1^{\ns}$, with $\ham{X_1^{\ns}}{Y_1^{\ns}}\le 1$, $\frac{\probof{f(X_1^{\ns})\in S}}{\probof{f(Y_1^{\ns})\in S}}\le e^\varepsilon$, for all $i$, and measurable $S$.
\paragraph{Private Property Estimation.} Given $\alpha, \varepsilon, \beta$, $f$, and independent samples $X_1^{\ns}$ from an unknown distribution $\pi$, design an $\varepsilon$-differentially private estimator $\hat f:X_1^{\ns}\rightarrow\mathbb{R}$ such that with probability at least $1-\beta$, $\absv{\hat{f}(X_1^{\ns})-f(\pi)}<\alpha$. Similar to the non-private setting, the \emph{sample complexity} of $\varepsilon$-differentially private estimation problem is $C(f,\alpha, \varepsilon) = \min_{\hat f: \hat f \text{is $\varepsilon$-DP}}C_{\hat{f}}(f, \alpha, 1/3)$, the smallest number of samples $n$ for which there exists such a $\pm\alpha$ estimator with error probability at most 1/3.
In their original paper~\cite{DworkMNS06} provides a scheme for differential privacy, known as the Laplace mechanism.
This method adds Laplace noise to a non-private scheme in order to make it private.
We first define the sensitivity of an estimator, and then state their result in our setting.
\begin{definition}
\label{def:sensitivity}
The \emph{sensitivity} of an estimator $\hat{f}:[k]^{n}\rightarrow\mathbb{R}$ is
$\Delta_{n,\hat{f}}{\hfill\blksquare}\medskip \max_{\ham{X_1^{\ns}}{Y_1^{\ns}}\le1} \absv{\hat{f}(X_1^{\ns})-\hat{f}(Y_1^{\ns})}.$ Let $D_{\hat f}(\alpha,\varepsilon) = \min\{{n}: \Delta_{n,\hat{f}}\le \alpha\varepsilon\}$.\end{definition}
\label{sec:prelim}
\begin{lemma}
\label{lem:main-sensitivity}
\[
C(f,\alpha, \varepsilon) = O\Paren{\min_{\hat f} \left\{C_{\hat f}(f,\alpha/2)+ D_{\hat f}\left(\frac{\alpha}{4},\varepsilon\right)\right\}}.
\]
\end{lemma}
\begin{proof}
~\cite{DworkMNS06} showed that for a function with sensitivity $\Delta_{n,\hat{f}}$, adding Laplace noise $X \sim Lap(\Delta_{n,\hat{f}}/\varepsilon)$ makes the output $\varepsilon$-differentially private.
By the definition of $D_{\hat f}(\frac{\alpha}{4},\varepsilon)$, the Laplace noise we add has parameter at most $\frac{\alpha}{4}$. Recall that the probability density function of $Lap(b)$ is $\frac1{2b} e^{-\frac{|x|}{b}}$, hence we have $\probof{|X| > \alpha/2} < \frac{1}{e^2}$. By the union bound, we get an additive error less than $\alpha = \frac{\alpha}{2} + \frac{\alpha}{2}$ with probability at most $1/3 + \frac{1}{e^2} < 0.5$. Hence, with the median trick, we can boost the error probability to $1/3$, at the cost of a constant factor in the number of samples.
\end{proof}
To prove sample complexity lower bounds for differentially private estimators, we observe that the estimator can be used to test between two distributions with distinct property values, hence is a harder problem. For lower bounds on differentially private testing, \cite{AcharyaSZ17} gives the following argument based on coupling:
\begin{lemma}
\label{lem:coupling}
Suppose there is a coupling between distributions $\pi$ and $q$ over ${\cal X}^n$, such that $\expectation{\ham{X_1^{\ns}}{Y_1^{\ns}}} \le D$. Then, any $\varepsilon$-differentially private algorithm that distinguishes between $\pi$ and $q$ with error probability at most $1/3$ must satisfy $D = \Omega\Paren{\frac1{\varepsilon}}$.
\end{lemma}
\subsection{Problems of Interest}
\label{sec:probs}
\paragraph{Support Size.} The support size of a distribution $\pi$ is $S(\pi) =\absv{\{x:\pi(x)>0\}}$, the number of symbols with non-zero probability values. However, notice that estimating $S(\pi)$ from samples can be hard due to the presence of symbols with negligible, yet non-zero probabilities. To circumvent this issue,~\cite{RaskhodnikovaRSS09} proposed to study the problem when the smallest probability is bounded. Let $\Delta_{\ge\frac1\ab}
{\hfill\blksquare}\medskip\left\{\pi\in\Delta:
\pi(x)\in\{0\}\cup\left[1/k,1\right]\right\}$
be the set of all distributions where all non-zero probabilities have value at least $1/k$. For $\pi\in\Delta_{\ge\frac1\ab}$, our goal is to estimate $S(\pi)$ up to $\pm\distk$ with the least number of samples from $\pi$.
\paragraph{Support Coverage.} For a distribution $\pi$, and an integer $m$, let $S_m(\pi) = \sum_{x} (1 - (1-\p(\smb))^m)$, be the expected number of symbols that appear when we obtain $m$ independent samples from the distribution $\pi$. The objective is to find the least number of samples $n$ in order to estimate $S_m\Paren{\pi}$ to an additive $\pm \alpha m$.
Support coverage arises in many ecological and biological studies~\cite{ColwellCGLMCL12} to quantify the number of \emph{new} elements (gene mutations, species, words, etc) that can be expected to be seen in the future.
Good and Toulmin~\cite{GoodT56} proposed an estimator that for any constant $\alpha$, requires $m/2$ samples to estimate $S_m(p)$.
\paragraph{Entropy.}
The Shannon entropy of a distribution $\pi$ is $H(p) =\sum_x p(x)\log\frac1{p(x)}$,
$H(p)$ is a central object in information theory~\cite{CoverT06}, and also arises in many fields such as machine learning~\cite{Nowozin12}, neuroscience~\cite{BerryWM97, NemenmanBRS04}, and others. Estimating $H(p)$ is hard with any finite number of samples due to the possibility of infinite support. To circumvent this,
a natural approach is to consider distributions in $\Delta_{\ab}$.
The goal is to estimate the entropy of a distribution in $\Delta_{\ab}$ to an additive $\pm \alpha$, where $\Delta_{\ab}$ is all discrete distributions over at most $k$ symbols.
\section{Statement of Results}
\label{sec:results}
Our theoretical results for estimating support coverage, support size, and entropy are given below.
Algorithms for these problems and proofs of these statements are provided in Section~\ref{sec:theory}.
Our experimental results are described and discussed in Section~\ref{sec:exp}.
\begin{restatable}{theorem}{supportcoverage}
\label{thm:supportcoverage}
For any $\varepsilon = \Omega(1/m)$, the sample complexity of support coverage is
$$
C(S_m, \alpha, \varepsilon)= O\Paren{\frac{m\log (1/\alpha)}{\log m}+ \frac{m\log (1/\alpha)}{\log (\varepsilon m)}}.
$$
Furthermore,
$$
C(S_m, \alpha, \varepsilon)= \Omega\Paren{\frac{m\log (1/\alpha)}{\log m}+ \frac{1}{\alpha \varepsilon}}.
$$
\end{restatable}
\begin{restatable}{theorem}{ssize}
\label{thm:ssize}
For any $\varepsilon = \Omega(1/k)$, the sample complexity of support size estimation is
$$
C(S, \alpha, \varepsilon)= O\Paren{\frac{k\log^2 (1/\alpha)}{\log k}+ \frac{k\log^2 (1/\alpha)}{\log (\varepsilon k)}}.
$$
Furthermore,
$$
C(S, \alpha, \varepsilon)= \Omega\Paren{\frac{k\log^2 (1/\alpha)}{\log k}+ \frac{1}{\alpha \varepsilon}}.
$$
\end{restatable}
\begin{restatable}{theorem}{entropy}
\label{thm:entropy}
Let $\lambda>0$ be \emph{any} small fixed constant.
For instance, $\lambda$ can be chosen to be any constant between $0.01$ and $1$.
We have the following upper bounds on the sample complexity of entropy estimation:
$$
C(H, \alpha, \varepsilon)= O\Paren{\frac{k}{\alpha}+\frac{\log^2(\min\{k,n\})}{\alpha^2}+\frac{1}{\alpha\varepsilon}\log\Paren{\frac1{\alpha\varepsilon}}}
$$
and
$$
C(H, \alpha, \varepsilon)= O\Paren{\frac{k}{\lambda^2\alpha\logk}+\frac{\log^2(\min\{k,n\})}{\alpha^2} + \Paren{\frac1{\alpha\varepsilon}}^{1+\lambda}}.
$$
Furthermore,
$$
C(H, \alpha, \varepsilon) =\Omega\Paren{\frac{k}{\alpha\logk}+\frac{\log^2(\min\{k,n\})}{\alpha^2}+\frac{\logk}{\alpha\varepsilon}}.
$$
\end{restatable}
\noindent We provide some discussion of our results.
At a high level, we wish to emphasize the following two points:
\begin{enumerate}
\item Our upper bounds show that the cost of privacy in these settings is often negligible compared to the sample complexity of the non-private statistical task, especially when we are dealing with distributions over a large support.
Furthermore, our upper bounds are almost tight in all parameters.
\item The algorithmic complexity introduced by the requirement of privacy is minimal, consisting only of a single step which noises the output of an estimator.
In other words, our methods are realizable in practice, and we demonstrate the effectiveness on several synthetic and real-data examples.
\end{enumerate}
First, we examine our results on support size and support coverage estimation.
We note that we focus on the regime where $\varepsilon$ is not exceptionally small, as the privacy requirement becomes somewhat unusual.
For instance, non-privately, if we have $m$ samples for the problem of support coverage, then the empirical plug-in estimator is the best we can do.
However, if $\varepsilon = O(1/m)$, then group privacy~\cite{DworkR14} implies that the algorithm's output distribution on \emph{any} dataset of $m$ samples must be very similar -- however, these samples may have an \emph{arbitrary} value of support coverage $\in [m]$, which precludes hopes for a highly accurate estimator.
To avoid degeneracies of this nature, we restrict our attention to $\varepsilon = \Omega(1/m)$.
In this regime, if $\varepsilon = \Omega(m^{\gamma}/m)$ for any constant $\gamma > 0$, then up to constant factors, our upper bound is within a constant factor of the optimal sample complexity without privacy constratints.
In other words, for most meaningful values of $\varepsilon$, privacy comes for free.
Next, we turn our attention to entropy estimation.
We note that the second upper bound in Theorem~\ref{thm:entropy} has a parameter $\lambda$ that indicates a tradeoff between the sample complexity incurred in the first and third term.
This parameter determines the degree of a polynomial to be used for entropy estimation.
As the degree becomes smaller (corresponding to a large $\lambda$), accuracy of the polynomial estimator decreases, however, at the same time, low-degree polynomials have a small sensitivity, allowing us to privatize the outcome.
In terms of our theoretical results, one can think of $\lambda = 0.01$.
With this parameter setting, it can be observed that our upper bounds are almost tight.
For example, one can see that the upper and lower bounds match to either logarithmic factors (when looking at the first upper bound), or a very small polynomial factor in $1/\alpha\varepsilon$ (when looking at the second upper bound).
For our experimental results, we experimentally determined an effective value for the parameter $\lambda$ on a single synthetic instance.
We then show that this choice of parameter generalizes, giving highly-accurate private estimation in other instances, on both synthetic on real-world data.
\section{Additional Experimental Results}
\label{sec:supp-experiments}
This section contains additional plots of our synthetic experimental results.
Section~\ref{sec:supp-exp-entropy} contains experiments on entropy estimation, while Section~\ref{sec:supp-exp-coverage} contains experiments on estimation of support coverage.
\subsection{Entropy Estimation}
\label{sec:supp-exp-entropy}
We present four more plots of our synthetic experimental results for entropy estimation.
Figures~\ref{fig:entropy-k100-eps1} and~\ref{fig:entropy-k100-eps2} are on a smaller support of $k =100$, with $\varepsilon = 1$ and $2$, respectively.
Figures~\ref{fig:entropy-k1000-eps05} and~\ref{fig:entropy-k1000-eps2} are on a support of $k=1000$, with $\varepsilon = 0.5$ and $2$.
\begin{figure*}
\centering
\subfigure[]{
\begin{minipage}[b]{0.3\textwidth}
\includegraphics[width=1\textwidth]{plot/supp/entropy_eps1k100distribution0.pdf}
\includegraphics[width=1\textwidth]{plot/supp/entropy_eps1k100distribution3.pdf}
\end{minipage}
}
\subfigure[]{
\begin{minipage}[b]{0.3\textwidth}
\includegraphics[width=1\textwidth]{plot/supp/entropy_eps1k100distribution1.pdf}
\includegraphics[width=1\textwidth]{plot/supp/entropy_eps1k100distribution4.pdf}
\end{minipage}
}
\subfigure[]{
\begin{minipage}[b]{0.3\textwidth}
\includegraphics[width=1\textwidth]{plot/supp/entropy_eps1k100distribution2.pdf}
\includegraphics[width=1\textwidth]{plot/supp/entropy_eps1k100distribution5.pdf}
\end{minipage}
}
\caption{Comparison of various estimators for the entropy, $k=100$, $\varepsilon =1$.}
\label{fig:entropy-k100-eps1}
\end{figure*}
\begin{figure*}
\centering
\subfigure[]{
\begin{minipage}[b]{0.3\textwidth}
\includegraphics[width=1\textwidth]{plot/supp/entropy_eps2k100distribution0.pdf}
\includegraphics[width=1\textwidth]{plot/supp/entropy_eps2k100distribution3.pdf}
\end{minipage}
}
\subfigure[]{
\begin{minipage}[b]{0.3\textwidth}
\includegraphics[width=1\textwidth]{plot/supp/entropy_eps2k100distribution1.pdf}
\includegraphics[width=1\textwidth]{plot/supp/entropy_eps2k100distribution4.pdf}
\end{minipage}
}
\subfigure[]{
\begin{minipage}[b]{0.3\textwidth}
\includegraphics[width=1\textwidth]{plot/supp/entropy_eps2k100distribution2.pdf}
\includegraphics[width=1\textwidth]{plot/supp/entropy_eps2k100distribution5.pdf}
\end{minipage}
}
\caption{Comparison of various estimators for the entropy, $k=100$, $\varepsilon =2$.}
\label{fig:entropy-k100-eps2}
\end{figure*}
\begin{figure*}
\centering
\subfigure[]{
\begin{minipage}[b]{0.3\textwidth}
\includegraphics[width=1\textwidth]{plot/supp/entropy_eps05k1000distribution0.pdf}
\includegraphics[width=1\textwidth]{plot/supp/entropy_eps05k1000distribution3.pdf}
\end{minipage}
}
\subfigure[]{
\begin{minipage}[b]{0.3\textwidth}
\includegraphics[width=1\textwidth]{plot/supp/entropy_eps05k1000distribution1.pdf}
\includegraphics[width=1\textwidth]{plot/supp/entropy_eps05k1000distribution4.pdf}
\end{minipage}
}
\subfigure[]{
\begin{minipage}[b]{0.3\textwidth}
\includegraphics[width=1\textwidth]{plot/supp/entropy_eps05k1000distribution2.pdf}
\includegraphics[width=1\textwidth]{plot/supp/entropy_eps05k1000distribution5.pdf}
\end{minipage}
}
\caption{Comparison of various estimators for the entropy, $k=1000$, $\varepsilon =0.5$.}
\label{fig:entropy-k1000-eps05}
\end{figure*}
\begin{figure*}
\centering
\subfigure[]{
\begin{minipage}[b]{0.3\textwidth}
\includegraphics[width=1\textwidth]{plot/supp/entropy_eps2k1000distribution0.pdf}
\includegraphics[width=1\textwidth]{plot/supp/entropy_eps2k1000distribution3.pdf}
\end{minipage}
}
\subfigure[]{
\begin{minipage}[b]{0.3\textwidth}
\includegraphics[width=1\textwidth]{plot/supp/entropy_eps2k1000distribution1.pdf}
\includegraphics[width=1\textwidth]{plot/supp/entropy_eps2k1000distribution4.pdf}
\end{minipage}
}
\subfigure[]{
\begin{minipage}[b]{0.3\textwidth}
\includegraphics[width=1\textwidth]{plot/supp/entropy_eps2k1000distribution2.pdf}
\includegraphics[width=1\textwidth]{plot/supp/entropy_eps2k1000distribution5.pdf}
\end{minipage}
}
\caption{Comparison of various estimators for the entropy, $k=1000$, $\varepsilon =2$.}
\label{fig:entropy-k1000-eps2}
\end{figure*}
\subsection{Support Coverage}
\label{sec:supp-exp-coverage}
We present three additional plots of our synthetic experimental results for support coverage estimation.
In particular, Figures~\ref{fig:coverage-k1000}, \ref{fig:coverage-k5000}, and~\ref{fig:coverage-k100000} show support coverage for $k$ = 1000, 5000, 100000.
\begin{figure*}
\centering
\subfigure[]{
\begin{minipage}[b]{0.3\textwidth}
\includegraphics[width=1\textwidth]{plot/supp/synthetic_plots2_total_eps_k1000distribution0.pdf}
\includegraphics[width=1\textwidth]{plot/supp/synthetic_plots2_total_eps_k1000distribution3.pdf}
\end{minipage}
}
\subfigure[]{
\begin{minipage}[b]{0.3\textwidth}
\includegraphics[width=1\textwidth]{plot/supp/synthetic_plots2_total_eps_k1000distribution1.pdf}
\includegraphics[width=1\textwidth]{plot/supp/synthetic_plots2_total_eps_k1000distribution4.pdf}
\end{minipage}
}
\subfigure[]{
\begin{minipage}[b]{0.3\textwidth}
\includegraphics[width=1\textwidth]{plot/supp/synthetic_plots2_total_eps_k1000distribution2.pdf}
\includegraphics[width=1\textwidth]{plot/supp/synthetic_plots2_total_eps_k1000distribution5.pdf}
\end{minipage}
}
\caption{Comparison between the private estimator with the non-private SGT when $k=1000$.}
\label{fig:coverage-k1000}
\end{figure*}
\begin{figure*}
\centering
\subfigure[]{
\begin{minipage}[b]{0.3\textwidth}
\includegraphics[width=1\textwidth]{plot/supp/synthetic_plots2_total_eps_k5000distribution0.pdf}
\includegraphics[width=1\textwidth]{plot/supp/synthetic_plots2_total_eps_k5000distribution3.pdf}
\end{minipage}
}
\subfigure[]{
\begin{minipage}[b]{0.3\textwidth}
\includegraphics[width=1\textwidth]{plot/supp/synthetic_plots2_total_eps_k5000distribution1.pdf}
\includegraphics[width=1\textwidth]{plot/supp/synthetic_plots2_total_eps_k5000distribution4.pdf}
\end{minipage}
}
\subfigure[]{
\begin{minipage}[b]{0.3\textwidth}
\includegraphics[width=1\textwidth]{plot/supp/synthetic_plots2_total_eps_k5000distribution2.pdf}
\includegraphics[width=1\textwidth]{plot/supp/synthetic_plots2_total_eps_k5000distribution5.pdf}
\end{minipage}
}
\caption{Comparison between the private estimator with the non-private SGT when $k=5000$.}
\label{fig:coverage-k5000}
\end{figure*}
\begin{figure*}
\centering
\subfigure[]{
\begin{minipage}[b]{0.3\textwidth}
\includegraphics[width=1\textwidth]{plot/supp/synthetic_plots2_total_eps_k100000distribution0.pdf}
\includegraphics[width=1\textwidth]{plot/supp/synthetic_plots2_total_eps_k100000distribution3.pdf}
\end{minipage}
}
\subfigure[]{
\begin{minipage}[b]{0.3\textwidth}
\includegraphics[width=1\textwidth]{plot/supp/synthetic_plots2_total_eps_k100000distribution1.pdf}
\includegraphics[width=1\textwidth]{plot/supp/synthetic_plots2_total_eps_k100000distribution4.pdf}
\end{minipage}
}
\subfigure[]{
\begin{minipage}[b]{0.3\textwidth}
\includegraphics[width=1\textwidth]{plot/supp/synthetic_plots2_total_eps_k100000distribution2.pdf}
\includegraphics[width=1\textwidth]{plot/supp/synthetic_plots2_total_eps_k100000distribution5.pdf}
\end{minipage}
}
\caption{Comparison between the private estimator with the non-private SGT when $k=100000$.}
\label{fig:coverage-k100000}
\end{figure*}
\subsubsection{Upper Bound for Support Size Estimation}
\label{sec:ssize-ub}
In \cite{OrlitskySW16}, it is shown that the support coverage estimator can be used to obtain optimal results for estimating the support size of a distribution.
In this fashion, taking $m=k\log(3/\alpha)$, we we may use an estimate of the support coverage $S_m(\pi)$ as an estimator of $S(\pi)$.
In particular, their result is based on the following observation.
\begin{lemma}
\label{lem:sssc}
Suppose $m\ge k\log (3/\alpha)$, then for any $\pi\in\Delta_{\ge\frac1\ab}$,
\[
\absv{S_m(\pi) - S(\pi)}\le \frac{\distk}3.
\]
\end{lemma}
\begin{proof}
From the definition of $S_m(\pi)$, we have $S_m(\pi)\le S(\pi)$. For the other side,
\begin{align}
S(p) -S_m(p) &= \sum_{x} \Paren{1-\pi(x)}^m \le \sum_{x} e^{-m\pi(x)} \nonumber \\
&\le k\cdot e^{-\log (3/\alpha)} ~~~~~ = \frac{k\alpha}{3}. \qedhere
\end{align}
\end{proof}
Therefore, estimating $S_m(\pi)$ for $m = k\log (3/\alpha)$, up to $\pm \distk/3$, also estimates $S(p)$ up to $\pm \alpha k$. Therefore, the goal is to estimate the smallest value of $n$ to solve the support coverage problem.
Suppose $r = \log (3/\alpha)$, and $m = k\log (3/\alpha) = k \cdot r$ in the support coverage problem. Then, we have
\begin{align}
t= \frac mn-1 = \frac{k\log (3/\alpha)}{n}-1.\label{eq:exp-t}
\end{align}
Then, by Lemma~\ref{lem:bias-coverage} in the previous section, we have
\begin{align}
&~~~\absv{\expectation{\hat{S}_m(X_1^{\ns})} - S(\pi)} \nonumber\\
&\le \absv{\expectation{\hat{S}_m(X_1^{\ns})} - S_m(\pi)} + \absv{S_m(\pi) - S(\pi)}\nonumber\\
&\le 2+2e^{r(t-1)}+\min\{m, k\}\cdot e^{-r} + \frac{k\alpha}{3}\nonumber\\
&\le 2+2e^{r(t-1)}+k\cdot e^{-\log (3/\alpha)} + \frac{k\alpha}{3}\nonumber\\
&\le 2 + 2e^{r(t-1)}+ 2\frac{k\alpha}{3}.\nonumber
\end{align}
We will find conditions on $n$ such that the middle term above is at most $k\alpha$. Toward this end, note that $2e^{r(t-1)} \le \distk$ holds if and only if ${r(t-1)} \le \log\Paren{\frac{\distk}{2}}$. Plugging in~\eqref{eq:exp-t}, this holds when
\begin{align}
\log (3/\alpha)\cdot \Paren{\frac{k\log (3/\alpha)}{n}-2} \le \log\Paren{\frac{\distk}{2}},\nonumber
\end{align}
which is equivalent to
\iffalse
\begin{align}
n\ge \frac{k\log^2(3/\alpha)}{\log{\frac{\distk}{2}}+2\log \frac 3\alpha } = \frac{k\log^2(3/\alpha)}{\log{\frac{k}{2} }}\nonumber
\end{align}
\fi
\begin{align}
n\ge \frac{k\log^2(3/\alpha)}{\log{\frac{\distk}{2}}+2\log \frac 3\alpha } = O\Paren{ \frac{k\log^2(1/\alpha)}{\log{k }} }\nonumber
\end{align}
where we have assumed without loss of generality that $\alpha>\frac1k$.
The computations for sensitivity are very similar. From Lemma 1~\ref{lem:main-sensitivity}, we need to find the value of $n$ such that
\[
2+2e^{r(t-1)}\le \alpha\epsk,
\]
where we assume that $n \le \frac12k\log (3/\alpha)$, else we just add noise to the true number of observed distinct elements
By computations similar to the expectation case, this reduces to
\begin{align}
n \ge \frac{k\log^2(3/\alpha)}{\log{\frac{\alpha\epsk}{2}}+\log \frac 3\alpha}.\nonumber
\end{align}
Therefore, this gives us a sample complexity of
\begin{align}
n = O\Paren{\frac{k\log^2(1/\alpha)}{\log\Paren{\epsk}}}
\end{align}
for the sensitivity result to hold.
We note that the bound above blows up when $\varepsilon\le \frac1k$. However, we note that our lower bound implies that we need at least $\Omega(1/\varepsilon) =\Omega(k)$ samples in this case, which is not in the sub-linear regime that we are interested in. We therefore consider only the regime where the privacy parameter $\varepsilon$ is at least $1/k$.
\subsubsection{Lower Bound for Support Size Estimation}
\label{sec:ssize-lb}
In this section, we prove a lower bound for support size estimation, as described in Theorem~\ref{thm:ssize}.
The techniques are similar to those for support coverage in Section~\ref{sec:coverage-lb}.
The first term of the complexity is the lower bound for non-private setting.
This follows by combining the lower bound of~\cite{OrlitskySW16} for support coverage, with the equivalence between estimation of support size and coverage as implied by Lemma~\ref{lem:sssc}.
We focus on the second term in the sequel.
Consider the following two distributions: $u_1$ is a uniform distribution over $[k]$ and $u_2$ is a uniform distribution over $[(1-\alpha)k]$. Then the support size of these two distribution differs by $\alpha k$, and $d_{\mathrm {TV}}(u_1,u_2) = \alpha$.
Hence by Lemma~\ref{lem:min_coupling}, we know the following:
\begin{lemma} \label{lem:coupling_ssize}
Suppose $u_1 \sim U[k]$ and $u_2 \sim U[(1-\alpha)k]$, there is a coupling between $u_1^n$ and $u_2^n$ with expected Hamming distance equal to $ \alpha n $.
\end{lemma}
Moreover, given $n$ samples, we must be able to privately distinguish between $u_1$ and $u_2$ given an $\alpha$ accurate estimator of entropy with privacy considerations.
Thus, according to Lemma~\ref{lem:coupling}
and Lemma~\ref{lem:coupling_ssize}, we have:
\[
\alpha n\ge \frac1{\varepsilon}\Rightarrow n = \Omega\Paren{\frac1{\varepsilon\alpha}}.
\]
\section{Algorithms and Analysis}
\label{sec:theory}
In this section, we prove our results for support coverage in Section~\ref{sec:coverage}, support size in Section~\ref{sec:ssize}, and entropy in Section~\ref{sec:entropy}.
In each section, we first describe and analyze our algorithms for the relevant problem.
We then go on to describe and analyze a lower bound construction, showing that our upper bounds are almost tight.
All our algorithms fall into the following simple framework:
\begin{enumerate}
\item Compute a non-private estimate of the property;
\item Privatize this estimate by adding Laplace noise, where the parameter is determined through analysis of the estimator and potentially computation of the estimator's sensitivity.
\end{enumerate}
\subsection{Support Coverage Estimation}
\label{sec:coverage}
In this section, we prove Theorem~\ref{thm:supportcoverage}, about support coverage estimation:
\supportcoverage*
Our upper bound is described and analyzed in Section~\ref{sec:coverage-ub}, while our lower bound appears in Section~\ref{sec:coverage-lb}.
\input{coverage}
\subsection{Support Size Estimation}
In this section, we prove our main theorem about support size estimation, Theorem~\ref{thm:ssize}
\ssize*
\noindent Our upper bound is described and analyzed in Section~\ref{sec:ssize-ub}, while our lower bound appears in Section~\ref{sec:ssize-lb}.
\label{sec:ssize}
\input{support-size}
\subsection{Entropy Estimation}
\label{sec:entropy}
In this section, we prove our main theorem about entropy estimation, Theorem~\ref{thm:entropy}
\entropy*
\noindent We describe and analyze two upper bounds.
The first is based on the empirical entropy estimator, and is described and analyzed in Section~\ref{sec:entropy-ub-empirical}.
The second is based on the method of best-polynomial approximation, and appears in Section~\ref{sec:entropy-ub-poly}.
Finally, our lower bound is in Section~\ref{sec:entropy-lb}.
\input{entropy}
| {'timestamp': '2018-03-02T02:00:26', 'yymm': '1803', 'arxiv_id': '1803.00008', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00008'} | arxiv |
\section{Introduction}
\label{sec:intro}
Information and communication technologies are experiencing fast and relevant changes in our modern society. Network technologies are becoming ubiquitous and more efficient, and computing services are delivering higher performance as well as faster response times, rising the development of new and more sophisticated computing paradigms. Such progression in the advancement of computing and communication technologies is pushing the emergence of the smart computing era. We are already surrounded by several smart concepts, such as smart cities, smart industry, smart farms, all in all, building the concept of smart environments. In such contexts, different types of computing devices are integrated, together with multiple types of sensors and actuators. Sensors networks are continuously capturing and producing large volumes of structured and unstructured data, thus including big data technologies into the smart environments.\\
Indeed, smart environments have been defined as {\em a physical world that is richly and invisibly interwoven with sensors, actuators, displays, and computational elements, embedded seamlessly in the everyday objects of our lives, and connected through a continuous network} \cite{1}, or also as {\em a small world where different kinds of smart devices are continuously working to make inhabitants' lives more comfortable} \cite{2}. The concept of smart computing comes from the ubiquitous computing, whereby integrating various kind of existing technologies (such as cloud computing, fog computing, the Internet of Things (IoT), or Wireless Sensor Networks (WSN)) builds up the smart environment paradigm.\\
So defining efficient smart environments essentially means appropriately integrating various kind of existing technologies, where some of such technologies (for instance, cloud computing) provide the best facilities to store and process big data, and some other (for example, the IoT or the WSN) provide the best facilities to producing and capturing those data from various kind of sources of the real world. Furthermore, additional technologies (for instance, fog computing or edge computing) provide the most appropriate facilities to process those data near to the end users or edge devices, speeding up performance as well as reducing network traffic through the system. Considering and combining all these facilities provided by the various existing technologies, helps creating better and more efficient smart environment systems.\\
In order to run such complex systems efficiently, it is essential to organize and manage the broad set of heterogeneous resources properly. For this reason, resources organization becomes a vital issue in the control system. Efficient resources management and organization requires deep knowledge about the type and features of those system resources, and proper categorization. Our primary intention in this literature survey is to identify the resources of the different computing paradigms that build up smart environments, and also to find out the features and behaviors of those resources. We give our highest concern to finding the possible resources classifications for those computing paradigms, as well as looking for the resource and system ontologies that have been defined by the various researchers.\\
In this research work, we have focused on those computing platforms and system resources related to smart environments and tried to identify the technological gaps and differences between resources of the various computing platforms. We have surveyed those research works which define somehow the resources of different computing paradigms and which present some sort of classification, taxonomy or ontology. As a result of our survey, we have found that, for smart environments, it is essential to consider together several computing paradigms and technologies, and that there is not, yet, any research work that integrates a merged resources classification, taxonomy or ontology required in such heterogeneous smart scenarios.\\
The rest of this paper is organized as follows. Section \ref{sec:sos} positions the scope of this literature survey by revisiting the different definitions of {\em classification}, {\em categorization}, {\em taxonomy}, and {\em ontology}, and describing the considered scenarios of analysis. In Section \ref{sec:liter}, we present the extensive literature survey organized according to the various computing paradigm considered: fog computing, IoT, and cloud computing. By following up the list of proposals, in Section \ref{sec:ana} we present our analysis of the different research works and summarize them in a table. Some interesting findings are discussed in Section \ref{sec:synop} and, finally, some concluding remarks are presented in Section \ref{sec:conc}.
\section{Scope of the Survey}
\label{sec:sos}
Different research works have been published describing systems in terms of \textit{classification}, \textit{categorization}, \textit{taxonomy}, or even \textit{ontology}. Before diving into the details of such literature, in this section, we will try to understand and clarify this terminology and propose our interpretation of these terms. And then, we will describe the scenarios of analysis that will determine the scope of our literature survey.
\subsection{Classification, Categorization, Taxonomy, and Ontology}
\label{sec:defi}
Knowing the system characteristics, features and behaviors, as well as other related vital aspects, is essential for a proper system understanding. In our literature survey, we have observed that several researchers present some taxonomy by considering a categorization or classification of their system resources and services, or even propose some ontology for their systems. In \cite{3}, the authors define \textit{classification} as the set of concepts which have been considered for grouping entities according to their similarity. They also said that, the taxonomy contains a "subsumption hierarchy" in the form of transitive \textit{subclassOf} relations, i.e., each object of a class can be assumed to be also an object of all parent categories. Whereas in \cite{4}, authors define \textit{taxonomy} as \textit{the science of categorization, or classification, of things based on a predefined system; typically, taxonomy contains a controlled vocabulary with a hierarchical tree-like structure}. So according to them the taxonomy is a path to build a systematic model, by organizing the features into categories and subcategories. They also said that, according to a philosophical view, an \textit{ontology} is the study of the kind of things that exist in a real scenario, which defines the type of things and their relations. In \cite{5}, the authors say that ontology has mostly come to mean one of the two related things: {\em i)} it is a representation vocabulary, often specialized in some domain or subject matter, or {\em ii)} it is used to refer to a body of a knowledge for describing some domain. In \cite{6}, the authors say that \textit{by implicitly or explicitly, every knowledge model is committed to some conceptualization, and an ontology is the explicit specifications of this conceptualization}. So an ontology is the collection of various kinds of entities and relations among them.
From the above definitions, we conclude that \textit{classification} organizes concepts in order to build the \textit{taxonomy} \cite{7}, what means that \textit{classification} is the subset of \textit{taxonomy}. Whereas the term \textit{ontology} is much broader and larger in scope \cite{8}. For instance, as an illustrative example, in an ontological forest, a taxonomy is a tree. Or, regarding graph theory, we can represent a taxonomy as the tree and an ontology as the graph, where all the edges are to be considered as the relations between different vertices. In this paper, our focus is to identify how researchers propose their ontologies, by following the various classifications, categorizations and taxonomies of different computing paradigms.
\subsection{Considered Research Scenarios}
\label{subsec:crs}
Cloud computing initiated a new era of computation, where most of the work (i.e. computation, data processing, etc.) is performed at the cloud data centers, which are often geographically centralized. Besides, vast numbers of IoT devices and sensors are increasingly being deployed everywhere. Almost all modern devices are connected to the Internet, and many of them have additional sensors and actuators. In fact, one of the leading research and advisory company, Gartner Inc. \cite{9}, forecasts that by 2020 almost 20.4 billion connected things will be in use worldwide. Also by 2022, M2M traffic flows are expected to constitute up to 45\% of the whole Internet traffic \cite{10}. Beyond these predictions, McKinsey Global Institute reported in 2015 that the number of connected machines had grown 300\% over the last five years. Traffic monitoring of a cellular network in the US also showed an increase of 250\% for M2M traffic volume in 2011 \cite{11}. Also, according to the Cisco reports, they predict that 50 billion objects and devices will be connected to the Internet by 2020. However, more than 99 percent of today's available things in the world remain unconnected \cite{12}. According to a Navigant Research report, the number of installed smart meters around the world will grow to 1.1 billion by 2022 \cite{13}. Another report from Automotive News states that the number of cars connected to the Internet worldwide will increase from 23 million in 2013 to 152 million in 2020 \cite{14}. So, it is clear that IoT is going to rule over the modern technology, but most importantly, these IoT devices and sensors are highly distributed over the network, along with the agile and latency-sensitive service requirements. So, for the cloud data centers, in case of latency-sensitive service requirements, it is quite apparent that they might fail to deal with high processing and storage demand for this vast set of IoT devices at the edge. As a result, congested network, high latency in service delivery, and poor Quality of Service (QoS) are being experienced \cite{15}. To overcome these problems, researchers come with a new computing paradigm, fog computing, which consists of adding some processing capabilities between the cloud data center and the IoT devices/sensors. Fog computing is one emerging technology, so there are still lots of work to do in this domain. Still, many research work is going on to make some transparent and standard architectures for this platform, which will allow being quickly adopted by any use-case. The primary objective of fog computing is to extend the cloud computing facilities to the edge of the network \cite{15,16}, turning fog computing to be agiler. But, interestingly, most of the research works justify that fog computing is not going to rule over the cloud computing, rather than together, they are going to solve many problems and will provide better facilities to the next computing and networking platforms \cite{16}. In addition to the cloud, fog, and IoT paradigms, which define the core of our interests, some other related technologies will complete the whole picture, such as grid computing, mobile edge computing, and wireless sensor networks, which will also be considered in this survey.
\section{Literature Survey}
\label{sec:liter}
In this section, we briefly describe the different research works which have considered somehow the resources categorization, classification, taxonomy, ontology, or just some sort of resources management, all of them in the scope of smart environments. Some authors explicitly use any of these terms in their works, but some others propose implicitly some resources classification as part of their system architecture organization. We have tried to include all of them in this literature survey. In section \ref{subsec:fcp} we address those research works in the area of fog computing. In section \ref{subsec:iotp} we discuss the IoT related research works, in section \ref{subsec:ccp} we focus on the cloud computing related literature and, in section \ref{subsec:ocp}, we consider those additional research works on the areas of grid computing, WSN, mobile edge computing, or other related technologies.
\subsection{Fog Computing Platforms}
\label{subsec:fcp}
Several authors have published their work with some contributions related to resources categorization in the scope of fog computing. In \cite{16,17,18,19} the authors present mainly some architectural contributions and, as part of these, they address some classification issues. In \cite{15,20,21} the researchers propose explicitly one taxonomy for fog computing platforms. In addition, we have observed that many researchers focus on identifying features, behaviors and attributes in fog computing, as in \cite{18,19,20,22,23,24}, where they discuss their challenges and characteristics. Interestingly, in \cite{21} they present a taxonomy for a connected object, which is mostly suggested as the taxonomy for edge or fog devices. In the next few subsections, we discuss individually those research works which have been done around the fog computing paradigm.\\
\subsubsection{Bonomi et al.}
Bonomi et al. have made important contributions in the areas of fog computing and, consequently, they have several works presenting different aspects about their architecture. In this literature survey we are considering two of their works. In \cite{16}, the authors present fog computing as a distributed architecture, where fog relies on technological components for scalable virtualization of the essential resource classes, such as computing, storage, and networking. By following up two use-cases, they propose the software architecture for a fog computing platform. The main components of their proposed architecture are various physical resources (computation resources, network resources, and storage resources), the abstraction layer, the fog service orchestration layer, and some APIs for applications. They propose the abstraction layer to provide a uniform and programmable interface by hiding the platform heterogeneity for monitoring and managing, not only the resources, but also the various hypervisors, OSes, and service containers. By adopting different techniques to support virtualization in a fog computing architecture, this layer allows running OSes or service containers on a physical machine to improve resource utilization. In this paper, authors have not explicitly defined any classification or taxonomy of the system resources, but reviewing their architecture, we can get an idea about the classification of physical resources as well as identify the attributes, features and behaviors of the fog resources. Whereas in \cite{24}, the authors initially discuss on various use-cases and real scenarios, where fog is playing a predominant role. Considering all these scenarios, the authors identified the characteristics of fog computing paradigm. They said that fog computing has some key attributes. As fog brings to the cloud facilities to the edge of the network, it is quite relevant that fog is providing the services to the end users, within low latency or delay. Also, it has some unique features like location awareness, heterogeneity, support to virtualization, mobility, and so on. In this paper, the authors add that fog computing enables the facility of interoperability and federation across the various service domains and facilitates the on-line analytics and interplay by processing the data close to the source. They discuss the primary attributes and features in the fog computing paradigm and characterize the participants of fog computing, such as providers and users. Focusing on their work, we can also identify the characteristics, attributes and behaviors of their system resources. Though they have not explicitly mentioned the classification, taxonomy or ontology of their system resources, by discussing their system's resources characteristics, attributes, behaviors, and resource owner’s role, it helps us identifying their system resource classification.
\subsubsection{Munir et al.}
In this paper \cite{17}, the authors present a novel integrated fog-cloud architecture by considering the benefits of IoT, fog, and cloud computing platforms. Their proposed architecture is an energy efficient reconfigurable layered architecture and, according to them, this architecture can easily fit with various kind of fog computing applications. The layered architecture facilitates abstraction. In their architecture, the bottom section contains two components: the hardware layer and the reconfiguration layer. The virtualization layer resides on top of these two layers, and it abstracts the hardware resources of the edge server from the higher application service layer, where the virtual machines run. On top of the application service layer there is another layer of components, known as the analytics layer, which has three components: the power manager, the machine learning module, and platform services. The topmost layer is the application layer, which consists of several application platforms. So one can get a clear idea about the technologies involved in their integrated fog, cloud and IoT paradigm. We also found that the virtualization technology plays an important role in their system resources. By following their work, we can easily identify the attributes, features and behaviors of their system resources, what helps contextualizing their work with respect to our interest.
\subsubsection{Syed et al.}
In \cite{18}, the authors present a pattern for the fog computing paradigm. They define pattern as \textit{nothing but a solution to a recurring problem, which is generating in a specific context}. They propose the Pattern-Oriented Software Architecture (POSA) template to describe the pattern of fog computing for a particular context. The pattern illustrates its architecture, including computing, storage and networking services. They understand fog computing as a virtualized platform, which resides on the IoT devices and cloud data centers. According to them, a large number of nodes allows fog computing to collect data efficiently from a distributed platform, while providing low-latency services and supporting the mobility of the fog nodes. They also support location-awareness, heterogeneity, transparency, and big data analytics to the edge, as well as scalability of the platform. Fog computing also endorses the multi-tenancy and multiplicity of providers, and enhances security to the edge devices. By presenting the pattern-oriented software architecture for the fog paradigm, the authors did not explicitly address the classification and taxonomy of their system resources, but following up their work and software architecture we conclude that fog resources are composed and also classified by their computing, storage and networking specification. In addition, we can get the knowledge about the attributes, features and behaviors of their fog resources considered.
\subsubsection{Baccarelli et al.}
In this paper \cite{19}, the authors propose a new dimension of fog computing paradigm: the Fog of Everything (FoE). They present a fog computing architecture, which mainly consists of six blocks: \textit{(1)} the IoE layer, consisting of heterogeneous resource-limited devices, \textit{(2)} the wireless access network, that supports Fog-to-Thing (F2T) and Thing-to-Fog (T2F) communication through TCP/IP connections, \textit{(3)} the interconnected fog nodes, acting as a virtualized cluster head, \textit{(4)} the inter-fog backbone, that provides inter-fog connectivity and inter-fog resource pooling, \textit{(5)} the virtualization layer, that allows each thing to augment its limited resources by exploiting the computing capacity of a corresponding virtual clone, and \textit{(6)} the overlay inter-clone virtual network, that allows P2P inter-clone communication by relying on TCP/IP end-to-end transport connections. Additionally, they divide their FoE model into four different layers, named the cloud layer, the overlay layer, the fog layer and the IoE layer. By following up their work and proposed architecture, we found some attributes, features and behaviors of their system resources. We also found that the networking technologies are involved in their computing paradigm, and that virtualization in another basic technologies, which plays an important role to manage their system resources. In addition, energy or power of the system resources is one of the key points to classify their system resources. Though they have not mentioned explicitly the classification and taxonomy of their system resources, but focusing on their system architecture and attributes of their system, it helps us understanding their system resources and classification.
\subsubsection{Mahmud and Buyya}
In this work \cite{15}, the authors argue that fog computing facilitates location-awareness, mobility support, real-time interactions, scalability, and interoperability, which allows this technology to work efficiently regarding service latency, power consumption, network traffic, capital and operational expenses, and content distribution. These are the key features that should be appropriately handled in a fog computing system to get the best performance. They also discuss different kinds of management issues with severe impact on the fog computing paradigm. Following some previous research works, they review different fog node architectures, application programming platforms, mathematical models, and optimization techniques which attain a certain level of service level objectives (SLO). According to them, these SLOs can be classified into various kind of management aspects to fog computing platform, such as latency management, cost management, network management, computation management, application management, data management, and power management. The main contribution of this paper is the taxonomy of the fog computing paradigm, where the authors consider the following parameters: fog nodes configuration, nodal collaboration, resource/service provisioning metrics, service level objectives, applicable networking system and security concern.
\subsubsection{Perera et al.}
According to the authors in \cite{20}, fog computing supports the dynamic discovery of Internet objects, dynamic configuration and device management, multi-protocol support for both, application and communication level, mobility, and data management at the edge of the network. It enables context discovery and awareness as a facility to the users. In addition, data analytics, security, and privacy can be supported by the fog computing at the edge of the network. In fact, fog computing provides mostly all the features of cloud computing at the edge. In this paper, the authors classify the edge devices into several categories according to their computation capabilities, mainly availability of memory, availability of energy and availability of communication. By following up various research works about fog computing, the authors conclude that cloud companion support and data analytics are the most popular features in these fog computing research efforts.
\subsubsection{Dorsemaine et al.}
In \cite{21}, the authors present a taxonomy for the connected object, where a connected object could be \textit{sensor(s) and/or actuator(s) carrying out a specific function and that can communicate with other equipment; it is part of an infrastructure allowing the transport, storage, processing, and access to the generated data by users or other systems}. According to them, a taxonomy of a connected object can be presented in several categories, such as hardware: storage, memory, processor; software: operating system, APIs; security; network: standards, bandwidth, etc. In this paper, they discuss the different functional attributes regarding interaction with the sensors and actuators, mobility and management of the connected objects.
\subsubsection{Yi et al.}
The authors in \cite{22} argue that there are lots of challenges in the cloud computing paradigm, such as an unreliable latency, and the lack of mobility support and location unawareness for the end users. For this reason, they say that the fog computing architecture facilitates the reliable connectivity and low-latency services to the edge of the network, and that makes an automatic choice over the cloud to perform it in the edge of the network. In this paper, they discuss on the resource provisioning and resource management in fog computing paradigm, and describe the computation offloading strategy in fog computing platforms. They are focused on finding out the policies for monitoring the resources as well as the definition of the cost model for accessing the fog resources. In this paper, the authors did not explicitly address any classification or taxonomy of their system resources, but following up their work we can identify the attributes, behaviors and features of their system resources, as well as the security and privacy issues involved in their system resources. As like other authors, the authors argue that virtualization plays an important role to manage the system resources.
\subsubsection{Varshney and Simmhan}
In \cite{23}, by comparing edge, fog and cloud computing, the authors present a system architecture of fog computing where they identify the resource characteristics in the fog computing paradigm. The authors say that edge and fog layers have the capabilities of physical and application mobility, privacy sensitivity, and an augmentative runtime environment. In this paper, they also briefly discuss on offloading management and data management in the fog realm. And finally, after discussing on fog computing architectures and following various managerial and application related issues, they identify the challenges for the fog computing paradigm. According to them, there are several technical challenges should be addressed and solved soon: programmability and application-specific customization and optimizations of fog resources, predicting user demand, reducing power and networking consumption, security and privacy, and so on. Following up their contributions, we can get a clear idea about the characteristics, attributes and features of their system resources. Though they have not presented a taxonomy or classification of their system resources, focusing on the characteristics and attributes of their system resources helps identifying the classification the system resources according to their characteristics and attributes.
Note that in our literature survey we have not only focused on those papers discussing the resources classification or taxonomy, but also on those research works which concentrate on managerial related issues in the fog computing paradigm. Managing resources and services properly is essential to run a system efficiently. For instance, in \cite{16} the authors briefly discuss some policy-based service orchestration techniques to manage the services in the fog computing paradigm efficiently. Authors in \cite{19,20,23} present a resource management strategy for fog computing systems, wherein \cite{20} authors are focused on devices management in the fog computing paradigm, and in \cite{19,23} they discuss on the resources and network management in fog computing platforms. In this literature review, we have also found that most researchers consider some use-cases to present their work and, as part of this, they also mention some particular types of devices, which are involved in their proposed system \cite{15,16,17,19,20,24}. And authors in \cite{15,20,21} present some taxonomy for fog computing platforms by considering various use-cases and applications. But most interestingly, and importantly, we have not seen any research work where researchers have explicitly presented some general ontology for a complete fog computing platform, though we found a couple of research works where researchers have given some classifications and taxonomy for such platforms and their resources.
\subsection{IoT Platforms}
\label{subsec:iotp}
In this section we survey those research works in the area of the Internet of Things (IoT). We have found several kind of system architectures or managerial issues in the IoT paradigm to solve the different challenges in this platform by considering different application and use-cases. Interestingly, in these scenarios, from the system architectures and their interactions with the system resources, the researchers propose their views, taxonomy, classification and ontology for the IoT resources. Like in \cite{10,25,26,27,28,29,30,31}, where these researchers propose their system architecture for IoT platforms, but also discuss on the various kind of resource model for this paradigm. In addition, to know a system better, it is essential to know the features and behaviors of the system resources, such in \cite{10,14,25,27,28,30,32,33,34,35}. We have also found that, in some other the works \cite{27,29,30,31,32,33,34}, researchers have given their concern to efficiently manage the IoT system resources. Finally, and more interestingly, we have found some research works \cite{14,27,32,36} where researchers propose explicitly some classification or taxonomy by considering different parameters, and some other \cite{25,26,36}, where the authors discuss on the ontology of the IoT paradigm. So, in the next few paragraphs, we present the various research works related to the IoT paradigm resources classification.\\
\subsubsection{Al-Fuqaha et al.}
The authors in \cite{10} propose a new system architecture for the IoT paradigm. According to the authors, their IoT architecture has five layers: the objects layer, or perception layer, represents the physical sensors of the IoT that aim to collect and process data; the object abstraction layer, transfers data from the objects layer to the service management layer through secure channels; the service management layer, or middleware (pairing) layer, pairs a service with its requester based on addresses and names; the application layer, provides the services requested by customers; and the business layer, or management layer, which manages the overall IoT system activities and services. The IoT communication technologies connect various objects to deliver specific smart services; for example, WiFi, Bluetooth, IEEE 802.15.4, Z-wave, and LTE-Advanced are used in IoT for the communication. In summary, communication technologies and protocols involved in their system resources can be easily identified. In addition, they implicitly mention the attributes and features of their system resources by focusing and discussing the challenges and QoS criteria of the considering system and resources.
\subsubsection{Zhang amd Meng}
Authors in \cite{25} propose a multi-dimensional ontology-based IoT resource model. According to them, the resource model is the combination of the layer structure of IoT, the system architecture, and an ontological presentation and dimensional features of the elements. In their research work, they classify the IoT world into three parts: entity, service, and resource. The entity is the owner or user of resources, such as program, protocol, person, or device. The service is defined as an intermediary between the entity and the resource, which contains IOPE (input, output, precondition, and effect) information, global context information, interface, and specific resource set. And resource is the owner of information. They define the IoT resource model as a combination form of the layer structure, the ontology presentation, and dimensional features of IoT resource elements. The most important contribution of this research work is the ontological representation of the IoT resource model. By presenting such ontology, the researchers analyze the multi-dimensional features of IoT resources.
\subsubsection{Wang et al.}
In \cite{26}, the authors present an Ontology-based Resource Description Model (ORDM) where things in IoT refer to any devices and equipment with functions of perception, control, and processing. They propose things to consist primarily of kinds of sensors, actuators, tags, etc. Their ontology-based resource description model considers the following five classes: attribute, state, control, history, and privacy. The description contents for the IoT devices are classified by examining several aspects such as inherent information of IoT devices containing the classification, property and interface information; working state, acquisition, feedback and stored history information; and the authentication and privacy information of the IoT devices. After presenting their ontology model, they consider a use-case of smart office in order to create a unified resource description for all of the IoT resources. Finally, they discuss on different business related functions for IoT devices.
\subsubsection{Gubbi et al.}
According to the authors in \cite{27} an IoT system can be seen from two perspectives: Internet-centric and Thing centric. In their IoT framework, they considered the WSN (the Network of Things) to reside in the bottom layer. In the middle layer there is the cloud computing platform, and on the top of the layer all the applications that have been running and supported by the WSN and cloud computing layers. The authors identify three components in the IoT paradigm which enables the ubiquitous computing: the hardware, made up of sensors, actuators, and embedded communication hardware; the middleware, consisting on on-demand storage and computing tools for data analytics; and the presentation, consisting of easy to understand visualization and interpretation tools, which can be widely accessed on different platforms. Following up this work we can extract an IoT resources model and identify the attributes and behaviors of the IoT resources.
\subsubsection{Zhao et al.}
In this paper \cite{28} the authors address the demand for making a solution of resource matching and selection in the IoT paradigm. They observed that IoT resources mostly have limited computation capabilities and their exposing resources often operate in dynamic environments. Compared to Web services, the IoT resources are less reliable, their logic is much more straightforward, and their outputs usually represent the observation data of feature-of-interests associated with physical objects. They propose a multidimensional semantic resource model. According to this, each dimension constitutes an ontology model, which includes the well-defined hierarchy, descriptions, and restrictions of the corresponding dimension. Based on this resource model, the semantic matching could accurately measure the similarity of each dimension between resources in parallel, where users are able to aggregate the measurement values of different dimensions according to their preferences. Resources in their model can be RFID tag, sensor, and actuator. We can identify the classification of IoT elements for their considering system paradigm.
\subsubsection{Haller et al.}
In \cite{29} the authors present a domain model of IoT which is providing the template and structures, made by the analysis of various use-cases. According to them, the domain of the IoT can be classified into five core components: the augmented entity (a combination of virtual and physical entity), the user, the device (hardware elements to interact with real-world objects), resources (computational elements), and services. A device is a piece of computing hardware and, more specifically, it is the superclass of that kind of hardware which enables the IoT facilities by establishing the connection between the physical world and the digital world. Resources are considered as the software components, which implement some particular type of functionalities, and can be hosted on a device or anywhere in the network. And services are some specific type of functionality which exposes the standard interfaces and that can be invoked by the users. They show how their IoT domain model can be implemented in a system domain. So considering this work, we can understand the resource definition for their proposed IoT domain and, therefore, get a clear idea about the IoT resources classification.
\subsubsection{Sanchez et al.}
The authors in \cite{30} describe an architectural reference model for open real-world IoT experimentation facilities, as defined in the SmartSantander project. Their architecture is a three-tiered structure, consisting of an IoT device tier, an IoT gateway tier, and a server tier. IoT objects are providing sensing services, and they are capturing and producing data continuously. The IoT model needs to work with some higher storage and computing platform, like cloud computing or fog computing, in order to process and manage those data. Their reference model for IoT system architecture supports three main functional features: experiment support, platform management, and service provision. Considering their use-cases and test-bed implementations, and by following various aspects and management issues, they proposed a taxonomy for the IoT resources in their platform, where these resources can be initially classified into three category, named portal server, gateway, and IoT node. Furthermore, they have classified these three categories according to their host capabilities, type of experiment, service type and participation.
\subsubsection{Kantarci and Mouftah}
In our literature survey we found that some researchers have also considered the cloud computing systems to define the system architecture for IoT, such as in \cite{31}. Specifically, in this research paper they consider a cloud-centric IoT system, which can leverage the efficiency of several applications like as smart health-care, smart transportation systems, smart cities, etc. They propose a cloud platform in a cloud-centric IoT architecture to provide storage resources for aggregated sensing data, as well as computing resources for data analytics and data mining during information retrieval and knowledge discovery on sensing data received via IoT objects. They classify the existing methodologies to address the sensing-as-a-service in the cloud-centric IoT paradigm. According to their proposal, they categorize their quests into three categories: the service provider base search, the GPS-less sensing/scheduling, and the service provider recruitment. Then, the authors address the various research challenges of existing methodologies in a cloud-centric IoT paradigm. In this research work, the authors do not explicitly propose any resources classification or taxonomy for their system paradigm, but when considering the sensing technology, they have defined some sort of classification for their system resources.
\subsubsection{Ahmed et al.}
In this research work \cite{14}, the authors discuss on different kind of networking technologies involved in smart environments, and provide a comparison table between different communication technologies. According to them, WiFi, 3G, 4G, and satellite are the key wireless technologies, where WiFi is mainly used in smart homes, smart cities, smart transportation, smart industries, and smart building environments; 3G and 4G are mostly used in smart cities and smart grid environments; and satellites are used in smart transportation, smart cities, and smart grid environments. In this paper, the authors also discuss on various IoT based smart environments. Considering and following some use-cases, they found some parameters to create a taxonomy for the IoT platform. This taxonomy is based on the following parameters: communication enablers (WiFi, 3G, 4G, satellite), network types (WLAN, WPAN, WAN, MAN, WRAN), technologies (sensing, communication, data fusion, emerging computing, information security), wireless standards (IEEE 802.11, IEEE 802.15.1, IEEE802.15.4), objectives (cost reduction, improve utilization, proactive maintenance, minimal user interaction), and characteristics (prediction capabilities, new enhanced services, remote Monitoring, decision-making capabilities). In this paper, the researchers present a taxonomy for the smart environment, which can be used for making some classification and taxonomy for resources of the IoT paradigm.
\subsubsection{Rayes and Salam}
In this work \cite{32}, the authors characterize the IoT sensing device with three components: the sensor, The microcontroller, and the connectivity. They define eleven types of sensor that can be attached to an IoT platform: temperature, pressure, flow, imaging, fluid level, noise, air pollution, proximity and displacement, infrared, moisture and humidity, and speed sensor. Another way of capturing information from “things” is through the use of RFID, a mechanism to capture information pre-embedded into the so-called tag of a thing or an object using radio waves. It consists of two parts: the tag and the reader. And video tracking is another mechanism to identify and monitor “things”, when sensors and RFID tags are not available. It can also be used in conjunction with sensors and/or RFID to provide a more comprehensive solution. They also classified the actuators, as electrical, mechanical linear, hydraulic, pneumatic, and manual actuators.
\subsubsection{Bermudez-Edo et al.}
The authors in \cite{33} describe IoT concepts in three classes: objects, system or resources, and services. They also classify the IoT devices as sensing devices, actuating devices, and tag devices. From our interest, the most important contribution of this paper is the IoT-Lite ontology, created to be used with a common quantity taxonomy, qu-taxo, to describe the units and quantity kind that IoT devices can measure. This taxonomy is represented by individuals in the ontology and is based on other well-known taxonomies such as qu and qudt. Similarly, some other classes, such as object, service, or attribute, can be linked to a vocabulary to choose the terms from a set of individual and existing concepts. Their proposed ontology is based on Semantic Sensor Network Ontology (SSNO), and they claim the IoT-Lite ontology to be a lightweight version of SSNO.
\subsection{Cloud Computing Platforms}
\label{subsec:ccp}
Cloud Computing is an architectural model that leverages on-demand provisioning and management of computing, and which defines the set of good practices for building an elastic and dynamic set of computing resources to be delivered as a service. In this section, we follow those research works done around the cloud computing paradigm. In this survey we have found that there are more researchers focusing on providing some taxonomy and ontology for cloud resources \cite{4,34,35,36,37,38,39,40,41}, cloud resources management \cite{39,42,43}, and cloud services \cite{37}. However, some researchers have also focused on discussing the cloud paradigm architecture and service models, or identifying the challenges for cloud computing. In the following paragraphs we present the various research works around the cloud paradigm.\\
\subsubsection{Weerasiri et al.}
In \cite{34} the authors present a taxonomy for cloud resources management techniques over the life cycle phases, services and processes, which they call the cloud resource orchestration. They define five dimensions to present the taxonomy for cloud resource orchestration techniques, which are: Resources (resource types, resource entity model, resource access method, resource representation notation), Orchestration Capabilities (primitive actions, orchestration strategies, language paradigm, cross-cutting concern), User Layer (DevOps, application developers, domain experts), Runtime Environment (virtualization technique, execution model, target environment), and Knowledge Reuse (reused artifact, reuse technique). In addition, the cloud providers enable the virtualization techniques through the three categories of cloud resources: infrastructure, platform, and software (as-a-Service). They propose the resource entity to be considered either as an elementary model, where resources do not confide on any other cloud resources, or as a composite model, where cloud resources bring together other elementary resources and also the composite resources to make a significant form of cloud resources. In a cloud computing paradigm, the virtualization technology plays a pivotal role to manage the system and its resources.
\subsubsection{Youseff et al.}
In this paper \cite{35}, the authors present an ontology for the cloud computing paradigm. This has been classified into five layers, such as Applications, Software Environments, Software Infrastructure, Software Kernel, and Hardware. The authors also propose that services offered in the cloud software infrastructure layer could be classified into three part, which are computational resources, data storage, and data communications. The authors also propose the authors propose a pricing model for the cloud computing paradigm, which can be considered into three forms: tiered pricing, per-unit pricing, or subscription-based pricing. In this work, the authors also discussed the various challenges related to the cloud computing paradigm. As per our survey objective, presenting the cloud ontology is the most important contribution of this research work.
\subsubsection{Pittaras et al.}
The authors in \cite{36} propose a distributed resource discovery scheme for multi-cloud infrastructure. They argue that various cloud service providers have their own model to describe cloud resources so, enabling the peers of this multi-cloud architecture requires coming up with a common ontology. They propose the Infrastructure and Network Description Language (INDL) in order to describe the network and infrastructure of a multi-cloud architecture. According to this model, resources are presented as a node (VirtualNode), node components (processor component, memory component, storage component, and switching component), and network element (link, interface). Their main motivation for this research work is allowing a large number of different resource providers, where each peer consists of a resource provider and a resource information service. They also propose their solution to discover the resources among the distributed and heterogeneous resource providers, and this solution also handles dynamic resources status updates and supports infrastructure abstraction policies through use of the semantic web technology. Following this work we can identify the cloud resource components and role of the resource owner, so that might help us to fulfill our interests.
\subsubsection{Zhang et al.}
In \cite{37} the authors present an OWL-based cloud ontology (CoCoOn) which describes the functional and non-functional concepts, attributes and relations of infrastructure services in the cloud computing paradigm. According to them, cloud resources can be classified as Infrastructure-as-a-Service (IaaS), Platform-as-a-Service (PaaS), and Software-as-a-Service (SaaS). They have further classified in their proposed ontology the IaaS resource layer into compute (virtualization), network, and storage (network storage). The authors also propose a system model for CloudRecommender, which can estimate costs and compute saving costs across multiple cloud service providers. In this work, the authors have defined the classification of their system resources, which is of great interest in this survey.
\subsubsection{Arianyan et al.}
In this paper \cite{4}, the authors propose a taxonomy for the cloud computing paradigm. They describe a model to evaluate the cloud products and calculate some value to make some ranking of the products. Their proposed taxonomy model is named the Hierarchical Cloud Taxonomy Engine (HCTE), where they categorize the cloud products into eight major groups, which are deployment model (implementation model, platform model, connectivity), technical features (platform, virtualization, software, hardware support, resource location, standard, billing system, limitation, green computing support), security features (security level, data safety, data removal, incident notification, security monitoring, security in virtual layer, access control, access report), services features (service types, service mobility area, service compatibility, service dependability, user friendliness, service group model, user category, service portability, QoS features), management features (architecture, management support, policies enforcement, SLA monitoring, service orchestration and automation, events management and user report), financial features (charging model, price policy support, payment model, service price evaluation tools), backup and recovery model (data backup, system backup, data after termination, termination alarm, automatic recovery system), and legal aspects, guarantee and support (license type, support policy, support agility, guarantee type, update, language, law enforcement and regularity compliance, popularity). Here the researchers have further classified the deployment models of cloud computing considering the implementation (Private, Public, Hybrid), the platform (distributed or single), and connectivity (full mesh, star, hierarchical). Based on their proposed taxonomy, they present some equations to calculate the score for cloud products so that they can make some cloud product ranking table.
\subsubsection{Fernando et al.}
Researchers in \cite{38} present a new type of cloud computing paradigm, which is mobile in nature. They provide an extensive survey of mobile cloud computing platforms considering various driving issues for the necessity of the mobile cloud computing paradigm. In addition, they present a taxonomy for mobile cloud computing platforms based on the following items: operational issues (offloading method, cost-benefit analysis, mobility management, connection protocols), end user-level issues (incentives, presentation, usability), service and application level issues (application, performance, cloud APIs), privacy, security and trust (general cloud security, mobile cloud security, privacy), context-awareness (service provisioning, risk assessment, resource and common goal identification, energy awareness), and data management (personal data storage on mobile cloud, data access issues, data portability and interoperability, embedded mobile databases). Based on the proposed classification the authors identify the challenges of the mobile cloud computing platform. Though the researchers have not explicitly mentioned the classification or taxonomy for their system resources, this can be extracted from their contributions.
\subsubsection{Singh and Chana}
In this paper \cite{39}, the authors present an extensive survey on resource scheduling and management in the cloud paradigm. They have also classified the cloud resources into two main categories, software resources (application, component service), and hardware resources (processor, network, storage). Resource management in cloud includes two stages, cloud resource provisioning and properly schedule the cloud resources. In this paper, the authors have also focused on the various mapping technology, a different way of resource execution and monitoring strategy. Following the different surveyed research works, they identify lots of challenges in cloud resource scheduling and, also, they discuss the benefits of the cloud resource scheduling techniques. They provide a clear resource classification and, also, we can extract additional resource behaviors from their work.
\subsubsection{Jennings and Stadler}
The authors in \cite{40} revisit several research works in cloud computing and classify the cloud resources into different types. They propose four types, such as compute resources, storage resources, networking resources, and power resources. They also divide the cloud computing paradigm into two models, the service model and the deployment model. The service model can be classified as Infrastructure-as-a-Service, Platform-as-a-Service, and Software-as-a-Service, and the cloud deployment model can be classified as private, public, hybrid, and community. In this paper, the authors provide an extensive survey of resource management strategies, and identify different research challenges for managing the resources in the cloud paradigm. From their contribution, not only we recognize the classification of their system resources, but we can also identify the behaviors and features of their system resources.
\subsubsection{Moscato et al.}
In this paper \cite{41}, the authors define an ontology by identifying the various challenges and problems in the multi-cloud federation structure. The fundamental classes of their ontology are protocol, layer, service models, cloud system visibility, essential characteristics, component, technology, deployment models, framework, actor, property, common state, language, SLA, and abstraction. In their ontology, the resource class is the most complex and, following the Open Cloud Computing Interface (OCCI) specifications, they assume that everything in the cloud system is a cloud resource. In addition, by quoting the National Institute of Standards and Technology (NIST), they classify the cloud computing architecture in five essential characteristics (on-demand self-service, broad network access, resource pooling, rapid elasticity, and measured service), three service models (IaaS, PaaS, SaaS) and four deployment models (public, private, community, and hybrid cloud). They also define the cloud roles at different levels, as service provider, consumer, broker, auditors, and carriers. And finally, by identifying the necessity of cloud federation among the different cloud service providers, the authors propose a federated cloud computing architecture, which they call the mOSAIC Architecture.
\subsubsection{Parikh et al.}
In this research work \cite{42}, the authors classify the cloud resources based on the following utilities: fast computation utility (processor, memory, algorithms, operating system, APIs), storage utility (hard drive, flash drive, database softwares, database servers), communication utility (physical, logical), power / energy utility (cooling devices, UPS), and security utility (trust, authentication, integrity, privacy, availability). Based on this utility based classification, they propose the cloud resource management taxonomy and make some comparison among several cloud resource management algorithms. According to the authors, the cloud computing paradigm has been composed of three kinds of service models (SaaS, PaaS, IaaS) and four types of deployment models (private cloud, public or hosted cloud, community cloud, and hybrid clouds).
\subsubsection{Mustafa et al.}
In \cite{43}, the authors extensively survey several research works about resource management strategies for the cloud computing paradigm. The authors present the service and deployment models, which can be classified as IaaS, PaaS and SaaS for the service model, and private, public, and hybrid for the deployment model. They also propose a taxonomy for cloud resource management strategies, classifying them as energy-aware, SLA-aware, market-oriented, load balanced, network load-aware, resource management for hybrid cloud computing platform, and resource management on mobile cloud platform. The authors also discuss on each classification of their proposed taxonomy, addressing the different strategies for managing the cloud resources. Though the researchers have not explicitly mentioned the classification, taxonomy and ontology for their system resources, we can implicitly obtain the parameters and aspects for classifying their resources.
\subsubsection{Botta et al.}
The authors in \cite{44}, provide an extensive literature survey for the cloudIoT platform by following up two different predominant and popular technologies: cloud computing and IoT. They identify the driving forces for the integration of both technologies by considering several use-cases and applications, and present an architecture for a cloud-IoT platform. The authors also present the service model as IaaS, PaaS and Saas, and the cloud deployment model as private, public, hybrid, and community. After following up some use-cases and applications, they identify several challenges in the cloud-IoT paradigm regarding big data, security, intelligence, network communication, pricing, and SLA enforcement, among others. From this paper we can implicitly extract some attributes, behaviors and features of their system resources, and determine the parameters for classifying their system resources.
As a summary of this category, we have found a couple of research works focused to identifying the characteristics of the cloud computing paradigm \cite{44,45}. We have also found, in \cite{35}, that the researchers have presented some basic concepts for the definition of a pricing model for cloud. There are lots of research works which identify the challenges and issues for the cloud computing platform \cite{38,39,40,41,42,43} and, most importantly, we have found that lots of work have been focused to manage the cloud resources and services \cite{34,37,39,40,42,45}. In this survey, we observed that most research works have been oriented to presenting the cloud computing system architecture and the cloud deployment and service models.
\subsection{Platforms of Related Technologies}
\label{subsec:ocp}
In the previous subsections, we reviewed those research works in the areas of fog computing, IoT, and cloud computing. However, there are still several other works not directly related to those areas, but close to them, which could somehow enhance the findings obtained from our main objectives. So in this section we are going to focus on some research work focused on the following platforms: grid computing, wireless sensor networks (WSN), and mobile edge computing, among others. As our primary intention is to identify the classification, taxonomy and ontology of system resources of various computing paradigms, in this literature survey we have put our focus on those works where researchers have given more concern to identify the resource classification and propose some taxonomy, and following on the architectural and managerial issues of those systems.\\
\subsubsection{Karaoglanoglou and Karatza}
In \cite{46}, the authors identify and discover the appropriate resources in a grid system. They argue that resource discovery in a large-scale grid system is a challenging job, so designing a proper resource catalog would help finding the adequate resources as per the users request. Grid resources are heterogeneous and shared among different organizations, and these resources range from networks, clusters of computers, memory space or storage capacity, computational power (CPU time or CPU cycles), data repositories, attached peripheral devices, sensors, software applications, online instruments, and data. In their grid system, they categorize resources into several levels through a simple matchmaking framework, ranging from limited to powerful capabilities. By considering the memory and storage capacities of grid resources, they define a simple category-table. Then they evaluate the performance of their resource discovery scheme, by considering three parameters: the available disk size, memory space, and the distance in hops a request must travel until it gets satisfied.
\subsubsection{Kaur}
The author in \cite{47} presents a semantic-based resource discovery mechanism for grid environments, considering the grid resource information and usage policies of grid resources. According to the author, \textit{grid is a platform, which consists of a significant amount of distributed and loosely-coupled resources over geographically dispersed locations that equipage together to satisfy the user job/application requirements}. The spread resources in grid form the Virtual Organization (VO), which represents the standard rules to enable sharing and selection. After following different related work, in this paper the author presents a system architecture for grid platform by focusing on the semantic resource discovery scheme, policy matchmaking system, and also the policy aggregator of the grid system. The author also presents an ontology to describe the grid resources. The grid resource information properties consists of the information about operating system type, kernel version, processor speed, number of nodes, RAM speed, hard disk space, storage space, information about the applications, information about the policies, information about the various software, and information about the network.
\subsubsection{Qadir et al.}
In this paper \cite{48}, the authors present a collective overview of the programmable wireless network platform. By following up different application scenarios they presented some challenges in wireless programmable networking system and proposed some new ideas and directions to build the new programmable wireless networking platform. They identified some common trends in programmable wireless networking platforms, and classified some trends for the platform architecture specification, as follows: trends in software-defined wireless networking platform, trends in cognitive wireless networking platform, trends in virtualizable wireless networking platform, and trends in cloud-based wireless networking platform. By analyzing this work we can identify most wireless technologies involved in their system and understand the features, attributes and behaviors of their system resources.
\subsubsection{Oteafy and Hassanein}
Authors in \cite{49} present a novel paradigm in WSN in order to utilize the network resources efficiently. They argue that their proposed architecture is cross-platform, and different applications can use the resources of their proposed WSN platform. Their proposed paradigm is presented in three phases, the resource abstraction and representation, the application representation as a finite set of functional requirements over these resources, and an optimal mapping approach to assigning applications (their functionalities) to the available resources across existing WSNs. In order to identify the primary relations between the IoT and the WSN paradigms, they discuss the various heterogeneous connectivity issues in IoT platform, and also the various dynamic applications working on the WSN platforms. They say that they \textit{introduce an abstraction of all components in a WSN, including ones with confined temporal properties (i.e. resources “passing by”), and extend the definition to encompass IoT components that add to its resource pool (e.g. cell phones, municipal antennas, objects with different access networks, etc.)}. In their paper, the authors considered the sensor nodes and IoT objects as resources, and then they present the core attributes of the resources.
\subsubsection{Ahmed and Ahmed}
In \cite{50}, the authors discuss a particular type of distributed platform, called mobile edge computing (MEC), where computation and processing is usually done in the edge devices. In this paper, the authors identify the taxonomy of mobile edge computing by considering the following parameters: characteristics (proximity, dense geographical distribution, low latency, location awareness, network context information), actors (application developers, content provider, mobile subscribers, OTT players, MEC service provider, software vendors, network equipment vendors), access technologies (Wi-Fi, 3G, 4G, 5G, Wi-Max, Bluetooth), applications (computational offloading, collaborative computing, web content optimization, memory replication, content delivery), objectives (minimize latency, minimize energy, minimize cost, maximize throughput, minimize radio utilization, optimize computational resource), computational platforms (cloud, MEC server, mobile node), and key enablers (cloud and virtualization, high volume servers, network technologies, software development kits, portable devices). They also focused on the pricing model, the scalability, and security. After presenting the taxonomy of the MEC platform, the authors conclude that there are lots of research opportunity to standardize the communication protocol in the MEC paradigm.
\subsubsection{Lee and Hughes}
In this paper \cite{51}, the authors present a new direction of WSN platforms, which strives towards a shared architecture and multi-application paradigm. They introduce a new vision for sensor network paradigm, named tangible cloud, and present the reference architecture and pricing model for this paradigm. They argue the use of an open interface enables resources of the tangible cloud to work with the existing cloud tools, and that makes the tangible cloud resources more inter-operable with the WSN. Following up some use-cases, they propose a reference architecture for their platform, considering the Tangible Infrastructure as a Service, Tangible Platform as a Service, and Tangible Software as a Service. They also introduce the pricing model for their tangible cloud reference architecture. From their contributions we can extract the parameters for classifying their system resources.
\subsubsection{Sharifi et al.}
In \cite{52}, the authors identify the taxonomy of cyber foraging of mobile devices, where computations are done in a powerful non-mobile computation device close to the mobile device. In order to successfully offload a program from a mobile device to a surrogate device, some key metrics should be considered, such as mobile and surrogate specifications, application specifications, network specifications, and context specifications. They also present the taxonomy of cyber foraging approaches by considering the following parameters: offloading type (static, dynamic), surrogate type (static computer, mobile device, cloud), offloading scale (single surrogate, multiple surrogate), live migration, solver location (surrogate, mobile device), code availability (pre-installed RPC, virtual machine, code offloading), offloading granularity (fine-grain application partitioning, coarse-grain whole application migration), parameter of decision (energy, memory, storage, CPU, latency, I/O, responsiveness), and data availability (already available, data offloading from mobile device, transfer from previous surrogate or Internet).
\section{Analysis and Discussion}
\label{sec:ana}
In this section we present a table that summarizes the classification features addressed in the aforementioned 45 research projects and, then, after analyzing the global picture, we present and discuss our findings.
\subsection{Summary of Contributions}
\label{sec:soc}
In our literature survey we have observed that each researcher has different interests and objectives when defining, or suggesting, their resources classification or taxonomy. Some of them from a system architecture perspective and according to their platform scope (cloud, fog, IoT, etc.), some others from a resources and services management perspective, or some others concerned about understanding the system behaviors and features, and addressing the various challenges of those systems. So we have identified the parameters suggested in all surveyed research works, organized, and assessed them according to the following categories:
\begin{itemize}
\item Hardware: Processor, Memory, Storage, Power, GPU, and FPGA
\item Software: Operating System, Application and APIs, and Database Product Information
\item Network: Bandwidth, Technology and Standards, Applicable Networking System, Communicating Techniques, and Deployment Model
\item Security: Authenticity, Intrusion, Privacy, Trust, Encryption, Denial of Service Attack, Identification, Accountability, Confidentiality, and Authorization
\item Data: Source and Owner, Type and Size, Content Format, Analysis Type, Processing Framework or Infrastructure
\item IoT: Type of Sensors, Actuators, and RFID tags
\item Cost: Computation, Communication, and Deployment
\item Features and Behaviors: Scalability, Fault-Tolerance, Location-Awareness, Availability, Agility / Real-Time, Autonomy, Mobility, Multi-Tenancy, Reliability, Context Information, Programmability and Virtualization, Ubiquitous, Heterogeneity, On-Demand, Geo-Distribution, Flexibility / Interoperability, Transparency / Openness, and Proximity
\item Management: Latency, Power, Data, Network, Cost, Application, Computation, Operational, Service, Policies, User-Actor, and SLA
\item Use-Cases or Applicable System: Type of Use-Cases
\end{itemize}
Then, considering the upper mentioned parameters, we have built the Table 1, where all the fields for these categories (rows in the table) have been filled up according to the description of each research work (columns in the table). The box corresponding to each category which is addressed in the corresponding research work has been shadowed, so providing a graphical snapshot of what categories are more relevant for the different research areas and, therefore, allowing the extraction of many valuable findings, as presented in the next subsection.
\begin{figure*}
\centering
\includegraphics[width=\textwidth,height=\textheight]{image/1__1_.pdf}
\label{lab:image}
\end{figure*}
\subsection{Discussion of Contributions}
\label{sec:synop}
After analyzing the table, different synoptic findings can be extracted. We have organized these findings following the same categories used to organize the table, which are: Hardware related findings, Software related findings, Networking related findings, Security related findings, Data related findings, IoT devices related findings, Cost related findings, Features related findings, and Management related findings. Next, we present each of these findings.
\textbf{Hardware related findings}. We have observed that most researchers in the fog computing and IoT based research works are concerned about an efficient power management. This has sense, since many small devices at the edge (for instance, smartphones) as well as many sensors, are battery powered. In addition, except for the IoT based research works, almost every other project focuses on the hardware components (i.e., processor, memory, storage). Interestingly, we have only found three papers \cite{10,23,44} where researchers consider other hardware components, such as GPU and FGPA, to represent the characteristics of their considered computing platform.
\textbf{Software related findings}. With respect to the software related issues, we have found that software is not important in most IoT based research. Exceptionally, only in a couple of these works \cite{29,30}, the authors have considered the APIs involved in their system resources in order to create a catalog of services. Conversely, this attributes category gains relevancy in the cloud related systems, where the software to be classified and organized becomes more diverse. It is also relevant for some fog computing-based research works \cite{16,18,19,21} where researchers are concerned about identifying the various heterogeneous OS, apps, and APIs involved with the fog and edge devices.
\textbf{Networking related findings}. The network related attributes are interesting, mainly, for fog and edge computing research works, with main concern about network bandwidth management. As the variety in fog and IoT devices is great, many researchers are focused on identifying the standards and protocols for these paradigms. We also found that in some papers, such as \cite{14,15,17}, they discuss various types of networking devices (switches, routers, set-top boxes) in order to present their system architecture. But most interestingly, we have observed that some cloud-based research works are also interested in network bandwidth in order to manage cloud resources \cite{34,43,45}, and discovering resources \cite{36} or services\cite{37}.
\textbf{Security related findings}. The most relevant security attributes addressed are authenticity, privacy, trustiness, and confidentiality. In addition, with respect to the security category, most research works are either concerned in several security aspects, or in none. It is also worth noticing that the DOS attack is only considered as an eventual security challenge in one research paper from the fog computing paradigm \cite{15}. In any case, from this literature survey, security is one of the least addresses set of attributes.
\textbf{Data related findings}. Though data is one of the key components of any computing paradigm, we found that this attribute is one of the least considered. Only in some IoT related research works has been partially considered, addressing concepts such as data source, size, and content type information. One exception is \cite{52} where researchers identify the taxonomy of cyber foraging at mobile devices. According to them, data availability is one of the critical aspects of the cyber foraging technique, and that helps classifying mobile devices in this category.
\textbf{IoT related findings}. This category is expected in most IoT-based research works, as expected. Researchers have discussed on the type of the sensors, actuators, and RFID tags. We have also observed in \cite{21,44} that, to address the connected objects and the cloud-IoT paradigm, researchers have focused to identifying the type of sensors, actuators, and RFID in their systems. In fact, these two papers focus on integrated fog and cloud platforms, so this fact is actually quite natural.
\textbf{Cost related findings}. This category is certainly the one with least interest. It is being considered mainly in cloud based research works. In fact, it is evident that cost is a crucial factor that should be considered before presenting some new proposal for making the cloud much more efficient.
\textbf{Features related findings}. The features and behaviors category includes a variable set of specific attributes. We observe that the cloud computing paradigm has some unique features, such as fault-tolerance, centralization, on-demand, etc; but no concern for transparency and openness, nor geographical-related issues. In other computing platforms (i.e., fog, IoT, grid, and WSN) resources are geographically distributed and near to the edge of the network, so they provide real-time services, and also these systems are very much aware of their working location. We also found that virtualization is mostly related to the fog and cloud computing paradigms.
\textbf{Management related findings}. Management is one category mainly addressed in the areas of fog computing and cloud computing. Within this category, the cloud paradigm seems more interested in features such as cost, operational, and SLA, whereas the fog paradigm is more interested in latency, power management, and data management. Interestingly, in the IoT area there is minimal concern about these attributes.
\section{Conclusion}
\label{sec:conc}
In this paper we have developed an exhaustive survey about the different research works which addresses, somehow, any sort of resources categorization, classification, taxonomy or ontology, in the context of smart environments technology. Although only some authors explicitly use any of these terms in their works, some others propose implicitly some resources classification as part of their system architecture organization or management. We have tried to include all of them in this literature survey. With this survey we pretend to find out the technological challenges and gaps among the different computing paradigms and technologies.
We have observed that each researcher has different interests and objectives when defining, or suggesting, their resources classification or taxonomy. Some of them from a system architecture perspective and according to their platform scope, some others from a resources and services management perspective, or some others concerned about understanding the system behaviors and features. As part of this research work, we have designed and presented a table that summarizes all surveyed works and provides a compact and graphical snapshot of the current classification trends.
The goal and primary motivation of this survey when identifying the resource classification has been to understand the current state of the art and identify the gaps between the different computing paradigms involved in smart environment scenarios. As a result of our survey, we have found that it is essential to consider together several computing paradigms and technologies, and that there is not, yet, any research work that integrates a merged resources classification, taxonomy or ontology required in such heterogeneous scenarios. With these goals as a starting point, we will extend our research with the definition and assessment of a new and comprehensive resources ontology that considers all relevant technological paradigms associated to the smart environments, including fog computing, cloud computing, and the IoT technologies.
\section*{Acknowledgment}
This work was supported by the Spanish Ministry of Economy and Competitiveness
and the European Regional Development Fund, under contract TEC2015-66220-R
(MINECO/FEDER), and by the H2020 EU mF2C project reference 730929.
\ifCLASSOPTIONcaptionsoff
\newpage
\fi
| {'timestamp': '2018-03-02T02:02:54', 'yymm': '1803', 'arxiv_id': '1803.00087', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00087'} | arxiv |
\section{Introduction}
Over the last few years, the need for specific design of kernels for a given data structure has been recognized by the kernel community.
Recently, a Hilbert space embedding for probability measures has been proposed, with applications including dimensionality reduction, independence testing and machine learning.
Therefore the use of specialized metrics and divergences measures in the successful design of dimensionality reduction techniques has been progressively acquiring much recognition. There are numerous real scenarios and applications for which the parameters of interest belong to non-flat manifolds, and where the Euclidean geometry results are unsuitable to evaluate the similarities. Indeed, this is usual case in the comparison of probability density functions.
So, for better results the kernel should be adjusted as acurately as possible to the subjacent structure of the input space.
Kernel on probability measures are very handy for dealing with graph problems, trees, manifolds, acoustic and signal processing and they became very popular because of their many applications.
In probability theory, the distance between probability measures is used in studying pattern analysis see John Shawe Taylor and Mello Cristianini (2004).
Another application is in giving a bounded probability space $\mathcal{X}$ and using the kernel to compare arbitrary sets in that space, by putting e.g the uniform measure on each set. This extremely useful to compare data of variable length,
sequence data in bioinformatics for example, kernel methodes for predictting protein-protein in interactions (Asa Ben-Hur, Willian Stafford Noble 2005).\\
The 20th century witnessed tremendous efforts to exploit new distance/similarity measures for a variety of applications. There are a substantial number of distance/similarity measures encountered in many different fields such as biology, chemistry, computer science, ecology, information theory, geology, mathematics, physics, statistics, etc. Distance or similarity measures are essential to solve many pattern recognition problems such
as classification, clustering, and retrieval problems. Various distance/similarity measures that are applicable to compare two probability density functions.
The advantages of discriminative learning algorithms and kernel machines are combined with generative modeling using
a novel kernel between distributions. In the probability product kernel, data points in the input space are mapped to distributions over the sample space and a general inner product is then evaluated as the integral of the product of pairs of distributions.
Recently, developments in machine learning, including the emergence of support vector machines, have rekindled interest in kernel methods (Vapnik, 1998; Hastie et al., 2001) and take full advantage of well known probabilistic models.
These kernel methods have been widely employed to solve machine learning problems such as classification and clustering. Although there are many existing graph kernel methods for comparing patterns represented by undirected graphs, the corresponding methods for directed structures are less developed.
In particular for domains such as speech and images kernel functions have been suggested as good ways to combine an underlying generative model in the feature space and discriminant classifiers such as SVM. \\
Of particular concern to mathematicians is that several divergence measures are asymmetric. \\
However, in support vector machine classifier, asymmetric kernel functions are not used so far, although they are frequently used in other kernel classifies. \\
In this paper, we suggest an alternative procedure by exploiting the symmetric AB-divergence measures, and present an information theoretic kernel method for assessing the similarity between a pair of directed graphs. \\
In particular, we show that our kernel method provides an efficient tool in statistical learning theory, and SVM have demonstrated highly competitive performance in numerous real-world applications, such as medical diagnosis, bioinformatics, face recognition, image processing and text mining, which has established SVM as one of the most popular, state-of-the-art tools for knowledge discovery and data mining. Similar to artificial neural networks, SVM possess the well-known ability of being universal approximators of any multivariate function to any desired degree of accuracy. \\
\par
The remainder of this paper is organized as follows.
In section 2, we set out the basic notations, the definitions and assumptions.
We will show the close relationship between Hilbert metrics and pd kernels so that in general, stratements for one category can be easily transferred to another. In section 3, we definit a Hilbertian
metrics the Alpha-Beta-Symmetric divergence (ABS-divergence) and the property of this divergence are studied and we are given a corresponding positive
definite kernels. In section 4, the results of the simulations are presented. Therefore we evaluated the performance of the proposed metrics and kernels in tree classifications. And we proposed and apply a algorithm in experimental dataset to analysis the robustness of the divergence proposed. In the last section we presented the conclusion.
\section{Basic Notation and some results}
For a class of Hilbertian metrics, that are metrics which can be isometrically embedded into a Hilbert space. We will also use the following function class to define this subclass of metrics.
\subsection{Hilbertian Metrics, Positive Definite Kernels}
The positive definite kernel $\mathcal{K}(x,y)$ corresponds to an inner product
$\langle \phi_{x},\phi_{y}\rangle_{\mathcal{H}}$ in some feature space $\mathcal{H}$.
The class of conditionally positive definite (cpd) kernel is less well known. Nevertheless
this class is of great interest since SCh\"{o}lkopf show in (P. J. Moreno, P. P. Hu, and N Vasconcelos 2003) that all translation invariant kernel methods
can also use the larger class of cpd kernels. Therefore we give a short summary of this type of kernels and their
connection to Hilbertian metrics.\\
\begin{defn}
A real valued function $\mathcal{K}$ on $\mathcal{X}\times\mathcal{X}$ is positive definite (pd) (resp. conditionally positive definite (cpd)
if and only if $\mathcal{K}$ is symmetric and $\sum_{i,j}^{n}c_{i}c_{j}\mathcal{K}(x_{i},x_{j})\geq0$,for all $n\in \mathbb{N},x_{i}\in \mathcal{X},i=1,...,n$,
and for all $c_{i}\in \mathbb{R},i=1,...,n,$ (resp. for all $c_{i}\in \mathbb{R},i=1,...,n$ with $\sum_{i}^{n}c_{i}=0$).
\end{defn}
The following theorem describes the class of Hilbertian metrics:
\begin{thm} (I. J Schoenberg 1938)\\
A metric space $(\mathcal{X},d)$ can be embedded isometrically into a Hilbert space if and only if
$-d^2(x,y)$ is conditionally positive definite (cpd).
\end{thm}
\begin{lem}\label{lem:are}
(J. P. R. Christensen, C. berg and P. Ressel 1984) \\
Let $\mathcal{K}$ be a kernel defined as $\mathcal{K}(x,y)=\widehat{k}(x,y)-\widehat{k}(x,x_{0})-\widehat{k}(x_{0},y)+\widehat{k}(x_{0},x_{0})$, where $x_{0}\in \mathcal{X}$.
Then $\mathcal{K}$ is pd if and only if $\widehat{k}$ is cpd.
\end{lem}
Similar to pd kernel one can also characterize cpd kernel. Presently one can write all cpd kernel in the form :
$\mathcal{K}(x,y)=\displaystyle\frac{-1}{2}||\phi_{x}-\phi_{y}||_{\mathcal{H}}^{2}+f(x)+f(y)$. The cpd kernel corresponding to Hilbertian (semi)-metrics
are characterized by $f(x)=0$ for all $x \in \mathcal{X}$, whereas if $\mathcal{K}$ is pd it follows that $f(x)=\displaystyle\frac{1}{2}\mathcal{K}(x,x)\geq 0$.
We also would like to point out that for SVM the class of Hilbertian (semi)-metrics is more important than the class of pd kernels.
Namely one can show, (see M. Hein and O. Bousquet 2003), which the solution and optimization problem of the SVM only depends on the Hilbertian (semi)-metric, which is implicitly defined by each pd kernel. Moreover a whole family of pd kernels induces the same metric.
Hilbertian metrics since, using \textbf{lemma \ref{lem:are}}, one can always define a corresponding pd kernel.
Nevertheless for the convenience of the reader we will often explicity state the corresponding pd kernels.
\subsection{Hilbertian Metrics on Probabilitity Measures}
For simplicity, we are dealing with the case of discrete probability measures
on $D=\{1,2,...,N\}$ ,where $1\leq N \leq \infty$. Given a Hilbertian metrics d on $\mathbb{R}_{+}$ it is easy
to see that the metric on $d_{\mathcal{M}_{+}^{1}}$ given by $D_{\mathcal{M}_{+}^{1}}^{2}(P,Q)=\sum_{i=1}^{N}d_{\mathbb{R}_{+}}^{2}(p_{i},q_{i})$
is a Hilbertian metric on $\mathcal{M}_{+}^{1}(D)$. The following proposition extends the simple discrete case to the general case of
a Hilbertian metrics on a probability space
$\mathcal{X}$. In order to simplify the notation we define $p(x)$ to be the Radon-Nikodym
derivative $(dP/d\mu)(x)$ of P with respect to the dominating measure $\mu$.
\begin{prop}
Let P and Q be two probability measures on $\mathcal{X}$, $\mu$ an arbitrary dominating measure of P and Q
and $d_{\mathbb{R}_{+}}$ (where $d_{\mathbb{R}_{+}}$ is the positive part of the real line with 0 included) a $\displaystyle1/2$-homogeneous Hilbertian metrics on $\mathbb{R}_{+}$. Then $D_{\mathcal{M}_{+}^{1}(\mathcal{X})}^{2}$ defined as
\begin{equation}
D_{\mathcal{M}_{+}^{1}}^{2}(P,Q):=\int_{\mathcal{X}}d_{\mathbb{R}_{+}}^{2}(p(x),q(x))d_{\mu}(x)
\end{equation}
is a Hilbertian metrics on $\mathcal{M}_{+}^{1}(\mathcal{X})$. $D_{\mathcal{M}_{+}^{1}(\mathcal{X})}^{2}$ is independent of the dominating measure $\mu$.
\end{prop}
\begin{pro}First we show by using the $1/2$-homogeneity of $d_{\mathbb{R}_{+}^{1}}$ is independent of the dominating measure $\mu$. We have
$$\int_{\mathcal{X}}d_{\mathcal{M}_{+}^{1}}^{2}(\frac{dP}{d\mu},\frac{dQ}{d\mu})d\mu=\int_{\mathcal{X}}d_{\mathcal{M}_{+}^{1}}^{2}(\frac{dP}{d\nu}\frac{d\nu}{d\mu},
\frac{dQ}{d\nu}\frac{d\nu}{d\mu})\frac{d\mu}{d\nu}d\nu=\int_{\mathcal{X}}d_{\mathcal{M}_{+}^{1}}^{2}(\frac{dP}{d\nu},\frac{dQ}{d\nu})d\nu$$
\end{pro}
where we use that $d_{\mathbb{R}_{+}}^{2}$ is $1$-homogeneous. It is easy that $-D_{\mathcal{M}_{+}^{1}}^{2}(\mathcal{X})$ is conditionally positive definite,
simplicity take for every $n \in \mathbb{N},P_{1},....,P_{n}$
the dominating measure $\frac{\sum_{i=1}^{n}P_{i}}{n}$ and use that $-D_{\mathbb{R}_{+}}^{2}$ is conditionally positive definite.
\begin{rem}
It is in principe very easy to build hilbertian metrics on $\mathcal{M}_{+}^{1}(\mathcal{X})$ using arbitrary Hilbertian metrics
on $\mathbb{R}_{+}$ and plugging it into the \textbf{definition 1}.
\end{rem}
But the key property of the method we propose is the independence of the metric $d$ on $\mathcal{M}_{+}^{1}(\mathcal{X})$ of
the dominating measure. That is we have generated a metric which is invariant with respect to general coordinate transformations on $\mathcal{X}$,
therefore we call it a covariant metric.
\subsection{$\lambda$-homogeneous Hilbertian Metrics and Positive Definite Kernels on $\mathbb{R}_{+}$}
In this paper we consider the class of Hilbertian metrics on probability measure, therefore the Hilbertian metrics on $\mathbb{R}_{+}$ is the main element of our approche.
This is the event we requiere that the Hilbertian metrics on $\mathbb{R}_{+}$ is $\lambda$-homogeneous.
The class of $\lambda$-homogeneous Hilbertian metrics on $\mathbb{R}_{+}$ was characterized by Fuglede:
\begin{defn}(Tops$\phi$e 2003) and B.Fuglede 2004)\\
A Hilbertian metrics si $\lambda$-homogeneous if and only if $d^{2}(cp,cq)=c^{\lambda}d^{2}(p,q)$ for all $c\in \mathbb{R}_{+}$ .
\end{defn}
\begin{thm}(B. Fuglede 2004)\\
A symmetric function $d : \mathbb{R}_{+}\times \mathbb{R}_{+}\rightarrow \mathbb{R}_{+}$ with $d(x,y)=0 \Longleftrightarrow x=y$ is a $\gamma$-homogeneous, continuous Hilbertian metrics d on $\mathbb{R}_{+}$
if and only if there existe a (necessarily unique) non-zero bounded measure $\rho \geq 0$ on $\mathbb{R}_{+}$ such that $d^2$ can be written as
\begin{equation}
d^2(x,y)=\int_{\mathbb{R}_{+}}|x^{(\gamma+i\lambda)}-y^{\gamma+i\lambda}|^{2}d\rho(\lambda)
\end{equation}
\end{thm}
Using \textbf{lemma \ref{lem:are} }we define the corresponding class of pd kernel on $\mathbb{R}_{+}$ by choosing $x_{0}=0$. We will see later that this corresponds to choosing the zero-measure as origin of the RKHS (reproducing kernel Hilbert space).
\begin{cor}
A symmetric function $k : \mathbb{R}_{+}\times \mathbb{R}_{+}\rightarrow \mathbb{R}_{+}$ with $k(x,y)=0\Longleftrightarrow x=0$ is a $2\gamma$-homogeneous continuous pd kernel $\mathcal{K}$ on $\mathbb{R}_{+}$
if and only if there exists a (necessarily unique ) non-zero bounded symmetric measure $\kappa\geq0$ on $\mathbb{R}$ such that $\mathcal{K}$ is given as
\begin{equation}
\mathcal{K}(x,y)=\int_{\mathbb{R}}x^{(\gamma+i\lambda)}y^{(\gamma-i\lambda)}d\kappa(\lambda)
\end{equation}
\end{cor}
\begin{pro}
If we have the form given in (2), then it is obviously $2\gamma$-homogeneous and since $\mathcal{K}(x,y)=x^{2\gamma}\kappa(\mathbb{R})$ we have have $\mathcal{K}(x,x)=0\Longleftrightarrow x=0$.
The other direction follows by first noting
that $\mathcal{K}(0,0)=\langle \phi_{0},\phi_{0}\rangle=0$ and then by appying theorem 2, where $\kappa$ is the symmetrized version of $\rho$ around the origin, together with \textbf{lemma \ref{lem:are} }
and $\mathcal{K}(x,y)=\langle \phi_{x},\phi_{y}\rangle=\frac{1}{2}(-d^{2}(x,y)+d^{2}(x,0)+d^{2}(y,0)).$ $\Box$
\end{pro}
Andrezej Cichocki, Sergio Cruees and Shun-ichi Amari (January 2011) proposed an interesting two-parameter family of metrics, the AB-divergence defined:
\begin{defn}
The function $d:\mathbb{R}_{+}\times \mathbb{R}_{+}\rightarrow \mathbb{R}$ defined as:
\begin{equation}
d_{AB}^{(\alpha,\beta)}(x,y)=\left\{
\begin{array}{cccc}
&& -\frac{1}{\alpha\beta}(x^{\alpha}y^{\beta}-\frac{\alpha}{(\alpha+\beta)}
x^{\alpha+\beta}-\frac{\beta}{(\alpha+\beta)}y^{\alpha+\beta}) \hspace{0.2cm}for\hspace{0.2cm} \alpha,\beta,\alpha+\beta\neq 0\cr\\
&&\frac{1}{\alpha^{2}}(x^{\alpha}\log (\frac{x^{\alpha}}{y^{\alpha}})-x^{\alpha}+y^{\alpha})\hspace{0.5cm}for\hspace{0.5cm} \alpha \neq 0, \beta=0 \cr\\
&& \frac{1}{\alpha^{2}}(\log( \frac{y^{\alpha}}{x^{\alpha}})+(\frac{y^{\alpha}}{x^{\alpha}})^{-1}-1)\hspace{0.5cm}for \hspace{0.5cm}\alpha=-\beta\neq0\cr\\
&& \frac{1}{\beta^{2}}(y^{\beta}\log (\frac{y^{\beta}}{x^{\alpha}})-y^{\beta}+x^{\alpha}) \hspace{0.5cm}for\hspace{0.5cm}\alpha=0;\beta\neq0 \cr\\
&& \frac{1}{2}(\log x -\log y)^{2}\hspace{0.5cm}for\hspace{0.5cm}\alpha,\beta=0 \cr
\end{array}
\right.
\end{equation}
where $ d_{AB}^{(\alpha,\beta)}(x,y)$ is a divergence on $\mathbb{R}_{+}$
\end{defn}
\subsection{A brief recall of Support Vector Machine (SVM)}
SVM were developed by Cortes and Vapnik (1995) for binary classification. Their approach may be roughly sketched as follows:
\begin{itemize}
\item class separation: basically, we are looking for the optimal separating hyperplane between the two classes by maximizing the margin between the classes closest points, the points lying on the boundaries are called support vectors, and the middle of the margin is our optimal separating hyperplane;
\item nonlinearity: when we cannot find a linear separator, data points are projected into an (usually) higher-dimensional space where the data points effectively become linearly separable (this projection is relised via kernel techniques);
\item problem solution: the whole task can be formulated as a quadratic optimization problem which can be solved by known techniques etc.
\end{itemize}
An implicit mapping $\Phi$ was used by SVM of the input data into a high-dimensional fearture space defined by a kernel function, the inner product $\langle \Phi (x),\Phi (y) \rangle$ between the images of two data points $x,y$ was returing by the function in the feature space. The kernel function can be represented as
\begin{equation}
\mathcal{K}(x,y)=\langle \Phi (x),\Phi (y) \rangle
\end{equation}
where $\Phi : X\rightarrow H $ is the projection function, this function project x and y into the feature space H.
Relationship between the kernel method and SVM: Sch\"{o}lkopf showed that the class
of cpd kernel can be used in SVM due to the translation invariant of the maximal margin problem in the RKHS, and the kernel can be used in SVM to the classification, the regression etc if we found a good kernel function .
The advantage of kernel method and SVM is that we can found and used a kernel for a problem particular that could be applied directly to data without the need for a feature extraction process.
This was used in (M. Hein and O. Bousquet 2003) to show that the properties of the SVM only depend on the Hilbertian metrics. That is all cpd kernel are
generated by a Hilbertian metric $d(x,y)$ through $\mathcal{K}(x,y)=-d^2(x,y)+g(x)+g(y)$ where $g: \mathcal{X} \longrightarrow \mathbb{R}$ and the solution of the SVM only depends on the Hilbertian metric $d(x,y)$.
\section{Main results}
Generally the AB-metrics is not symmetric. We extend and improve this family an two-parameter symmetric.
The metrics we propose is very interesting since it is a
symmetric and smoothed variant from AB-metrics. This allows us to recover all proprety in Hilbertian
metrics on $\mathcal{M}_{+}^{1}(\mathcal{X})$ from the family of two-parameter.
\begin{thm}
The function $d:\mathbb{R}_{+}\times\mathbb{R}_{+}\rightarrow \mathbb{R}_{+}$ defined as :
\begin{equation}
d_{ABS}^{\alpha,\beta}(x,y)=\left\{
\begin{array}{cccc}
&&\frac{1}{\alpha\beta}(x^{\alpha}-y^{\alpha})(x^{\beta}-y^{\beta})\hspace{0.2cm} for \hspace{0.2cm}\alpha,\beta\neq0\cr\\
&&\frac{1}{\alpha^{2}}(x^{\alpha}-y^{\alpha})\log(\frac{x^{\alpha}}{y^{\alpha}}) \hspace{0.2cm}for \hspace{0.2cm}\alpha\neq 0,\beta=0\cr\\
&&\frac{1}{\alpha^{2}}((x^{\alpha}-y^{\alpha})\log(\frac{x^{\alpha}}{y^{\alpha}})+(\frac{x^{\alpha}}{y^{\alpha}})^{-1}+
(\frac{y^{\alpha}}{x^{\alpha}})^{-1}-2)\hspace{0.1cm}for\hspace{0.1cm} \alpha=-\beta\neq 0\cr\\
&&\frac{1}{\beta^{2}}(x^{\beta}-y^{\beta})\log(\frac{x^{\beta}}{y^{\beta}})\hspace{0.2cm}for\hspace{0.2cm}\alpha=0,\beta\neq 0\cr\\
&&\frac{1}{2}(\log x-\log y)\hspace{0.2cm}for \hspace{0.2cm}\alpha=\beta=0\cr\\
\end{array}
\right.
\end{equation}
is a $\gamma$-homogeneous Hilbertian metrics on $\mathbb{R}_{+}$,note that $d_{ABS}^{(\alpha,\beta)}$ is symmetric.
\end{thm}
\begin{pro}
The proof for the symmetry is trivial because this function is symmetric by construction and $d_{ABS}^{(\alpha,\beta)}(cx,cy)=c^{\alpha +\beta}d_{ABS}^{(\alpha,\beta)}(x,y)$ where $\gamma=\alpha + \beta $ then $d_{ABS}^{(\alpha ,\beta)}$ is $\gamma$-homogeneous. Second for simplicity note that $\mathcal{K}(x,y)=-d^{2}(x,y)$, where $d^{2}$ is a Hilbertian metrics. The all conditions for theorem of Schoenberg satisfied we have $-d^{2}$ cpd.$\square$
\end{pro}
We can now apply the principle to construct Hilbertian metrics on
$\mathcal{M}_{+}^{1}(\mathcal{X})$, of building Hilbertian metrics on $\mathcal{M}_{+}^{1}(\mathcal{X})$ and use the
family of $\gamma$-homogeneous Hilbertian metrics $d_{ABS}^{(\alpha,\beta)}$ on $\mathbb{R}_{+}$.
\begin{defn}
We proposed two ways to build the symmetry divergence:\\ Thype-1 :
\begin{equation}
D_{ABS}^{(\alpha,\beta)}=\frac{1}{2}[D_{AB}^{(\alpha,\beta)}(P,Q)+D_{AB}^{(\alpha,\beta)}(Q,P)]
\end{equation}
Type-2:
\begin{equation}
D_{ABS}^{(\alpha,\beta)}(P,Q)=\frac{1}{2}[D_{AB}^{(\alpha,\beta)}(P,\frac{P+Q}{2})+D_{AB}^{(\alpha,\beta)}(Q,\frac{P+Q}{2})]
\end{equation}
\end{defn}
For the construction ABS-divergence we used the definition above and we apply the \textbf{proposition} (1) from the section(2). We obtain
the symmetric ABS-divergence (Type-1) defined as:
\begin{defn}: Let P and Q two probability measures on $\mathcal{X}$ (probability space) and $\mu$ an dominating measure of P, Q and $d_{ABS}^{(\alpha,\beta)}$ a $\gamma$-homogeneous Hilbertian metrics on $\mathbb{R}_{+}$, then $D_{ABS}^{(\alpha,\beta)}$ defined as:
\begin{equation}
D_{ABS}^{(\alpha,\beta)}(P,Q)=\left\{
\begin{array}{cccc}
&& \frac{1}{\alpha\beta}\int_{\mathcal{X}} (p^{\alpha}-q^{\alpha})(p^{\beta}-q^{\beta})d\mu(x)\hspace{0.2cm}for
\hspace{0.2cm}\alpha\neq0,\beta\neq0 \cr\\
&& \frac{1}{\alpha^{2}}\int_{\mathcal{X}} (p^{\alpha}-q^{\alpha})\log(\frac{p^{\alpha}}{q^{\alpha}})d\mu(x)
\hspace{0.2cm}for \hspace{0.2cm}\alpha\neq 0,\beta=0\cr\\
&& \frac{1}{\alpha}\int_{\mathcal{X}} ((p^{\alpha}-q^{\alpha})\log(\frac{p^{\alpha}}{q^{\alpha}})+
\frac{q^{\alpha}}{p^{\alpha}}+\frac{p^{\alpha}}{q^{\alpha}}-2)d\mu(x) \hspace{0.2cm}for \hspace{0.2cm}\alpha=-\beta\neq 0\cr\\
&& \frac{1}{\beta^{2}} \int_{\mathcal{X}} (p^{\beta}-q^{\beta})\log(\frac{p^{\beta}}{q^{\beta}})d\mu(x)\hspace{0.2cm}for \hspace{0.2cm}\alpha=0,\beta\neq0\cr\\
&& \frac{1}{2}\int_{\mathcal{X}} (\log x-\log y)d\mu(x) \hspace{0.2cm}for \hspace{0.2cm} \alpha=\beta=0\cr\\
\end{array}
\right.
\end{equation}
is a $\gamma$-homogeneous Hilbertian metrics on $\mathcal{M}_{+}^{1}(\mathcal{X})$.
\end{defn}
The ABS-divergence has the following basic properties:
\begin{propr}:\\
\begin{enumerate}
\item Convexity : $D_{ABS}^{(\alpha,\beta)}(P,Q)$ is convex with respect to both P and Q.
\item Strict Positvity: $D_{ABS}^{(\alpha,\beta)}(P,Q)\geq 0$ and $D_{ABS}^{(\alpha,\beta)}(P,Q)=0$ if and only if $P=Q$.
\item Continuity: The ABS-divergences is continuous function of real variant $(\alpha,\beta)$ in the whole range
including singularities.
\item Symmetric: $D_{ABS}^{(\alpha,\beta)}(P,Q)=D_{ABS}^{(\alpha,\beta)}(Q,P)$
\item $\gamma$-homogeneous: $D_{ABS}^{(\alpha,\beta)}(cP,cQ)=c^{\alpha+\beta}D_{ABS}^{(\alpha,\beta)}(P,Q)$
\end{enumerate}
\end{propr}
We used the instrument of building Hilbertian metrics on $\mathcal{M}_{+}^{1}(\mathcal{X})$
and use the family of ($\alpha+\beta$)-homogeneous Hilbertian metrics $d_{ABS}^{(\alpha,\beta)}$ on $\mathbb{R}_{+}$.
This yield as special case the following measures on $\mathcal{M}_{+}^{1}(\mathcal{X})$.
$$ D_{ABS}^{\alpha,\beta}(P,Q)=\int_{\mathcal{X}} \varphi_{\alpha ,\beta}(p(x)q(x))d\mu (x)$$
\begin{center}
\begin{tabular}{|c|c|c|}
\hline
Divergence $D_{ABS}^{\alpha,\beta}(P,Q)$& function $\varphi_{\alpha ,\beta}(p(x)q(x))$& Name\\
& & \\
\hline
$D_{ABS}^{(1,1)}(P,Q)$ & $(p(x)-q(x))^{2}$ & Euclidian\\
& & \\
\hline
$D_{ABS}^{(1/2,1)}(P,Q)$ & $2(\sqrt{p(x)}-\sqrt{q(x)})(p(x)-q(x))$& $V_{1}$-Hellinger \\
& & \\
\hline
$D_{ABS}^{(1/2,-1)}(P,Q)$ & $2(\sqrt{p(x)}-\sqrt{q(x)})\frac{(p(x)-q(x))}{p(x)q(x)}$ & $V_{2}$-Hellingher\\
& & \\
\hline
$D_{ABS}^{(1/2,1/2)}(P,Q)$ &$4(\sqrt{p(x)}-\sqrt{q(x)})^{2}$ & Hellinger\\
& & \\
\hline
$D_{ABS}^{(1,0)}(P,Q)$ &$(p(x)-q(x))\log(\frac{p(x)}{q(x)})$ & Jeffrey\\
& & \\
\hline
\end{tabular}\\
\title{Table (a): $D_{ABS}^{\alpha,\beta}(P,Q)$ divergence}
\end{center}
$D_{ABS}^{(1,1)}$ corresponds to the square of euclidian metric, $D_{ABS}^{(1/2,1/2)}$ corresponds to the Hellinger metric which
is well known in the statistics community, $D_{ABS}^{(1,0)}$ correspond to the Jeffreys metric, $ D_{ABS}^{(1/2,1)}$ $V_{1}$-Hellinger and $D_{ABS}^{(1/2,-1)}$ $V_{2}$-Hellinger is a variant of Hellinger metrics.\\
For completeness we also give the corresponding pd kernels on $\mathcal{M}_{+}^{1}(\mathcal{X})$,
where we take in \textbf{lemma \ref{lem:are}} the zero measure as $x_{0}\in \mathcal{M}_{+}^{1}(\mathcal{X})$.
This choice seems strange at first since we are dealing with probability measures.
But in fact the whole framework presented in this paper can easily be extended to all finite, positive
measure on $\mathcal{X}$. For this, set zero measure is a natural choice of the origin.
\[ \mathcal{K}_{(1,1)}(P,Q)=\int_{\mathcal{X}} p(x)q(x)d\mu(x)\]
\[\mathcal{K}_{(1/2,1)}(P,Q)=\int_{\mathcal{X}} (q(x)\sqrt{p(x)}+p(x)\sqrt{q(x)})d\mu(x)\]
\[ \mathcal{K}_{(1/2,1/2)}(P,Q)=4\int_{\mathcal{X}} \sqrt{p(x)q(x)}d\mu(x)\]
\[ \mathcal{K}_{(1,0)}(P,Q)=\frac{1}{2}( \int_{\mathcal{X}} (q(x)-p(x))\log(\frac{p(x)}{q(x)})-p(x)-q(x))d\mu(x)\]
Using two-parameters is so difficult in practice that is the reason why
we will proposed a one-parameter family to improve the ABS-divergence.
\begin{prop}
The function $d :\mathbb{R}_{+}\times\mathbb{R}_{+}\longrightarrow \mathbb{R}_{+}$ defined as :
\begin{equation}
d_{t}^{2}(x,y)=\left\{
\begin{array}{cccc}
&& \frac{1}{2}(\frac{x^{t}-y^{t}}{t})^2 \hspace{0.5cm} for\hspace{0.2cm}t\neq0 \cr\\
&& \frac{1}{2}(\log x-\log y) \hspace{0.5cm}for\hspace{0.2cm}t=0\cr
\end{array}
\right.
\end{equation}
is a $2t$-homogeneous Hilbertian metric on $\mathbb{R}_{+}$ if $t\neq 0$.
\end{prop}
\begin{pro}
Note that $d_{t}^{2}$ is symmetric by construction and
it's easy verified the property of Hilbertian metric. Therfore we show that: $d_{t}^{2}(cx,cy)=\displaystyle\frac{1}{2}(\frac{(cx)^{t}-(cy)^{t}}{t})^2=\displaystyle\frac{c^{2t}}{2}(\frac{x^{t}-y^{t}}{t})^2=c^{2t}d_{t}^{2}(x,y)$.$\square$
\end{pro}
We used the proposition 1 of building Hilbertian metrics on $\mathcal{M}_{+}^{1}(\mathcal{X})$
and use the family of $2t$-homogeneous Hilbertian metrics $d_{t}^{2}$ on $\mathbb{R}_{+}$.
Therefor we obtain as special case the following measures on $\mathcal{M}_{+}^{1}(\mathcal{X})$.
\[ D_{t}^{2}(P,Q)=\int_{\mathcal{X}} \varphi_{t}(p(x)q(x))d\mu (x)\]
\begin{center}
\begin{tabular}{|c|c|c|}
\hline
Divergence $D_{t}^{2}(P,Q)$& function $\varphi_{t}(p(x)q(x))$& Name\\
& & \\
\hline
$D_{1}^{2}(P,Q)$ & $\frac{1}{2}(p(x)-q(x))^{2}$ & Euclidian\\
& & \\
\hline
$D_{-1}^{2}(P,Q)$ & $\frac{1}{2} (\frac{1}{p(x)}-\frac{1}{q(x)})^{2}$ & S-Euclidian \\
& & \\
\hline
$D_{-\frac{1}{2}}^{2}(P,Q)$ & $2(\sqrt{p(x)}-\sqrt{q(x)})^{2}$ & Hellinger\\
& & \\
\hline
$D_{\frac{1}{2}}^{2}(P,Q)$ &$2(\frac{1}{\sqrt{ p(x)}}-\frac{1}{\sqrt{q(x)}})^{2}$ & S-Itakura Saito\\
& & \\
\hline
\end{tabular}\\
\title{Table (b): Divergence using $2t$-homogeneous Hilbertian metric}
\end{center}
$D_{1}^{2}$ correspond to the square of euclidian metric, $D_{-1}^{2}$ is an other version of euclidian metric,
$D_{1/2}^{2}$ corresponds
two Hellinger mertric. The Hellinger metric is well known in the statistics community.
$D_{-\frac{1}{2}}$ is a symmetrized Itakura-Saito distance (called also the COSH distance) modified.
For completeness we also give the corresponding pd kernels on $\mathcal{M}_{+}^{1}(\mathcal{X})$,
where we take in \textbf{lemma \ref{lem:are}} the zero measure as $x_{0}\in \mathcal{M}_{+}^{1}(\mathcal{X})$.
This choice seems strange at firts since we are dealing with probability measures.
But in fact the whole framework presented in this paper can easily be extended to all finite, positive
measures on $\mathcal{X}$. For this set zero measure is a natural choice the origin.
\[\mathcal{K}_{t}(P,Q)=\frac{1}{2}\int_{\mathcal{X}}\frac{x^ty^t}{t^2}d\mu \]
\[ \mathcal{K}_{1}(P,Q)=\frac{1}{2}\int_{\mathcal{X}}p(x)q(x)d\mu(x)\]
\[\mathcal{K}_{-1}(P,Q)=\frac{1}{2}\int_{\mathcal{X}}\frac{1}{p(x)q(x)}d\mu(x)\]
\[\mathcal{K}_{\frac{1}{2}}(P,Q)=2\int_{\mathcal{X}}\sqrt{p(x)q(x)}d\mu(x)\]
\[\mathcal{K}_{-\frac{1}{2}}(P,Q)=2\int_{\mathcal{X}}\frac{1}{\sqrt{p(x)q(x)}}d\mu(x)\]
\section{Numerical studies}
To show the interest of our study the examples of applications have been proposed. For the SVM we made studies on the classification of the genes and on the sex of the cats knowing the weight of the heart and the body. As regards classification of images, we use our divergencs to separate them into two classes.
\subsection{Application in SVM}
The performance of metrics and kernels has been compared in classification using some data sets.
All data sets were split into a training (80\%) and a test (20\%) set. For the problem we use SVM method. For all experiments we use the one-parameter family $d^{2}_{t}$ of hilbertian metric, the corresponding kernel cpd is $\mathcal{K}=-D^{2}_{t}$ with varying penalety constants $C$ in the SVM, and we use the transformed kernel (gaussian transformation):
\[\mathcal{K}_{t}(P,Q)=\displaystyle e^{-D^{2}_{t}(P,Q)/2 \sigma^{2}}\]
The test error was evaluated by the best parameters $C$ and $\sigma$. The best constant penality $C$ and $\sigma$ was found by cross-validation.
We evaluated the performance of the proposed metrics and kernels in three classification tasks. Firstly we generated a artificiel data and we consider the test error for kernels proposed. Secondly as a real-world application, let us test the ability of SVM to predict the class of a tumour from gene expression data. We use a publicly available datasets of gene expression data for 128 different individuals with acute lymphoblastic leukemia (ALL). Here we focus on predicting the type of the disease (B-cell or T-cell). Therfore we test a SVM classifier for cancer diagnosis from gene expression data, and we test the ability of a SVM to predict the class of the disease from gene expression. Finally we apply the data from support functions and datasets for Venables and Ripley's MASS. We use the anatomical data from domestic cats, the heart and body weights of samples of male and famale cats used for digitalis experiments. The cats were all adult, over 2 kg body weight. We presented the classification error according to the sex of the cats.
The tables shows the test errors for the kernels corresponding to $t=\{-1;-1/2;1/2;1\}$ from the ABS-divergence resp. and their gaussian transformation. The first line shows the kernels directly (dir) and the second line the gaussian transformation (tran).
\begin{center}
\begin{tabular}{|c||c|c|c|c|}
\hline
Divergence & Euclidian & Hellinger & Itakura-Saito & S-Euclidian \\
& error \hspace{0.2cm} C \hspace{0.2cm}$\sigma$& error \hspace{0.2cm} C \hspace{0.2cm} $\sigma$ & error \hspace{0.2cm} C \hspace{0.2cm} $\sigma$ & error \hspace{0.2cm} C \hspace{0.2cm} $\sigma$ \\
\hline
Data \hspace{0.15cm} (dir)&0.0001\hspace{0.2cm} 10\hspace{0.2cm} - & 0.005\hspace{0.2cm} 10\hspace{0.2cm} -- & 0.26\hspace{0.2cm}100\hspace{0.2cm} -- & 0.13\hspace{0.2cm} 10\hspace{0.2cm} - \\
Artificial\hspace{0.15cm}(tran)&0.0001\hspace{0.2cm} 10\hspace{0.2cm} 1.5 & 0.005\hspace{0.2cm} 10\hspace{0.2cm} 0.5 & 0.125\hspace{0.2cm} 100\hspace{0.2cm} 1.5 & 0.17\hspace{0.2cm} 100\hspace{0.2cm} 1.5 \\
\hline
\end{tabular}\\
\title{Table 1: Test error using data artificial}
\end{center}
Table 1 shows that the errors committed using the conditionally defined positive $\mathcal{K}$ and the kernel transformed $\mathcal{K}_t$ are in the same proportion for the Euclidean divergence and the Hellinger divergence with $\sigma= 1.5$ and the constant C = 10 . While for the Itakura-saito divergence the errors committed in the classifications with the $\mathcal{K}_t$ kernel are smaller than that of the $\mathcal{K}$ kernel with $\sigma = 1.5$ and C = 100. So the classification with the transformed core is better than the one used directly. For the S-Euclidean divergence by varying the constant C, C = 10 for the kernel $\mathcal{K}$ and C = 100 for the kernel transforms $\mathcal{K}_t$ , we find that the transformed nucleus offers a better classification result. Thus in all cases we notice that the transformed nuclei give the best results. For the sake of using the transformed nuclei for artificial data.
\begin{center}
\begin{tabular}{|c||c|c|c|c|}
\hline
Divergence & Euclidian & Hellinger & Itakura-Saito & S-Euclidian \\
& error \hspace{0.2cm} C \hspace{0.2cm}$\sigma$& error \hspace{0.2cm} C \hspace{0.2cm} $\sigma$ & error \hspace{0.2cm} C \hspace{0.2cm} $\sigma$ & error \hspace{0.2cm} C \hspace{0.2cm} $\sigma$ \\
\hline
Data"ALL"\hspace{0.1cm}(dir)&0.679 \hspace{0.2cm} 10 \hspace{0.2cm}-& 0.414\hspace{0.2cm} 10 \hspace{0.2cm} - & 0.257 \hspace{0.2cm} 10 \hspace{0.2cm} - & 0.461 \hspace{0.2cm} 10 \hspace{0.2cm} - \\
gene \hspace{0.4cm}(tran)&0.0234\hspace{0.2cm} 10 \hspace{0.2cm}0.5 & 0.156\hspace{0.2cm} 100 \hspace{0.2cm} 1.5 & 0.0468 \hspace{0.2cm} 100 \hspace{0.2cm} 1.5 & 0.164 \hspace{0.2cm} 100\hspace{0.2cm} 1.5 \\
\hline
\end{tabular}\\
\title{Table 2: test error using data "ALL" gene}
\end{center}
With the data gene (ALL), we find that the kernel transformed offers the best resutats for the classification. However with the use of kernels $\mathcal{K}$ it is the kernel constructed with the divergence of Itakoura-Saito that gives the best classification results, followed by Hellinger, S-Euclidean and the Euclidean divergence. Whereas if we use kernel transformed, it is those built with Euclidean divergence that give the best results, followed by that of Itakura-Saito, Hellinger and S-Euclidian.
\begin{center}
\begin{tabular}{|c||c|c|c|c|}
\hline
Divergence & Euclidian & Hellinger & Itakura-Saito & S-Euclidian \\
& error \hspace{0.2cm} C \hspace{0.2cm}$\sigma$& error \hspace{0.2cm} C \hspace{0.2cm} $\sigma$ & error \hspace{0.2cm} C \hspace{0.2cm} $\sigma$ & error \hspace{0.2cm} C \hspace{0.2cm} $\sigma$ \\
\hline
Data"MASS"\hspace{0.15cm}(dir)&0.236 \hspace{0.2cm} 1 \hspace{0.2cm}-& 0.326\hspace{0.2cm} 1 \hspace{0.2cm} - & 0.340 \hspace{0.2cm} 1 \hspace{0.2cm} - & 0.326 \hspace{0.2cm} 10 \hspace{0.2cm} - \\
cats\hspace{0.3cm}(tran) &0.194\hspace{0.2cm} 1 \hspace{0.2cm}0.5 & 0.326\hspace{0.2cm} 10 \hspace{0.2cm} 0.5 & 0.368 \hspace{0.2cm} 1 \hspace{0.2cm} 0.5 & 0.181 \hspace{0.2cm} 1 \hspace{0.2cm} 0.5 \\
\hline
\end{tabular}\\
\title{Table 3: Test error using data cats "MASS"}
\end{center}
With the data cats (MASS), if we use kernel $\mathcal{K}$ we have almost the same results for all measures of divergence. However with the modified kernel the classification obtained with the S-Euclidean divergence and the Euclidean divergence offer the best results. It should also be noted that for the divergence of Itakura-Saito it is the kernel $\mathcal{K}$ that gives the best results.
In conclusion we retain that the choice of the best method depends on data and constants.
\subsection{Applications in imagess classifications}
In this work we apply the above proposed algorithm and also implement with the metrics proposed in the section above, to color image segmentation. The divergence we proposed gives a good classification with different threshold (k). In our experiments we used the data from the image (a) and apply our algorithm with different threshold. From these figures, we can see the results experimented by our algorithm. These results have been obtained with our divergences following some (k) values.\\
\vspace{1cm}
\begin{center}
\begin{tabular}{ccc}
\hline
\hline
&\textbf{Algorithm}&
\\\hline
\hline
$X \in M_{l,c}(\mathbb{R})$& &matrix origin
\\
$X^{'} \in M_{l,c}(\mathbb{R})$ && matrix sortie
\\
$X^{'}$&$\longleftarrow$& matrix null order $l\times c$
\\
for i & rang($1,l-1$):&
\\
$P_{1}$&$\longleftarrow$& $X_{i,j-1}$
\\
$P_{2}$&$\longleftarrow$&$X_{i-1,j}$
\\
If &norm$(P_{1},P_{2})<k$&
\\
$P_{0}$& $\longleftarrow$& $(225,225,225)$
\\
else:&&
\\
$P_{0}$& $\longleftarrow$ &$(0,0,0)$
\\
$X^{'}$&$\longleftarrow$& $P_{0}$
\\\hline
\hline
\end{tabular}
\end{center}
\subsubsection{Facial image segmentation}
\begin{center}
\begin{tabular}{ccc}
\includegraphics[width=3cm]{lissa.jpg}\title{a}&\includegraphics[width=3cm]{Photo2-4.jpg}\title{b}\\
\includegraphics[width=3cm]{Photo1354.jpg}\title{c}&\includegraphics[width=3cm]{Photo2-5.jpg}\title{d}&\includegraphics[width=3cm]{Photo3-4.jpg}\title{e}\\
\includegraphics[width=3cm]{Photo3-5.jpg}\title{f}&\includegraphics[width=3cm]{Photo4-5.jpg}\title{g}&\includegraphics[width=3cm]{Photo1350.jpg}\title{h}\\
\includegraphics[width=3cm]{Photo5-5.jpg}\title{i}&\includegraphics[width=3cm]{Photo50.jpg}\title{j}&\includegraphics[width=3cm]{Photo80.jpg}\title{k}\\
\end{tabular}\\
\title{Fig 1: Results facial image segmentation}
\end{center}
In this part of the work we will make a brief presentation of the classification of an image. A presentation of the transformation with the corresponding divergence and the optimal threshold.
The color image segmentation results is that :(a) coresponds to the original image , (b) image $D_{ABS}^{(1,0)}$-divergence with k=2.4, (c) image $D_{ABS}^{(1,1)}$-divergence with k=1354, (d) image $D_{ABS}^{(1/2,-1)}$-divergence and k=2.5, (e) image $D_{ABS}^{(1/2,-1)}$-divergence with k=3.4, (f) image $D_{ABS}^{(1,0)}$-divergence with k=3.5, (g) image $D_{ABS}^{(1/2,1/2)}$-divergence with k=4.5, (h) image $D_{ABS}^{(1,1)}$-divergence with k=1350, (c) image $D_{ABS}^{(1,1)}$-divergence with k=1354, (i) image $D_{ABS}^{(1/2,1/2)}$-divergence with k=5.5, (j) image $D_{ABS}^{(1/2,1)}$-divergence with k=50, (k) image $D_{ABS}^{(1/2,1)}$-divergence with k=80.\\
From these figures (Fig 1), we can observe the experimental results of our algorithm on a facial image. Using on divergences in the proposed algorithm, we can observe the separation into two classes of our image according to the metric used with an adequate theshold. We can see some differences between the segmentation results images (b-k). For example, the images (b) and (f) given by the $D_{ABS}^{(1,0)}$ divergence showed a bleary delimitation of the original image (a); for the images (c,e,h,i) we used (resp.) $D_{ABS}^{(1,1)}$, $D_{ABS}^{(1/2,-1)}$, $D_{ABS}^{(1,1)}$, and $D_{ABS}^{(1/2,1/2)}$ divergences they correctly delineates the contour of the image (a); for the images (d,g,j) the $D_{ABS}^{(1/2,-1)}$, $D_{ABS}^{(1/2,1/2)}$, and $D_{}^{(1/2,1)}$ divergences results are relatively homogeneous and do a good work.
\subsubsection{Fruit image segmentation}
\begin{center}
\begin{tabular}{ccc}
\includegraphics[width=3cm]{fraise.jpg}\title{1}&\includegraphics[width=3cm]{ABS101.png}\title{2}\\
\includegraphics[width=3cm]{ABS105.png}\title{3}&\includegraphics[width=3cm]{ABS201.png}\title{4}&\includegraphics[width=3cm]{ABS205.png}\title{5}\\
\includegraphics[width=3cm]{ABS301.png}\title{6}&\includegraphics[width=3cm]{ABS305.png}\title{7}&\includegraphics[width=3cm]{ABS401.png}\title{8}\\
\includegraphics[width=3cm]{ABS405.png}\title{9}&\includegraphics[width=3cm]{ABS501.png}\title{10}&\includegraphics[width=3cm]{ABS505}\title{11}\\
\end{tabular}\\
\title{Fig 2: Fruit image segmentation}
\end{center}
The images in Figure 2 correspond to a classification using the proposed algorithm. The classification uses our divergences with a certain decision threshold k. Image 1 corresponds to the original images. The image 2 corresponds to the classification using the divergence $D_{ABS}^{(1,1)}$ with a threshold k = 0.1, the image 3 is that of this divergence with the threshold k = 0.5. The images 4 and 5 correspond to the classification the divergence $D_{ABS}^{(\frac{1}{2},\frac{1}{2})}$ with the thresholds k = 0.1 and k = 0.5 respectively. The classification made with the divergence $D_{ABS}^{(\frac{1}{2},1)}$ with the threshold k = 0.1 and k = 0.5 respectively corresponding to the 6 and 7.The images 8 and 9 are obtained with the divergence $D_{ABS}^{(\frac{1}{2},-1)}$ with the thresholds k = 0.1 and k = 0.5. The images 10 and 11 correspond to the classification with the divergence$ D_{ABS}^{(1,0)}$ with k = 0.1 and k = 0.5 respectively.
From these figure (fig:2), we can observe the experimental results of our algorithm on a fruit image. Using on divergences in the proposed algorithm, we can observe the separation into two classes of our image according to the metrics used with an adequate theshold. For k=0.1 figures (2,4,6,8,10) present the better representation image than k=0.5 images (3,5,7,9,11). The fruits images reprensentations depend two thing k and the diverggences. But in this cas we have a few differences between our divergences.
\section{Conclusion}
A general method to build Hilbertian metrics on probability measures from Hilbertian on $\mathbb{R}_{+}$ was presented. Using results from Cichocki and Amari from the Alpha-Beta-divergence, then we generalized this framework
by incorporating the symmetry property. We propose a new variant of Alpha-Beta-Symmetric divergence metrics (ABS-divergence) and kernels associed. Our main contributions consist of, first is to construct a new family of metrics, ABS-divergence and kernels, and second is to be integrated into SVM and algorithm classification.
Our results, which are based on a choice of ABS divergence parameters leading to symmetric kernel $\mathcal{K}_t$, are very efficient compared to classical $\mathcal{K}$-based methods.
\section{Acknowledgments}
This reseach was supported, in part, by grants from NLAGA project, "Non linear Analysis, Ceometry and Applications Projet". ( Supported by the University Cheikh Anta Diop UCAD ).
\newpage
| {'timestamp': '2018-09-18T02:07:45', 'yymm': '1803', 'arxiv_id': '1803.00001', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00001'} | arxiv |
\section{\uppercase{Introduction}}
The channel model of memory with defective cells (i.e., stuck-at defects) was introduced by Kuznetsov and Tsybakov~\cite{Kuznetsov1974}. As shown in Fig.~\ref{fig:BDC}, this channel model has a channel state $S \in \{0, 1, \lambda\}$, which is called defect information. The state $S=0$ corresponds to a stuck-at 0 defect that always outputs a 0 independent of its input value, the state $S=1$ corresponds to a stuck-at 1 defect that always outputs a 1, and the state $S = \lambda$ corresponds to a normal cell that outputs the same value as its input. The probabilities of 0, 1, $\lambda$ states are $\beta/2$, $\beta/2$ (assuming a symmetric defect probability), and $1 - \beta$, respectively~\cite{Kuznetsov1974, ElGamal2011}. We call this channel model the binary defect channel (BDC).
The capacity of the BDC is $1 - \beta$ when both the encoder and the decoder know the defect information. If the decoder is aware of the defect locations in an array of memory cells, then the defects can be treated as erasures so that the capacity is $1 - \beta$~\cite{Heegard1983capacity, ElGamal2011}. On the other hand, Kuznetsov and Tsybakov investigated the model where the encoder knows the channel state information (i.e., locations and stuck-at values of defects) and the decoder does not have any information of defects~\cite{Kuznetsov1974}. It was shown that the capacity is also $1 - \beta$ even when only the encoder knows the defect information~\cite{Kuznetsov1974, Heegard1983capacity}. The capacity of the BDC is given by
\begin{equation}\label{eq:BDC_capacity}
C_{\mathrm{BDC}} = 1 - \beta.
\end{equation}
A practical coding scheme for the BDC is \emph{additive encoding} which masks defects by adding a carefully selected binary vector~\cite{Kuznetsov1974, Tsybakov1975additive, Dumer1990}. The goal of masking defects is to make a codeword whose values at the locations of defects match the stuck-at values of corresponding defects.
\begin{figure}[!t]
\centering
\includegraphics[width=0.3\textwidth]{fig_BDC.eps}
\vspace{-3mm}
\caption{Binary defect channel (BDC).}
\label{fig:BDC}
\vspace{-5mm}
\end{figure}
Recently, the BDC has received renewed attention as a possible channel model for nonvolatile memories such as phase change memories (PCMs) and flash memories~\cite{Lastras-Montano2010,Jagmohan2010coding,Hwang2011iterative,Jacobvitz2013,Kim2013coding, Kim2013redundancy, Mahdavifar2015,Kim2016locally}. The write operation of PCM involves heating and cooling chalcogenide alloy, which results in expansion and contraction of the alloy. The repeated writes eventually cause the heating element to detach from the alloy resulting in a stuck-at defect that can be read but not written~\cite{Pirovano2004}. In flash memories, it has been shown that highly interfered cells can be regarded as stuck-at defects because of the unique properties of flash memory~\cite{Kim2014dirtyflash}.
In~\cite{Tsybakov1975}, the binary defect and symmetric channel (BDSC) model was considered where memory cells suffer from both stuck-at defects and random errors. This channel model is more realistic since random errors happen in PCM cells because of write noise, resistance drift, and unwanted heating~\cite{Pirovano2004}. Similarly, flash memory suffers from random errors due to charge loss and random telegraph noise~\cite{Prall2007}.
A \emph{nested coding} approach for the BDSC was proposed by Tsybakov~\cite{Tsybakov1975} and Heegard~\cite{Heegard1983plbc}, where the codes are referred to as \emph{partitioned linear block codes (PLBCs)}. Heegard showed that PLBC can achieve the capacity of the BDSC as well as suggested specific code constructions based on Bose-Chaudhuri-Hocquenghem (BCH) codes, i.e., partitioned BCH (PBCH) codes~\cite{Heegard1983plbc,Zamir2002nested}.
A PLBC requires two generator matrices as other nested linear codes. One of them is for masking stuck-at defects and the other generator matrix is for correcting transient errors. Due to these two generator matrices, we can separate the redundancy for masking defects from the redundancy for correcting random errors~\cite{Heegard1983plbc}. We assume that the number of redundant bits for masking defects and correcting random errors are $l$ and $r$, respectively. Hence, the total redundancy is $l + r = n - k$ (where $n$ is the codeword size and $k$ is the message size). Note that the code rate is $R = k / n = (n - l - r) / n $.
The fact that the redundancy can be divided into two parts leads to the problem of redundancy allocation. The objective is to find the optimal $(l, r)$ minimizing the probability of recovery failure for a fixed total redundancy $n-k$. This redundancy allocation problem can be stated as follows:
\begin{equation}\label{eq:opt_prob}
\begin{aligned}
\left( l^*, r^* \right) = \; & \underset{(l, r)}{\text{argmin}} & & P( \widehat{\mathbf{m}} \ne \mathbf{m}) \\
& \text{subject to} & & 0 \le l \le n - k, \quad 0 \le r \le n - k\\
&&& l+r = n-k
\end{aligned}
\end{equation}
where $\mathbf{m}$ and $\widehat{\mathbf{m}}$ denote a message and its estimate (recovered message), respectively. $P( \widehat{\mathbf{m}} \ne \mathbf{m})$ denotes the probability of recovery failure. Not surprisingly, the optimal redundancy allocation $(l^*, r^*)$ depends on the channel. If a channel exhibits only stuck-at defects, we should allot all redundancy to masking stuck-at defects, i.e., $(l^{*}, r^{*})=(n-k, 0)$. It is also expected that the optimal redundancy allocation for a channel with only random errors is $(l^{*}, r^{*})=(0, n-k)$.
Our main contributions in this paper are the formulation of redundancy allocation problem for finite-length PLBC and the techniques to estimate the optimal redundancy allocation. Asymptotically, the probability of recovery failure can converge to zero if the capacity conditions of PLBC are satisfied. However, we observe that the probability of recovery failure of finite-length PLBC can be significantly different depending on redundancy allocations even though they all satisfy the capacity region conditions.
We propose the following techniques to estimate the optimal redundancy allocation of finite-length PLBC. First, we investigate the redundancy allocation of the binary defect and erasure channel (BDEC) where transient errors are modeled by erasures. We derive the upper bound on the probability of recovery failure. Based on this upper bound, we will obtain the estimate $(\widehat{l}, \widehat{r})$ for the optimal $(l^{*}, r^{*})$. Similarly, we derive the estimate of the probability of recovery failure for the BDSC. Using this estimate of the probability of recovery failure, we can estimate the optimal redundancy allocation. Numerical results show that the estimates $(\widehat{l}, \widehat{r})$ of both the BDEC and the BDSC are well matched with the optimal redundancy allocations obtained by Monte-Carlo simulations.
To the best of our knowledge, the redundancy allocation problem for finite-length PLBC has not been addressed. Past work providing asymptotic results is not useful in trying to determine the optimal redundancy allocation for finite-length PLBC. We believe that this redundancy allocation problem is practically important with the applications of nonvolatile memories.
The rest of the paper is as follows. In Section~\ref{sec:channel}, we explain the channel models and PLBC. In Section \ref{sec:ra}, we propose techniques to determine the proper redundancy allocation of finite-length partitioned codes for the BDEC and the BDSC. Section~\ref{sec:conclusion} concludes the paper.
\section{\uppercase{Channel Model and PLBC: Preliminaries}} \label{sec:channel}
\subsection{Channel Model}
The BDC in Fig.~\ref{fig:BDC} can be described as follows. Let ``$\circ$'' denote the operator $\circ:\{0, 1\} \times \left\{0, 1, \lambda\right\} \rightarrow \{0, 1\}$ as in~\cite{Heegard1983plbc}
\begin{equation}\label{eq:circ_operator}
c \circ s =
\begin{cases}
c, & \text{if } s = \lambda ; \\
s, & \text{if } s \ne \lambda.
\end{cases}
\end{equation}
By using the operator $\circ$, an $n$-cell memory with stuck-at defects is modeled by
\begin{equation}
\mathbf{y} = \mathbf{c} \circ \mathbf{s} \label{eq:BDC_vector}
\end{equation}
where ${\mathbf{c}}, {\mathbf{y}}\in \left\{0, 1\right\}^n$ are the codeword and the channel output vector, respectively. Also, the channel state vector ${\mathbf{s}} \in \left\{ 0, 1, \lambda \right\}^n$ represents the defect information in the $n$-cell memory. Note that $\circ$ is the vector component-wise operator.
As shown in~Fig.~\ref{fig:BDC}, the probabilities of stuck-at defects and normal cells are given by
\begin{equation}\label{eq:BDC_prob}
P(S = s) =
\begin{cases}
1 - \beta, & \text{if } s = \lambda ; \\
\frac{\beta}{2}, & \text{if } s \ne \lambda.
\end{cases}
\end{equation}
Now we consider the channel models with both permanent stuck-at defects and transient errors, i.e., the BDEC and the BDSC. For the BDEC, $\mathbf{c} \circ \mathbf{s}$ will be the channel input of the BEC with the erasure probability $\alpha$. Also, the BDSC can be modeled by
\begin{equation}
\mathbf{y} = \mathbf{c} \circ \mathbf{s} + \mathbf{z} \label{eq:BDSC_vector}
\end{equation}
where $\mathbf{c} \circ \mathbf{s}$ is the channel input of the binary symmetric channel (BSC) with the crossover probability $p$ and ${\mathbf{z}} \in \{0, 1\}^n$ is the random error vector.
Assuming that stuck-at defects do not suffer from transient errors, the capacity can be determined by the following theorem.
\begin{theorem}\cite{Heegard1983capacity}\label{thm:capacity_separate}
If the stuck-at defects do not suffer from transient errors, then the capacity is given by
\begin{equation} \label{eq:capacity_separate}
\widetilde{C}^{\text{max}} = \widetilde{C}^{\text{enc}} = P(S = \lambda)\widetilde{C}
\end{equation}
\end{theorem}
where $\widetilde{C}$ is the capacity of the discrete memoryless channel (DMC) with $P(Y \mid X) = P(Y \mid X, S = \lambda)$. The superscript `max' in \eqref{eq:capacity_separate} represents the capacity when the defect information is fully known to both the encoder and decoder. Also, the superscript `enc' denotes the capacity when only the encoder knows the defect information. Since $\widetilde{C}^{\text{enc}}$ is the same as $\widetilde{C}^{\text{max}}$, we can omit the superscript if the stuck-at defects do not suffer from transient errors.
Let $\widetilde{C}_{\text{BDEC}}$ denote the capacity of the channel when only the normal cells can be erased. Similarly, let $\widetilde{C}_{\text{BDSC}}$ denote the capacity of the channel when only the normal cells suffer from random errors. By Theorem \ref{thm:capacity_separate}, it is clear that
\begin{align}
\widetilde{C}_{\text{BDEC}} & = (1-\beta)(1-\alpha), \label{eq:capacity_BDEC_tilde} \\
\widetilde{C}_{\text{BDSC}} & = (1-\beta)(1-h(p)) \label{eq:capacity_BDSC_tilde}
\end{align}
where $h\left( x\right) = -x \log_2 x - \left(1-x\right) \log_2\left(1-x\right)$. If neither the encoder nor the decoder knows the defect information, the capacity is given by~\cite{Heegard1983capacity}
\begin{equation} \label{eq:capacity_BDSC_tilde_min}
\widetilde{C}_{\text{BDSC}}^{\text{min}} = 1-h\left((1-\beta)p + \frac{\beta}{2} \right),
\end{equation}
which is the capacity of the BSC with the crossover probability
\begin{equation}\label{eq:p_tilde}
\widetilde{p} = (1-\beta)p + \frac{\beta}{2}.
\end{equation}
If both the stuck-at defects and the normal cells suffer from transient errors, it is difficult to derive closed-from expressions for $C_{\text{BDSC}}^{\text{max}}$ and $C_{\text{BDSC}}^{\text{enc}}$. Note that the superscript `max' represents the capacity when the defect information is fully known to both the encoder and decoder and the superscript `enc' represents the capacity when only the encoder knows the defect information. Instead, these capacities can be evaluated numerically~\cite{Heegard1983capacity}. For the BDEC, we can derive $C_{\text{BDEC}}^{\text{max}}$ and $C_{\text{BDEC}}^{\text{enc}}$ because of the channel model's simpleness. If both the encoder and decoder know the defect information, this channel is equivalent to the BEC with the erasure probability of $\alpha + \beta - \alpha \beta$. Hence,
\begin{equation}
C_{\text{BDEC}}^{\text{max}} = 1 - \alpha - \beta + \alpha \beta = (1 - \beta)(1 - \alpha)
\end{equation}
which is the same as in \eqref{eq:capacity_BDEC_tilde}. The capacity $C_{\text{BDEC}}^{\text{enc}}$ is derived as follows.
\begin{proposition} \label{thm:capacity_BDEC}
If only the encoder knows the defect information, the capacity of the BDEC is given by
\begin{equation} \label{eq:capacity_BDEC}
C_{\text{BDEC}}^{\text{enc}} = 1 - \alpha - \beta
\end{equation}
which shows that $C_{\text{BDEC}}^{\text{enc}} < C_{\text{BDEC}}^{\text{max}} = \widetilde{C}_{\text{BDEC}}$.
\end{proposition}
\begin{proof}
The proof is given in Appendix \ref{pf:capacity_BDEC}-A.
\end{proof}
Although $C_{\text{BDEC}}^{\text{enc}} < C_{\text{BDEC}}^{\text{max}} = \widetilde{C}_{\text{BDEC}}$, the difference between $C_{\text{BDEC}}^{\text{enc}}$ and $\widetilde{C}_{\text{BDEC}}$ is only $\alpha \beta$ which is much smaller than $\alpha$ or $\beta$ for $\alpha, \beta \ll 1$.
For the BDSC, the closed-form expressions for $C_\text{BDSC}^{\text{max}}$ and $C_\text{BDSC}^{\text{enc}}$ are not known. In~\cite{Heegard1983plbc}, only a non-closed-form expression for $C_\text{BDSC}^{\text{enc}}$ was derived. Although we cannot obtain a closed-form expression for $C_\text{BDSC}$, we derive the following bound.
\begin{proposition} \label{thm:capacity_bound_BDSC}
If only the encoder knows the defect information, the capacity of the BDSC is bounded by
\begin{equation} \label{eq:capacity_bound_BDSC}
C_{\text{BDSC}}^{\text{lower}} \le C_{\text{BDSC}}^{\text{enc}} \le C_{\text{BDSC}}^{\text{upper}}
\end{equation}
where
\begin{align}
C_{\text{BDEC}}^{\text{lower}} &= 1 - \beta - h(p), \label{eq:capacity_lower_BDSC} \\
C_{\text{BDEC}}^{\text{upper}} &= \widetilde{C}_{\text{BDSC}} = (1 - \beta)(1 - h(p)). \label{eq:capacity_upper_BDSC}
\end{align}
\end{proposition}
\begin{proof}
The proof is given in Appendix \ref{pf:capacity_bound_BDSC}-B.
\end{proof}
From \eqref{eq:capacity_lower_BDSC} and \eqref{eq:capacity_upper_BDSC}, we can see that the difference between the upper bound and lower bound is only $\beta h(p)$. For $\beta, p \ll 1$, $\beta h(p)$ is much smaller than $\beta$ and $h(p)$.
\subsection{Partitioned Linear Block Codes (PLBCs)} \label{subsec:PLBC}
In \cite{Heegard1983plbc}, Heegard proposed the PLBCs which can be viewed as nested codes~\cite{Zamir2002nested}. PLBCs are capable of correcting both stuck-at errors (due to stuck-at defects) and transient errors. Note that the PLBC can correct transient errors occurring in both stuck-at defects and normal cells. An $[n,k,l]$ PLBC is a pair of linear subspaces ${\mathcal{C}}_1 \subset \{0, 1\}^n$ and ${\mathcal{C}}_0 \subset \{0, 1\}^n$ of dimension $k$ and $l$ such that ${\mathcal{C}}_1 \cap {\mathcal{C}}_0 =\{ \mathbf{0}\}$. Then the direct sum
\begin{equation}\label{eq:direct_sum}
{\mathcal{C}} \triangleq {\mathcal{C}}_1 + {\mathcal{C}}_0 = \{ {\mathbf{c}} = {\mathbf{c}}_1 + {\mathbf{c}}_0 | {\mathbf{c}}_1 \in {\mathcal{C}}_1 , {\mathbf{c}}_0 \in {\mathcal{C}}_0 \}.
\end{equation}
is an $[n, k+l]$ linear block code with a generator matrix $\widetilde{G} = \left[ G_1 \quad G_0 \right]$. Note that the sizes of $G_1$ and $G_0$ are $n \times k$ and $n \times l$, respectively. An example of PLBC can be found in~\cite{Heegard1983plbc}.
The encoding and decoding are described as follows.
\emph{Encoding:} A message $\mathbf{m}$ is encoded to a corresponding codeword $\mathbf{c} = \mathbf{c}_1 + \mathbf{c}_0 = G_1\mathbf{m} + G_0\mathbf{d}$. First, we encode $\mathbf{m}$ into $G_1 \mathbf{m}$ for correcting transient errors. Next, the stuck-at defects are masked by $G_0 \mathbf{d}$ where $\mathbf{d}$ is chosen carefully to mask stuck-at defects.
\emph{Decoding:} Let the received vector be $\mathbf{y} = \mathbf{c} \circ \mathbf{s} + \mathbf{z}$ according to~\eqref{eq:BDSC_vector}. The decoder computes the syndrome ${\mathbf{v}} = \widetilde{H}^T {\mathbf{y}}$ (superscript $T$ denotes transpose) where $\widetilde{H}$ is the parity check matrix of $\mathcal{C}$ such that $\widetilde{H}^T \widetilde{G} = 0_{r, k+l}$ (the $r \times (k+l)$ all-zero matrix). Based on the syndrome $\mathbf{v}$, the decoder chooses $\widehat{\mathbf{z}}$ (i.e., the estimate of $\mathbf{z}$) such that $\widetilde{H}^T \widehat{\mathbf{z}} = \mathbf{v}$. Then $\widehat{\mathbf{m}} = \widetilde{G}_1^T \widehat{\mathbf{c}}$ where $\widehat{\mathbf{c}}= \mathbf{y} + \widehat{\mathbf{z}}$. The message inverse matrix $\widetilde{G}̃_1$ is defined as an $n \times k$ matrix such that $\widetilde{G}̃_1^{T} G_1 =I_k$ and $\widetilde{G}̃_1^{T} G_0 =0_{k, l}$.
\begin{definition}
A pair of minimum distances $\left(d_0, d_1 \right)$ of an $[n, k, l]$ PLBC are given by \cite{Heegard1983plbc}.
\begin{align} \label{eq:PLBC_d0}
d_0 = \underset{
\substack{
{\mathbf{c}} \ne {\mathbf{0}} \\
G_0^T {\mathbf{c}}= {\mathbf{0}}
}}
{\text{min }} \|{\mathbf{c}}\|, \:\:
d_1 = \underset{
\substack{
\mathbf{m} \ne \mathbf{0} \\
\widetilde{H}^T \mathbf{c}= \mathbf{0}}}
{\text{min }} \|\mathbf{c}\|
\end{align}
where $\| \cdot \|$ is the Hamming weight of the given vector.
\end{definition}
Note that $d_1$ is greater than or equal to the minimum distance of the $[n,k+l]$ linear block code with the parity check matrix $\widetilde{H}$, while $d_0$ is the minimum distance of the $[n,k+r]$ linear block code with the parity check matrix $G_0$~\cite{Heegard1983plbc}.
It is critical to choose the proper $\mathbf{d}$ during the encoding stage of PLBC. The minimum distance encoding (MDE) chooses $\mathbf{d}$ as follows.
\begin{align}
\mathbf{d}^* & =\underset{\mathbf{d}}{\text{argmin }} \|\mathbf{c} \circ \mathbf{s} - \mathbf{c} \| = \underset{\mathbf{d}}{\text{argmin }} \left\| \mathbf{s}^{\mathcal{U}} + G_0^{\mathcal{U}} \mathbf{d} + G_1^{\mathcal{U}} \mathbf{m} \right\| \nonumber \\
&= \underset{\mathbf{d}}{\text{argmin }} \left\| G_0^{\mathcal{U}} \mathbf{d} + \mathbf{b}^{\mathcal{U}} \right\| \label{eq:BDC_opt_problem}
\end{align}
where $\| {\mathbf{c}} \circ {\mathbf{s}} - {\mathbf{c}} \|$ represents the number of errors due to stuck-at defects and ${\mathbf{b}} = G_1 {\mathbf{m}} + {\mathbf{s}}$. Also, ${\mathcal{U}}=\left\{i_1,\ldots,i_u \right\}$ indicates the set of locations of stuck-at defects. We use the notation of ${\mathbf{s}}^{\mathcal{U}}=\left(s_{i_1},\ldots,s_{i_u}\right)^T$, $G_0^{\mathcal{U}}=\left[{\mathbf{g}}_{0,i_1}^T,\ldots,{\mathbf{g}}_{0,i_u}^T \right]^T$, and $G_1^{\mathcal{U}}=\left[{\mathbf{g}}_{1,i_1}^T,\ldots,{\mathbf{g}}_{1,i_u}^T \right]^T$ where ${\mathbf{g}}_{0,i}$ and ${\mathbf{g}}_{1,i}$ are the $i$-th rows of $G_0$ and $G_1$ respectively.
By solving the optimization problem in \eqref{eq:BDC_opt_problem}, we can minimize the number of errors due to stuck-at defects. It was shown~\cite{Heegard1983plbc} that the capacity of the BDSC can be achieved by the MDE and the maximum likelihood decoding (MLD). However, the encoding complexity of the MDE is ${\mathcal{O}}(2^u)$. Instead of solving the exponential complexity optimization problem, we just try to solve the following linear equation.
\begin{equation}\label{eq:BDC_LE}
G_0^{\mathcal{U}} {\mathbf{d}} = {\mathbf{b}}^{\mathcal{U}}
\end{equation}
Gaussian elimination or some other linear equation solution methods can be used to solve \eqref{eq:BDC_LE} with ${\mathcal{O}}\left(u^3\right)$ complexity. If the encoder fails to find a solution of \eqref{eq:BDC_LE}, then encoding failure is declared. It is clear that \eqref{eq:BDC_LE} has at least one solution if and only if
\begin{equation} \label{eq:BDC_LE_sol_exist}
\rank \left( G_0^{\mathcal{U}} \right) = \rank \left( G_0^{\mathcal{U}} \mid \mathbf{b}^{\mathcal{U}} \right)
\end{equation}
where $\left( G_0^{\mathcal{U}} \mid \mathbf{b}^{\mathcal{U}} \right)$ denotes the augmented matrix. If $u<d_{0}$, $\rank\left(G_0^{\mathcal{U}}\right)$ is always $u$ by \eqref{eq:PLBC_d0}. Hence, \eqref{eq:BDC_LE_sol_exist} holds and at least one solution $\mathbf{d}$ exists. If $u \ge d_0$, the encoder may fail to find a solution of \eqref{eq:BDC_LE}.
For convenience, we define a random variable $E$ as follows.
\begin{equation} \label{eq:BDC_E}
E =
\begin{cases}
1, & \|\mathbf{c} \circ \mathbf{s} - \mathbf{c} \| = 0 \text{ (encoding success)} \\
0, & \|\mathbf{c} \circ \mathbf{s} - \mathbf{c} \| \ne 0 \text{ (encoding failure)}
\end{cases}
\end{equation}
We observe that the probability of encoding failure $P(E=0)$ by solving \eqref{eq:BDC_opt_problem} is the same as $P(E=0)$ by solving \eqref{eq:BDC_LE}. It is because $G_0^{\mathcal{U}} \mathbf{d} \ne \mathbf{b}^{\mathcal{U}}$ if and only if $\|{\mathbf{c}} \circ {\mathbf{s}} - {\mathbf{c}} \| \ne 0$. Although solving \eqref{eq:BDC_LE} is suboptimal in regards to the number of stuck-at errors (i.e., $\|{\mathbf{c}} \circ {\mathbf{s}} - {\mathbf{c}} \|$), $C_{\text{BDC}}$ can be achieved by solving \eqref{eq:BDC_LE} instead of \eqref{eq:BDC_opt_problem}, which is shown in the following Proposition by using the results of~\cite{Heegard1983plbc}.
\begin{proposition} \label{thm:BDC_capacity}
$C_{\text{BDC}}$ can be achieved by solving \eqref{eq:BDC_LE}.
\end{proposition}
\begin{proof}The proof is given in Appendix~\ref{pf:BDC_capacity}-C.
\end{proof}
We note that Dumer proposed an asymptotically optimal code for the BDC with encoding complexity ${\mathcal{O}}\left(n \log_2^3{n}\right)$~\cite{Dumer1990}. In this paper, we are focusing on Heegard's partitioned codes with encoding by solving linear equation of \eqref{eq:BDC_LE}. It is because this linear equation approach allows to derive the upper bound on encoding failure probability based on linear algebra. This upper bound plays a pivotal role in estimating the optimal redundancy allocation for the BDEC and the BDSC. Moreover, for a finite-length $n$ and a reasonable defect probability $\beta$, $u \simeq \beta n$ is not a large number, hence, the computational complexity ${\mathcal{O}}(u^3)$ is not high.
\section{\uppercase{Redundancy Allocation of Finite-Length PLBC}} \label{sec:ra}
In this section, we investigate the redundancy allocation for finite-length PLBC. In order to clarify the redundancy allocation problem for finite-length PLBC, we define a pair of code rates $\left(R_1, R_0\right)$ where $R_0 = \frac{l}{n}$ is the code rate of ${\mathcal{C}}_0$ in \eqref{eq:direct_sum}. Also, $R_1 = \frac{k}{n}$ is the code rate of ${\mathcal{C}}_1$, which is equivalent to the actual code rate $R = \frac{k}{n}$. For the given codeword size $n$, we can readily calculate $(l, r)$ from $\left(R_1, R_0\right)$.
\begin{figure}[!t]
\vspace{-2mm}
\centering
\includegraphics[width=0.30\textwidth]{fig_BDEC_region.eps}
\vspace{-3mm}
\caption{Capacity region of the BDEC derived in Proposition~\ref{thm:BDEC_region}. Two points of $Q_1$ and $Q_2$ in the capacity region represent the pairs of code rates $\left(R = R_1 = \frac{k}{n}, R_0 = \frac{l}{n}\right)$. Note that they have different redundant allocations $(l, r)$ in spite of the same actual code rates $R = R_1 = \frac{k}{n}$.}
\label{fig:BDEC_region}
\vspace{-5mm}
\end{figure}
For the BDEC, we will derive the capacity region $\mathbb{C}_{\text{BDEC}}$ in Theorem~\ref{thm:BDEC_region}. If $(R_1, R_0) \in \mathbb{C}_{\text{BDEC}}$, then $P(\widehat{\mathbf{m}} \ne \mathbf{m})$ converges to zero as $n \rightarrow \infty$. In Fig.~\ref{fig:BDEC_region}, $Q_1$ and $Q_2$ represent two pairs of code rates in ${\mathbb{C}}_{\text{BDEC}}$ with the same $R_1 = R$. Then, $Q_1$ and $Q_2$ have the same total redundancy $n - k = l + r$ whereas they have different redundancy allocations $(l, r)$. Note that $Q_1$ allocates more redundancy for defects (i.e., larger $l$) than $Q_2$.
Asymptotically, both $Q_1$ and $Q_2$ make $P(\widehat{\mathbf{m}} \ne \mathbf{m})$ converge to zero. On the other hand, $P(\widehat{\mathbf{m}} \ne \mathbf{m})$ of $Q_1$ and $Q_2$ can be significantly different for the finite-length codes, which leads to the need for formulating and solving the redundancy allocation problem in \eqref{eq:opt_prob}.
In order to choose the optimal redundancy allocation $(l^*, r^*)$ of \eqref{eq:opt_prob}, we should derive the $P(\widehat{\mathbf{m}} \ne \mathbf{m})$ which depends on the channel parameters (i.e., $\beta$, $\alpha$, $p$) as well as the code parameters $(n, k, l)$. In the following subsection, we will derive the upper bound on encoding failure probability for finite-length codes, which is important for deriving the estimate of $P(\widehat{\mathbf{m}} \ne \mathbf{m})$.
\subsection{Upper Bound on Encoding Failure Probability}
Since we focus on the redundancy allocation problem in finite-length codes, we derive an upper bound on $P(E=0)$ for finite $n$. During the encoding stage, $\mathbf{d}$ is chosen by solving the linear equation \eqref{eq:BDC_LE} instead of the optimization problem \eqref{eq:BDC_opt_problem}.
\begin{lemma}\label{lemma:BDC_ef_UB_fixed_u} An upper bound on the probability of encoding failure given $u$ defects is given by
\begin{equation}\label{eq:enc_fail_upper}
P\left(E=0 \mid U=u \right) \le \min \left\{ \frac{\sum_{w=d_{0}}^{u}{B_{0, w} \binom{n-w}{u-w}}}{\binom{n}{u}}, 1\right\}
\end{equation}
where the random variable $U$ represents the number of stuck-at defects. In addition, $B_{0, w}$ is the weight distribution of ${\mathcal{C}}_{0}^{\perp}$ (i.e., the dual code of ${\mathcal{C}}_0$).
\end{lemma}
\begin{proof}
The proof is given in Appendix~\ref{pf:BDC_ef_UB_fixed_u}-D.
\end{proof}
Lemma~\ref{lemma:BDC_ef_UB_fixed_u} supports that $P\left(E=0 \mid U=u \right) = 0$ for $u < d_{0}$. The following Lemma states that $P\left(E=0 \mid U=u \right)$ can be obtained exactly for $d_0 \le u \le d_0 + \left\lfloor \frac{d_0-1}{2} \right\rfloor$ where $\lfloor x \rfloor$ is the largest integer not greater than $x$.
\begin{lemma}\label{lemma:BDC_ef_exact}For $u \le d_0 + \left\lfloor \frac{d_0 - 1}{2} \right\rfloor$, $P\left(E=0 \mid U=u \right)$ is given by
\begin{equation}
\label{eq:BDC_ef_exact}
P\left(E=0 \mid U=u \right) = \frac{1}{2} \cdot \frac{\sum_{w=d_{0}}^{u}{B_{0, w} \binom{n-w}{u-w}}}{\binom{n}{u}}.
\end{equation}
\end{lemma}
\begin{proof}
The proof is given in Appendix~\ref{pf:BDC_ef_exact}-E.
\end{proof}
From the definition of $d_0$ in \eqref{eq:PLBC_d0}, Lemma~\ref{lemma:BDC_ef_UB_fixed_u}, and Lemma~\ref{lemma:BDC_ef_exact}, we can state the following theorem.
\begin{theorem}\label{thm:enc_fail_bound_fixed_u} $P\left(E = 0 \mid U=u\right)$ is given by
\begin{numcases}{\hspace{-6mm}}
\hspace{-1mm}0, &\hspace{-6mm} for $u < d_0$ \label{eq:BDC_ef_exact_0}
\\
\hspace{-1mm}\frac{1}{2} \cdot \frac{\sum_{w=d_{0}}^{u}{B_{0, w} \binom{n-w}{u-w}}}{\binom{n}{u}}, &\hspace{-6mm} for $d_0 \le u \le d_0 + t_0$ \label{eq:BDC_ef_exact_1}
\\
\hspace{-1mm}\le \min \left\{ \frac{\sum_{w=d_{0}}^{u}{B_{0, w} \binom{n-w}{u-w}}}{\binom{n}{u}}, 1\right\}\hspace{-1mm}, &\hspace{-6mm} for $ u > d_0 + t_0$. \label{eq:BDC_ef_bound}
\end{numcases}
where $t_0 = \left\lfloor \frac{d_0 - 1}{2} \right\rfloor$.
\end{theorem}
We compare our upper bounds and simulation results assuming the the number of defects $u$ is given. The $[n = 31, k, l]$ partitioned BCH (PBCH) codes are considered and the weight distributions $B_{0, w}$ are calculated using the MacWilliams identity~\cite{Macwilliams1977theory}. The details of PBCH codes can be found in~\cite{Heegard1983plbc}. Fig.~\ref{fig:plot_fixed_u} shows that the upper bounds of \eqref{eq:BDC_ef_bound} are close to the simulation results for $P(E=0 \mid U=u)$. In addition, the calculated values of \eqref{eq:BDC_ef_exact_1} are well matched with the simulation results. Fig.~\ref{fig:plot_fixed_u} shows that the upper bounds approach $P(E=0 \mid U=u)$ and meet $P(E=0 \mid U=u)$ as the code rate decreases.
From the bound on $P(E=0 \mid U=u)$ in Theorem~\ref{thm:enc_fail_bound_fixed_u}, we derive the following upper bound.
\begin{corollary}\label{cor:BDC_UB_1} An upper bound on the probability of encoding failure $P\left(E = 0 \right)$ is given by
\begin{align}
P(E=0)
&\le \sum_{u=d_0}^{n}{ \beta^{u} \left( 1 - \beta \right)^{n-u}}\sum_{w=d_0}^{u}{B_{0,w} \binom{n-w}{u-w}} \label{eq:bound_enc_fail_2}.
\end{align}
\end{corollary}
\begin{proof}
It can be shown by $P(U=u) = \binom{n}{n} \beta^u (1-\beta)^{n-u}$ and \eqref{eq:BDC_ef_bound}.
\end{proof}
\begin{figure}[!t]
\centering
\subfloat[$u=10$]{\includegraphics[width=0.4\textwidth]{fig_plot_fixed_u_10.eps}
\label{fig:plot_fixed_u_10}}
\hfill
\subfloat[$u=12$]{\includegraphics[width=0.4\textwidth]{fig_plot_fixed_u_12.eps}
\label{fig:plot_fixed_u_12}}
\caption{Comparison of simulation results, upper bounds by \eqref{eq:BDC_ef_bound}, and calculated values by \eqref{eq:BDC_ef_exact_1} for $P(E = 0 \mid U=u)$. $[n = 31, k, l]$ PBCH codes are used. The code rate is $R = k/n$.}
\label{fig:plot_fixed_u}
\vspace{-5mm}
\end{figure}
Since it is intractable to compute $B_{0,w}$ for large $n$, we consider the following binomial approximation.
\begin{equation}\label{eq:B0w_approximate}
B_{0,w} \cong 2^{-l} \binom{n}{w}
\end{equation}
For many codes including random linear codes (each element of generator matrix is chosen uniformly at random from $\left\{0, 1 \right\}$) and BCH codes, it is known that the weight distributions are well approximated by the binomial distribution~\cite{Macwilliams1977theory}.
\begin{corollary}\label{cor:BDC_UB_2}If the weight distribution $B_{0,w}$ follows the binomial approximation, the upper bound of \eqref{eq:bound_enc_fail_2} is given by
\begin{align}
P(E=0) &\le 2^{-l}\left(1 + \beta\right)^n \label{eq:BDC_UB_2}, \\
\log_2{P(E=0)} &\le n \left\{R - \left(1 - \log_2(1 + \beta) \right) \right\}. \label{eq:BDC_UB_2_log}
\end{align}
\end{corollary}
\begin{proof}
From \eqref{eq:bound_enc_fail_2} and \eqref{eq:B0w_approximate}, the upper bound on $P\left(E = 0 \right)$ can be derived as follows.
\begin{align}
P\left(E=0\right)
& \le \sum_{u = d_0}^{n}{\beta^u \left(1 - \beta \right)^{n-u} \sum_{w=d_0}^{u}{B_{0, w} \binom{n-w}{u-w}} } \label{eq:bound_enc_fail_variant_0} \\
& = 2^{-l} \sum_{u = d_0}^{n}{\beta^u \left(1 - \beta \right)^{n-u} \sum_{w=d_0}^{u}{\binom{u}{w} \binom{n}{u}}} \label{eq:bound_enc_fail_variant_2} \\
& \le 2^{-l} \sum_{u = 0}^{n}{\binom{n}{u} \left(2\beta\right)^u \left(1 - \beta \right)^{n-u}} \label{eq:bound_enc_fail_variant_4} \\
& = 2^{-l} \left(1 + \beta \right)^n \label{eq:RA_M}
\end{align}
where \eqref{eq:bound_enc_fail_variant_2} follows from $\binom{n}{w} \binom{n-w}{u-w} = \binom{u}{w} \binom{n}{u}$. Also, \eqref{eq:bound_enc_fail_variant_4} follows from the binomial theorem $\sum_{w = 0}^{u}{\binom{u}{w}} = 2^u$.
\eqref{eq:BDC_UB_2_log} can be obtained by taking the logarithm.
\end{proof}
Fig.~\ref{fig:plot_fixed_beta} shows that the upper bound is very close to the simulation results when the probability of encoding failure is low. In regards to the simulation results, we used PBCH codes for the BDC with $\beta = 0.1$
\begin{remark}
\eqref{eq:BDC_UB_2} shows that the probability of encoding failure decreases as $l$ increases, whereas the probability of encoding failure increases as $\beta$ increases. For infinite-length codes, this upper bound is not tight since $1 - \log_2(1 + \beta)$ of \eqref{eq:BDC_UB_2_log} is less than $C_{\text{BDC}} = 1 - \beta$. However, this upper bound is tight for finite-length codes as shown in Fig.~\ref{fig:plot_fixed_beta}. Moreover, the upper bound in \eqref{eq:BDC_UB_2_log} is the linear function of $R$ where $n$ is the slope and $1 - \log_2(1 + \beta)$ is the $R$-intercept, which explicitly shows that longer codes improve the probability of encoding failure.
\end{remark}
\begin{figure}[!t]
\centering
\includegraphics[width=0.4\textwidth]{fig_plot_fixed_beta.eps}
\caption{Comparison of simulation results and upper bounds in~\eqref{eq:BDC_UB_2} for the probability of encoding failure $P(E=0)$. We used PBCH codes for the BDC with probability of defect $\beta=0.1$.}
\label{fig:plot_fixed_beta}
\vspace{-2mm}
\end{figure}
\subsection{Redundancy Allocation: BDEC} \label{sec:BDEC_ra}
For the BDEC, the encoder should try to mask stuck-at defects and the decoder should correct erasures. The encoding process of the BDEC is the same as the encoding in \ref{subsec:PLBC}. Only the decoding will be modified as follows.
\emph{Decoding (BDEC):} The MLD is done by solving the following linear equation.
\begin{equation}\label{eq:BDEC_decoder}
\widetilde{G}^{\mathcal{V}} \begin{bmatrix} \widehat{\mathbf{m}} \\ \widehat{\mathbf{d}} \end{bmatrix} = {\mathbf{y}}^{\mathcal{V}}
\end{equation}
where ${\mathcal{V}}=\left\{j_1,\cdots, j_v\right\}$ indicates the locations of $v$ unerased bits. We use the notation of ${\mathbf{y}}^{\mathcal{V}}=\left(y_{j_1}, \cdots, y_{j_v}\right)^T$ and $\widetilde{G}^{\mathcal{V}}=\left[ \widetilde{\mathbf{g}}_{j_1}^T, \cdots, \widetilde{\mathbf{g}}_{j_v}^T \right]^T$ where $\widetilde{\mathbf{g}}_j$ is the $j$-th row of $\widetilde{G}$. By solving \eqref{eq:BDEC_decoder}, we can obtain estimates of the message $\mathbf{m}$ and redundancy $\mathbf{d}$, i.e., $\widehat{\mathbf{m}}$ and $\widehat{\mathbf{d}}$. We consider the MLD in order to derive the upper bound on $P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right)$. The MLD can be accomplished by solving the linear equation in \eqref{eq:BDEC_decoder}, whose complexity is ${\mathcal{O}}\left(n^3\right)$.
\begin{theorem} \label{thm:BDEC_region}
If a pair of code rates $\left(R_0, R_1\right)$ satisfy the following conditions, then the probability of recovery failure $P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right)$ approaches zero as $n \rightarrow \infty$.
\begin{equation}
R_0 > \beta, \quad R_1 + R_0 < 1 - \alpha \label{eq:BDEC_region}
\end{equation}
\end{theorem}
where $\alpha$ is the probability of erasure and $\beta$ is the probability of defect for the BDEC.
\begin{proof}
We show that $P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right)$ approaches zero with $n$ if $\left(R_0, R_1\right)$ satisfies \eqref{eq:BDEC_region}. We can claim that $P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right) = P\left(E=0\right) + P\left(E=1, D=0\right)$ where the random variable $D$ is defined as follows.
\begin{equation} \label{eq:BDEC_D}
D =
\begin{cases}
1, & ~\text{decoding success} \\
0, & ~\text{decoding failure}
\end{cases}
\end{equation}
From~\eqref{eq:BDC_CA}, we can claim that $P\left( E=0 \right) \le n (\beta + \epsilon) 2^{-n \left( \frac{l}{n} - \beta - \epsilon\right)} + \epsilon'$. Hence, $P\left( E=0 \right)$ converges to zero if $R_0 = \frac{l}{n} > \beta$. If the additive encoding succeeds (i.e., $E=1$), then the corresponding channel is equivalent to the BEC with the erasure probability $\alpha$. It is because all the stuck-at defects are masked. Note that the code rate of $\widetilde{G}$ of \eqref{eq:BDEC_decoder} is $\frac{k+l}{n} = R_0 + R_1$. Thus, $R_0 + R_1 < 1 - \alpha$.
\end{proof}
\begin{table}[t]
\caption{All Possible Redundancy Allocation Candidates of $\left[ n = 1023, k=923, l \right]$ PBCH Codes}
\label{tab:PLBC}
\centering
\renewcommand{\arraystretch}{1.1}
\small{
\begin{tabular}{c|c|c|c|c|c}
\hline
Code & {$l$} & {$r$} & {$d_0$} & {$d_1$} & Remarks \\ \hline \hline
0 & 0 & 100 & 0 & 21 & Only correcting transient errors\\ \hline
1 & 10 & 90 & 3 & 19 &\\ \hline
2 & 20 & 80 & 5 & 17 &\\ \hline
3 & 30 & 70 & 7 & 15 &\\ \hline
4 & 40 & 60 & 9 & 13 &\\ \hline
5 & 50 & 50 & 11 & 11 & \\ \hline
6 & 60 & 40 & 13 & 9 &\\ \hline
7 & 70 & 30 & 15 & 7 &\\ \hline
8 & 80 & 20 & 17 & 5 &\\ \hline
9 & 90 & 10 & 19 & 3 &\\ \hline
10& 100 & 0 & 21 & 0 & Only masking stuck-at defects\\ \hline
\end{tabular}}
\vspace{-5mm}
\end{table}
Fig.~\ref{fig:BDEC_region} represents the capacity region by Theorem~\ref{thm:BDEC_region}. The supremum of $R_1$ in this capacity region is $1 - \alpha - \beta$ which is equal to $C_{\text{BDEC}}^{\text{enc}}$ of \eqref{eq:capacity_BDEC}. From \eqref{eq:BDEC_region}, we can obtain $l > n\beta$ and $r > n \alpha$, which achieve the capacity for infinite $n$.
As explained earlier, these asymptotic results cannot be directly used to choose the optimal redundancy allocation $\left(l^*, r^*\right)$ of \eqref{eq:opt_prob} for finite-length codes. We emphasize that the optimal redundancy allocation $\left(l^*, r^*\right)$ is equivalent to finding the optimal (i.e., minimizing the probability of recovery error) point in the capacity region in Fig.~\ref{fig:BDEC_region}.
In order to solve the optimization problem of \eqref{eq:opt_prob}, we need a closed-form expression for $P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right)$. Unfortunately, it is difficult to obtain the exact expression of $P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right)$. Thus, we will consider an estimate $(\widehat{l}, \widehat{r})$ which minimizes an upper bound on $P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right)$.
\begin{theorem} \label{thm:BDEC_UB}
An upper bound on $P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right)$ is given by
\begin{align}
P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right) &\le \sum_{u=d_0}^{n}{ \beta^{u} \left( 1 - \beta \right)^{n-u}}\sum_{w=d_0}^{u}{B_{0,w} \binom{n-w}{u-w}} \nonumber \\
&+ \sum_{e = d_1}^{n}{\alpha^e \left(1 - \alpha \right)^{n-e}
\sum_{w=d_1}^{e}{A_{w} \binom{n-w}{e-w}}}.
\end{align}
where $A_w$ is the weight distribution of $\mathcal{C}$. If $A_w$ and $B_{0, w}$ follow the binomial distribution,
\begin{equation} \label{eq:BDEC_UB}
P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right) \le 2^{-l} \left(1 + \beta \right)^n + 2^{-r} \left( 1 + \alpha \right)^n.
\end{equation}
\end{theorem}
\begin{proof}
The proof is given in Appendix~\ref{pf:BDEC_UB}-F.
\end{proof}
In this upper bound, we observe a dual relation between erasures and defects~\cite{Kim2016duality}. Note that $A_w$ and $B_{0,w}$ are the weight distributions of $\mathcal{C}$ and ${\mathcal{C}}_0^{\perp}$, respectively.
From these upper bounds on $P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right)$, we can modify \eqref{eq:opt_prob} for the BDEC as follows.
\begin{equation}\label{eq:BDEC_opt_prob}
\begin{aligned}
( \widehat{l}, \widehat{r} ) = \; & \underset{(l, r)}{\text{argmin}} & & \text{Upper bound on }P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right) \\
& \text{subject to} & & 0 \le l \le n - k, \quad 0 \le r \le n - k\\
&&& l+r = n-k
\end{aligned}
\end{equation}
If the code parameters $(n, k, l, d_0, d_1)$ and the channel parameters ($\alpha$, $\beta$) are given, the solution $( \widehat{l}, \widehat{r} )$ of \eqref{eq:BDEC_opt_prob} can be obtained. To illustrate this, we consider $\left[ n = 1023, k=923, l \right]$ PBCH codes. All possible redundancy allocation candidates of PBCH codes are listed in Table~\ref{tab:PLBC}. Since $l$ and $r$ are multiples of 10 (i.e., the degree of the Galois field of $[n = 1023, k]$ BCH codes), there are 11 redundancy allocation candidates. Hence, we can readily obtain the redundancy $( \widehat{l}, \widehat{r} )$ that minimizes the objective function of \eqref{eq:BDEC_opt_prob}.
In addition, the objective function is \emph{convex} if we treat $l$ and $r$ as real values, even though we know that they are non-negative integers less than or equal to $n-k$. We can derive the solution $(\widetilde{l}, \widetilde{r})$ of \eqref{eq:BDEC_opt_prob} satisfying \emph{Karush-Kuhn-Tucker} (KKT) conditions.
\begin{corollary} \label{cor:BDEC_KKT} Treating $l$ and $r$ as real values, the solution of \eqref{eq:BDEC_opt_prob} satisfying KKT conditions is given by
\begin{numcases}{(\widetilde{l}, \widetilde{r})=}
(0, n-k), & \hspace{-5mm} for $\frac{1+\alpha}{1+\beta} > 2^{1 - R} $ \label{eq:BDEC_opt_sol_con1}
\\
\left( \check{l}, \check{r} \right), & \hspace{-5mm} for $2^{-(1 - R)} \le \frac{1+\alpha}{1+\beta} \le 2^{1 - R} $ \label{eq:BDEC_opt_sol_con3}
\\
(n-k, 0), & \hspace{-5mm} for $\frac{1+\alpha}{1+\beta} < 2^{-(1 - R)}$ \label{eq:BDEC_opt_sol_con2}
\end{numcases}
where $\left( \check{l}, \check{r} \right)$ is given by
\begin{align}
\check{l} &= \frac{1}{2} \left\{ n \left( 1 - \log_2{\frac{1+\alpha}{1 +\beta}} \right) - k \right\}, \label{eq:BDEC_opt_sol_1} \\
\check{r} &= \frac{1}{2} \left\{ n \left( 1 + \log_2{\frac{1+\alpha}{1 +\beta}} \right) - k \right\}. \label{eq:BDEC_opt_sol_2}
\end{align}
\end{corollary}
\begin{proof}
The proof is given in Appendix~\ref{pf:BDEC_KKT}-G.
\end{proof}
\begin{table}[t]
\renewcommand{\arraystretch}{1.3}
\caption{BDEC with the Same $C_{\text{BDEC}}=0.96$}
\label{tab:BDEC_channel}
\centering
{\hfill{}
\small{
\begin{tabular}{c|c|c|c}
\hline
Channel & {$\alpha$} & {$\beta$} & {Remarks} \\ \hline \hline
1 & 0.040 & 0 & BEC \\ \hline
2 & 0.035 & 0.005 & \\ \hline
3 & 0.025 & 0.015 & \\ \hline
4 & 0.020 & 0.020 & \\ \hline
5 & 0.015 & 0.025 & \\ \hline
6 & 0.005 & 0.035 & \\ \hline
7 & 0 & 0.040 & BDC \\ \hline
\end{tabular}}
}
\hfill{}
\vspace{-3mm}
\end{table}
If $\alpha$ is much larger than $\beta$ such that $\frac{1+\alpha}{1+\beta} > 2^{1 - R} $ for all possible $(l, r)$, then \eqref{eq:BDEC_opt_sol_con1} shows that we should allot all redundancy for correcting erasures to minimize the upper bound of \eqref{eq:BDEC_opt_prob}. If $\beta$ is much larger than $\alpha$ such that $\frac{1+\alpha}{1+\beta} < 2^{-(1 - R)}$ for all possible $(l, r)$, then \eqref{eq:BDEC_opt_sol_con2} shows that we should allot all redundancy for masking stuck-at defects to minimize the upper bound. For other $\alpha$ and $\beta$, we should allot the redundancy $(l, r)$ such that $2^{-l} \left(1 + \beta \right)^n = 2^{-r} \left( 1 + \alpha \right)^n$ to minimize the upper bound, which are satisfied by \eqref{eq:BDEC_opt_sol_1} and \eqref{eq:BDEC_opt_sol_2}.
\begin{remark}
If only the normal cells can be erased, the corresponding channel's erasure probability is $\widetilde{\alpha} = (1-\beta)\alpha$. Hence the capacity will be $1 - \widetilde{\alpha} - \beta = (1 - \beta)(1-\alpha)$ which is the same as \eqref{eq:capacity_BDEC_tilde}. The equivalent results of Theorem~\ref{thm:BDEC_region}, Theorem~\ref{thm:BDEC_UB}, and Corollary~\ref{cor:BDEC_KKT} can be obtained by replacing $\alpha$ by $\widetilde{\alpha}$.
\end{remark}
In order to compare the optimal redundancy and the estimated redundancy allocation based on the derived upper bound, we consider several channels in Table~\ref{tab:BDEC_channel} whose capacities are all equal, i.e., $C_{\text{BDEC}}^{\text{enc}}=0.96$. For these channels, we investigate the performance of $\left[ n = 1023, k=923, l \right]$ PBCH codes in Table~\ref{tab:PLBC}.
Fig.~\ref{fig:plot_BDEC_RA} shows the simulation results for the channels in Table~\ref{tab:BDEC_channel}. The simulation results of channel 1 (BEC) and channel 7 (BDC) are omitted because their optimal redundancy allocations are obvious. The optimal redundancy allocation for channel 1 (BEC) is $\left(l^*, r^* \right) = (0, 100)$. The more stuck-at defects a channel has, the larger $l$ is expected to be for the optimal redundancy allocation. Eventually, the optimal redundancy allocation for channel 7 (BDC) will be $\left(l^*, r^* \right) = (100, 0)$. The optimal $\left(l^*, r^*\right)$ can be obtained from Monte-Carlo simulation results in Fig.~\ref{fig:plot_BDEC_RA}, which are presented in the second column of Table~\ref{tab:BDSC_redundancy}.
We can readily obtain the redundancy $(\widehat{l}, \widehat{r})$ that minimizes the upper bounds in Fig.~\ref{fig:plot_BDEC_RA}. The estimates of redundancy allocation $(\widehat{l}, \widehat{r})$ are shown in the third column of Table~\ref{tab:BDEC_redundancy} which shows that $(\widehat{l}, \widehat{r})$ by the upper bounds matches very well the redundancy $(l^*, r^*)$ determined by Monte-Carlo simulations.
Next, $(\widetilde{l}, \widetilde{r})$ can be calculated from \eqref{eq:BDEC_opt_sol_con1}--\eqref{eq:BDEC_opt_sol_2} by treating $l$ and $r$ as real values. Resulting $(\widetilde{l}, \widetilde{r})$ values are shown in the last column of Table~\ref{tab:BDEC_redundancy}. $(\widehat{l}, \widehat{r} )$ is the nearest one from $(\widetilde{l}, \widetilde{r})$ considering the possible redundancy allocation candidates in Table~\ref{tab:PLBC}.
\begin{figure}[!t]
\centering
\includegraphics[width=0.4\textwidth]{fig_plot_BDEC_RA.eps}
\caption{Comparison of simulation results (simul.) and upper bounds (UB) of the probability of recovery failure $P(\widehat{\mathbf{m}} \ne \mathbf{m})$ of BDEC channels in Table \ref{tab:BDEC_channel}.}
\label{fig:plot_BDEC_RA}
\end{figure}
\begin{table}[t]
\renewcommand{\arraystretch}{1.3}
\caption{Optimal Redundancy Allocations $\left(l^*, r^*\right)$ and Their Estimates $(\widehat{l}, \widehat{r})$ and $(\widetilde{l}, \widetilde{r})$ of BDEC}
\label{tab:BDEC_redundancy}
\centering
\small{
\begin{tabular}{c|c|c|c}
\hline
Channel & {$\left(l^*, r^*\right)$} & {$(\widehat{l}, \widehat{r})$} & {$(\widetilde{l}, \widetilde{r})$} \\ \hline \hline
1 & (0, 100) & (0, 100) & (0, 100) \\ \hline
2 & (30, 70) & (30, 70) & (28.3, 71.7) \\ \hline
3 & (40, 60) & (40, 60) & (42.8, 57.2) \\ \hline
4 & (50, 50) & (50, 50) & (50, 50) \\ \hline
5 & (60, 40) & (60, 40) & (57.2, 42.8) \\ \hline
6 & (70, 30) & (70, 30) & (71.7, 28.3) \\ \hline
7 & (100, 0) & (100, 0) & (100, 0) \\ \hline
\end{tabular}}
\vspace{-5mm}
\end{table}
\subsection{Redundancy Allocation: BDSC} \label{sec:BDSC_ra}
A similar approach to redundancy allocation of the BDEC will be used for the BDSC. Instead of minimizing the upper bound on $P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right)$, we will derive an estimate of $P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right)$ for the BDSC and the redundancy allocation $(l, r)$ that minimizes this estimate of $P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right)$ will be used.
For the BDC and the BDEC, the number of unmasked defects after encoding failure (i.e., $\mathbf{c} \circ \mathbf{s} \ne \mathbf{c}$) does not affect $P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right)$. On the other hand, the number of unmasked defects is important for $P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right)$ of the BDSC. The reason is that the stuck-at errors due to unmasked defects can be treated as random errors and corrected during the decoding stage. Hence, we propose a two-step encoding method (described in Algorithm~\ref{alg:twostep}), which reduces the performance gap between \eqref{eq:BDC_opt_problem} and \eqref{eq:BDC_LE}.
\begin{algorithm}
\caption{Two-step Encoding}\label{alg:twostep}
\begin{algorithmic}[]
\State \textbf{Step 1:} Try to solve \eqref{eq:BDC_LE}, i.e., $G_0^{\mathcal{U}} {\mathbf{d}} = {\mathbf{b}}^{\mathcal{U}}$.
\If{$u < d_0$} go to \textbf{End}. \Comment A solution $\mathbf{d}$ always exists.
\Else
\Comment A solution ${\mathbf{d}}$ exists so long as \eqref{eq:BDC_LE_sol_exist} holds.
\If{$\mathbf{d}$ exists} go to \textbf{End}.
\Else ~go to \textbf{Step 2}.
\EndIf
\EndIf
\State \textbf{Step 2:}
\begin{itemize}
\item Choose $d_0 - 1$ locations among $\mathcal{U}$ and define ${\mathcal{U}}' = \left\{i_1, \ldots, i_{d_0 - 1}\right\}$.
\item Solve the following linear equation: $G_0^{\mathcal{U}'}{\mathbf{d}} = {\mathbf{b}}^{\mathcal{U}'}$ \qquad \qquad \Comment A solution $\mathbf{d}$ always exists.
\end{itemize}
\State \textbf{End}
\end{algorithmic}
\end{algorithm}
The two-step encoding tries to reduce the number of unmasked defects by using the second step (i.e., Step 2) even though $\mathbf{c} \circ \mathbf{s} \ne \mathbf{c}$. When the encoder fails to solve \eqref{eq:BDC_LE}, the encoder randomly chooses $d_0 - 1$ defect locations among $\mathcal{U}$ and define ${\mathcal{U}}' = \left\{i_1, \ldots, i_{d_0 - 1}\right\}$. Afterwards, the encoder solves $G_0^{\mathcal{U}'}{\mathbf{d}} = {\mathbf{b}}^{\mathcal{U}'}$ where a solution $\mathbf{d}$ always exists by the definition of $d_0$ in \eqref{eq:PLBC_d0}. If $\mathbf{d}$ is obtained in Step 2, then the number of unmasked defects is $u - \left(d_0 - 1 \right)$ instead of $u$. For the BDC and the BDEC, Step 2 cannot improve $P(\widehat{\mathbf{m}} \ne \mathbf{m})$ since unmasked stuck-at defects cannot be corrected during the decoding stage. However, Step 2 is helpful for the BDSC since the stuck-at errors can be regarded as random errors and corrected at the decoder.
The two-step encoding's complexity is ${\mathcal{O}}\left( u^3\right)$ because both Step 1 and Step 2 are related to solving the linear equations. Also, the bounded distance decoding for estimating $\widehat{\mathbf{z}}$ can be implemented by polynomial decoding algorithms. For PBCH codes, standard algorithms such as Berlekamp-Massey algorithm can be used for decoding. The flow of PLBC's decoding for the BDSC was explained in Section \ref{subsec:PLBC}.
We will derive the upper bound on $P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right)$ where the two-step encoding and the bounded distance decoding are used.
\begin{theorem}\label{thm:BDSC_bound_fail} The upper bound on $P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right)$ is given by
\begin{align}
\hspace{-3mm} & P\left( \widehat{\mathbf{m}}\ne \mathbf{m} \right) \nonumber \\
\hspace{-3mm} & \le \left[ \sum_{u=d_0}^{n} \left\{ \hspace{-1mm} { \binom{n}{u} \beta^{u} \left( 1 - \beta \right)^{n-u}} \min \left\{ \frac{ \sum_{w=d_0}^{u}{B_{0,w} \binom{n-w}{u-w}}}{\binom{n}{u}}, 1\right\} \right. \right. \nonumber\\
\hspace{-3mm} & \left. \left.\cdot \sum_{t=t_1 + d_0 - u}^{n}{\binom{n}{t} p^{t} \left( 1 - p \right)^{n-t}} \right\} \right] + \sum_{t=t_1 + 1}^{n}{\binom{n}{t}p^t (1-p)^{n-t}}
\label{eq:BDSC_bound_fail}
\end{align}
where $t_1 = \left\lfloor \frac{d_1 - 1}{2} \right\rfloor$ is the error correcting capability of $\mathcal{C}$.
\end{theorem}
\begin{proof}The proof is given in Appendix~\ref{pf:BDSC_bound_fail}-H.
\end{proof}
During the derivation of the upper bound of \eqref{eq:BDSC_bound_fail}, we regard all the unmasked stuck-at defects as random errors. However, on average, only half of the unmasked defects result in error if $P(S=0) = P(S = 1) = \frac{\beta}{2}$. Thus, we can derive the following estimate of $P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right)$.
\begin{corollary}\label{cor:BDSC_estimate_fail} The estimate of $P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right)$ is given by
\begin{align}
& \hspace{-1mm} P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right) \nonumber \\
& \hspace{-1mm} \simeq \left[ \sum_{u=d_0}^{n} \left\{ {\binom{n}{u} \beta^{u} \left( 1 - \beta \right)^{n-u}} \min\left\{ \frac{\sum_{w=d_0}^{u}{B_{0,w} \binom{n-w}{u-w}}}{\binom{n}{u}} , 1 \right\} \right.\right. \nonumber \\
& \quad \cdot \left.\left. \sum_{t=t_1 - \left\lceil \frac{u - d_0 + 1}{2} \right\rceil + 1 }^{n}{\binom{n}{t} p^{t} \left( 1 - p \right)^{n-t}} \right\} \right]\nonumber \\
& + \sum_{t=t_1 + 1}^{n}{\binom{n}{t}p^t (1-p)^{n-t}} \label{eq:BDSC_estimate_fail}
\end{align}
where $\lceil x \rceil$ is the smallest integer not less than $x$.
\end{corollary}
\begin{proof}
The proof is given in Appendix~\ref{pf:BDSC_bound_fail}.
\end{proof}
In order to compare the optimal redundancy $(l^*, r^*)$ and the estimated redundancy allocation, we consider the several channels shown in Table \ref{tab:BDSC_channel}. Channel 1 and Channel 7 are equivalent to the BSC and the BDC, respectively. For the other channels from Channel 2 to Channel 6, their lower bounds of the capacity $C_{\text{BDSC}}^{\text{lower}}$ of \eqref{eq:capacity_lower_BDSC} and the upper bounds $C_{\text{BDSC}}^{\text{upper}}$ are almost the same. Thus, we can estimate $C_{\text{BDSC}}^{\text{enc}}$ from bounds although the closed-form of $C_{\text{BDSC}}^{\text{enc}}$ is not known.
It is worth mentioning that all the channel parameters are chosen to have almost the same $\widetilde{p} \simeq 4 \times 10^{-3}$, which was given by~\eqref{eq:p_tilde}. Hence, all the channels show similar $P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right)$ for $(l, r) = (0, 100)$ which represents the case when the defect information is not used. On the other hand, each channel has different $C_{\text{BDSC}}^{\text{enc}}$. The larger $\beta$, the more defect information we can obtain, which results in the larger $C_{\text{BDSC}}^{\text{enc}}$. We apply $\left[ n = 1023, k=923, l \right]$ PBCH codes in Table \ref{tab:PLBC}.
Fig.~\ref{fig:plot_BDSC_RA} compares the simulation results and the estimates of $P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right)$ for the channels in Table~\ref{tab:BDSC_channel}, which shows that the estimates of $P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right)$ given by \eqref{eq:BDSC_estimate_fail} match well with simulation results. Hence, we can choose the redundancy allocation minimizing the estimates instead of the simulation results in spite of the binomial approximation of \eqref{eq:B0w_approximate}. The redundancy allocation that minimizes the estimate of $P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right)$ is the estimate of the optimal redundancy allocation, i.e., $(\widehat{l}, \widehat{r})$. The simulation results of $P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right) < 10^{-8}$ are incomplete because of their impractical computations.
Table~\ref{tab:BDSC_redundancy} shows that the estimate of the optimal redundancy allocation $(\widehat{l}, \widehat{r})$ is the same as the optimal redundancy allocation $(l^*, r^*)$ for the channels in Table~\ref{tab:BDSC_channel}. Thus, we can accurately estimate the optimal redundancy allocation without simulations. The estimate of optimal redundancy allocation requires much less computations than Monte-Carlo simulations.
\begin{table}[t]
\renewcommand{\arraystretch}{1.3}
\caption{Several Channel Parameters of the BDSC}
\label{tab:BDSC_channel}
\centering
{\small
\begin{tabular}{c|c|c|c|c}
\hline
Channel & {$p$} & {$\beta$} & $C_{\text{BDSC}}^{\text{lower}}$ & $C_{\text{BDSC}}^{\text{upper}}$ \\ \hline \hline
1 & $4.0 \times 10^{-3}$ & 0 & \multicolumn{2}{c}{0.9624} \\ \hline
2 & $3.0 \times 10^{-3}$ & $2.0 \times 10^{-3}$ & 0.9685 & 0.9686 \\ \hline
3 & $2.5 \times 10^{-3}$ & $3.0 \times 10^{-3}$ & 0.9718 & 0.9719 \\ \hline
4 & $2.0 \times 10^{-3}$ & $4.0 \times 10^{-3}$ & 0.9752 & 0.9753 \\ \hline
5 & $1.0 \times 10^{-3}$ & $6.0 \times 10^{-3}$ & 0.9826 & 0.9827 \\ \hline
6 & $5.0 \times 10^{-4}$ & $7.0 \times 10^{-3}$ & 0.9868 & 0.9868 \\ \hline
7 & 0 & $8.0 \times 10^{-3}$ & \multicolumn{2}{c}{0.9920} \\ \hline
\end{tabular}
}
\vspace{-2mm}
\end{table}
\begin{figure}[!t]
\centering
\includegraphics[width=0.4\textwidth]{fig_plot_BDSC_RA.eps}
\caption{Comparison of simulation results and estimates of the probability of recovery failure $P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right)$.}
\label{fig:plot_BDSC_RA}
\vspace{-3mm}
\end{figure}
\begin{table}[t]
\renewcommand{\arraystretch}{1.3}
\caption{Optimal Redundancy Allocations $(l^*, r^*)$ and Their Estimates $(\widehat{l}, \widehat{r})$ of BDSC by~\eqref{eq:BDSC_estimate_fail}}
\label{tab:BDSC_redundancy}
\centering
{\small
\begin{tabular}{c|c|c}
\hline
Channel & $(l^*, r^*)$ & $(\widehat{l}, \widehat{r})$ \\ \hline \hline
1 & (0, 100) & (0, 100) \\ \hline
2 & (10, 90) & (10, 90) \\ \hline
3 & (10, 90) & (10, 90) \\ \hline
4 & (20, 80) & (20, 80) \\ \hline
5 & (30, 70) & (30, 70) \\ \hline
6 & (30, 70) & (30, 70) \\ \hline
7 & (100, 0) & (100, 0) \\ \hline
\end{tabular}}
\vspace{-5mm}
\end{table}
Fig.~\ref{fig:plot_BDSC_RA} also shows that the optimal redundancy allocation significantly improves $P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right)$. For example, $P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right)$ of channel 6 is $1.00 \times 10^{-7}$ with the optimal redundancy allocation $(l^*, r^*) = (30, 70)$ whereas $P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right)$ is $2.80 \times 10^{-3}$ with $(l, r) = (0, 100)$. Thus, it is important to find and use the optimal redundancy allocation for better $P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right)$.
In addition, it is worth mentioning that $P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right)$ for $(l^*, r^*)$ improves as $\beta$ increases in Fig.~\ref{fig:plot_BDSC_RA}. $P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right)$ of all the channels are almost the same for the redundancy allocation of $\left(l=0, r=n-k\right)$ because all the channel parameters are chosen to have the same $\widetilde{C}_{\text{BDSC}}^{\text{min}}$. As $\beta$ increases, $P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right)$ for $(l^*, r^*)$ improves because the PLBC can exploit more defect information as indicated by the lower and upper bounds on $C_{\text{BDSC}}^{\text{enc}}$ in Table \ref{tab:BDSC_channel}.
\section{\uppercase{Conclusion}} \label{sec:conclusion}
The redundancy allocation of finite-length codes for memory with permanent stuck-at defects and transient errors was investigated. We derived the upper bound on the probability of recovery failure for the BDEC and the estimate of the probability of recovery failure for the BDSC. Based on these analytical results, we estimated the optimal redundancy allocation effectively. The estimated redundancy allocation matches the optimal redundancy allocation well while requiring much less computation than Monte-Carlo simulations.
\appendices
\section*{A. Proof of Proposition~\ref{thm:capacity_BDEC}\label{pf:capacity_BDEC}}
By Gelfand-Pinsker theorem~\cite{Gelfand1980},
\begin{equation}
C_{\text{BDEC}}^{\text{enc}} = \max_{P(U \mid S), X(U, S)}{(I(U; Y) - I(U; S))}
\end{equation}
where $\left| \mathcal{U} \right| \le \min{ \left\{ \left| \mathcal{X} \right| \cdot \left| \mathcal{S} \right|, \left| \mathcal{Y} \right| + \left| \mathcal{S} \right| - 1 \right\}}$.
It is clear that $I(U; Y) - I(U; S) = H(U \mid S) - H(U \mid Y)$. For $S = \lambda$, set $U \sim \text{Bern}(1/2)$ and $X=U$, i.e., $U$ is a Bernoulli random variable with parameter $\frac{1}{2}$. If $S \ne \lambda$, we set $U=X=S$. Then, $H(U \mid S) = H(X \mid S) = 1 - \beta$. In addition, $ H(U\mid Y) = H(X) - I(X; Y) = \alpha$ where $H(X) = 1$ follows from $P(X = 0) = P(X = 1)$ for both stuck-at defects and normal cells. We should minimize $H(U \mid Y)$ to obtain $C_{\text{BDEC}}^{\text{enc}}$, which can be achieved by setting $I(X;Y) = 1 - \alpha$ (i.e., the capacity of the BEC). Hence, $C_{\text{BDEC}}^{\text{enc}} = 1 - \alpha - \beta$.
\section*{B. Proof of Proposition~\ref{thm:capacity_bound_BDSC} \label{pf:capacity_bound_BDSC}}
The upper bound of \eqref{eq:capacity_bound_BDSC} is easy to see because of \eqref{eq:capacity_BDSC_tilde} where we assume that the stuck-at defects do not suffer from random errors. Unlike the BDEC, the unmasked defects in the BDSC can be corrected by the decoder. Hence, we can allow the encoder to mask a fraction of stuck-at defects. Suppose that $\eta$ denotes the fraction of unmasked stuck-at defects during encoding. We need to find the optimal $\eta^*$, which makes it complicated to derive the capacity in~\cite{Heegard1983plbc}. By setting $\eta = 0$ instead of using the optimal $\eta^*$, the lower bound of \eqref{eq:capacity_lower_BDSC} can be derived, which is similar to the proof of Proposition \ref{thm:capacity_BDEC}. For $S = \lambda$, set $U \sim \text{Bern}(1/2)$ and $X=U$. For $S \ne \lambda$, we set $U=X=S$ which means that $\eta = 0$. Then, $H(U \mid S) = 1 - \beta$. In addition, $H(U\mid Y) = H(X \mid Y) = h(p)$. Hence, $C_{\text{BDSC}}^{\text{lower}} = 1 - \beta - h(p)$.
\section*{C. Proof of Proposition ~\ref{thm:BDC_capacity} \label{pf:BDC_capacity}}
Suppose that each element of $G_0$ is selected at random with equal probability from $\{0, 1\}$. Then,
\begin{align}
P\left( E=0 \right) & = P\left( E=0, n(\beta - \epsilon) \le |{\mathcal{U}}| \le n(\beta + \epsilon) \right) + \epsilon' \nonumber\\
& \le \sum_{u=n(\beta - \epsilon)}^{n(\beta + \epsilon)}{P\left(\rank\left(G_0^{{\mathcal{U}}}\right) < u \mid |{\mathcal{U}}|=u\right)} + \epsilon' \nonumber\\
& \le (2n\epsilon + 1) 2^{n \left( \frac{k}{n} - (1 - \beta) + \epsilon\right)} + \epsilon' \label{eq:BDC_CA}
\end{align}
where we assume that $n(\beta \pm \epsilon)$ are integers without loss of generality. If $R = \frac{k}{n} < C_{\text{BDC}} - \epsilon$, $P\left( E=0 \right)$ converges to zero as $n \rightarrow \infty$.
\section*{D. Proof of Lemma~\ref{lemma:BDC_ef_UB_fixed_u}\label{pf:BDC_ef_UB_fixed_u}}
First, we will show that
\begin{align}
&P\left(E=0 \mid U=u\right) \nonumber \\
&= \sum_{j=1}^{u}{\left(1 - \frac{1}{2^j} \right)P \left( \rank \left( G_0^{\mathcal{U}} \right) =u - j \mid U=u \right)}.\label{eq:BDC_exact}
\end{align}
If $\rank \left( G_0^{\mathcal{U}} \right) = u$, \eqref{eq:BDC_LE} has at least one solution since \eqref{eq:BDC_LE_sol_exist} holds, i.e., $P\left(E=0 \mid U=u\right)=0$. If $\rank \left( G_0^{\mathcal{U}} \right) = u - j$ for $1 \le j \le u$, the last $j$ rows of the row reduced echelon form of $G_0^{\mathcal{U}}$ are zero vectors. In order to satisfy \eqref{eq:BDC_LE_sol_exist}, the last $j$ elements of the column vector $\mathbf{b}^{\mathcal{U}}$ should also be zeros. The probability that the last $j$ elements of $\mathbf{b}^{\mathcal{U}}$ are zeros is $\frac{1}{2^j}$ since $P(S=0 \mid S \ne \lambda) = P(S=1 \mid S \ne \lambda) = \frac{1}{2}$. Thus, $P\left(E=0 \mid U=u\right)$ is given by \eqref{eq:BDC_exact}. Also,
\begin{align}
\frac{P \left( \rank \left( G_0^{\mathcal{U}} \right) < u \mid U=u \right)}{2}
\le P\left(E=0 \mid U=u\right) \nonumber \\
\le P \left( \rank \left( G_0^{\mathcal{U}} \right) < u \mid U=u \right). \label{eq:enc_fail_upper0}
\end{align}
Suppose that there exists a nonzero codeword ${\mathbf{c}}^{\perp} \in {\mathcal{C}}_{0}^{\perp}$ of Hamming weight $w$. Note that $G_0$ is the parity check matrix of ${\mathcal{C}}_{0}^{\perp}$. Let $\Psi_w({\mathbf{c}}^{\perp})=\left\{ i \mid c_i^{\perp} \ne 0 \right\}$ denote the locations of nonzero elements of ${\mathbf{c}}^{\perp}$ and ${\mathcal{U}} = \left\{i_1,\ldots,i_u \right\}$ denote the locations of $u$ defects.
If $\Psi_w({\mathbf{c}}^{\perp}) \subseteq \mathcal{U}$, $\rank \left( G_0^{\mathcal{U}} \right) < u$. Note that $G_0^{\Psi_{w}({\mathbf{c}}^{\perp})}$ is a submatrix of $G_0^{\mathcal{U}}$ and the rows of $G_0^{\Psi_{w}({\mathbf{c}}^{\perp})}$ are linearly dependent since $G_0^T {\mathbf{c}}^{\perp} = {\mathbf{0}}$.
For any $\mathbf{c}^{\perp}$ such that $\Psi_w({\mathbf{c}}^{\perp}) \subseteq {\mathcal{U}}$, the number of possible $\mathcal{U}$ is $\binom{n-w}{u-w}$. Due to double counting, the number of $\mathcal{U}$ which results in $\rank \left( G_0^{\mathcal{U}} \right) < u$ will be less than or equal to $\sum_{w=d_{0}}^{u}{B_{0,w} \binom{n-w}{u-w}}$. Since the number of all possible $\mathcal{U}$ such that $U=u$ is $\binom{n}{u}$,
\begin{equation} \label{eq:BDC_upper_bound_rank}
P\left(\rank \left( G_0^{\mathcal{U}} \right) < u \mid U=u \right) \le \frac{\sum_{w=d_{0}}^{u}{B_{0, w} \binom{n-w}{u-w}}}{\binom{n}{u}}.
\end{equation}
From \eqref{eq:enc_fail_upper0} and \eqref{eq:BDC_upper_bound_rank}, the upper bound on $P\left(E=0 \mid U=u \right)$ is given by \eqref{eq:enc_fail_upper}. Note that we set $P\left(E=0 \mid U=u \right) = 1$ if $\frac{\sum_{w=d_{0}}^{u}{B_{0, w} \binom{n-w}{u-w}}}{\binom{n}{u}} \ge 1$.
\section*{E. Proof of Lemma~\ref{lemma:BDC_ef_exact}\label{pf:BDC_ef_exact}}
The proof has two parts. First, we will show that
\begin{equation} \label{eq:BDC_exact_condition_pf1}
P\left(\rank \left( G_0^{\mathcal{U}} \right) < u \mid U=u \right) = \frac{\sum_{w=d_{0}}^{u}{B_{0, w} \binom{n-w}{u-w}}}{\binom{n}{u}}
\end{equation}
for $u \le d_0 + t_0$ where $t_0 = \left\lfloor \frac{d_0 - 1}{2} \right\rfloor$, which means that there is no double counting in \eqref{eq:BDC_upper_bound_rank}. Second, we will prove that
\begin{align}
& P\left(\rank \left( G_0^{\mathcal{U}} \right) < u \mid U=u \right) \nonumber \\
& \quad = P\left(\rank \left( G_0^{\mathcal{U}} \right) = u-1 \mid U=u \right) \label{eq:BDC_exact_condition_pf2}
\end{align}
for $u \le d_0 + t_0$, i.e., $P\left(\rank \left( G_0^{\mathcal{U}} \right) \le u-2 \mid U=u \right)=0$.
Then, $P\left(E=0 \mid U=u \right)$ is given by
\begin{align}
\hspace{-5mm}P\left(E=0 \mid U=u \right)
&= \frac{P \left( \rank \left( G_0^{\mathcal{U}} \right) = u - 1 \mid U=u \right)}{2} \label{eq:BDC_exact_condition_step1}\\
&= \frac{1}{2} \cdot \frac{\sum_{w=d_{0}}^{u}{B_{0, w} \binom{n-w}{u-w}}}{\binom{n}{u}} \label{eq:BDC_exact_condition_step2}
\end{align}
where \eqref{eq:BDC_exact_condition_step1} follows from \eqref{eq:BDC_exact} and \eqref{eq:BDC_exact_condition_pf2}. Also, \eqref{eq:BDC_exact_condition_step2} follows from \eqref{eq:BDC_exact_condition_pf1}.
1) Proof of \eqref{eq:BDC_exact_condition_pf1}
Suppose that there are two nonzero codewords ${\mathbf{c}}_1^{\perp}, {\mathbf{c}}_2^{\perp} \in {\mathcal{C}}_0^{\perp}$ such that $\|{\mathbf{c}}_1^{\perp}\| = w_1$ and $\|{\mathbf{c}}_2^{\perp}\| = w_2$. Without loss of generality, assume that $d_0 \le w_1 \le w_2$. The locations of nonzero elements in ${\mathbf{c}}_1^{\perp}$ and ${\mathbf{c}}_2^{\perp}$ are given by $ \Psi_{w_1}\left({\mathbf{c}}_1^{\perp}\right)= \left\{ i_{1,1},\ldots,i_{1, w_1} \right\}$ and $ \Psi_{w_2}\left({\mathbf{c}}_2^{\perp}\right)= \left\{ i_{2,1},\ldots,i_{2, w_2} \right\}$.
Let $\Psi_{\alpha}=\left\{i_1, \ldots, i_{\alpha} \right\}$ denote $\Psi_{\alpha} = \Psi_{w_1}\left({\mathbf{c}}_1^{\perp}\right) \cap \Psi_{w_2}\left({\mathbf{c}}_2^{\perp}\right)$. Then, $\Psi_{w_1}\left({\mathbf{c}}_1^{\perp}\right) = \Psi_{\alpha} \cup \left\{ i_{1,1}',\ldots,i_{1, \beta_1}' \right\}$ and $\Psi_{w_2}\left({\mathbf{c}}_2^{\perp}\right) = \Psi_{\alpha} \cup \left\{ i_{2,1}',\ldots,i_{2, \beta_2}' \right\}$ where $i_{1, j_1}'$ for $j_1 \in \left\{1, \ldots, \beta_1 \right\}$ and $i_{2, j_2}'$ for $j_2 \in \left\{1, \ldots, \beta_2 \right\}$ are the reindexed locations of nonzero elements of ${\mathbf{c}}_1^{\perp}$ and ${\mathbf{c}}_2^{\perp}$ that are mutually disjoint with $\Psi_{\alpha}$. Note that $\left\{ i_{1,1}',\ldots,i_{1, \beta_1}' \right\} \cap \left\{ i_{2,1}',\ldots,i_{2, \beta_2}' \right\} = \emptyset $, $\beta_1 = w_1 - \alpha$ and $\beta_2 = w_2 - \alpha$.
Due to the property of linear codes, ${\mathbf{c}}_3^{\perp} = {\mathbf{c}}_1^{\perp} + {\mathbf{c}}_2^{\perp}$ is also a codeword of ${\mathcal{C}}_0^{\perp}$, i.e., ${\mathbf{c}}_3^{\perp} \in {\mathcal{C}}_0^{\perp}$ and $\|{\mathbf{c}}_3^{\perp} \|=\beta_1 + \beta_2$. Also, the following conditions hold because of the definition of $d_0$.
\begin{equation*}
\alpha + \beta_1 \ge d_0, \quad \alpha + \beta_2 \ge d_0, \quad \beta_1 + \beta_2 \ge d_0
\end{equation*}
Thus, we can claim that $2 \left( \alpha + \beta_1 + \beta_2 \right) \ge 3 d_0$, which results in $\alpha + \beta_1 + \beta_2 \ge d_0 + \left\lfloor \frac{d_0 + 1}{2} \right\rfloor = d_0 + t_0 + 1$ since $\alpha + \beta_1 + \beta_2$ has to be an integer.
For double counting to occur in \eqref{eq:BDC_upper_bound_rank}, there should exist at least two codewords ${\mathbf{c}}_1^{\perp}$ and ${\mathbf{c}}_2^{\perp}$ such that $\Psi_{w_1}\left({\mathbf{c}}_1^{\perp}\right) \cup \Psi_{w_2}\left({\mathbf{c}}_2^{\perp}\right) \subseteq\mathcal{U}$. It means that double counting occurs only if $u \ge \alpha + \beta_1 + \beta_2 \ge d_0 + t_0 + 1$. Thus, there is no double counting for $u \le d_0 + t_0$. For $u \le d_0 + t_0$, there exists at most one codeword ${\mathbf{c}}^{\perp}$ such that $\Psi_{w}\left({\mathbf{c}}^{\perp} \right) \subseteq {\mathcal{U}}$.
2) Proof of \eqref{eq:BDC_exact_condition_pf2}
It is clear that $\rank \left( G_0^{\mathcal{U}}\right) = u - 1$ if and only if there exists only one nonzero codeword $\mathbf{c}^{\perp}$ such that $\Psi_{w}\left( {\mathbf{c}}^{\perp} \right) \subseteq {\mathcal{U}}$. Note that $\rank \left( G_0^{\mathcal{U}}\right) < u - 1$ if and only if $\mathcal{U}$ includes the locations of nonzero elements of at least two nonzero codewords. We have already shown that there exists at most one nonzero codeword ${\mathbf{c}}^{\perp}$ such that $\Psi_{w}\left( {\mathbf{c}}^{\perp} \right) \subseteq {\mathcal{U}}$ for $u \le d_0 + t_0$.
\section*{F. Proof of Theorem~\ref{thm:BDEC_UB}\label{pf:BDEC_UB}}
From $P\left( \widehat{\mathbf{m}} \ne {\mathbf{m}} \right) = P\left(E=0\right) + P\left(E=1, D=0\right)$, we derive the upper bounds on $P\left(E=0\right)$ and $P\left(E=1, D=0\right)$ respectively. The upper bounds on $P\left(E=0\right)$ was shown in Corollary~\ref{cor:BDC_UB_1} and \ref{cor:BDC_UB_2}. If the additive encoding succeeds (i.e., $E=1$), then the corresponding channel is equivalent to the BEC with the erasure probability $\alpha$. The upper bound is given by
\begin{align}
P\left(E=1, D=0\right) & \le \sum_{e = d_1}^{n}{\alpha^e \left(1 - \alpha \right)^{n-e}
\sum_{w=d_1}^{e}{A_{w} \binom{n-w}{e-w}}} \nonumber \\
& = 2^{-r} \left(1 + \alpha \right)^n \label{eq:RA_D}
\end{align}
which follows from $
P\left(D=0 \mid |{\mathcal{E}}|=e \right) \le \frac{\sum_{w=d_{1}}^{e}{A_{w} \binom{n-w}{e-w}}}{\binom{n}{e}}$. If $A_w = 2^{-r} \binom{n}{w}$, \eqref{eq:RA_D} can be derived by a similar way as for Corollary~\ref{cor:BDC_UB_2}.
\section*{G. Proof of Corollary~\ref{cor:BDEC_KKT}\label{pf:BDEC_KKT}}
Suppose that $l$ and $r$ are real values. Since the objective function is convex and other constraints are linear, the optimization problem of \eqref{eq:BDEC_opt_prob} is convex. The Lagrangian $L$ is given by
\begin{align}
&L\left( l, r, \lambda_1, \lambda_2, \lambda_3, \lambda_4, \nu \right) = 2^{-l} \left(1 + \beta \right)^n + 2^{-r} \left( 1 + \alpha \right)^n \nonumber \\
& + \lambda_1 (-l) + \lambda_2 (-r) + \lambda_3 \left\{l - (n - k)\right\} + \lambda_4 \left\{r - (n - k)\right\} \nonumber \\
& + \nu \left\{ l + r - (n - k) \right\}
\end{align}
where $\lambda_i$ for $i = 1, 2, 3, 4$ are the Lagrange multipliers associated with the inequality constraints and $\nu$ is the Lagrange multiplier with the equality constraint.
The KKT conditions can be derived as follows.
\begin{align}
\nabla L & = 0 \label{eq:appendix_KKT_gradient_expand}\\
-l & \le 0, \quad -r \le 0 \\
l - (n - k) & \le 0,\quad r - (n - k) \le 0 \\
l + r - (n - k ) & = 0 \label{eq:appendix_KKT_equality} \\
\lambda_i & \ge 0, \quad i = 1,\ldots, 4 \\
\lambda_1 l & = 0, \quad \lambda_2 r = 0 \\
\lambda_3 \left\{ l - (n - k) \right\} & = 0, \quad \lambda_4 \left\{ r - (n - k) \right\} = 0
\end{align}
If $\alpha$ is much greater than $\beta$ such that $\frac{1+\alpha}{1+\beta} > 2^{1 - R} $, then we can claim that $2^{-l} \left(1 + \beta \right)^n < 2^{-r} \left(1 + \alpha \right)^n$ for any $(l, r)$ where $l+r = n-k$. By \eqref{eq:appendix_KKT_gradient_expand}, it is true that
\begin{equation}
2^{-r} \left(1 + \alpha \right)^n - 2^{-l} \left(1 + \beta \right)^n = \lambda_1' - \lambda_2' - \lambda_3' + \lambda_4' > 0
\end{equation}
where $\lambda_i' = \frac{\lambda_i}{\ln{2}}$. Thus, $\lambda_1 + \lambda_4 > \lambda_2 + \lambda_3 \ge 0$. It is clear that $(l, r) = (0, n-k)$ satisfies the KKT conditions since $\lambda_2 = \lambda_3 = 0$ due to complement slackness. If $\beta$ is much greater than $\alpha$ such that $\frac{1+\alpha}{1+\beta} < 2^{-(1 - R)}$, then it can be shown that $(l, r) = (n-k, 0)$ satisfies the KKT conditions similarly.
Otherwise, suppose that $0<l<n-k$ and $0 < r < n-k$. Due to complementary slackness, $\lambda_1 = \lambda_2 = \lambda_3 = \lambda_4 = 0$. Thus, \eqref{eq:appendix_KKT_gradient_expand} will be as follows.
\begin{align}
- \ln{2} \cdot 2^{-l} \left( 1 + \beta \right)^n + \nu &= 0 \label{eq:appendix_opt_sol_con3_1}\\
- \ln{2} \cdot 2^{-r} \left( 1 + \alpha \right)^n + \nu &= 0 \label{eq:appendix_opt_sol_con3_2}
\end{align}
By \eqref{eq:appendix_opt_sol_con3_1} and \eqref{eq:appendix_opt_sol_con3_2},
\begin{equation} \label{eq:appendix_opt_sol_con3_3}
2^{-l} \left( 1 + \beta \right)^n = 2^{-r} \left( 1 + \alpha \right)^n.
\end{equation}
Then, we can derive \eqref{eq:BDEC_opt_sol_1} and \eqref{eq:BDEC_opt_sol_2} by \eqref{eq:appendix_KKT_equality} and \eqref{eq:appendix_opt_sol_con3_3}.
\section*{H. Proof of Theorem~\ref{thm:BDSC_bound_fail} and Corollary~\ref{cor:BDSC_estimate_fail}\label{pf:BDSC_bound_fail}}
The probability of recovery failure $P\left( \widehat{\mathbf{m}} \ne \mathbf{m} \right)$ is given by
\begin{equation*}
P\left( \widehat{\mathbf{m}} \ne {\mathbf{m}} \right) = P(E=0, \widehat{\mathbf{m}} \ne {\mathbf{m}}) + P(E=1, \widehat{\mathbf{m}} \ne \mathbf{m}).
\end{equation*}
The stuck-at errors due to unmasked defects can be corrected at the decoder even if the encoding fails. First, we will derive the upper bound on $P(E=0, \widehat{\mathbf{m}} \ne \mathbf{m})$. By the chain rule, $P(E=0, \widehat{\mathbf{m}} \ne \mathbf{m})$ is given by
\begin{align}
{P(E=0, \widehat{\mathbf{m}} \ne \mathbf{m})} &= \sum_{u=1}^{n} { \left\{ P(U=u) P(E=0 \mid U=u) \right. } \nonumber \\
& \quad \left. \cdot {P(\widehat{\mathbf{m}} \ne {\mathbf{m}} \mid E=0,U=u)} \right\} \nonumber
\end{align}
where $P(U=u) = \binom{n}{u} \beta^{u} \left( 1 - \beta \right)^{n-u}$. In addition, the upper bound on $P(E=0 |U=u)$ is given by Lemma~\ref{lemma:BDC_ef_UB_fixed_u}. Also, $P(\widehat{\mathbf{m}} \ne {\mathbf{m}} \mid E=0, U=u)$ is given by
\begin{align}
{P(\widehat{\mathbf{m}} \ne {\mathbf{m}} \mid E=0, U=u)} &\le P\left( t \ge t_1 - u + d_0 \right). \label{eq:P_D0E0Uu1}
\end{align}
where $t$ is the number of random errors. Note that $u - \left( d_0 - 1 \right)$ represents the number of unmasked defects when two-step encoding fails. Since the number of random errors can be modeled by the binomial random variable, $P(\widehat{\mathbf{m}} \ne {\mathbf{m}} \mid E=0, U=u)$ is given by
\begin{align}
\hspace{-2mm}P\left( \widehat{\mathbf{m}} \ne {\mathbf{m}} \mid E=0, U=u \right)
&\le \hspace{-5mm} \sum_{t=t_1 + d_0 - u}^{n}\hspace{-2mm}{\binom{n}{t} p^{t} \left( 1 - p \right)^{n-t}}.
\end{align}
Hence,
\begin{align}
&P(E=0, \widehat{\mathbf{m}} \ne {\mathbf{m}}) \nonumber \\
& \le \sum_{u=d_0}^{n} \left\{ \binom{n}{u} {\beta^{u} \left( 1 - \beta \right)^{n-u}} {\min \left\{ \frac{\sum_{w=d_0}^{u}{B_{0,w} \binom{n-w}{u-w}}}{\binom{n}{u}} , 1\right\}} \right. \nonumber \\
&\quad\left. \cdot \sum_{t=t_1 + d_0 - u}^{n}{\binom{n}{t} p^{t} \left( 1 - p \right)^{n-t}} \right\}.
\end{align}
Now, we will derive the upper bound on $P(E=1, \widehat{\mathbf{m}} \ne \mathbf{m})$. If the encoding succeeds, the channel is equivalent to the BSC.
\begin{align}
P(E=1, \widehat{\mathbf{m}} \ne {\mathbf{m}}) \le \sum_{t=t_1 + 1}^{n}{\binom{n}{t}p^t (1-p)^{n-t}}.
\end{align}
For the proof of Corollary~\ref{cor:BDSC_estimate_fail}, we will change \eqref{eq:P_D0E0Uu1} by considering $P(S=0) = P(S=1) = \frac{\beta}{2}$. Because only the half of unmasked defects result in stuck-at errors on average,
\begin{align}
& {P(\widehat{\mathbf{m}} \ne {\mathbf{m}} \mid E=0, U=u)} \nonumber \\
& \simeq P\left( t \ge t_1 - \left\lceil \frac{u - d_0 + 1}{2} \right\rceil + 1 \right)
\end{align}
Thus, \eqref{eq:BDSC_bound_fail} will be changed into~\eqref{eq:BDSC_estimate_fail}.
\vspace{10pt}
\bibliographystyle{IEEE}
| {'timestamp': '2018-03-02T02:03:49', 'yymm': '1803', 'arxiv_id': '1803.00117', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00117'} | arxiv |
\section{Introduction} \label{ss:intro}
Non-rigid structure-from-motion (NRSfM) is a classical problem in computer vision, where the task is to recover the 3D shape of a deforming object from multiple images. Despite the fact that NRSfM for arbitrary deformation still remains an open problem, it can be solved efficiently under some mild prior assumptions about the deformation and the shape configuration \cite{dai2014simple, lee2013procrustean, kumar2017spatio, zhu2014complex, akhter2009nonrigid,kumar2016multi, kumar2017monocular,gait,gait2}.
Even though the existing solutions to \emph{sparse NRSfM} have demonstrated outstanding results, they do not scale to dense feature points and their resilience to noise remains unsatisfactory.
Moreover, the state-of-the-art algorithms \cite{garg2013dense, dai2017dense} to solve \emph{dense NRSfM} are computationally expensive and rely on the assumption of global low-rank shape which, unfortunately, fails to cater to the inherent local structure of the deforming shape over time. Consequently, to represent dense non-rigid structure under such formulations seem rather flimsy and implausible.
\begin{figure}[t]
\begin{center}
\includegraphics[width=1.0\linewidth]{Figures/firstPagePlot.pdf}
\caption{\small{Our algorithm takes dense long-term 2D trajectories of a non-rigid deforming object as input, and provides a dense detailed 3D reconstruction of it. The reconstructed surface captures the complex non-linear motion which can be helpful for real world applications such as 3D virtual and augmented reality. Example frames are taken from publicly available real datasets: real face sequence\cite{garg2013dense} and kinect\_paper sequence\cite{varol2012constrained} respectively.} \label{fig:firstpageresult}}
\end{center}
\vspace{-0.8cm}
\end{figure}
For many real-world applications, such as facial expression reconstruction, limitations such as scalability, timing, robustness, reliable modeling, \etc, are of crucial concern. Despite these limitations, no template-free approach exists that can reliably deal with these concerns. In this paper, we propose a template-free dense NRSfM algorithm that overcomes these difficulties. As a first step to overcome these difficulties, we reduce the overall high-dimensional non-linear space spanned by representing the deforming shape as a union of several local low-dimensional linear subspaces. Our approach is based on a simple idea/assumption \ie, any complex deforming surface can be approximated by a locally linear subspace structure \cite{crane2013conformal}. We use this simple intuition in a spatio-temporal framework to solve dense NRSfM. This choice naturally leads to a few legitimate queries:
\noindent {\emph{ a) Why spatio-temporal framework for solving dense NRSfM?}}
Spatio-temporal framework by Kumar \etal \cite{kumar2017spatio} has exhibited the state-of-the-art results on the recent NRSfM challenge \cite{challenge2017, jensen2018benchmark}.
A recent method \cite{Agudo2017CVPR} which follows the same idea as proposed by Kumar \etal \cite{kumar2017spatio} has also observed an improvement in the reconstruction accuracy under such formulations.
Even though the concept behind such a framework is elementary, no algorithm to our knowledge exists that exploit such an intrinsic idea for dense NRSfM.
\noindent{\emph{ b) Why the previously proposed spatio-temporal methods are unable to handle dense NRSfM?}}
The formulation proposed by Kumar \etal \cite{kumar2017spatio} and its adaptation \cite{Agudo2017CVPR} is inspired from SSC~\cite{elhamifar2009sparse}, and LRR~\cite{liu2013robust}. As a result, the complexity of their formulations grows exponentially in the order of the number of data points. This makes it difficult to solve dense NRSfM using their formulations. Moreover, these methods \cite{kumar2017spatio, zhu2014complex, Agudo2017CVPR} use an assumption that non-rigid shape should lie on a low-dimensional linear or affine subspace globally. In reality, such an assumption does not hold for all kinds of non-linear deformations \cite{wang2008manifold, rabaud2008re}. Although a recent spatio-temporal method proposed by Dai \etal \cite{dai2017dense} solves this task, it involves a series of least square problems to be solved, which is computationally demanding.
To overcome all these issues, we propose a spatio-temporal dense NRSfM algorithm which is free from such unwarranted assumptions and limitations. Instead, we adhere to the assumption that the low-dimensional linear subspace spanned by a deforming shape is locally valid. Such an assumption about shapes has been well studied in topological manifold theory \cite{absil2004riemannian,dollar2007non}. The Grassmann manifold is a topologically rich non-linear manifold, each point of which represents the set of all right-invariant subspaces of the Euclidean space. One property of the Grassmannian that is particularly useful in our setting is that the points in it can be embedded into the space of symmetric matrices. This property has been used in several computer vision applications that deal with subspace representation of data \cite{hamm2008grassmann,cetingul2009intrinsic}. Accordingly, in our problem, to model a non-linear shape, using a Grassmannian allows us to represent the shape as a set of ``smooth'' low-dimensional surfaces embedded in a higher dimensional Euclidean space. Such a representation not only reduces the complexity of our task but also makes our formulation robust and scalable as described below.
\noindent {\emph{c) Why Grassmann manifold?}}
It is well-known that the complex non-rigid deformations are composed of multiple subspaces that quite often fit a higher-order parametric model \cite{pasko2002function, sheng2011facial, zhu2014complex}. To handle such complex models globally can be very challenging -- both numerically and computationally. Consequently, for an appropriate representation of such a model, we decompose the overall non-linearity of the shape by a set of locally linear models that span a low-rank subspace of a vector space. As alluded to above, the space of all $d$-dimensional linear subspaces of $\mathbb{R}^{N}$ ($0 < d < N$) forms the Grassmann manifold \cite{absil2004riemannian, absil2009optimization}. Modeling the deformation on this manifold allows us to operate on the number of subspaces rather than on the number of vectorial data points (on the shape), which reduces the complexity of the problem significantly. Moreover, since each local surface is a low-rank subspace, it can be faithfully reconstructed using a few eigenvalues and corresponding eigenvectors, which makes such a representation scalable and robust to noise.
The aforementioned properties of the Grassmannian perfectly fit our strategy to model complex deformations, and therefore, we blend the concept of spatio-temporal representations with local low-rank linear models. This idea results in a two-stage coupled optimization problem \ie, local reconstruction and global grouping, which is solved efficiently using the standard ADMM algorithm \cite{boyd2011distributed}. As the local reconstructions are performed using a low-rank eigen decomposition, our representation is computationally efficient and robust to noise. We demonstrate the benefit of our approach to benchmark real and synthetic sequences \S\ref{ss:Experiment and results}. Our results show that our method outperforms previous state-of-the-art approaches by 1-2 \% on all the benchmark datasets. Before we provide the details of our algorithm, we review some pertinent previous works in the next section.
\section{Background}
This section provides a brief background on the recent advancements in NRSfM, focusing mainly on the methods that are relevant to this work.
\par{\bf{Preliminaries:}} We borrow the notation system from Dai \etal's work \cite{dai2014simple} for its wide usage. Given `$P$' feature points over `$F$' frames, we represent $W \in \mathbb{R}^{2F \times P}$, $S \in \mathbb{R}^{3F \times P}$, $R \in \mathbb{R}^{2F \times 3F}$ as the measurement, the shape, and the rotation matrices, respectively. Here $R$ matrix is composed of block diagonal $R_{i} \in \mathbb{R}^{2 \times 3}$, representing per frame orthographic camera projection. Also, the notation $S^\sharp \in \mathbb{R}^{3P \times F}$ stands for the rearranged shape matrix, which is a linear mapping of $S$. We use $\|\ .\ \|_F$ and $\|\ .\ \|_*$ to denote the Frobenius norm and the nuclear norm, respectively.
{\footnotesize \begin{table*}[h!]
\centering
\begin{tabular}{|c|c|}
\hline
\begin{tabular}[c]{@{}c@{}}\label{tab:rw1} {(a) \bf{Dai \emph{et al.'s}}} \cite{dai2014simple}\\ $\underset{S^\sharp, E} {\text{minimize}} ~\| S^\sharp \|_* + \lambda \|E \|_F^2$ \\ ${\text{subject to:}}$ $W = RS + E$ \\ \end{tabular} & \begin{tabular}[c]{@{}c@{}} {(b) \bf{Zhu \emph{et al.'s} }}\cite{zhu2014complex}\\ $\underset{S^\sharp, C, E} {\text{minimize}} ~ \| C \|_* + ~\gamma \| S^\sharp \|_* + \lambda \|E \|_1 $ \\ ${\text{subject to:}}$ $S^\sharp = S^\sharp C, W = RS + E$ \\ \end{tabular} \\ \hline
\begin{tabular}[c]{@{}c@{}} {(c) \bf{Kumar \emph{et al.'s}}} \cite{kumar2017spatio}\\ $\underset{S, S^\sharp, C_1, C_2} {\text{minimize}}\frac{1}{2} \|W-RS\|_F^2 + \lambda_1 \| C_1 \|_1 + \lambda_2 \| S^\sharp \|_* + \lambda_3 \|C_2 \|_1$ \\ ${\text{subject to:}}$ $S = SC_1, S^\sharp = S^\sharp C_2, 1^{T}C_1 = 1^{T}, 1^{T}C_2 = 1^{T},$\\ $diag(C_1) = 0, diag(C_2) = 0, S^\sharp = g(S)$ \\ \end{tabular} & \begin{tabular}[c]{@{}c@{}} {(d) \bf{Garg \emph{et al.'s}}}\cite{garg2013dense}\\ $\underset{S, R} {\text{minimize}}\frac{\lambda}{2} \|W-RS\|_F^2 + \sum_{f, i, p}\|\nabla S_{f}^{i}(p)\| + \tau \|S^\sharp\|_*$ \\ $\text{subject to:} $\\ $ R \in \mathbb{SO}(3)$\\ \end{tabular} \\ \hline
\end{tabular}
\caption{\small A brief summary of formulation used by some of the recent approaches to solve sparse and dense NRSfM which are closely related to our method. Among all these four methods only Garg \emph{et al.'s} \cite{garg2013dense} approach is formulated particularly for solving dense NRSfM. }
\label{tab:related works}
\vspace{-0.2cm}
\end{table*}}
\subsection{Relevant Previous Work}
\noindent \par{\it{Dai et al.'s approach:}} Dai \etal proposed a simple and elegant solution to NRSfM \cite{dai2014simple}. The work, dubbed ``prior-free", provides a practical solution as well as new theoretical insights to NRSfM. Their formulation involves nuclear norm minimization on $S^\sharp$ instead of $S$ --see Table \ref{tab:related works}(a). This is enforced due to the fact that $3K$ rank bound on $S$ is weaker than $K$ rank bound on $S^\sharp$, where $K$ refers to the rank of $S$. Although this elegant framework provides robust results for the shapes that span a single subspace, it may perform poorly on complex non-rigid motions \cite{zhu2014complex}.
\noindent \par{{\it{Zhu et al.'s approach:}} To achieve better 3D reconstructions on complex non-rigid sequences, this work capitalized on the limitations of Dai \etal's work\cite{dai2014simple} by exploiting the union of subspaces in the shape space \cite{zhu2014complex}. The proposed formulation is inspired by LRR \cite{liu2013robust} in conjunction with Dai \etal work --see Table \ref{tab:related works}(b). In the formulation, $C \in \mathbb{R}^{F \times F}$, $E \in \mathbb{R}^{2F \times P}$ are the coefficient and error matrices.
\noindent \par{\it{Kumar et al.'s approach:}} Kumar \etal exploits multiple subspaces both in the trajectory space and in the shape space \cite{kumar2017spatio}. This work demonstrated empirically that procuring multiple subspaces in the trajectory and shape spaces provide better reconstruction results. They proposed a joint segmentation and reconstruction framework, where segmentation inherently benefits reconstruction and vice-versa --see Table \ref{tab:related works}(c). In their formulation $C_1 \in \mathbb{R}^{P \times P}$, $C_2 \in \mathbb{R}^{F \times F}$ are the coefficient matrices and, $g(.)$ linearly maps $S$ to $S^\sharp$.
\noindent \par{\it{Dense NRSfM approach:}} Garg \etal developed a variational approach to solve dense NRSfM \cite{garg2013dense}. The optimization framework proposed by them employs total variational constraint on the deforming shape ($\nabla S_{f}^{i}(p)$) to allow edge preserving discontinuities, and trace norm constraints to penalize the number of independent shapes --see Table \ref{tab:related works}(d). Recently, Dai{\emph{ et al.}} has also proposed a dense NRSfM algorithm with a spatio-temporal formulation \cite{dai2017dense}.
\subsection{Motivation}
This work is intended to overcome the shortcomings of the previous approaches to solve dense NRSfM. Accordingly, we would like to outline the critical limitations associated with them. Although some of them are highlighted before, we reiterate it for the sake of completeness.
\begin{enumerate}[nolistsep, itemindent=0em, label=(\alph*)]
\item To solve dense NRSfM using the formulation proposed by Kumar \etal \cite{kumar2017spatio} and Zhu \etal \cite{zhu2014complex} is nearly impossible due to the complexity of their formulation \S \ref{ss:intro}.
Also, the error measure used by them is composed of Euclidean norm defined on the original data (see Table \ref{tab:related works}), which is not proper for non-linear data with a manifold structure \cite{absil2004riemannian, wang2015low}.
\item The algorithm proposed by Garg \etal \cite{garg2013dense} results in a biconvex formulation, which is computationally expensive and needs a GPU to speed up the implementation. Similarly, Dai \etal's recent work\cite{dai2017dense} is computationally expensive as well due to costly gradient term in their formulation.
\item Methods such as \cite{yu2015direct, li2009robust} rely on the template prior for dense 3D reconstruction of the object. Other piecewise approach for solving dense NRSfM \cite{russell2012dense} require a post-processing step to stitch all the local reconstructions.
\end{enumerate}
To avoid all the aforementioned limitations, we propose a new dense NRSfM algorithm. The primary contributions of this paper are as follows:
\begin{enumerate}[nolistsep]
\item A scalable spatio-temporal framework on the Grassmann manifold to solve dense NRSfM which does not need any template prior.
\item An effective framework that can handle non-linear deformations even with noisy trajectories and provides state-of-the-art results on benchmark datasets.
\item An efficient solution to the proposed optimization based on the ADMM procedure \cite{boyd2011distributed}.
\end{enumerate}
\section{Problem Formulation}
In this section, we first provide a brief introduction to the Grassmann manifold and a suitable definition for a similarity distance metric on it, before revealing our formulation.
\subsection{Grassmann Manifold}
The Grassmann manifold, usually denoted as $\mathcal{G}(n, r)$, consists of all $r$-dimensional linear subspaces of $\mathbb{R}^{n}$, where $n>r$. A point on the Grassmann manifold is represented by a $n \times r$ matrix (say $X$), whose columns are composed of orthonormal basis of the subspace spanned by $X$, denoted as $\mathbf{span}(X)$ or in short as [$X$]. Let's suppose [$X_1$], [$X_2$] are two such points on this manifold, then among several similarity distances known for this manifold \cite{hamm2008grassmann}, we will be using the \emph{projection metric} distance given by $\small{d_g([X_1], [X_2]) = \frac{1}{\sqrt[]{2}} \|X_1X_1^{T}- X_2X_2^{T}\|_F}$, as it allows directly embedding the Grassmannian points into a Euclidean space (and the use of the Frobenius norm) using the mapping $X\rightarrow XX^T$.
With this metric, $(\mathcal{G}, d_g)$ forms a metric space. Interested readers may refer to \cite{hamm2008grassmann} for details.
\begin{figure*}
\centering
\includegraphics[width=0.95\textwidth, height=0.25\textheight] {Figures/conceptDiagramGM.pdf}~~~
\caption{\small{Conceptual illustration of data point representation on the grassmann manifold. Each local subspace can equivalently be represented by a single point on the manifold. {\bf{Top row:}} Construction of grassmann samples in the trajectory space using spatial information. {\bf{Bottom row:}} Construction of grassmann samples in the shape space by partitioning the shapes in a sequential order over frames.}}
\label{fig:manifoldconcept}
\end{figure*}
\subsection{Formulation}\label{ss:formulation}
With the relevant background as reviewed in the above sections, we are now ready to present our algorithm to solve the dense NRSfM task under orthographic projection. We start our discussion with the classical representation to NRSfM \ie,
\begin{equation}
\begin{small}
W_{s} = RS_{s}\label{eq:reprojectionErr}
\end{small}
\end{equation}
where, $W_{s} \in \mathbb{R}^{2F \times P}$, $R = {\text{blkdiag}}(R_1, ..., R_F) \in \mathbb{R}^{2F \times 3F}$, $S_{s} \in \mathbb{R}^{3F \times P}$. The motive here is, given the input measurement matrix, solve for rotation ($R$) and 3D shape ($S_s$). To serve this objective, Eq.\eqref{eq:reprojectionErr} maintains the camera motion and the shape deformation such that it complies with the image measurements. For our method, we solve for rotations using the Intersection method \cite{dai2014simple} by assuming that the multiple non-rigid motions within a single deforming object, over frames, can be faithfully approximated by per frame single relative camera motion with a higher rank\footnote{Check the supplementary material for a detail discussion on rotation.}. Accordingly, our goal reduces to develop a systematic approach that can reliably explain the non-rigid shape deformations and provides better 3D reconstruction. We use subscript `$s$' in Eq.\eqref{eq:reprojectionErr} to indicate that the column permutations of $S_s$ and $W_s$ matrix are allowed. However, the column permutations of $S_t^{\sharp}$ is inadmissible as it results in discontinuous trajectories over frames.
\noindent{\bf{Grassmannian Representations in Trajectory Space:}}
Let's suppose $\mathbf{\Psi}_s$ = $\{ {\it{\Psi_{s1}}}, {\it{\Psi_{s2}}}, .. {\it{\Psi_{sK_s}}}\}$ is the set of points on the Grassmann manifold generated using $S_s$ matrix, then ${\bf{\mathcal{T}}}_s = \big\{ (\mathit{\Psi_{s1}})(\mathit{\Psi_{s1}})^T, (\mathit{\Psi_{s2}})(\mathit{\Psi_{s2}})^T..., (\mathit{\Psi_{sK_s}})(\mathit{\Psi_{sK_s}})^T \big\}$ represents a tensor which is constructed by mapping all symmetric matrices of the Grassmann data points ---refer Figure \ref{fig:manifoldconcept}(a). As discussed before in \S \ref{ss:intro}, to explain the complex deformations, we reduce the overall non-linear space as a union of several local low-dimensional linear spaces which form the sample points on the Grassmann manifold. But, the notion of self-expressiveness is valid only for Euclidean linear or affine subspace. To apply self-expressiveness on the Grassmann manifold one has to adopt linearity onto the manifold. Since, Grassmann manifold is isometrically equivalent to the symmetric idempotent matrices \cite{chikuse2012statistics}, we embed the Grassmann manifold into the symmetric matrix manifold, where the self-expression can be defined in the embedding space. This leads to the following optimization:
\begin{equation}
\begin{small}
\begin{aligned}
& \displaystyle \underset{E_s, C_s} {\text{minimize}} ~\|E_s\|_{F}^2 + \lambda_1\|C_s\|_* \\
& \displaystyle \text{\it{subject to:}} ~{\bf{\mathcal{T}}}_s = {\bf{\mathcal{T}}}_s C_s + E_s
\end{aligned}
\end{small}
\end{equation}
We denote $C_s \in \mathbb{R}^{K_s \times K_s}$ as the coefficient matrix with `$K_s$' as the total number of spatial groups. Here, $E_s$ measures the trajectory group reconstruction error as per the manifold geometry. Also, we would like to emphasize that since the object undergoes deformations in the 3D space, we operate in 3D space rather than in the projected 2D space. $\|~\|_*$ is enforced on $C_s$ for a low-rank solution.
\noindent{\bf{Grassmannian Representations in Shape Space:}}
Deforming object attains different state over time which adheres to distinct temporal local subspaces \cite{kumar2017spatio}. Assuming that the temporal deformation is smooth over-time, we express deforming shapes in terms of local self-expressiveness across frames as:
\begin{equation}
\begin{small}
\begin{aligned}
& \displaystyle \underset{E_t, C_t} {\text{minimize}} ~\|E_t\|_{F}^2 + \lambda_2\|C_t\|_* \\
& \displaystyle \text{\it{subject to:}}
{\bf{\mathcal{T}}}_t = {\bf{\mathcal{T}}}_t C_t + E_t
\end{aligned}
\end{small}
\end{equation}
Similarly, ${\bf{\mathcal{T}}}_t$ is the set of all symmetric matrices constructed using a set of Grassmannian samples $\mathbf{\Psi}_t $, where $\mathbf{\Psi}_t$ contains the samples which are drawn from $S_{t}^{\sharp} \in \mathbb{R}^{3P \times F}$ ---refer Figure \ref{fig:manifoldconcept}(b). Intuitively, $S_{t}^{\sharp}$ is a shape matrix with each column as a deforming shape. $E_t$, $C_t \in \mathbb{R}^{K_t \times K_t}$ represent the temporal group reconstruction error and coefficient matrix respectively, with $K_t$ as the number of temporal groups. $\|~\|_*$ is enforced on $C_t$ for a low-rank solution.
\noindent{\bf{Spatio-Temporal Formulation:}} Combining the above two objectives and their constraints with reprojection error term give us our formulation. Our representation blends the local subspaces structure along with the global composition of a non-rigid shape. Thus, the overall objective is:
\begin{equation} \label{eq:overallOptimization}
\begin{small}
\begin{aligned}
& \displaystyle \underset{S_{s}, S_{t}^{\sharp}, E_s, E_t, C_s, C_t} {\text{minimize}} \hspace{-0.3cm} \mathbf{E} = \frac{1}{2} ~\|W_{s}-RS_{s}\|_F^2 + \gamma \| S_{t}^{\sharp} \|_* + \lambda_1\|E_s \|_F^2 \\
& \displaystyle + \lambda_2\|E_{t}\|_F^{2} + \lambda_3 \|C_s\|_* + \lambda_4 \|C_t\|_*\\
& \displaystyle \text{\it{subject to:}} ~{\bf{\mathcal{T}}}_s = {\bf{\mathcal{T}}}_s C_s + E_s; {\bf{\mathcal{T}}}_t = {\bf{\mathcal{T}}}_t C_t + E_t;\\
& \displaystyle \hspace{10ex}\mathbf{\Psi}_s = \mathit{\xi(C_s, S_s, \sigma_{\epsilon})}; \mathbf{\Psi}_t = \mathit{\xi(C_t, S_t^{\sharp}, \sigma_{\epsilon})}; \\
& \displaystyle \hspace{10ex} S_{s} = \zeta\big(\mathbf{\Psi}_s, \Sigma_s, V_s, N_s); S_{t}^{\sharp} = \zeta\big( \mathbf{\Psi}_t, \Sigma_{t}^{\sharp}, V_t, N_t ); \\
& \displaystyle \hspace{10ex} S_{t}^{\sharp} = \mathscr{T}_1(S_{s}); W_s = \mathscr{T}_2(W_{s}, S_s);
\end{aligned}
\end{small}
\end{equation}
The re-projection error constraint performs the 3D reconstruction using $W_{s}$ and $R$. Meanwhile, the local subspace grouping naturally enforces the union of subspace structure in $S_s$, $ S_{t}^{\sharp}$ with corresponding low-rank representations of the coefficient matrices $C_s$ and $C_t$. Here, the function $\xi(.)$ draws inference from $C$ matrices to refine Grassmannian sample set, both in trajectory and shape spaces. The function $\zeta(.)$ reconstructs $S_s$ and $S_{t}^{\sharp}$ matrices based on a set of local subspaces ($\mathbf{\Psi}_s, \mathbf{\Psi}_t, V_s, V_t $), singular values ($\Sigma_s$, $\Sigma_t$) and the number of top eigenvalues ($N_s, N_t$). The function $\mathscr{T}_1(.)$ transforms $S_{s} \in \mathbb{R}^{3F \times P}$ matrix to $S_{t}^{\sharp} \in \mathbb{R}^{3P \times F}$ matrix and $\mathscr{T}_2(.)$ function rearranges $W_s$ matrix as per the recent ordering of $S_s$\footnote{It's important to keep track of column permutation of $W_s$, $S_s$.}. Parameters such as `$\sigma_{\epsilon}$', `$N_s$' and `$N_t$' provides the flexibility to handle noise and adjust computations. Note that the element of the sets $\mathbf{\Psi}_s, \mathbf{\Psi}_t, V_s ~\text{and} ~V_t$ are obtained using SVD. The above equation \ie Eq: \eqref{eq:overallOptimization} is a coupled optimization problem where the solution to $S$ matrices influence the solution of $C$ matrices and vice-versa, and ${\small\mathscr{T}_1}()$ connects $ S_{t}^{\sharp}$ to $S_s$.
\begin{algorithm*}[t!]
\caption{Scalable Dense Non-Rigid Structure from Motion: A Grassmannian Perspective}\label{alg:Algorithm1}
\begin{algorithmic}[1]
\REQUIRE
$W_s$, $R$ using \cite{dai2014simple}, tuning parameters: $\lambda_1$, $\lambda_2$, $\lambda_3$, $\lambda_4$, $\gamma$, $\rho=1.1$, $\beta=1e^{-3}$, $\beta_m=1e^{6}$, $\epsilon = 1e^{-12}$, $K_s$, $K_t$.\\
\hspace{-0.3cm}{\bf Initialize:} $S_s$ = pseudoinverse($R$)$W_s$ and ${ S^{\sharp}_t} = \mathscr{T}_1(S_s)$.\\
\hspace{-0.3cm}{\bf Initialize:} `$K_t$' temporal data points on the Grassmann manifold using `${ S^{\sharp}_t}$' matrix,
$\mathbf{\Psi}_t$ = $\{\it{\Psi_{ti}}\}_{i=1}^{K_t}$.\\
\hspace{-0.3cm}{\bf Initialize:} `$K_s$' spatial data points on the Grassmann manifold using `${ S_s}$' matrix, $\mathbf{\Psi}_s$ = $\{\it{\Psi_{si}}\}_{i=1}^{K_s}$.\\
\hspace{-0.3cm}{\bf Initialize:} The auxiliary variables $J_s$, $J_t$ and Lagrange multiplier $\{Y_i\}_{i=1}^{3}$ as zero matrices.\\
\hspace{-0.3cm}{\bf Initialize:} $\Omega_{ij}^{s}$ = $trace[ \big({\it{\Psi_{sj}^T} } {\it{\Psi_{si}}} \big) \big({\it{\Psi_{si}^T} } {\it{\Psi_{sj}}} \big)]$,
$\Omega_{ij}^{t}$ = $trace[ \big({\it{\Psi_{tj}^T} } {\it{\Psi_{ti}}} \big) \big({\it{\Psi_{ti}^T} } {\it{\Psi_{tj}}} \big)]$, $\mathbf{\Omega}_s = (\Omega_{ij}^{s})_{i, j = 1}^{K_s}$, $\mathbf{\Omega}_t = (\Omega_{ij}^{t})_{i, j = 1}^{K_t}$\\
\hspace{1.2cm} $L_sL_s^{T}$ = Cholesky($\mathbf{\Omega}_s$), $L_tL_t^{T}$ = Cholesky($\mathbf{\Omega}_t$)
\vspace{0.2cm}\\
\WHILE {not converged}
\STATE $S_s$ $\gets$ $\Big(\beta\big(\mathscr{T}_1^{-1}(S_t^{\sharp}) + \frac{\mathscr{T}_1^{-1}(Y_1)}{\beta}\big) + R^T W_s \Big)\big/ (R^{T}R + \beta I)$ \\
\STATE $C_s$ $\gets$ $\Big(2\lambda_1 L_s L_s^{T} + \beta(J_s -\frac{Y_2}{\beta}) \Big) $ $\big(2 \lambda_1 L_s L_s^{T} + \beta I_s \big)^{-1}$\\
\STATE $\mathbf{\Psi}_s$ $\gets$ $\xi(C_s, S_s, \sigma_{\epsilon})$ \hspace{3.0cm} \COMMENT {Update spatial Grassmann points}
\STATE $S_s$ $\gets$ $\zeta(\mathbf{\Psi}_s, \Sigma_s, V_s, N_s)$; \hspace{2.0cm} \COMMENT {refine based on top $N_s$ eigen value}
\STATE $J_s$ $\gets$ $U_{J_s} \mathcal{S}_{\frac{\lambda_3}{\beta}}(\Sigma_{J_s}) V_{J_s}$, where $[U_{J_s}, \Sigma_{J_s}, V_{J_s}] = \emph{svd}(C_s + \frac{Y_2}{\beta})$ and $\mathcal{S}_\tau[x]$ = sign(x)max($|x|$-$\tau$, 0)
\STATE $S_t^{\sharp}$ $\gets$ $U_t \mathcal{S}_{\frac{\gamma}{\beta}} (\Sigma_t)V_t$, where $[U_t, \Sigma_t, V_t] = \emph{svd}(\mathscr{T}_1(S_s) - \frac{Y_1}{\beta})$ and $\mathcal{S}_\tau[x]$ = sign(x)max($|x|$-$\tau$, 0)\\
\STATE $C_t$ $\gets$ $\Big(2\lambda_2 L_t L_t^{T} + \beta(J_t -\frac{Y_3}{\beta}) \Big) $ $\big(2 \lambda_2 L_t L_t^{T} + \beta I_t \big)^{-1}$
\STATE $\mathbf{\Psi}_t$ $\gets$ $\xi(C_t, S_t^{\sharp}, \sigma_{\epsilon})$ \COMMENT {Update temporal Grassmann points}
\STATE $S_t^{\sharp}$ $\gets$ $\zeta(\mathbf{\Psi}_t, \Sigma_t, V_t, N_t)$;\hspace{2.0cm} \COMMENT {refine based on top $N_t$ eigen value} \\
\STATE $J_t$ $\gets$ $U_{J_t} \mathcal{S}_{\frac{\lambda_4}{\beta}}(\Sigma_{J_t}) V_{J_t}$, where $[U_{J_t}, \Sigma_{J_t}, V_{J_t}] = \emph{svd}(C_t + \frac{Y_3}{\beta})$ and $\mathcal{S}_\tau[x]$ = sign(x)max($|x|$-$\tau$, 0)
\STATE $\Omega_{ij}^{s}$ $\gets$ $trace[ \big({\it{\Psi_{sj}^T} } {\it{\Psi_{si}}} \big) \big({\it{\Psi_{si}^T} } {\it{\Psi_{sj}}} \big)]$,
$\Omega_{ij}^{t}$ $\gets$ $trace[ \big({\it{\Psi_{tj}^T} } {\it{\Psi_{ti}}} \big) \big({\it{\Psi_{ti}^T} } {\it{\Psi_{tj}}} \big)]$;\\
\STATE $\mathbf{\Omega}_s \gets (\Omega_{ij}^{s})_{i, j = 1}^{K_s}$, $\mathbf{\Omega}_t \gets (\Omega_{ij}^{t})_{i, j = 1}^{K_t}$;\COMMENT. $\mathbf{\Omega}_s \succeq 0,\mathbf{\Omega}_t \succeq 0$, if $\mathbf{\Omega}_s || \mathbf{\Omega}_t = 0$ add $\delta \mathbf{I}$ to make it $\succ 0$ (see suppl. material)\\
\STATE $L_sL_s^{T}$ = Cholesky($\mathbf{\Omega}_s$), $L_tL_t^{T}$ = Cholesky($\mathbf{\Omega}_t$); \\
\STATE $W_s$ $\gets$ $\mathscr{T}_2(W_{s}, S_s)$ \hspace{2.0cm}\COMMENT {Note: Column permutation for $W_s$ and $S_s$ should be same.}
\STATE $Y_1$ := $Y_1 + \beta(S_{t}^{\sharp} - \mathscr{T}_1(S_{s}))$, $Y_2$ := $Y_2 + \beta(C_s - J_s)$, $Y_3$ := $Y_3 + \beta(C_t - J_t)$; \COMMENT Update Lagrange multipliers\\
\STATE $\beta\gets \text{minimum}(\rho\beta, \beta_m)$ \\
\STATE maxgap := maximum($[\| S_t^\sharp - \mathscr{T}_1(S_{s})\|_{\infty}, \|C_s - J_s \|_{\infty}, \|C_t - J_t\|_{\infty} ]$)
\IF{(maxgap $<$ $\epsilon$ $ \parallel \beta > \beta_m$)}
\STATE break;
\ENDIF \COMMENT check for the convergence
\ENDWHILE \COMMENT Note: $\delta$ is a very small positive number and $\mathbf{I}$ symbolizes identity matrix.
\ENSURE $S_s$, $S_t$, $C_s$, $C_t$.
\COMMENT {Note: Kindly use economical version of {\it{svd}} on a regular desktop.}
\end{algorithmic}
\end{algorithm*}
\section{Solution} \label{ss:Solution}
The formulation in Eq.\eqref{eq:overallOptimization} is a non-convex problem due to the bilinear optimization variables (${\bf{\mathcal{T}}}_s C_s$, ${\bf{\mathcal{T}}}_t C_t$), hence a global optimal solution is hard to achieve. However, it can be efficiently solved using Augmented Lagrangian Methods (ALMs) \cite{boyd2011distributed}, which has proven its effectiveness for many non-convex problems. Introducing Lagrange multipliers $(\{Y_i\}_{i=1}^3)$ and auxiliary variables $(J_s, J_t)$ to Eq.\eqref{eq:overallOptimization} gives us the complete cost function as follows:
\begin{equation}
\begin{small}
\begin{aligned}
& \displaystyle \underset{S_{s}, S_{t}^{\sharp}, C_s, C_t, J_s, J_t} {\text{minimize}} \hspace{-0.3cm} \mathbf{E} = \frac{1}{2} ~\|W_{s}-RS_{s}\|_F^2 + \frac{\beta}{2}\| S_{t}^{\sharp} - \mathscr{T}_1(S_{s})\|_F^2 + \\
& \displaystyle <Y_1, S_{t}^{\sharp} - \mathscr{T}_1(S_{s})> + \gamma \| S_{t}^{\sharp} \|_* + \lambda_1\|{\bf{\mathcal{T}}}_s-{\bf{\mathcal{T}}}_s C_s\|_F^2 + \lambda_3 \|J_s\|_* \\
& \displaystyle + \frac{\beta}{2}\|C_s - J_s\|_F^2 + <Y_2, C_s - J_s> + \lambda_2\|{\bf{\mathcal{T}}}_t-{\bf{\mathcal{T}}}_t C_t\|_F^{2} + \\
& \displaystyle \lambda_4 \|J_t\|_* + \frac{\beta}{2}\|C_t -J_t \|_F^2 + <Y_3, C_t-J_t> \\
& \displaystyle \text{\it{subject to:}} ~\mathbf{\Psi}_s = \mathit{\xi(C_s, S_s, \sigma_{\epsilon})}; \mathbf{\Psi}_t = \mathit{\xi(C_t, S_t^{\sharp}, \sigma_{\epsilon})}; \\
& \displaystyle \hspace{10ex} S_{s} = \zeta(\mathbf{\Psi}_s,\Sigma_s, V_s, N_s); S_{t}^{\sharp} = \zeta(\mathbf{\Psi}_t, \Sigma_t^{\sharp}, V_t, N_t); \\
& \displaystyle \hspace{10ex} W_s = \mathscr{T}_2(W_{s}, S_s);
\end{aligned} \label{eq:overallOptimization3}
\end{small}
\end{equation}
The function $\xi(.)$ first computes the SVD of $C$ matrices, \ie $C = [U_c, \Sigma_c, V_c]$, then forms a matrix $A$ such that $A_{ij} = [XX^T]_{ij}^{\sigma_{\epsilon}}$, where $\sigma_{\epsilon}$ is set empirically based on noise levels and $X = U_c(\Sigma_c)^{0.5}$ (normalized). Secondly, it uses $A_{ij}$ to form new Grassmann samples from the $S$ matrices\cite{ji2014efficient}. Notice that $\xi(.)$ operates on $C$ matrices whose dimensions depend on the number of Grassmann samples. This reduces the complexity of the task from exponential in the number of vectorial points to exponential in the number of linear subspaces. The later being of the order 10-50, where as the former can go more than 50,000 for dense NRSfM.
The $\zeta(.)$ function is defined as follows $\zeta$ = $\big\{ (\mathbf{\Psi}_a, \Sigma_a, V_a, r) | S_a$ = $\mathbf{horzcat}(\mathbf{\Psi}_a^r\Sigma_a^rV_a^r), \forall 1 \leq a \leq \mathbf{Card}(\mathbf{\Psi}_a), r \in \mathbb{Z}^{+} \big\}$, where $r$ stands for top-$r$ eigenvalues, $\mathbf{Card}(.)$ denotes the cardinal number of the set and $\mathbf{horzcat}(.)$ denotes for the horizontal concatenation of matrices. Intuitively, $\zeta(.)$ reconstructs back each local low-rank subspace. During implementation, we use $S_s$, $S_{t}^\sharp$ in place of $S_a$ accordingly. The optimization variables over iteration are obtained by solving for one variable at a time treating others as constant, keeping the constraints intact. For detailed derivations for each sub-problem and proofs, kindly refer to the supplementary material. The pseudo code of our implementation is provided in {\bf{Algorithm \ref{alg:Algorithm1}}}.
\section{Experiments and Results} \label{ss:Experiment and results}
We compare the performance of our method against four previously reported state-of-the-art approaches, namely Dense Spatio-Temporal DS \cite{dai2017dense}, Dense Variational DV \cite{garg2013dense}, Trajectory Basis PTA \cite{akhter2009nonrigid} and Metric Projection MP \cite{paladini2012optimal}. To test the performance, we used dense NRSfM dataset introduced by Garg\emph{ et al.} \cite{garg2013dense} and Varol\emph{ et al.} \cite{varol2012constrained} under noisy and noise free conditions. For quantitative evaluation of 3D reconstruction, we align the estimated shape $S_{est}^{t}$ with ground-truth shape $S_{GT}^{t}$ per frame using Procrustes analysis. We compute the average RMS 3D reconstruction error as $e_{3D} = \frac{1}{F}\sum_{t=1}^{F}\frac{\|S_{est}^{t} - S_{GT}^{t}\|_F}{\|S_{GT}^{t}\|_F}$. We used Kmeans++ algorithm \cite{arthur2007k} to initialize segments without disturbing the temporal continuity.
\begin{figure*}
\centering
\includegraphics[width=1.0\textwidth] {Figures/syntheticFace4Result.pdf}~~~
\caption{\small{Reconstruction results obtained on synthetic dense face dataset (face sequence 4). {\bf{Top row}} : Ground-truth 3D points, {\bf{Bottom row}} : Recovered 3D points using our approach.}}
\label{fig:syntheticSeq4res}
\end{figure*}
\begin{figure*}
\subfigure [\label{fig:d1}] {\includegraphics[width=0.33\textwidth, height= 0.14\textheight]{Figures/RealFaceResult1.pdf}}
\subfigure [\label{fig:d2}] {\includegraphics[width=0.33\textwidth, height= 0.14\textheight]{Figures/RealBackResult1.pdf}}
\subfigure [\label{fig:d3}] {\includegraphics[width=0.33\textwidth, height= 0.14\textheight]{Figures/RealHeartResult1.pdf}}
\caption{\small{Qualitative reconstruction results procured on benchmark real dense dataset \cite{garg2013dense} a) Face sequence (28,332 feature points over 120 frames) b) Back sequence (20,561 feature points over 150 frames) c) Heart sequence (68,295 feature points over 80 frames).}}
\label{fig:denseresults}
\end{figure*}
\begin{figure*}
\centering
\includegraphics[width=1.0\textwidth, height= 0.17\textheight] {Figures/kinect_paper_tshirt1.pdf}~~~
\caption{\small{Reconstruction results on benchmark kinect\_tshirt (74,000 points, 313 frames) and kinect\_paper(58,000 points, 193 frames) dataset \cite{varol2012constrained}. {\bf{Top row}}: Input image frame. {\bf{Bottom row}}: Dense 3D reconstruction for the corresponding frame using our approach.}}
\label{fig:kinect_paper_tshirt_res}
\end{figure*}
\noindent{\bf{Experiments on Synthetic Face Sequences:}}
This dataset consists of 4 different face sequence with 28,880 feature points tracked over multiple frames. The face sequence 1, 2 is a 10 frame long video, whereas, face sequence 3, 4 is a 99 frame long video. It's a challenging dataset mainly due to different rotation frequencies and deformations in each of the sequence. Figure \ref{fig:syntheticSeq4res} shows the qualitative reconstruction results obtained using our approach in comparison to the ground-truth for face sequence 4. Table \ref{tab:densefacesequence} lists the performance comparisons of our method with other competing methods. Clearly, our algorithm outperforms the other baseline approach, which helps us to conclude that holistic approaches to rank minimization without drawing any inference from local subspace structure is a less effective framework to cope up with the local non-linearities.
\begin{table}[h]
\centering
\small
\begin{tabular}{c|c|c|c|c|l}
\hline
Data & DS \cite{dai2017dense} & DV \cite{garg2013dense} & PTA \cite{akhter2009nonrigid} & MP \cite{paladini2012optimal} & Ours \\ \hline
Seq.1 & 0.0636 & 0.0531 & 0.1559 & 0.2572 & {\bf{0.0443}} \\ \hline
Seq.2 & 0.0569 & 0.0457 & 0.1503 & 0.0640 & {\bf{0.0381}} \\ \hline
Seq.3 & 0.0374 & 0.0346 & 0.1252 & 0.0611 & {\bf{0.0294}} \\ \hline
Seq.4 & 0.0428 & 0.0379 & 0.1348 & 0.0762 & {\bf{0.0309}} \\ \hline
\end{tabular}
\caption{ \small{Average 3D reconstruction error ($e_{3D}$) comparison on dense synthetic face sequence\cite{garg2013dense}. Note: The code for DV \cite{garg2013dense} is not publicly available, we tabulated its results from DS \cite{dai2017dense} work.}}\label{tab:densefacesequence}
\end{table}
\noindent{\bf{Experiments on face, back and heart sequence:}} This dataset contains monocular videos of human facial expressions, back deformations, and beating heart under natural lighting conditions. The face sequence, back sequence, and heart sequence are composed of 28332, 20561, and 68295 feature points tracked over 120, 150, and 80 images, respectively. Unfortunately, due to the lack of ground-truth 3D data, we are unable to quantify the performance of these sequences. Figure \ref{fig:denseresults} shows some qualitative results obtained using our algorithm on this real dataset.
\noindent{\bf{Experiments on kinect\_paper and kinect\_tshirt sequence:}} To evaluate our performance on the real deforming surfaces, we used kinect\_paper and kinect\_tshirt dataset\cite{varol2012constrained}. This dataset provides sparse SIFT\cite{lowe1999object} feature tracks along with dense 3D point clouds of the entire scene for each frame. Since, dense 2D tracks are not directly available with this dataset, we synthesized it. To obtain dense feature tracks, we considered the region within a window containing the deforming surface. Precisely, we considered the region within $xw$ = (253, 253, 508, 508), $yw$ = (132, 363, 363, 132) across 193 frames for paper sequence, and $xw$ = (203, 203, 468, 468), $yw$ = (112, 403, 403, 112) across 313 frames for tshirt sequence to obtain the measurement matrix \cite{garg2013variational,garg2011robust}. Figure \ref{fig:kinect_paper_tshirt_res} show some qualitative results obtained using our method on this dataset. Table \ref{tab:kinectpapertshirtsequence} lists the numerical comparison of our approach with other competing dense NRSfM approaches on this dataset.
\begin{table}
\small
\centering
\begin{tabular}{c|c|c|c|c|l}
\hline
Data & DS \cite{dai2017dense} & DV \cite{garg2013dense} & PTA \cite{akhter2009nonrigid} & MP \cite{paladini2012optimal} & Ours \\ \hline
paper & 0.0612 & - & 0.0918 & 0.0827 & {\bf{0.0394}} \\ \hline
tshirt& 0.0636 & - & 0.0712 & 0.0741 & {\bf{0.0362}} \\ \hline
\end{tabular}
\caption{ \small{Average 3D reconstruction error ($e_{3D}$) comparison on kinect\_paper and kinect\_tshirt \cite{varol2012constrained} sequence. Note: The code for DV \cite{garg2013dense} is not publicly available. The pixels with no 3D data available were discarded for the experiments and the evaluation.}}\label{tab:kinectpapertshirtsequence}
\vspace{-0.5cm}
\end{table}
\begin{figure*}
\centering
\subfigure [\label{fig:a1}] {\includegraphics[width=0.225\textwidth, height=0.13\textheight]{Figures/performancewrtNoise.pdf}}
\subfigure [\label{fig:a2}] {\includegraphics[width=0.225\textwidth, height=0.13\textheight]{Figures/performancewrtNoisepaperTshirt.pdf}}
\subfigure [\label{fig:a3}] {\includegraphics[width=0.225\textwidth, height=0.13\textheight]{Figures/performancewithNs.pdf}}
\subfigure [\label{fig:a4}] {\includegraphics[width=0.225\textwidth, height=0.13\textheight]{Figures/performancewrtKs.pdf}}
\caption{ \small{ (a)-(b) Avg. 3D reconstruction error ($e_{3D}$) variation with the change in the noise ratio for synthetic face sequence and kinect sequence respectively. (c)-(d)
Variation in $e_{3D}$ with the number of top eigen value and number of grassmann data points for Face Seq3.}}
\label{fig:noiseandNsVariation}
\end{figure*}
\begin{figure*}
\centering
\subfigure [\label{fig:l4}]
{\includegraphics[width=0.22\textwidth, height=0.13\textheight]{Figures/Csfacesequence3.pdf}}
\subfigure [\label{fig:l3}] {\includegraphics[width=0.22\textwidth, height=0.13\textheight]{Figures/Ctfacesequence3.pdf}}
\subfigure [\label{fig:l2}]
{\includegraphics[width=0.22\textwidth, height=0.13\textheight]{Figures/AbalationAnalysis.pdf}}
\subfigure [\label{fig:l1}] {\includegraphics[width=0.22\textwidth, height=0.13\textheight]{Figures/timingComparison.pdf}}
\caption{\small{(a)-(b) A typical structure of $C_s \in \mathbb{R}^{K_s\times K_s}$, $C_t \in \mathbb{R}^{K_t \times K_t}$ after convergence. (c) Ablation test performance on the synthetic face sequence \cite{garg2013dense}. (d) Runtime comparison of our method with MP \cite{paladini2012optimal} and a recent state-of-the-art dense NRSfM algorithm DS\cite{dai2017dense}.}}
\label{fig:timingsandCstructure}
\vspace{-0.3cm}
\end{figure*}
\noindent{\bf{Experiments on noisy data:}} To evaluate the robustness of our method to noise levels, we performed experiments by adding Gaussian noise under different standard deviations to the measurement matrix. Similar to DS \cite{dai2017dense} the standard deviations are incorporated as $\sigma_n = r\ \text{max}\{|W_s|\}$ by varying $r$ from 0.01 to 0.05. We repeated the experiment 10 times. Figure \ref{fig:a1} and Figure \ref{fig:a2} shows the variation in the performance of our method under different noise ratio's on synthetic face sequences\cite{garg2013dense} and kinect sequences\cite{varol2012constrained} respectively. It can be inferred from the plot that even with large noise ratios, the average reconstruction error does not fluctuate significantly. This improvement is expected from our framework as it is susceptible only to top eigen values.
\par{\bf{Effects of variable initialization on the overall performance:}} We performed several other experiments to study the behavior of our algorithm under different variable initializations. For easy exposition, we conducted this experiment on noise free sequences. We mainly investigated the behavior of $N_s, N_t, K_s, K_t$ on the overall performance of our algorithm. Figure \ref{fig:a3} and Figure \ref{fig:a4} shows the variations in the reconstruction errors with respect to $N_s$ and $K_s$ respectively. A similar trend in the plots is observed for changes on $N_t$ and $K_t$ values. These plots clearly illustrate the usefulness of our local low-rank structure \ie, considering a small number of eigenvalues for every local structure is as good as considering all eigenvalues. Similarly, increasing the number of local subspaces after a certain value has negligible effect on the overall reconstruction error. Furthermore, we examined the form of $C_s$ and $C_t$ after convergence as shown Figure \ref{fig:l4} and Figure \ref{fig:l3}. Unfortunately, due to the lack of ground-truth data on local subspaces, we could not quantify $C_s$ and $C_t$. For qualitative analysis on the observation, kindly refer to the supplementary material.
\par{\bf{Ablation Analysis:}} This test is performed to evaluate the importance of spatial and temporal constraints in our formulation. To do this, we observe the performance of our formulation under four different setups: a) without any spatio-temporal constraint (NC), b) with only spatial constraint (SP), c) with only temporal constraint (TP), and d) with spatio-temporal constraint (Both). Figure \ref{fig:l2} shows the variations in reconstruction errors under these setups on four synthetic face sequence. The statistics clearly illustrate the importance of both constraints in our formulation.
\par{\bf{Runtime Analysis:}} This experiment is performed on a computer with an Intel core i7 processor and 16GB RAM. The script to compute the runtime is written in MATLAB 2016b. Figure \ref{fig:l1} shows the runtime comparisons of our approach with other dense NRSfM methods. The runtime reported in Figure \ref{fig:l1} corresponds to the results listed in Table \ref{tab:densefacesequence}, \ref{tab:kinectpapertshirtsequence}. The results clearly show the \emph{scalability} of our method on datasets with more than 50,000 points. Despite PTA \cite{akhter2009nonrigid} is faster than our approach, its accuracy suffers by a large margin for dense NRSfM (see Table \ref{tab:densefacesequence}, \ref{tab:kinectpapertshirtsequence}).
\section{Conclusion}
In this paper, we have introduced a scalable dense NRSfM algorithm which efficiently models the complex non-linear deformations. We achieved this by exploiting the non-linearity on the Grassmann manifold via a spatio-temporal formulation. Moreover, we provided an efficient ADMM \cite{boyd2011distributed} based solution for solving our optimization. In the future, we will consider how to extend this work to the projective setting with perspective cameras (\eg \cite{projectivePAMI,projective}).
\noindent\textbf{Acknowledgement.}{\footnotesize ~~ S. Kumar was supported in part by Australian Research Council (ARC) grant (DE140100180). Y. Dai was supported in part by National 1000 Young Talents Plan of China, Natural Science Foundation of China (61420106007), and ARC grant (DE140100180). H. Li is funded in part by ARC Centre of Excellence for Robotic Vision (CE140100016)}.
\balance
{\small
\bibliographystyle{ieee}
| {'timestamp': '2018-03-28T02:03:15', 'yymm': '1803', 'arxiv_id': '1803.00233', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00233'} | arxiv |
\section*{Acknowldegments}
We thank Glenn Bevilacqua, Neda Zolaktaf, Sharan Vaswani, Mark Schmidt, Laks V. S. Lakshmanan, and Tamara Munzner for their help and valuable discussions. We also thank the anonymous reviewers for their constructive feedback. This work has been funded by NSERC Canada, and supported in part by the Institute for Computing, Information and Cognitive Systems at UBC.
\section{Results}
\subsection{Consumer Modelling} In this section, we look at the consumer modelling component of our work.
Naturally, we expect users who rate more items to be more open to exploring unpopular items (higher risk-degree) and to have more varied tastes (lower focusing degree). Figure~\ref{fig:analysisEstimates}.a plots the consumer modelling measures with respect to the the number of rated items. We observe that all risk measures, NorNLT, skewpop3, theta, thetaIDF, and thetaIDFN, are positively correlated with the number of rated items. Regarding the focusing degree, we observe that as the users rate more movies, their average focusing degree decreases, which indicates that as users rate more and more items, they are more likely to be rating diverse items. \textcolor{red}{Can we also conclude that they have a higher desire for diversity? what about other datasets?} Moreover, the positive correlation between risk-degrees and number of rated items also motivates using the the number of items rated as a simple measure of risk. Figure~\ref{fig:analysisEstimates}.b plots the average popularity of rated items vs the number of rated items. We observe that as the number of rated items increases, their average popularity decreases.
Figure~\ref{fig:analysisEstimates}.c shows the Pearson coefficient correlation matrix for the ranked lists generated by ordering the users by the various risk measures. The ranked list generated by ...
\begin{figure*}[htb]
\centering
\subfigure[Estimates vs \#rated items ]{
\includegraphics[width=0.25\textwidth]{Figures/general/oTrainNorNLTItemsoTrainSkewPop3thetathetaIDFNthetaIDFrhooveroTrainNRatings.pdf}}
\subfigure[popularity of rated items over n ratings]{
\includegraphics[width=0.25\textwidth]{Figures/general/popoveroTrainNRatings.pdf}}
\subfigure[coeff matrix]{
\includegraphics[width=0.29\textwidth]{Figures/Coeff/userOrderCoeffMatrix.pdf}}
\caption{analysis of estimated params}
\label{fig:analysisEstimates}
\end{figure*}
Figure~\ref{fig:histograms} shows the histograms of various consumer modelling measures (averaged across the users that fall in each bin).
Figure~\ref{fig:histograms}.b shows the \# users vs number of long tail items rated (where the x-axis has been scaled to $[0,1]$ range).
Figure~\ref{fig:histograms}.c shows the \# users vs normalized number of long tail items rated (equation~\ref{eq:NorNLT-risk} which has further been scaled to $[0,1]$ range).
Figure~\ref{fig:histograms}.d shows the \# users vs number of items rated (where the x-axis has been scaled to $[0,1]$ range).
This figure has a long tail distribution, which shows the majority of users rate a few items; therefore the number of ratings may not distinguish between the users and will not serve as a good proxy of risk-degree.
Figure~\ref{fig:histograms}.e shows the histogram of focusing degree $\rho$ is normally distributed across the users, with $\mu = 0.48$ and $\sigma = 0.14$. Thus, considering the prior ratings of users, on average most users prefer equal levels of diversity and similarity.
Figure~\ref{fig:histograms}.f shows the histogram of heuristic risk is normally distributed and skewed to the right. This suggests heuristic risk is relatively low among users and that most users are risk-averse, and take less chances with the unpopular items. This is reasonable, since it also supports the long-tail distribution of the popularity vs item demand curve.
Figure~\ref{fig:histograms}.g --Figure~\ref{fig:histograms}.i show alternative risk-measures. h should be removed.
\begin{figure*}[htb]
\centering
\subfigure[HistogramNItemofoTrainNRatings]{
\includegraphics[width=0.3\textwidth]{Figures/Histograms/HistogramNItemofoTrainNRatings.pdf} }
\subfigure[HistogramofoTrainNLTItems]{
\includegraphics[width=0.3\textwidth]{Figures/Histograms/HistogramofoTrainNLTItems.pdf}}
\subfigure[HistogramofoTrainNorNLTItems]{
\includegraphics[width=0.3\textwidth]{Figures/Histograms/HistogramofoTrainNorNLTItems.pdf}}
\subfigure[HistogramofoTrainNRatings]{
\includegraphics[width=0.3\textwidth]{Figures/Histograms/HistogramofoTrainNRatings.pdf}}
\subfigure[Histogramofrho]{
\includegraphics[width=0.3\textwidth]{Figures/Histograms/Histogramofrho.pdf}}
\subfigure[Histogramoftheta]{
\includegraphics[width=0.3\textwidth]{Figures/Histograms/Histogramoftheta.pdf}}
\subfigure[HistogramofthetaIDFN]{
\includegraphics[width=0.3\textwidth]{Figures/Histograms/HistogramofthetaIDFN.pdf}}
\subfigure[HistogramofthetaIDF]{
\includegraphics[width=0.3\textwidth]{Figures/Histograms/HistogramofthetaIDF.pdf}}
\subfigure[HistogramofoTrainSkewPop3]{
\includegraphics[width=0.3\textwidth]{Figures/Histograms/HistogramofoTrainSkewPop3.pdf}}
\caption{histograms}
\label{fig:histograms}
\end{figure*}
\subsection{Recommendation performance across users}
In this section we evaluate recommendation performance across users. In Figures~\ref{fig:metricchanges-oTrainNorNLTItems} -- \ref{fig:metricchanges-rho} we consider K=15, and report the performance metrics as different consumer modelling measures are varied.
\textbf{Risk Degree}
Figure~\ref{fig:metricchanges-theta} depicts the changes across various metrics change as heuristic risk $\theta_u^h$ increases. Note that higher $\theta_u^h$ corresponds to risk-loving users that are more willing to take chances with less popular items. Therefore, as $\theta_u^h$ increases we expect more long-tail items to be offered , and LTaccuracy to be increasing. This is confirmed in Figure~\ref{fig:metricchanges-theta}.a, where LTAccuracy increases as $\theta_u^h$ increases (true for all of our methods). Regarding our baselines, they have not been designed with regard to this measure, and are relatively stable, e.g., MF is independent of this measure. However, we note that long-tail accuracy of wlim decreases as users become more risk-loving.
Moreover, as there is a system trade-off between relevance and long tail promotion, we expect relevance to be non-increasing as $\theta_u^h$ increases. Figure~\ref{fig:metricchanges-theta}.c plots relevance vs $\theta_u^h$, where we observe that as $\theta_u^h$ increases, the relevance of items offered by our method decreases. Particularly, risk-averse users are offered more relevant items, while risk-loving users are offered less relevant items(true for other variants of our method except thetaIDFN). Regarding our baselines, the relevance of items offered is either relatively constant, increasing, or with fluctuations. E.g., as $\theta_u^h$ increases, the relevance of items offered by wlim also increases, which is intuitively incorrect.
In Figure~\ref{fig:metricchanges-thetaIDFN}, thetaIDfN is used as an alternative risk measure. Figure~\ref{fig:metricchanges-thetaIDFN}.a shows the LTAccuracy, where wlim is decreasing and other methods are relativity stable. Figure~\ref{fig:metricchanges-thetaIDFN}.c, shows that as this measure increases, relevance of items offered by our method is relatively stable, while our baselines methods increase, which is incorrect.
\textcolor{red}{what about diversity, is it reasonable to expect it to be correlated with theta? } diversity, shown in Figure~\ref{fig:metricchanges-theta}.b.
\textbf{Focusing Degree} Figure~\ref{fig:metricchanges-rho} considers the focusing degree $\rho$. In Figure~\ref{fig:metricchanges-rho}.c, we observe that as $\rho$ increases, the relevance of items offered to users increases and eventually saturates. However, for all methods excluding our method, the point of saturation is $\rho \approx 0.25$, while for our method it is $\rho \approx 0.6$. Due to the trade-off between diversity and relevance, we see the opposite trend for the diversity measure, in Figure~\ref{fig:metricchanges-rho}.b. Anything about LTAccuracy?
\begin{figure*}[htb]
\centering
\subfigure[LTAccuracy]{
\includegraphics[width=0.15\textwidth]{Figures/metricChangesAcrossUsers15/oTrainNorNLTItems/meanLTAccuracyDictoveroTrainNorNLTItems.pdf}
}
\subfigure[Diversity]{
\includegraphics[width=0.15\textwidth]{Figures/metricChangesAcrossUsers15/oTrainNorNLTItems/meandiversityDictoveroTrainNorNLTItems.pdf}
}
\subfigure[Relevance]{
\includegraphics[width=0.15\textwidth]{Figures/metricChangesAcrossUsers15/oTrainNorNLTItems/meanrelevanceDictoveroTrainNorNLTItems.pdf}
}
\subfigure[Recall]{
\includegraphics[width=0.15\textwidth]{Figures/metricChangesAcrossUsers15/oTrainNorNLTItems/meanrecallDictoveroTrainNorNLTItems.pdf}
}
\subfigure[HistogramofoTrainNorNLTItems]{
\includegraphics[width=0.15\textwidth]{Figures/Histograms/HistogramofoTrainNorNLTItems.pdf}}
\caption{changes across users, $K=15$}
\label{fig:metricchanges-oTrainNorNLTItems}
\end{figure*}
\begin{figure*}[htb]
\centering
\subfigure[LTAccuracy]{
\includegraphics[width=0.15\textwidth]{Figures/metricChangesAcrossUsers15/oTrainSkewPop3/meanLTAccuracyDictoveroTrainSkewPop3.pdf}
}
\subfigure[Diversity]{
\includegraphics[width=0.15\textwidth]{Figures/metricChangesAcrossUsers15/oTrainSkewPop3/meandiversityDictoveroTrainSkewPop3.pdf}
}
\subfigure[Relevance]{
\includegraphics[width=0.15\textwidth]{Figures/metricChangesAcrossUsers15/oTrainSkewPop3/meanrelevanceDictoveroTrainSkewPop3.pdf}
}
\subfigure[Recall]{
\includegraphics[width=0.15\textwidth]{Figures/metricChangesAcrossUsers15/oTrainSkewPop3/meanrecallDictoveroTrainSkewPop3.pdf}
}
\subfigure[HistogramofoTrainSkewPop3]{
\includegraphics[width=0.15\textwidth]{Figures/Histograms/HistogramofoTrainSkewPop3.pdf}}
\caption{changes across users, $K=15$}
\label{fig:metricchanges-oTrainSkewPop3}
\end{figure*}
\begin{figure*}[htb]
\centering
\subfigure[LTAccuracy]{
\includegraphics[width=0.15\textwidth]{Figures/metricChangesAcrossUsers15/theta/meanLTAccuracyDictovertheta.pdf}
}
\subfigure[Diversity]{
\includegraphics[width=0.15\textwidth]{Figures/metricChangesAcrossUsers15/theta/meandiversityDictovertheta.pdf}
}
\subfigure[Relevance]{
\includegraphics[width=0.15\textwidth]{Figures/metricChangesAcrossUsers15/theta/meanrelevanceDictovertheta.pdf}
}
\subfigure[Recall]{
\includegraphics[width=0.15\textwidth]{Figures/metricChangesAcrossUsers15/theta/meanrecallDictovertheta.pdf}
}
\subfigure[Histogramoftheta]{
\includegraphics[width=0.15\textwidth]{Figures/Histograms/Histogramoftheta.pdf}}
\caption{changes across users, $K=15$}
\label{fig:metricchanges-theta}
\end{figure*}
\begin{figure*}[htb]
\centering
\subfigure[LTAccuracy]{
\includegraphics[width=0.15\textwidth]{Figures/metricChangesAcrossUsers15/thetaIDFN/meanLTAccuracyDictoverthetaIDFN.pdf}
}
\subfigure[Diversity]{
\includegraphics[width=0.15\textwidth]{Figures/metricChangesAcrossUsers15/thetaIDFN/meandiversityDictoverthetaIDFN.pdf}
}
\subfigure[Relevance]{
\includegraphics[width=0.15\textwidth]{Figures/metricChangesAcrossUsers15/thetaIDFN/meanrelevanceDictoverthetaIDFN.pdf}
}
\subfigure[Recall]{
\includegraphics[width=0.15\textwidth]{Figures/metricChangesAcrossUsers15/thetaIDFN/meanrecallDictoverthetaIDFN.pdf}
}
\subfigure[HistogramofthetaIDFN]{
\includegraphics[width=0.15\textwidth]{Figures/Histograms/HistogramofthetaIDFN.pdf}}
\caption{changes across users, $K=15$}
\label{fig:metricchanges-thetaIDFN}
\end{figure*}
\begin{figure*}[htb]
\centering
\subfigure[LTAccuracy]{
\includegraphics[width=0.15\textwidth]{Figures/metricChangesAcrossUsers15/thetaIDF/meanLTAccuracyDictoverthetaIDF.pdf}
}
\subfigure[Diversity]{
\includegraphics[width=0.15\textwidth]{Figures/metricChangesAcrossUsers15/thetaIDF/meandiversityDictoverthetaIDF.pdf}
}
\subfigure[Relevance]{
\includegraphics[width=0.15\textwidth]{Figures/metricChangesAcrossUsers15/thetaIDF/meanrelevanceDictoverthetaIDF.pdf}
}
\subfigure[Recall]{
\includegraphics[width=0.15\textwidth]{Figures/metricChangesAcrossUsers15/thetaIDF/meanrecallDictoverthetaIDF.pdf}
}
\subfigure[HistogramofthetaIDF]{
\includegraphics[width=0.15\textwidth]{Figures/Histograms/HistogramofthetaIDF.pdf}}
\caption{changes across users, $K=15$}
\label{fig:metricchanges-thetaIDF}
\end{figure*}
\begin{figure*}[htb]
\centering
\subfigure[LTAccuracy]{
\includegraphics[width=0.15\textwidth]{Figures/metricChangesAcrossUsers15/oTrainNRatings/meanLTAccuracyDictoveroTrainNRatings.pdf}
}
\subfigure[Diversity]{
\includegraphics[width=0.15\textwidth]{Figures/metricChangesAcrossUsers15/oTrainNRatings/meandiversityDictoveroTrainNRatings.pdf}
}
\subfigure[Relevance]{
\includegraphics[width=0.15\textwidth]{Figures/metricChangesAcrossUsers15/oTrainNRatings/meanrelevanceDictoveroTrainNRatings.pdf}
}
\subfigure[Recall]{
\includegraphics[width=0.15\textwidth]{Figures/metricChangesAcrossUsers15/oTrainNRatings/meanrecallDictoveroTrainNRatings.pdf}
}
\subfigure[HistogramofoTrainNRatings]{
\includegraphics[width=0.15\textwidth]{Figures/Histograms/HistogramofoTrainNRatings.pdf}}
\caption{changes across users, $K=15$}
\label{fig:metricchanges-oTrainNRatings}
\end{figure*}
\begin{figure*}[htb]
\centering
\subfigure[LTAccuracy]{
\includegraphics[width=0.15\textwidth]{Figures/metricChangesAcrossUsers15/rho/meanLTAccuracyDictoverrho.pdf}
}
\subfigure[Diversity]{
\includegraphics[width=0.15\textwidth]{Figures/metricChangesAcrossUsers15/rho/meandiversityDictoverrho.pdf}
}
\subfigure[Relevance]{
\includegraphics[width=0.15\textwidth]{Figures/metricChangesAcrossUsers15/rho/meanrelevanceDictoverrho.pdf}
}
\subfigure[Recall]{
\includegraphics[width=0.15\textwidth]{Figures/metricChangesAcrossUsers15/rho/meanrecallDictoverrho.pdf}
}
\subfigure[Histogramofrho]{
\includegraphics[width=0.15\textwidth]{Figures/Histograms/Histogramofrho.pdf}}
\caption{changes across users, $K=15$}
\label{fig:metricchanges-rho}
\end{figure*}
\subsection{Effect of risk ordering} Figures~\ref{fig:riskorderingeffect-NorNLT}--\ref{fig:riskorderingeffect-oTrainNRatings} examine the effect of making recommendations to users in order of increasing risk-degree compared to randomly selecting users and recommending items. Figure~\ref{fig:riskorderingeffect-Theta} considers heuristic risk as the measure of risk-degree. Figures~\ref{fig:riskorderingeffect-Theta}.a --~\ref{fig:riskorderingeffect-Theta}.d show that by sorting users in order of increasing heuristic risk, we achieve better coverage, gini, long tail accuracy, and diversity. However, this ordering results in a loss of relevance, as depicted by Figure~\ref{fig:riskorderingeffect-Theta}.e. The reason is that our algorithm sacrifices the relevance of movies offered to increase the overall coverage of the system. Our risk ordering, however, is devised so that the right group of users are targeted for this objective. Looking back at Figure~ref{fig:metricchanges-thetaIDF}.c, we can observe that indeed more risk-averse users are offered more relevant items, and the risk-loving users are offered the long-tail items that increase the coverage, gini of the system. Similar performance trends are observed for the other risk measures: NorNLT Figure~\ref{fig:riskorderingeffect-NorNLT}, Skewpop3 Figures~\ref{fig:riskorderingeffect-SkewPop3}, and ThetaIDFN* Figure~\ref{fig:riskorderingeffect-ThetaIDFN} . For the cases where we don't normalize the risk measure to account for the number of ratings (ThetaIDF Figure~\ref{fig:riskorderingeffect-ThetaIDF},oTrainNRatings Figure~\ref{fig:riskorderingeffect-oTrainNRatings}) we obtain lower diversity and relevance.
\begin{figure*}[tb]
\centering
\subfigure[Coverage]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/NorNLT/noRiskOrderingNorNLTvslazyGreedyNorNLTcoverageoverK.pdf}
}
\subfigure[Gini]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/NorNLT/noRiskOrderingNorNLTvslazyGreedyNorNLTginioverK.pdf}
}
\subfigure[LTAccuracy]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/NorNLT/noRiskOrderingNorNLTvslazyGreedyNorNLTLTAccuracyoverK.pdf}
}
\subfigure[Diversity]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/NorNLT/noRiskOrderingNorNLTvslazyGreedyNorNLTdiversityoverK.pdf}
}
\subfigure[Relevance]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/NorNLT/noRiskOrderingNorNLTvslazyGreedyNorNLTrelevanceoverK.pdf}
}
\subfigure[Recall]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/NorNLT/noRiskOrderingNorNLTvslazyGreedyNorNLTrecalloverK.pdf}
}
\subfigure[HistogramofoTrainNorNLTItems]{
\includegraphics[width=0.15\textwidth]{Figures/Histograms/HistogramofoTrainNorNLTItems.pdf}}
\caption{Effect of sorting consumers by risk measure vs randomly selecting users}
\label{fig:riskorderingeffect-NorNLT}
\end{figure*}
\begin{figure*}[htb]
\centering
\subfigure[Coverage]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/SkewPop3/noRiskOrderingSkewPop3vslazyGreedySkewPop3coverageoverK.pdf}
}
\subfigure[Gini]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/SkewPop3/noRiskOrderingSkewPop3vslazyGreedySkewPop3ginioverK.pdf}
}
\subfigure[LTAccuracy]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/SkewPop3/noRiskOrderingSkewPop3vslazyGreedySkewPop3LTAccuracyoverK.pdf}
}
\subfigure[Diversity]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/SkewPop3/noRiskOrderingSkewPop3vslazyGreedySkewPop3diversityoverK.pdf}
}
\subfigure[Relevance]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/SkewPop3/noRiskOrderingSkewPop3vslazyGreedySkewPop3relevanceoverK.pdf}
}
\subfigure[Recall]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/SkewPop3/noRiskOrderingSkewPop3vslazyGreedySkewPop3recalloverK.pdf}
}
\subfigure[HistogramofoTrainSkewPop3]{
\includegraphics[width=0.15\textwidth]{Figures/Histograms/HistogramofoTrainSkewPop3.pdf}}
\caption{Effect of sorting consumers by risk measure vs randomly selecting users}
\label{fig:riskorderingeffect-SkewPop3}
\end{figure*}
\begin{figure*}[htb]
\centering
\subfigure[Coverage]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/Theta/noRiskOrderingThetavslazyGreedyThetacoverageoverK.pdf}
}
\subfigure[Gini]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/Theta/noRiskOrderingThetavslazyGreedyThetaginioverK.pdf}
}
\subfigure[LTAccuracy]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/Theta/noRiskOrderingThetavslazyGreedyThetaLTAccuracyoverK.pdf}
}
\subfigure[Diversity]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/Theta/noRiskOrderingThetavslazyGreedyThetadiversityoverK.pdf}
}
\subfigure[Relevance]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/Theta/noRiskOrderingThetavslazyGreedyThetarelevanceoverK.pdf}
}
\subfigure[Recall]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/Theta/noRiskOrderingThetavslazyGreedyThetarecalloverK.pdf}
}
\subfigure[Histogramoftheta]{
\includegraphics[width=0.15\textwidth]{Figures/Histograms/Histogramoftheta.pdf}}
\caption{Effect of sorting consumers by risk measure vs randomly selecting users}
\label{fig:riskorderingeffect-Theta}
\end{figure*}
\begin{figure*}[htb]
\centering
\subfigure[Coverage]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/ThetaIDFN/noRiskOrderingThetaIDFNvslazyGreedyThetaIDFNcoverageoverK.pdf}
}
\subfigure[Gini]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/ThetaIDFN/noRiskOrderingThetaIDFNvslazyGreedyThetaIDFNginioverK.pdf}
}
\subfigure[LTAccuracy]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/ThetaIDFN/noRiskOrderingThetaIDFNvslazyGreedyThetaIDFNLTAccuracyoverK.pdf}
}
\subfigure[Diversity]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/ThetaIDFN/noRiskOrderingThetaIDFNvslazyGreedyThetaIDFNdiversityoverK.pdf}
}
\subfigure[Relevance]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/ThetaIDFN/noRiskOrderingThetaIDFNvslazyGreedyThetaIDFNrelevanceoverK.pdf}
}
\subfigure[Recall]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/ThetaIDFN/noRiskOrderingThetaIDFNvslazyGreedyThetaIDFNrecalloverK.pdf}
}
\subfigure[HistogramofthetaIDFN]{
\includegraphics[width=0.15\textwidth]{Figures/Histograms/HistogramofthetaIDFN.pdf}}
\caption{Effect of sorting consumers by risk measure vs randomly selecting users}
\label{fig:riskorderingeffect-ThetaIDFN}
\end{figure*}
\begin{figure*}[htb]
\centering
\subfigure[Coverage]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/ThetaIDF/noRiskOrderingThetaIDFvslazyGreedyThetaIDFcoverageoverK.pdf}
}
\subfigure[Gini]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/ThetaIDF/noRiskOrderingThetaIDFvslazyGreedyThetaIDFginioverK.pdf}
}
\subfigure[LTAccuracy]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/ThetaIDF/noRiskOrderingThetaIDFvslazyGreedyThetaIDFLTAccuracyoverK.pdf}
}
\subfigure[Diversity]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/ThetaIDF/noRiskOrderingThetaIDFvslazyGreedyThetaIDFdiversityoverK.pdf}
}
\subfigure[Relevance]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/ThetaIDF/noRiskOrderingThetaIDFvslazyGreedyThetaIDFrelevanceoverK.pdf}
}
\subfigure[Recall]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/ThetaIDF/noRiskOrderingThetaIDFvslazyGreedyThetaIDFrecalloverK.pdf}
}
\subfigure[HistogramofthetaIDF]{
\includegraphics[width=0.15\textwidth]{Figures/Histograms/HistogramofthetaIDF.pdf}}
\caption{Effect of sorting consumers by risk measure vs randomly selecting users}
\label{fig:riskorderingeffect-ThetaIDF}
\end{figure*}
\begin{figure*}[htb]
\centering
\subfigure[Coverage]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/NRatings/noRiskOrderingNRatingsvslazyGreedyNRatingscoverageoverK.pdf}
}
\subfigure[Gini]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/NRatings/noRiskOrderingNRatingsvslazyGreedyNRatingsginioverK.pdf}
}
\subfigure[LTAccuracy]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/NRatings/noRiskOrderingNRatingsvslazyGreedyNRatingsLTAccuracyoverK.pdf}
}
\subfigure[Diversity]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/NRatings/noRiskOrderingNRatingsvslazyGreedyNRatingsdiversityoverK.pdf}
}
\subfigure[Relevance]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/NRatings/noRiskOrderingNRatingsvslazyGreedyNRatingsrelevanceoverK.pdf}
}
\subfigure[Recall]{
\includegraphics[width=0.15\textwidth]{Figures/NoRiskOrderingFigures/NRatings/noRiskOrderingNRatingsvslazyGreedyNRatingsrecalloverK.pdf}
}
\subfigure[HistogramofoTrainNRatings]{
\includegraphics[width=0.15\textwidth]{Figures/Histograms/HistogramofoTrainNRatings.pdf}}
\caption{Effect of sorting consumers by risk measure vs randomly selecting users}
\label{fig:riskorderingeffect-oTrainNRatings}
\end{figure*}
\subsection{Top-K Recommendation performance evaluation}
Figure~\ref{fig:metrics} plots Top-K performance metrics consisting of coverage, gini, long-tail accuracy, diversity, and relevance as K is varied. We compare different variants of our algorithm (denoted as lazy greedy in all plots), traditional matrix factorization (MF) and four variants of our baseline, wlim.
Figure~\ref{fig:metrics}.a shows coverage, where most of our methods achieve a coverage of 1 at K=5 (heuristic risk at K=10). wlim is lower.
Figure~\ref{fig:metrics}.b, shows gini where a lower gini score represents a more balanced recommendation set(\textcolor{red}{can we say this for sure, or use entropy?}). All variants of our method achieve a lower gini coefficient. However, among the the baselines, wlim has the lowest gini coefficient.
Figure~\ref{fig:metrics}.c shows LTAccuracy performance. Even though wlim achieves the best overall LTAccuracy, it has lower coverage and a smaller gini coefficient.
Figure~\ref{fig:metrics}.d shows diversity where wlim is closely followed by our methods, then MF and other varients of wlim.
Figure~\ref{fig:metrics}.e, shows relevance, currently not scaled. MF has the best performance, then our method, variants of wlim.
\begin{figure*}[htb]
\centering
\subfigure[Coverage]{
\includegraphics[width=0.45\textwidth]{Figures/metrics/coverageoverK.pdf}
}
\subfigure[Gini]{
\includegraphics[width=0.45\textwidth]{Figures/metrics/ginioverK.pdf}
}
\subfigure[LTAccuracy]{
\includegraphics[width=0.45\textwidth]{Figures/metrics/LTAccuracyoverK.pdf}
}
\subfigure[Diversity]{
\includegraphics[width=0.45\textwidth]{Figures/metrics/diversityoverK.pdf}
}
\subfigure[Relevance]{
\includegraphics[width=0.45\textwidth]{Figures/metrics/relevanceoverK.pdf}
}
\subfigure[Recall]{
\includegraphics[width=0.45\textwidth]{Figures/metrics/recalloverK.pdf}
}
\caption{Top-$K$ recommendation performance metrics vs $K$.}
\label{fig:metrics}
\end{figure*}
\fi
\section{Conclusion}
\label{sec:conclusion}
This paper presents a generic top-$N$ recommendation framework for trading-off accuracy, novelty, and coverage. To achieve this, we profile the users according to their preference for long-tail novelty. We examine various measures, and formulate an optimization problem to learn these user preferences from interaction data. We then integrate the user preference estimates in our generic framework, GANC. Extensive experiments on several datasets confirm that there are trade-offs between accuracy, coverage, and novelty. Almost all re-ranking models increase coverage and novelty at the cost of accuracy. However, existing re-ranking models typically rely on rating prediction models, and are hence more effective in dense settings. Using a generic approach, we can easily incorporate a suitable base accuracy recommender to devise an effective solution for both sparse and dense settings.
Although we integrated the long-tail novelty preference estimates into a re-ranking framework, their use-case is not limited to these frameworks. In the future, we intend to explore the temporal and topical dynamics of long-tail novelty preference, particularly in settings where contextual information is available.
\iffalse
While we focused on promoting long-tail items across users, we did not consider diversity of individual top-$N$ recommendations, a factor that has been shown to positively affect consumer satisfaction. This is one direction for future work. Moreover, the sequential setting in our work, creates a dependency between different batches, where, the items recommended to a batch of users, depends on those recommended to previous batches. This dependency is created through the parameter $\mathbf{f}$, that is updated every time a top-$N$ set is allocated to a batch of users. A future direction for our work is to estimate a distribution over $\mathbf{f}$ that allows us to independently solve the problem for each user, leading to improvements across all performance metrics, including recommendation time.
We design algorithms that take advantage of the structure in the value functions to obtain both efficient and scalable solutions.
We design an algorithm that takes advantage of the structure in the value functions to obtain both efficient and scalable solutions.
\textcolor{red}{Our sequential algorithms can be applied for batch recommendation contexts,~e.g., personalized email marketing, where based on prior interaction data between users and items, a new round of recommendations must be sent to all users in the system. However, the independent coverage algorithms lift the sequential setting restrictions and allow it be applied for re-ranking the output of base recommender in any setting. }A future direction for our work is to incorporate explicit diversity metrics in the framework.
\fi
\subsection{Notation and data model}
\label{sec:Notation}
Let $\mathcal{U}$ denote the set of all consumers or users and $\mathcal{I}$ the set of all items. We reserve $u$, $s$ for indexing users, and $i$, $j$ for indexing items. Our dataset $\mathcal{D}$, is a set of ratings of users on various items, i.e., $\mathcal{D} = \{r_{ui}: u \in \mathcal{U}, i \in \mathcal{I} \}$. Since every user rates only a small subset of items, $\mathcal{D}$ is a small subset of a complete rating matrix $\mathbf{R}$, i.e., $\mathcal{D} \subset \mathbf{R} \in \mathbb{R}^{\vert \mathcal{U} \vert \times \vert \mathcal{I} \vert}$.
\iffalse
We split $\mathcal{D}$ into a train set $\mathcal{R}$ and test set $\mathcal{T}$, with $\mathcal{I}^\trainset$ denoting items in train, and $\mathcal{I}^\testset$ denoting items in test.
Let $\mathcal{I}_{u}^{\trainset} =\{ i: r_{ui} \in \mathcal{R} \}$ denote the items rated by user $u$ in the train set, and $\mathcal{U}_{i}^{\trainset} =\{ u: r_{ui} \in \mathcal{R} \}$ denote users that rated item $i$ in the train set, with similar definitions for $\mathcal{I}_{u}^{\testset}$ and $\mathcal{U}_{i}^{\testset}$.
For each user, we generate a top-$N$ sets by ranking all items that do not appear in the train set of that user, i.e., $\mathcal{I}^\trainset \setminus \mathcal{I}_{u}^{\trainset}$).
\fi
We split $\mathcal{D}$ into a train set $\mathcal{R}$ and test set $\mathcal{T}$. Let $\mathcal{I}^\trainset$ ($\mathcal{I}^\testset$) denote items in the train (test) set, with $\mathcal{I}_{u}^{\trainset}$ ($\mathcal{I}_{u}^{\testset}$) denoting the items rated by a single user $u$ in the train (test) set. Let $\mathcal{U}_{i}^{\trainset}$ ($\mathcal{U}_{i}^{\testset}$) denote users that rated item $i$ in the train (test) set. For each user, we generate a top-$N$ set by ranking all unseen train items, i.e.,~$\mathcal{I}^\trainset \setminus \mathcal{I}_{u}^{\trainset}$.
We denote the frequency of item $i$ in a given set $\mathcal{A}$ with $f_i^{\mathcal{A}}$. Following~\cite{adomavicius2012improving}, the popularity of an item $i$ is its frequency in the train set, i.e.,~$f_i^{\mathcal{R}} = |\mathcal{U}_{i}^{\trainset}|$. Based on the Pareto principle~\cite{yin2012challenging}, or the $80/20$ rule, we determine long-tail items, $\mathcal{L}$, as those that generate the lower $20\%$ of the total ratings in the train set, $ \mathcal{L} \subset \mathcal{I}^\trainset$ (i.e,~items are sorted in decreasing popularity).
In our work, we use $x_i = \frac{ x_i - \min(\mathbf{x}) }{ \max(\mathbf{x}) - \min(\mathbf{x}) }
$ for normalizing a generic vector $\mathbf{x}$.
\iffullpaper
Table~\ref{tab:notation} summarizes our notation.
We typeset the sets (e.g., $\mathcal{A}$), use upper case bold letters for matrices (e.g., $\mathbf{A}$), lower-case bold letters for vectors (e.g., $\mathbf{a}$), and lower case letters for scalar variables (e.g., $a$).
\begin{table}[t]
\centering
\small
\begin{tabular}{ll}
\toprule
{\bf Parameter} & {\bf Symbol} \\
\midrule
Dataset & $\mathcal{D}$\\
Train dataset & $\mathcal{R}$\\
Test dataset & $\mathcal{T}$\\
Set of users & $\mathcal{U}$ \\
Set of items & $\mathcal{I}$ \\
Set of long tail items in $\mathcal{R}$ & $\mathcal{L}$ \\
Specific user & $u$ \\
Specific item & $i$ \\
Set of items of $u$ in $\mathcal{R}$ & $\mathcal{I}_{u}^{\trainset}$ \\
Set of items of $u$ in $\mathcal{T}$ & $\mathcal{I}_{u}^{\testset}$ \\
Set of users of $i$ in $\mathcal{R}$ & $\mathcal{U}_{i}^{\trainset}$ \\
Set of users of $i$ in $\mathcal{T}$ & $\mathcal{U}_{i}^{\testset}$ \\
Rating of user $u$ on item $i$ & $r_{ui}$ \\
Size of top-$N$ set & $N$ \\
Top-$N$ set of $u$ & $\mathcal{P}_u$ \\
Collection of top-$N$ sets for all users & $\mathcal{P}$ \\
Long-tail novelty preference of user $u$ acc. model $m$ & $\theta^{m}_u$ \\
Accuracy function & $a(.)$ \\
Coverage function & $c(.)$ \\
Value function of user $u$ & $v_{u}(.)$ \\
\bottomrule
\end{tabular}
\caption{Notation.}
\label{tab:notation}
\end{table}
\fi
\iffalse
\begin{equation*}
\begin{aligned}
\small
& \mathcal{P}^* &\in & \underset{ \mathcal{P} = (\mathcal{P}_1 , ..., \mathcal{P}_{U})}{\argmax} && v(\mathcal{P}) \\
& && s.t.& & \mathcal{P}_{u} \subseteq \mathcal{I}, |\mathcal{P}_{u}|=N, \mathcal{P}_{u} \cap \mathcal{I}_{u} = \emptyset, \forall u \in \mathcal{U} .
\end{aligned}
\end{equation*}
Here, $v(.)$ quantifies the value of an allocation $\mathcal{P}$.
\fi
\section{Empirical Evaluation}
\label{sec:Experiments}
\subsection{Experimental setup}
\label{sec:ExpSetup}
\noindent \textbf{Datasets and data split. }Table~\ref{tab:DatasetStatsticsSmall} describes our datasets.
We use MovieLens 100K (ML-100K), 1 Million (Ml-1M), 10 Million (ML-10M) ratings~\cite{harper2016movielens}, Netflix, and
MovieTweetings 200K (MT-200K)~\cite{dooms2013movietweetings}. In the MovieLens datasets, every consumer has rated at least 20 movies ($\tau = 20$), with $r_{ui} \in \{ 1, \dots, 5\} $ (ML-10M has half-star increments).
MT-200K contains voluntary movie ratings posted on twitter, with $r_{ui} \in \{ 0, \dots, 10\} $. Following~\cite{hernandez2014probabilistic}, we preprocessed this dataset to map the ratings to the interval $[1,5]$. Due to the extreme sparsity of this dataset and to ensure every user has some data to learn from, we filtered the users to keep those with at least 5 ratings ($\tau = 5$).
\iffalse
\subsubsection{Data Split. }We split each dataset into train and test sets.
There are three possible schemes for splitting the data. The first is to randomly split the dataset into a train (80\%) and a test (20\%) set. Note in this case, it is possible that some users are not present in the train phase. The second is to fix the number of train ratings per user,~i.e., $ \psi= 10$~\cite{lee2014local,weimer2007maximum} and use the rest of the user's ratings in the test set, and evaluate ranking based algorithms. Users whose total ratings are fewer than $\psi$ are dropped. This scheme however is biased toward frequent users~\cite{lee2014local}. A third scheme, is to keep a fixed ratio $\kappa$ of each user's ratings in the train set, and move the rest to the test set~\cite{lee2014local}. ~\cite{weimer2007maximum} also introduced the weak generalization setup where the task is to predict the rank of of un-rated items for users known at training time. This method is applicable for all data splitting schemes. The strong generalization evaluation scheme is not of interest to us.
We use the third scheme.
\fi
Our selected datasets have varying density levels. Additionally, MT-200K and Netflix include a large number of difficult infrequent users, i.e., in MT-200K, 47.42\% (3.37\% in Netflix) of the users have rated fewer than 10 items, with the minimum being 4.
We chose these datasets to study performance in settings where users provide few feedback~\cite{kanagal2012supercharging,liu2017experimental}.
Next, we randomly split each dataset into train and test sets by keeping a fixed ratio $\kappa$ of each user's ratings in the train set and moving the rest to the test set~\cite{lee2014local}.
\iffullpaper
This way, when $\kappa =0.8$, an infrequent user with 5 ratings will have 4 train and 1 test rating, while a user with 100 ratings, will have 80 train ratings and the rest in test.
\fi
For ML-1M and ML-10M, we set $\kappa=0.5$. For MT-200K, we set $\kappa=0.8$. For Netflix, we use their probe set as our test set, and remove the corresponding ratings from train. We remove users in the probe set who do not appear in train set, and vice versa.
\begin{table}[t]
\centering
\scriptsize
\begin{tabular}{llllllll}
\toprule
{\bf Dataset} & {\bf $|\mathcal{D}|$} & {\bf $|\mathcal{U}|$} & {\bf $|\mathcal{I}|$} & d$\%$ & $\mathcal{L} \%$ & {\bf $\kappa$} & {\bf $\tau$ } \\ \midrule
ML-100K & 100K & 943& 1682 & 6.30 & 66.98 &0.5 & 20 \\
ML-1M & 1M & 6,040& 3,706 & 4.47 & 67.58 & 0.5 & 20 \\
ML-10M & 10M & 69,878 & 10,677 & 1.34& 84.31 & 0.5 & 20 \\
MT-200k & 172,506 & 7,969 & 13,864 & 0.16 & 86.84 & 0.8 & 5 \\
Netflix & 98,754,394 & 459,497 & 17,770 &1.21 & 88.27 & -& - \\
\bottomrule
\end{tabular}
\caption{Datasets description. $|\mathcal{D}|$ is number of ratings in dataset. Density is $ \text{d}\%= |\mathcal{D}| / ( |\mathcal{U}| * |\mathcal{I}|) \times 100\%$. Long-tail percentage is $\mathcal{L}\% = (|\mathcal{L}| / |\mathcal{I}^\trainset|) \times 100\%$. Train-test split ratio per user is $\kappa$, $\tau$ is the minimum number of ratings per user. }
\label{tab:DatasetStatsticsSmall}
\end{table}
\input{PerfMetrics}
\vspace{4mm}
\noindent \textbf{Other algorithms and their configuration. } We compare against, or integrate the following methods in our framework~\footnote{We report the default configurations specified in the original work for most algorithms.}.
\begin{itemize}
\item \textbf{Rand} is non-personalized and randomly suggests $N$ unseen items from among all items. It obtains high coverage and novelty, but low accuracy~\cite{vargas2014improving}.
\item \textbf{Pop}~\cite{cremonesi2010performance} is a non-personalized algorithm. For ranking tasks, it obtains high accuracy~\cite{cremonesi2010performance,vargas2014improving}, since it takes advantage of the popularity bias of the data. However, Pop makes trivial recommendations that lack novelty~\cite{cremonesi2010performance}.
\item \textbf{RSVD}~\cite{koren2009matrix} is a latent-factor model for rating prediction. We used \texttt{LIBMF}, with L2-Norm as the loss function, and L2-regularization, and Stochastic Gradient Descent (SGD) for optimization. We also tested the same model with non-negative constraints (RSVDN)~\cite{zhuang2013fast}, but did not find significant performance difference. We omit RSVDN from our results. We performed 10-fold cross validation and tested: number of latent factors $g \in \{8, 20, 40, 50, 80, 100\}$, L2-regularization coefficients $\lambda \in \{0.001, 0.005, 0.01, 0.05, 0.1\}$, learning rate $\eta \in \{0.002,0.003,0.01, 0.03\}$. For each dataset, we used the parameters that led to best performance
\iffullpaper
(see Appendix~\ref{sec:configurationofR-SVD}).
\else
(see~\cite{ourFullVersion}).
\fi
\item \textbf{PSVD}~\cite{cremonesi2010performance} is a latent factor model, known for achieving high accuracy and novelty~\cite{cremonesi2010performance}. In PSVD, missing values are imputed by zeros and conventional SVD is performed.
\iffullpaper
We used Python's \texttt{sparsesvd} module and tested number of latent factors $g \in \{10, 20, 40, 60, 100, 150, 200, 300\}$. We report results for two configurations: one with $10$ latent factors (PSVD10), and one with 100 latent factors (PSVD100).
\else
We used Python's \texttt{sparsesvd} module and tested two configurations: one with $10$ latent factors (PSVD10), and one with 100 latent factors (PSVD100).
\fi
\item \textbf{CoFiRank}~\cite{weimer2007maximum} is a ranking prediction model that can optimize directly the Normalized Discounted Cumulative Gain (NDCG) ranking measure~\cite{voorhees2001overview}.
We used the source code from~\cite{weimer2007maximum}, with parameters set according to~\cite{weimer2007maximum}: 100 dimensions and $\lambda =10$, and default values for other parameters. We experimented with both regression (squared) loss (CofiR100) and NDCG loss (CofiN100).
Similar to~\cite{balakrishnan2012collaborative,volkovs2012collaborative}, we found CofiR100 to perform consistently better than CofiN100 in our experiments on ML-1M and ML-100K. We only report results for CofiR100.
\item \textbf{Ranking-Based Techniques (RBT)}~\cite{adomavicius2012improving} maximize coverage by re-ranking the output of a rating prediction model according to a re-ranking criterion. We implemented two variants: one that re-ranks a few of the items in the head according to their popularity (Pop criterion), and another which re-ranks according to the average rating (Avg criterion). As in~\cite{adomavicius2012improving}, we set $T_{max}=5$ in all datasets. The parameter $T_R$ controls the extent of re-ranking. We tested $T_{R}\in [4,4.2,4.5]$, and found $T_R=4.5$ to yield more accurate results. Furthermore, because our datasets contain a wider range of users compared to~\cite{adomavicius2012improving}, we set $T_H=1$ on all datasets, except ML-10M and Netflix, where we set $T_H=0$. To refer to RBT variants, we use $\texttt{RBT}(\texttt{ARec}, \texttt{Re-ranking criterion})$.
\item \textbf{Resource~allocation}~\cite{ho2014likes}
is an method for re-ranking the output of a rating prediction model. It has two phases: \begin{enumerate*}
\item resources are allocated to items according to the received ratings, and
\item the resources are distributed according to the relative preferences of the users, and top-$N$ sets are generated by assigning a a 5D score (for accuracy, balance, coverage, quality, and quantity of long-tail items) to every user-item pair.
\end{enumerate*}
We use the variants proposed in~\cite{ho2014likes}, which are combinations of the scoring function (5D) with the rank by rankings (RR) and accuracy filtering (A) algorithms (Section 3.2.2 in~\cite{ho2014likes}). We use the template $\texttt{5D} (\texttt{ARec}, \texttt{A}, \texttt{RR})$ to show the different combinations, where A and RR are optional.
We implemented and ran all four variants with default values set according to~\cite{ho2014likes}: $k=3.|\mathcal{I}|$ and $q=1$.
\iffullpaper
\else
We report results for 5D(ARec) and 5D(ARec, A, RR)
\fi
\item \textbf{Personalized Ranking Adaptation (PRA)}~\cite{jugovac2017efficient} is a generic re-ranking framework, that first estimates user tendency for various criteria like diversity and novelty, then iteratively and greedily re-ranks items in the head of the recommendations to match the top-$N$ set with the user tendencies. We compare with the novelty-based variant of this framework, which relies on item popularity statistics to measure user novelty tendencies. We use the the mean-and-deviation based heuristic, that is measured using the popularity of rated items, and was shown to provide comparable results with other heuristics in~\cite{jugovac2017efficient}. For the configurable parameters, we followed~\cite{jugovac2017efficient}: Sample set size $S_u \in \min(|\mathcal{I}^{\mathcal{R}}_u|,10)$, the exchangeable set size $|X_u| \in \{10,20\}$, and used ``optimal swap'' strategy with $maxSteps=20$. We use the template $\texttt{PRA}(\texttt{ARec}, |X_u|)$ to refer to variants of PRA.
\end{itemize}
\section*{Acknowledgment}
\bibliographystyle{IEEEtran}
\small
\section{Introduction}
\label{sec:Introduction}
The goal in top-$N$ recommendation is to recommend to each
consumer a small set of $N$ items from a large collection of
items~\cite{cremonesi2010performance}. For example, Netflix may want
to recommend $N$ appealing movies to each consumer. Collaborative
Filtering (CF)~\cite{herlocker2002empirical,lee2012comparative} is a
common top-$N$ recommendation method. CF infers user interests by
analyzing partially observed user-item interaction data, such as user
ratings on movies or historical purchase
logs~\cite{kanagal2012supercharging}. The main assumption in CF is that
users with similar interaction patterns have similar interests.
Standard CF methods for top-$N$ recommendation focus on making suggestions that accurately reflect the user's preference history. However, as observed in previous work, CF recommendations are generally biased toward popular items, leading to a rich get richer effect~\cite{vargas2014improving,steck2011item}. The major reasons for this are \textit{popularity bias} and \textit{sparsity} of CF interaction data (detailed in Section~\ref{sec:related-work}). In a nutshell, to maintain accuracy, recommendations are generated from the dense regions of the data, where the popular items lie.
However, accurately suggesting popular items, may not be satisfactory for the consumers. For example, in Netflix, an accuracy-focused movie recommender may recommend ``Star Wars: The Force Awakens'' to users who have seen ``Star Wars: Rogue One''. But, those users are probably already aware of ``The Force Awakens''. Considering additional factors, such as novelty of recommendations, can lead to more effective suggestions~\cite{cremonesi2010performance,Castells2015,zhang2008avoiding,ziegler2005improving,zhang2012auralist}.
Focusing on popular items also adversely affects the satisfaction of the providers of the items. This is because accuracy-focused models typically achieve a low overall item space coverage across their recommendations, whereas high item space coverage helps providers of the items increase their revenue~\cite{vargas2014improving,Castells2015,adomavicius2011maximizing,anderson2006thelongtail, yin2012challenging,adomavicius2012improving}.
In contrast to the relatively small number of popular items, there are copious {\it long-tail\/} items that have fewer observations (e.g., ratings) available. More precisely, using the Pareto principle (i.e.,~the $80/20$ rule), long-tail items can be defined as items that generate the lower $20\%$ of observations~\cite{yin2012challenging}. Experimentally we found that these items correspond to almost $85\%$ of the items in several datasets (Sections~\ref{sec:Notation} and \ref{sec:Experiments}).
As previously shown, one way to improve the novelty of top-$N$ sets is to recommend interesting long-tail items~\cite{cremonesi2010performance,ge2010beyond}. The intuition is that since they have fewer observations available, they are more likely to be unseen~\cite{Kaminskas:2016:DSN:3028254.2926720}.
Moreover, long-tail item promotion also results in higher overall coverage of the item spac
~\cite{vargas2014improving,Castells2015,zhang2008avoiding,zhang2012auralist,adomavicius2011maximizing,anderson2006thelongtail,yin2012challenging,jambor2010optimizing}. Because long-tail promotion reduces accuracy~\cite{steck2011item}, there are trade-offs to be explored.
This work studies three aspects of top-$N$ recommendation: accuracy, novelty, and item space coverage, and examines their trade-offs. In most previous work, predictions of a base recommendation algorithm are \textit{re-ranked} to handle these trade-offs~\cite{adomavicius2012improving,jambor2010optimizing,zhang2013personalize,wang2009portfolio}. The re-ranking models are computationally efficient but suffer from two drawbacks. First, due to performance considerations, parameters that balance the trade-off between novelty and accuracy are not customized per user. Instead they are cross-validated at a global level. This can be detrimental since users have varying preferences for objectives such as long-tail novelty. Second, the re-ranking methods are often limited to a specific base recommender that may be sensitive to dataset density.
As a result, the datasets are pruned and the problem is studied in dense settings~\cite{adomavicius2012improving,ho2014likes}; but real world scenarios are often sparse~\cite{kanagal2012supercharging,liu2017experimental}.
\iffalse
We address these limitations by directly inferring user preference for long-tail novelty from interaction data. This allows us to customize the re-ranking per user, and design a \textit{generic} framework, which resolves the second problem. In particular, since the long-tail novelty preferences are estimated independently of any base recommender model, we can plug-in an appropriate base recommender w.r.t. the dataset sparsity
Modelling user preference for long-tail novelty using only item popularity statistics, e.g., the average popularity of rated items as in~\cite{jugovac2017efficient}, disregards additional information like whether the user found the item interesting and the long-tail preferences of other users of the items. \iffalse To incorporate them, we introduce the notion of \emph{item long-tail importance}. Both user long-tail preferences and item long-tail importance are dependent: a user has high preference for discovering long-tail items if she is interested in important long-tail items, and an item that is associated with many of these kinds of users is likely to be more important. We propose a joint optimization framework to directly learn, from interaction data, both the users' long-tail preferences and the items' long-tail importance. \fi
We propose an optimization approach that incorporates this information and directly learns, from interaction data, the users' long-tail novelty preferences.
Next, we use these learned preferences to design a top-$N$ recommendation framework thats is generic, and provides customized balance between accuracy, novelty, and coverage. We refer to it as framework as GANC. Using GANC, we design a novel algorithm, {\it Ordered Sampling-based Locally Greedy (OSLG)\/}, that relies on the learned long-tail novelty preferences to scalably correct for popularity bias. Our work does not rely on any additional contextual data, although such data, if available, can help promote newly-added long-tail items~\cite{agarwal2009regression,Saveski:2014:ICR:2645710.2645751}. In summary:
\fi
We address the first limitation by directly inferring user preference for long-tail novelty from interaction data. Estimating these preferences using only item popularity statistics, e.g., the average popularity of rated items as in~\cite{jugovac2017efficient}, disregards additional information, like whether the user found the item interesting or the long-tail preferences of other users of the items. We propose an approach that incorporates this information and learns the users' long-tail novelty preferences from interaction data.
This approach allows us to customize the re-ranking per user, and design a \textit{generic} re-ranking framework, which resolves the second limitation of prior work. In particular, since the long-tail novelty preferences are estimated independently of any base recommender, we can plug-in an appropriate one w.r.t. different factors, such as the dataset sparsity.
Our top-$N$ recommendation framework, \textbf{GANC}, is \textbf{G}eneric, and provides customized balance between \textbf{A}ccuracy, \textbf{N}ovelty, and \textbf{C}overage.
Our work does not rely on any additional contextual data, although such data, if available, can help promote newly-added long-tail items~\cite{agarwal2009regression,Saveski:2014:ICR:2645710.2645751}. In summary:
\begin{itemize}
\item We examine various measures for estimating user long-tail novelty preference in Section~\ref{sec:lt-pref} and formulate an optimization problem to directly learn users' preferences for long-tail items from interaction data in Section~\ref{sec:learning-lt-pref}.
\item We integrate the user preference estimates into GANC
(Section~\ref{sec:RiskbasedReranking}), and introduce {\it Ordered Sampling-based Locally Greedy (OSLG)\/}, a scalable algorithm that relies on user long-tail preferences to correct the popularity bias (Section~\ref{sec:optimizationAlgorithm}).
\item We conduct an extensive empirical study and evaluate performance from accuracy, novelty, and coverage perspectives (Section~\ref{sec:Experiments}). We use five datasets with varying density and difficulty levels.
In contrast to most related work, our evaluation considers realistic settings that include a large number of infrequent items and users.
\item Our empirical results confirm that the performance of re-ranking models is impacted by the underlying base recommender and the dataset density. Our generic approach enables us to easily incorporate a suitable base recommender to devise an effective solution for both dense and sparse settings. In dense settings, we use the same base recommender as existing re-ranking approaches, and we outperform them in accuracy and coverage metrics. For sparse settings, we plug-in a more suitable base recommender, and devise an effective solution that is competitive with existing top-$N$ recommendation methods in accuracy and novelty.
\end{itemize}
Section~\ref{sec:related-work} describes related work. Section~\ref{sec:conclusion} concludes.
\section{Related Work}
\label{sec:related-work}
We provide an overview of related work here. A detailed description of baselines and methods integrated in our framework is provided in Section~\ref{sec:Experiments}.
\vspace{4mm}
\noindent \textbf{Accuracy-focused rating prediction CF models} aim to accurately predict unobserved user ratings~\cite{koren2008factorization,lee2012comparative}.
Accuracy is measured using error metrics such as RMSE or Mean Absolute Error that are defined w.r.t. the observed user feedback.
Generally, these methods are grouped into memory-based or model-based~\cite{koren2008factorization}. Earlier memory-based or neighbourhood models used the rating data directly to compute similarities between users~\cite{herlocker1999algorithmic} or items~\cite{sarwar2001item}. However, these models are not scalable on large-scale datasets like Netflix. Model-based methods instead train a parametric model on the user-item matrix. Matrix Factorization models~\cite{koren2008factorization,koren2009matrix}, a.k.a.~Singular Value Decomposition (SVD) models, belong to this group and are known for both scalablility and accuracy~\cite{cremonesi2010performance}.
\iffullpaper
These models factorize the user-item matrix into a product of two matrices; one maps the users ($\mathcal{U}$), and the other maps items ($\mathcal{I}$), into a latent factor space of dimension $g \ll \min(\vert \mathcal{U} \vert, \vert \mathcal{I} \vert )$. Here, each user $u$, and each item $i$, are represented by a factor vector, $\mathbf{p}_u \in \mathbb{R}^{g}$, and $\mathbf{q}_i \in \mathbb{R}^{g}$, respectively. Ratings are estimated using $\hat{r}_{ui} = \mathbf{q}^{T}_i \mathbf{p}_u$.
Due to the large number of missing values in the user-item matrix, the regularized squared error on the observed ratings is minimized. The resulting objective function is non-convex, and iterative methods such as Stochastic Gradient Descent (SGD) or Alternating Least Squares (ALS)~\cite{koren2009matrix, mnih2007probabilistic,rendle:tist2012}
can be used to find a local minimum.
\else
Using the user-item interaction data, these models learn latent factors for representing the users and items. Unobserved user ratings are estimated using the latent factors~\cite{koren2009matrix, mnih2007probabilistic,rendle:tist2012,zhuang2013fast}.
\fi
From this group, we use RSVD and RSVDN~\cite{koren2009matrix,zhuang2013fast}, in Section~\ref{sec:Experiments}.
\vspace{2mm}
\noindent \textbf{Accuracy-focused ranking prediction CF models} focus on accurately compiling ranked lists.
The intuition is that since predicted rating values are not shown to the user, the focus should be on accurately selecting and ranking items.
Accordingly, accuracy is measured using ranking metrics, like recall and precision, that can be measured either on the observed user feedback, or on \emph{all} items~\cite{cremonesi2010performance,steck2013evaluation}.
For ranking tasks, Pop obtains high precision and recall~\cite{cremonesi2010performance,vargas2014improving}. PSVD~\cite{cremonesi2010performance} and CoFiRank~\cite{weimer2007maximum} are well-known latent factor models for ranking, with others in~\cite{balakrishnan2012collaborative,lee2014local}. We use Pop, PSVD, and CofiRank in Section~\ref{sec:Experiments}.
\iffalse
\subsection{Multi-objective CF Methods}
Research targeting multiple objectives beside accuracy, is divided into two groups~\cite{adomavicius2011maximizing,niemann2013new}: 1.~those that directly devise a model that accounts for additional objectives, and
2.~re-ranking techniques that post-process the output of a standard model.
\fi
\vspace{2mm}
\noindent \textbf{Multi-objective methods} devise new models that optimize several objectives, like coverage and novelty, in addition to accuracy~\cite{vargas2014improving,steck2011item, yin2012challenging,niemann2013new,shi2013trading}. In~\cite{niemann2013new}, items are assumed to be similar if they significantly co-occur with the same items. This leads to better representations for long-tail items, and increases their chances of being recommended. A new performance measure that combines accuracy and popularity bias is proposed in~\cite{steck2011item}. This measure can be gradually tuned towards recommending long-tail items. More recently, the idea of recommending users to items as a means of improving sales diversity, and implicitly, recommendation novelty, while retaining precision, has been explored in~\cite{vargas2014improving}. In comparison to both~\cite{steck2011item,niemann2013new}, we focus on targeted promotion of long-tail items. While~\cite{vargas2014improving} focuses on neighbourhood models for top-$N$ recommendation, our framework is generic and independent of the recommender models.
Graph-based approaches for long-tail item promotion are studied in~\cite{yin2012challenging,shi2013trading}. They construct a bipartite user-item graph and use a random walk to trade-off between popular and long-tail items. Rather than devise new multi-objective models, we post-process existing models.
\vspace{2mm}
\noindent \textbf{Re-ranking methods} post-process the output of a standard model to account for additional objectives like coverage and diversity rather than devising a new model. These algorithms are very efficient.
\cite{ziegler2005improving} explores re-ranking to maximize diversity within individual top-$N$. It shows that users preferred diversified lists despite their lower accuracy. However, diversifying individual top-$N$ sets does not necessarily increase coverage~\cite{jambor2010optimizing,niemann2013new}.
Re-ranking techniques that directly maximize coverage and promote long-tail items are explored in~\cite{adomavicius2011maximizing,adomavicius2012improving,ho2014likes,jugovac2017efficient}. In contrast to~\cite{adomavicius2011maximizing,adomavicius2012improving,ho2014likes} that re-rank rating prediction models, our framework is generic and is independent of the base recommendation model. Furthermore, our long-tail personalization is independently learned from interaction data. PRA~\cite{jugovac2017efficient} is also generic framework for re-ranking, although we differ in our long-tail novelty prefernce modelling. We use RBT~\cite{adomavicius2012improving}, Resource allocation~\cite{ho2014likes}, PRA~\cite{jugovac2017efficient} as baselines since we share similar objectives.
\iffalse
Unlike~\cite{adomavicius2011maximizing,adomavicius2012improving,ho2014likes} that re-rank rating prediction models, our framework is generic and the long-tail personalization is independently learned. A maximum flow or maximum bipartite matching problem is solved in~\cite{adomavicius2011maximizing}, while~\cite{adomavicius2012improving} proposes the RBT framework that re-ranks a few of the items according to a given ranking strategy, e.g. the popularity of items or the average ratings of items. However, this approach requires extensive tuning to find trade-off values. We use \textbf{RBT} as a baseline.
A resource allocation approach for re-ranking the output of a rating prediction model, is presented in~\cite{ho2014likes}. Their approach has two phases: \begin{enumerate*}
\item resources are allocated to items according to the received ratings, and
\item the resources are distributed according to the relative preferences of the users, and top-$N$ sets are generated by assigning a a 5D score (for accuracy, balance, coverage, quality, and quantity of long-tail items) to every user-item pair.
\end{enumerate*}
As baselines, we use \textbf{5D, 5DA, 5DRR}, and \textbf{5DARR} that are various combinations of the scoring function (5D) with the rank by rankings (RR) and accuracy filtering (A) algorithms (Section 3.2.2 in~\cite{ho2014likes}).
Recently,~\cite{jugovac2017efficient} proposed a generic Personalized Ranking Adaptation (PRA) framework. The idea is to estimate user tendency for various objectives like diversity and item popularity using various heuristics, and to recommend top-$N$ sets that match those tendencies. We use \textbf{PRA} as a baseline. The framework iteratively and greedily re-ranks items in the head of the recommendations to match them with the user preferences.
\subsection{Modelling User Novelty Preference}
While~\cite{lacerda2013building,Teo:2016:APD:2959100.2959171,yin2012challenging,zhang2008avoiding} profile users based on their preference for diverse recommendation sets, we profile users based on their tendencies towards novel items.
\fi
\vspace{2mm}
\noindent \textbf{Modelling user novelty preference} is studied in~\cite{jambor2010optimizing,jugovac2017efficient,kapoor2015like,oh2011novel,Zhao:2016:MNR:2911451.2911488}. As explained in~\cite{kapoor2015like}, an item can be novel in three ways: \begin{enumerate*}
\item it is new to the system and is unlikely to be seen by most users (cold-start), \item it existed in the system but is new to a single user, \item it existed in the system, was previously known by the user, but is a forgotten item.
\end{enumerate*}
\cite{kapoor2015like,Zhao:2016:MNR:2911451.2911488} focus on definitions 2 and 3 of novelty, which are useful in settings where seen items can be recommended again, e.g.,~music recommendation.
For defining users' novelty preferences, tag and temporal data are used in~\cite{kapoor2015like,Zhao:2016:MNR:2911451.2911488}.
\iffullpaper
A logistic regression model is used to predict user novelty preferences in~\cite{kapoor2015like}, while~\cite{Zhao:2016:MNR:2911451.2911488} learn a curiosity model for each user based on her access history and item tags.
\fi
\iffalse
The curiosity model is a function of item novelties. The item novelty for that user is defined based on the user's item access frequency, recency of access, and item tags. ~\cite{Zhao:2016:MNR:2911451.2911488} proposed a framework to accurately recommend items that the user is curious about. Gross movie earnings are used for defining users' tendencies for novelty in~\cite{oh2011novel}. In particular, to measure the tendency of users toward popular items,~\cite{oh2011novel} define a notion of personal popularity tendency (PPT) per user using the average gross earnings of each movie and based on the past ratings of the user. The computation of PPT, however, is based on the assumption that the total earnings of a movie reflects its popularity. The idea is to match the PPT of each user with the PPT of recommended items, thereby increasing the novelty of recommendation lists in a targeted manner.
\fi
In~\cite{oh2011novel}, gross movie earnings are assumed to reflect movie popularity, and are used to define a personal popularity tendency (PPT) for each user. The idea is to match the PPT of each user with the PPT of recommended items~\cite{oh2011novel}.
The major difference between our work and~\cite{kapoor2015like,oh2011novel,Zhao:2016:MNR:2911451.2911488} is that we focus on the cold-start definition of novelty (definition 1), we do not use contextual or temporal information to define users' tendencies for novelty, and we consider domains where each item is accessed at most once (seen items cannot be recommended).
In~\cite{jambor2010optimizing}, users are characterized based on their tendency towards disputed items, defined as items with high average rating and high variance. These items are claimed to be in the long-tail. We differ in terms of long-tail novelty definition, and consequently our preference estimates. \iffullpaper Furthermore,~\cite{jambor2010optimizing} independently solve a constrained convex optimization problem for each user, with the user's disputed item tendency as a constraint. \fi \cite{zhang2013personalize,wang2009portfolio} use a user risk indicator to decide between a personalized and a non-personalized model; both focus on accuracy. In contrast, we combine accuracy and coverage models. Furthermore, while their risk indicators are optimized via cross validation, we learn the users' long-tail preferences.
PRA~\cite{jugovac2017efficient} models user preference for long-tail novelty using on item popularity statistics. In contrast, we consider additional information, like if the user found the item interesting, and the long-tail preferences of other users of the item.
\vspace{2mm}
\noindent \textbf{CF interaction data properties and test ranking protocol }
are two important aspects to consider in recommendation setting. CF interaction data suffers from popularity bias~\cite{agarwal_chen_2016}. In the movie rating domain, for instance, users are more likely to rate movies they know and like~\cite{cremonesi2010performance,steck2011item,steck2013evaluation,agarwal_chen_2016,steck2010training}. As a result, the partially observed interaction data is not a random subset of the (unavailable) complete interaction data.
Furthermore, many real-world CF interaction datasets~\cite{dooms2013movietweetings,kanagal2012supercharging,liu2017experimental,zolaktaf2015learn} are sparse, and the majority of items and users have few observations available. Due to the popularity bias and sparsity of datasets, many accuracy-focused CF models are also biased toward recommending popular items.
Moreover, some accuracy evaluation protocols are also biased and tend to reward popularity biased algorithms~\cite{cremonesi2010performance,vargas2014improving,steck2013evaluation}. In~\cite{steck2013evaluation}, the main evaluation protocols are assessed in detail, and the ``All unrated items test ranking protocol'' is described to be closer to the accuracy the user experience in real-world recommendation setting, where performance is measured using the complete data rather than available data~\cite{steck2013evaluation}. Following~\cite{steck2013evaluation,vargas2014improving}, and w.r.t. the additional experiments we conducted
\iffullpaper
in Appendix~\ref{test-protocol-effect},
\else
in~\cite{ourFullVersion},
\fi
we chose the ``All unrated items test ranking protocol'' for experiments in Section~\ref{sec:Experiments}.
\iffalse
\textcolor{red}{modify later:}Finding an allocation that maximizes both the satisfaction of the users $s(\mathcal{P})$ and the satisfaction of the producer $p(\mathcal{P})$ is a multicriterion combinatorial optimization problem ($ \max _{ \mathcal{P} = (\mathcal{P}_1 , ..., \mathcal{P}_U)} \left [ s(\mathcal{P}), p(\mathcal{P}) \right]$)
~\cite{hwang2012multiple, miettinen2012nonlinear,ehrgott2000survey}.
\begin{equation}
\begin{aligned}
\small
& \underset{ \mathcal{P} = (\mathcal{P}_1 , ..., \mathcal{P}_U)} {\max}
& & \left [ s(\mathcal{P}), p(\mathcal{P}) \right] \\
& \text{Subject to}
& & \mathcal{P}_{u} \subseteq \mathcal{I}, |\mathcal{P}_{u}| \leq N, \mathcal{P}_{u} \cap \mathcal{I}_{u} = \emptyset, \forall u \in \mathcal{U}.
\end{aligned}
\label{eq:bijectiveOpt}
\end{equation}
The two objectives are conflicting and a single optimal solution, that simultaneously maximizes both objectives, does not exist. Instead, there exists a set of nondominated solutions, also called the \textit{Pareto optimal} set. A solution dominates another if it as good or better in all objectives and better in at least one objective\cite{boyd2004convex}. Pareto optimal solutions are mathematically equivalent. However, we need a single \textit{best} Pareto optimal solution that compromises between the satisfaction of the right group of users and the producer.
There are a number of ways to find Pareto optimal solutions~\cite{boyd2004convex, hwang2012multiple, miettinen2012nonlinear}. A standard approach is to bound one objective and optimize the other. By altering the bounds and the objective functions to optimize, (every) Pareto optimal solutions can be generated. Another approach is to \textit{scalarize} the objectives into a single function of the form $(1-\mu)s(\mathcal{P}), + \mu p(\mathcal{P})$, where $\mu$ trades-off consumer and producer satisfaction, and both functions are in the same unit. Different $\mu$ values, result in different Pareto optimal solutions. However, because the interplay and relation between individual user satisfaction functions and the producer satisfaction is unclear, is is difficult to determine appropriate bounds or good trade-off values to generate the best Pareto optimal solution. One option is to generate a set of Pareto optimal solutions,~e.g., by systematically varying the budget values or $\mu$. But this process is computationally expensive and requires a solution selection phase, where the best solution is chosen wrt a separate set of criteria.
Instead, we combine the objective function formulation with the solution selection phase, to automatically generate the best answer. We achieve this by constructing a personalized value function for each user.
\fi
\iffalse
\subsection{Top-$N$ Recommendation Diversity}
\textcolor{red}{more on diversity?}
For instance, in~\cite{yin2012challenging} measures diversity in the past purchases of individual users.~\cite{zhang2008avoiding} explicitly: represent user intents,~\cite{lacerda2013building} enhanced the diversity and novelty in individual recommendation lists by building informative user profiles from user-item interactions. ~\cite{di2014analysis} analyze users propensity toward diversity in recommendations, too simple,heuristic and only for MMR? In the diversification literature that model user intents
The appeal of recommendation sets depends on several criteria, e.g.,~\cite{zhang2012auralist} simultaneously targets accuracy, diversity, novelty, and serendipity, and offers a hybrid re-ranking framework for combining the qualities. Diversity within individual top-$N$ sets, also impacts the appeal of lists. In~\cite{ziegler2005improving}, the utility of a recommendation list for the user is defined as a composition of two quality metrics, accuracy and diversity of products offered in the top-$N$ set.
A topic diversification heuristic is proposed in~\cite{ziegler2005improving}, which uses an intra-list similarity measure based on classification taxonomies to re-rank lists generated by item-based CF or user-based CF. They showed that users preferred diversified lists despite their lower accuracy. The problem of maximizing diversity of top-$N$ sets while also maintaining adequate similarity to the user is examined in~\cite{zhang2008avoiding} and a constrained optimization problem that trades off relevance and diversity is formulated. A submodular (formally defined in Section~\ref{sec:TheoreticalAnalysis}
) framework using a linear combination of relevance and diversity is formulated in~\cite{qin2013promoting}, where relevance is captured using PMF~\cite{mnih2007probabilistic} and an entropy regularizer is proposed for modelling diversity. \cite{ashkan2015optimal} formulate the task a maximization of a modular function on the polytope of a submodular function, which is solved optimally by a greedy method. However, their approach is practical when the size of the recommended list is short, and they require an external source for the topics. In contrast to our work, the above methods are either heuristic, or require additional information sources to explicitly diversify the lists, and the trade-off between relevance and diversity is non-personalized, and does not target long-tail item promotion.
Diversity in RS is related to diversity in Information Retrieval (IR)~\cite{vargas2011intent,Castells2015},~e.g., summarization and search.
Relevance and non-redundancy are defined as desirable properties of good summaries in document summarization~\cite{lin2011class}.
Search result diversification aims to to retrieve a ranked list of relevant documents that cover all aspects of an (ambiguous) query~\cite{agrawal2009diversifying, carbonell1998use,drosou2010search, gollapudi2009axiomatic}. Many solution formulations are based on the Maximal Marginal Relevance (MMR) objective function~\cite{carbonell1998use}, that combines relevance and diversity: $j^* = \argmax_{j \in \mathcal{I} \setminus \mathcal{A} } \left[ \lambda_{MMR} r_{uj} - (1-\lambda_{MMR}) \max_{i \in \mathcal{A}} s(i, j)\right]$.
The idea is to select documents that are relevant to the query, but dissimilar to already selected documents. Among various diversification methods, relevance estimates are commonly produced by standard retrieval approaches, and the major difference is in the diversity estimate. Some methods opt for implicit diversity modelling~\cite{gollapudi2009axiomatic} while others explicitly model query aspects and diversity~\cite{agrawal2009diversifying,santos2010exploiting}. An axiomatic approach to diversification is described in~\cite{gollapudi2009axiomatic} and a number of diversification objectives are formulated. When the distance function is a metric, efficient algorithms can be designed for maximizing the diversity~\cite{gollapudi2009axiomatic}.
Submodular diversity components are also common in diversification algorithms~\cite{abbassi2013diversity,agrawal2009diversifying}; a submodular diversification framework that relies on a taxonomy, and aims to minimize the dissatisfaction of the average user is given in~\cite{agrawal2009diversifying}. Most search result diversification algorithms provide non-personalized diversified lists, although~~\cite{vallet2012personalized} developed a framework for personalized diversification of search results.
\fi
\section{GANC: Generic Re-ranking Framework}
\label{sec:RiskbasedReranking}
We define user satisfaction based on the accuracy of the top-$N$ set and its coverage of the item space, so as to introduce novelty and serendipity into recommendation sets.
We consider three components for our framework: \begin{enumerate*}
\item an accuracy recommender (ARec) that is responsible for suggesting accurate top-$N$ sets.
\item a coverage recommender (CRec) that is responsible for suggesting top-$N$ sets that maximize coverage across the item space, and consequently promote long-tail items.
\item the user preference for long-tail novelty $\theta_u \in [0,1]$.
\end{enumerate*}
We use the template $\texttt{GANC} (\texttt{ARec}, \bm{\theta}, \texttt{CRec)}$ to specify the used components.
We define individual user value functions for a top-$N $ set $\mathcal{P}_u$ a
\begin{equation}
\small
v_u(\mathcal{P}_u) = (1-\theta_u) a(\mathcal{P}_{u}) + \theta_{u} c(\mathcal{P}_{u}) \label{eq:vurelcov}
\end{equation}
where $a(.)$ measures the score of a set of items according to the accuracy recommender, and $c(.)$ measures the score of a set according to the coverage recommender. With slight abuse of notation, let $a(i)$ and $c(i)$ denote the accuracy score and coverage score of a single item $i$. We ensure $a(i), c(i) \in [0,1]$ to have the same scale. Furthermore, we define $a(\mathcal{P}_u) = \sum_{i \in \mathcal{P}_u} a(i) $ and $c(\mathcal{P}_u) = \sum_{i \in \mathcal{P}_u} c(i) $.
The user value function in Eq.~\ref{eq:vurelcov} positively rewards sets that increase coverage. Similar intuitions for encouraging solutions with desirable properties,~e.g., diverse solutions, have been used in related work~\cite{ agrawal2009diversifying}.
However, their trade-off parameters are typically obtained via parameter tuning or cross validation. By contrast, we impose personalization via the user preference estimate, $\theta_u$, that is learned based on historical rating data. Next, we list the various base recommender models integrated into GANC.
\iffalse
Competitive Mixture of Experts :The accuracy recommender and the coverage recommender can be viewed as two experts, and any of our risk measures can be used as a probabilistic switching indicator. Specifically, the top-$N$ set for a user is determined as follows:
\begin{enumerate}
\item With probability $1-\theta_u$ we choose the set suggested by the accuracy recommender, i.e., $v_u(\mathcal{P}_u) = a(\mathcal{P}_{u}) $.
\item With probability $\theta_u$ we suggest the top-$N$ set suggested by the coverage recommender, i.e., $ v_u(\mathcal{P}_u) = c(\mathcal{P}_{u})$.
\end{enumerate}
This model resolves scale issues between the two objective functions.
\fi
\subsection{Accuracy recommender}
\label{sec:accuracyRecommender}
The accuracy recommender provides an accuracy score, $a(i)$, for each item $i$. We experiment with three models (Section~\ref{sec:ExpSetup} provides details and setup configurations):
\begin{itemize}
\item \textbf{Most popular (Pop)} ~\cite{cremonesi2010performance} is non-personalized and recommends the most popular unseen items. It makes accurate recommendations, but has low coverage and novelty~\cite{cremonesi2010performance}. Since it does not score items, we define $a(i)=1$ if item $i$ is in the top-$N$ set suggested by Pop, otherwise $a(i)=0$.
\item \textbf{Regularized SVD (RSVD)}~\cite{zhuang2013fast} learns latent factors for users and items by analyzing user-item interaction data (e.g.,~ratings). The factors are then used to predict the values of unobserved ratings. We use RSVD to compute a predicted rating matrix $\mathbf{\hat{R}} \in \mathbb{R}^{\vert \mathcal{U} \vert \times \vert \mathcal{I} \vert}$. We normalize the predicted rating vectors of all users to ensure $\hat{r}_{ui} \in [0,1]$, and define $a(i) =\hat{r}_{ui}$.
\item \textbf{PureSVD (PSVD)}~\cite{cremonesi2010performance} is also a latent factor model. We follow the same procedure as RSVD, using PSVD factors~\cite{cremonesi2010performance}. Note, PSVD scores correspond to associations between users and items.
\end{itemize}
\iffalse
We use Pop, MF, and PureSVD in our framework. Since Pop does not output scores for items, we define $a(i)=1$ if item $i$ is in the top-$N$ set suggested by pop, otherwise $a(i)=0$. Note, the risk estimated in our framework allows us to introduce personalization into this non-personalized method.
For MF and PureSVD, we use the predicted factors to compute the predicted rating matrix $\mathbf{\hat{R}} \in \mathbb{R}^{\vert \mathcal{U} \vert \times \vert \mathcal{I} \vert}$. Next, we normalize the completed rating vectors of all users to ensure $\hat{r}_{ui} \in [0,1]$. (Unless otherwise stated, $\hat{r}$ denotes normalized values.) $a(i) =\hat{r}_{ui} $.
Note, the scores obtained from MF correspond to relevance scores, while those obtained from PureSVD correspond to associations between users and items.
MF accurately predicts the relevance of items to users. We combine the predicted ratings of unseen items with the ratings of seen items, and form the completed the user-item interaction matrix, $\mathbf{\hat{R}} \in \mathbb{R}^{\vert \mathcal{U} \vert \times \vert \mathcal{I} \vert}$. Next, we normalize the completed rating vectors of all users to ensure $\hat{r}_{ui} \in [0,1]$. (Unless otherwise stated, $\hat{r}$ denotes normalized values.) $a(i) =\hat{r}_{ui} $.
\begin{equation}
\small
w_u(\mathcal{P}_u ; \mathbf{\hat{R}} ) =\frac{1}{N} \sum_{i \in \mathcal{P}_u}{\hat{r}_{ui}}
\label{eq:modular-relevance}
\end{equation}
\fi
\subsection{Coverage recommender}
The coverage recommender provides a coverage score, $c(i)$, for each item $i$. We use three coverage recommenders:
\begin{itemize}
\item \textbf{Random (Rand)} recommends $N$ unseen items randomly. It has high coverage, but low accuracy~\cite{vargas2014improving}. We define $c(i) \sim $unif$(0,1)$.
\iffalse
\subsubsection{Binary Complement SVD} Here, we represent the user-item rating matrix using binary values, where 1 indicates the user rated the item and 0 indicates the item has not received any rating. We then apply SVD on the matrix. The resulting $\mathbf{\hat{R}}$ is estimated as in PureSVD. However to derive a model that promote long-tail items, we need to flip the result $\hat{r}^{'} = 1 - \hat{r}$.
\fi
\item \textbf{Static (Stat)} focuses exclusively on promoting less popular items. We define $c(i)$ to be a monotone decreasing function of $f_i^{ \mathcal{R}}$, the popularity of $i$ in the train set $\mathcal{R}$. We use $c(i) = \frac{1}{ \sqrt{f_i^{\mathcal{R}}+1 }}$ in our work.
Note the gain of recommending an item is constant.
\item \textbf{Dynamic (Dyn)} allows us to better correct for the popularity bias in recommendations. In particular, rather than the train set $\mathcal{R}$, we define $c(i)$ based on the set of recommendations made so far. Let $\mathcal{P} = \{ \mathcal{P}_u \}_{u=1}^ {|\mathcal{U}|} $ with $|\mathcal{P}_u| = N$, denote the collection of top-$N$ sets assigned to all users, and $\mathcal{A} = \{ \mathcal{A}_u \}_{u=1}^ {|\mathcal{U}|} $ with $\mathcal{A}_u \subseteq \mathcal{P}_u$, denote a partial collection where a subset of users have been assigned some items. We measure the long-tail appeal of an item using a monotonically decreasing function of the popularity of $i$ in $\mathcal{A}$, i.e., $f_i^{\mathcal{A}}$. We use
$c(i) = \frac{1}{\sqrt{ f_i^{\mathcal{A}} + 1} }\label{eq:coverage}$ in our work. The main intuition is that recommending an item has a diminishing returns property: the more the item is recommended, the less the gain of the item in coverage, i.e., $c(i)=1$ when $\mathcal{A} = \emptyset$, but decreases as the item is more frequently suggested
\end{itemize}
\subsection{Optimization Algorithm for GANC }
\label{sec:optimizationAlgorithm}
The overall goal of the framework is to find an optimal top-$N$ collection $\mathcal{P} = \{ \mathcal{P}_u \}_{u=1}^ {|\mathcal{U}|} $ that maximizes the aggregate of the user value functions:
\begin{align}
\small
\max_{\mathcal{P} } \ v(\mathcal{P}) = \sum_{u \in \mathcal{U}} v_{u}(\mathcal{P}_{u})
\label{eq:overallValueFunction}
\end{align}
The combination of Rand and Stat with the accuracy recommenders in Section~\ref{sec:accuracyRecommender}, result in value functions that can be optimized greedily and independently, for each user. Using Dyn, however, creates a dependency between the optimization of user value functions, where the items suggested to one user depend on those suggested to previous users. Therefore, user value functions can no longer be optimized independently.
\input{algSeqSample}
\vspace{4mm}
\noindent \textbf{Optimization algorithm for GANC with Dyn. }
\label{sec:optimizingFrameworkWithDynamic}
Because Dyn is monotonically decreasing in $f_i^{\mathcal{A}}$, when used in Eq.\ref{eq:vurelcov}, the overall objective in Eq.~\ref{eq:overallValueFunction} becomes submodular across users. Maximizing a submodular function is NP-hard~\cite{khuller1999budgeted}.
However, a key observation is that the constraint of recommending $N$ items to each user, corresponds to a partition matroid over the users.
Finding a top-$N$ collection $\mathcal{P}$ that maximizes Eq.~\ref{eq:overallValueFunction} is therefore an instance of maximizing a submodular function subject to a matroid constraint \iffullpaper
(see Appendix~\ref{sec:submodularmonotoneproof}).
\else
(see~\cite{ourFullVersion} for details).
\fi
A \textit{Locally Greedy} heuristic, due to Fisher et al.~\cite{fisher1978analysis}, can be applied: consider the users separately and in arbitrary order. At each step, select a user $u$ arbitrarily, and greedily construct $\mathcal{P}_u$ for that user. Proceed until all users have been assigned top-$N$ sets. Locally Greedy produces a solution at least half the optimal value for maximizing a submodular monotone function subject to a matroid constraint~\cite{fisher1978analysis}.
\iffalse
\begin{theorem}
\label{thm:greedylocallygreedy}
The locally greedy heuristic is a $1/2$-approximation algorithm for maximizing Eq.~\ref{eq:overallValueFunction} when $v$ is submodular monotone increasing~\cite{fisher1978analysis}.
\end{theorem}
\fi
However, locally greedy is sequential and has a computational complexity of $O(\vert \mathcal{U} \vert . \vert \mathcal{I}\vert . N)$ which is not scalable. Instead, we introduce a heuristic we call \textit{Ordered Sampling-based Locally Greedy} (OSLG). Essentially, we make two modifications based on the user long-tail preferences: first, proportionate to the distribution of user long-tail preferences $\bm{\theta}$, we sample a subset of users, and run the sequential algorithm on this sample only. Second, to allow the system to recommend more established or popular products to users with lower long-tail preference, instead of arbitrary order, we modify locally greedy to consider users in increasing long-tail preference.
\iffalse
to improve the scalability of the algorithm, we only run the sequential part on a representative sample of the users $\mathcal{S} \subset \mathcal{U}$, and propagate the information for users not included in the sample.
first, locally greedy, operates on users sequentially and in arbitrary order. We modify locally greedy to consider users in increasing risk degree.
\fi
Algorithm~\ref{algo:algSeqSample} shows GANC with OSLG optimization: We use $\mathbf{f}_i$ as a shorthand for $f_i^{\mathcal{A}}$, the popularity of item $i$ in the current set of recommendations, used in Dyn. First, $\mathbf{f}$ is initialized and user preferences $\bm{\theta}$ are estimated (line~\ref{algo:algSeqSample:line:initilize}). Next, we use Kernel density estimation (KDE)~\cite{sheather1991reliable} to approximate the Probability density function (PDF) of $\bm{\theta}$, and use the PDF to draw a sample $\mathcal{S}$ of size $S$ from $\bm{\theta}$ and find the corresponding users in $\mathcal{U}$ (line~\ref{algo:algSeqSample:line:sample}). The sampled users are then sorted in increasing long-tail preference (line~\ref{algo:algSeqSample:line:sortUsers}), and the algorithm iterates over the users. In each iteration, it updates the Dyn function (line~\ref{algo:algSeqSample:line:updateCoverageFunction1}) and assigns a top-$N$ set to the current user by maximizing her value function (line~\ref{algo:algSeqSample:line:top-NAssign1}). The Dyn function parameter $\mathbf{f}$ is then updated w.r.t. the recently assigned top-$N$ set (line~\ref{algo:algSeqSample:line:updateStep}). Moreover, $\mathbf{f}$ is associated with the current long-tail preference estimate $\theta_u$, and stored (line~\ref{algo:algSeqSample:line:storeshit}). The algorithm then proceeds to the next user. Since Dyn is monotonically decreasing in $\mathbf{f}_i$, frequently recommended items are weighted down by the value function of subsequent users. Consequently, as we reach users who prefer long-tail items and discovery, their value functions prefer relatively unpopular items that have not been recommended before. Thus, the induced user ordering, results in the promotion of long-tail items to the right group of users, such that we obtain better coverage while maintaining user satisfaction.
For each user not included in the sample set, $u \not\in \mathcal{S}$, we find the most similar user $s \in \mathcal{S}$, where similarity is defined as $|\theta_s-\theta_u|$ (line~\ref{algo:algSeqSample:line:getFrequency}), and use $F(\theta_s)$ to compute the coverage score (line~\ref{algo:algSeqSample:line:updateCoverageFunction2}), and assign a top-$N$ set. Observe, the value functions of $u \in \mathcal{U} \setminus \mathcal{S}$, are independent of each other, and lines \ref{algo:algSeqSample:line:getFrequency}-\ref{algo:algSeqSample:line:updateP} can be performed in parallel. The computational complexity of the sequential part drops to $O(\vert \mathcal{S} \vert . \vert \mathcal{I}\vert . N)$ at the cost of $O(\vert \mathcal{S} \vert . \vert \mathcal{I}\vert )$ extra memory.
\iffalse
\begin{align*}
\texttt{Pref. Model}_{\texttt{Acc. Rec.}}^{\texttt{Cov. Rec.}}
\end{align*}
\fi
\subsection{Distribution of long-tail novelty preferences}
Figure~\ref{fig:Hist-LT-PreferenceModels} plots the histogram of various long-tail preference
\iffullpaper
models.
\else
(results for other datasets are omitted due to space limitations, but have similar trends).
\fi
We observe $\theta^A_u$ is skewed to the right. This is due to the sparsity problem, where the majority of users rate a few items. $\theta^N_u$ is also skewed to the right across all datasets, due to both the popularity bias and sparsity problems~\cite{agarwal_chen_2016,Marlin07collaborativefiltering}.
On the other hand, $\theta^G_u$ is normally distributed, with a larger mean and a larger variance, on all datasets. In the experiments in Section~\ref{sec:perfOSLG}, we study the effect of these preference models on performance.
\iffalse
One explanation for the bias of all preference estimates towards lower values, is the popularity bias of training data. In some datasets, such as MovieLens, movies are presented to users to warm-start the recommender system. The presented movies, and the observed ratings, can be biased toward more popular movies~\cite{agarwal_chen_2016,Marlin07collaborativefiltering}. As a result, the preference estimates are biased towards lower values for datasets that exhibit this popularity bias.
Note, on the MovieTweetings dataset, where users voluntarily rate movies, and the effect of presentation bias is negligible, $\theta^*$ is normally distributed with $\mu_{\theta^*}=0.522$ and $\sigma_{\theta^*}=0.178 $, while $\theta^T$ and $\theta^N$ remain skewed toward lower values.
Note, popularity bias and sparsity are inherent characteristics of the recommendation domain, although some datasets suffer more. Totally eliminating this bias, may not be advantageous.
\fi
\iffullpaper
\begin{figure*}[t]
\centering
\subfloat[ML-100K]
{\includegraphics[scale=0.20]{Figures/CombinedHistograms/twoHistogramsofthetaTNRthetaNorNLTthetaTFIDFthetaStar2.pdf}
\label{fig:ML-Users-vs-theta}
}
\subfloat[ML-1M]
{\includegraphics[scale=0.20]{Figures-ml-1m/CombinedHistograms/twoHistogramsofthetaTNRthetaNorNLTthetaTFIDFthetaStar2.pdf
\label{fig:ML-Users-vs-theta}
}
\subfloat[ML-10M]
{\includegraphics[scale=0.20]{Figures-ml-10m/CombinedHistograms/twoHistogramsofthetaTNRthetaNorNLTthetaTFIDFthetaStar2.pdf}
\label{fig:ML-Users-vs-theta}
}
\subfloat[MT-200K]
{\includegraphics[scale=0.20]{Figures-mt-200k-m5-mapped/CombinedHistograms/twoHistogramsofthetaTNRthetaNorNLTthetaTFIDFthetaStar2.pdf
\label{fig:ML-Users-vs-theta}
}
\subfloat[Netflix]
{\includegraphics[scale=0.20]{FiguresSum/CombinedHistograms/twoHistogramsofthetaTNRthetaNorNLTthetaTFIDFthetaStar2.pdf}
\label{fig:ML-Users-vs-theta}
}
\caption{Histogram of long-tail novelty preference models. Observe $\theta^A_u$ is skewed toward smaller values because of sparsity, i.e.,~the majority of users rate a few items. $\theta^N_u$ is also biased toward smaller values, due to a combination of popularity bias and sparsity. $\theta^T_u$ and $\theta^G_u$ are less biased and more normally distributed and alleviate both problems.}
\label{fig:Hist-LT-PreferenceModels}
\end{figure*}
\else
\begin{figure}[t]
\centering
\subfloat[ML-1M]
{\includegraphics[scale=0.28]{Figures-ml-1m/CombinedHistograms/twoHistogramsofthetaTNRthetaNorNLTthetaTFIDFthetaStar2.pdf
\label{fig:ML-Users-vs-theta}
}
\subfloat[Netflix]
{\includegraphics[scale=0.28]{FiguresSum/CombinedHistograms/twoHistogramsofthetaTNRthetaNorNLTthetaTFIDFthetaStar2.pdf}
\label{fig:ML-Users-vs-theta}
}
\caption{Histogram of long-tail novelty preference models. Observe $\theta^A_u$ is skewed toward smaller values because of sparsity, i.e.,~the majority of users rate a few items. $\theta^N_u$ is also biased toward smaller values, due to a combination of popularity bias and sparsity. $\theta^T_u$ and $\theta^G_u$ are less biased and more normally distributed and alleviate both problems.}
\label{fig:Hist-LT-PreferenceModels}
\end{figure}
\fi
\iffullpaper
\begin{figure*}[t]
\centering
\subfloat[PSVD100]
{
\includegraphics[width=0.22\textwidth]{Figures-ml-1m/SampleSize/thetaStar2/pureSVD_best/fmeasureoverSampleSize.pdf}
}
\subfloat[PSVD10]
{
\includegraphics[width=0.22\textwidth]{Figures-ml-1m/SampleSize/thetaStar2/pureSVD_10/fmeasureoverSampleSize.pdf}
}
\subfloat[Pop]
{
\includegraphics[width=0.22\textwidth]{Figures-ml-1m/SampleSize/thetaStar2/pop_best/fmeasureoverSampleSize.pdf}
}
\subfloat[RSVD]
{
\includegraphics[width=0.22\textwidth]{Figures-ml-1m/SampleSize/thetaStar2/rhat_best/fmeasureoverSampleSize.pdf}
}
\caption{Performance of GANC(ARec, $\bm{\theta}^{G}$, Dyn) with OSLG optimization, as sample size (S) is varied. The accuracy recommender ARec is indicated in each sub-figure. Dataset is ML-1M.}
\label{fig:SampleSize1}
\end{figure*}
\begin{figure*}[t]
\centering
\subfloat[PSVD100]
{
\includegraphics[width=0.22\textwidth]{Figures-mt-200k-m5-mapped/SampleSize/thetaStar2/pureSVD_best/fmeasureoverSampleSize.pdf}
}
\subfloat[PSVD10]
{
\includegraphics[width=0.22\textwidth]{Figures-mt-200k-m5-mapped/SampleSize/thetaStar2/pureSVD_10/fmeasureoverSampleSize.pdf}
}
\subfloat[Pop]
{
\includegraphics[width=0.22\textwidth]{Figures-mt-200k-m5-mapped/SampleSize/thetaStar2/pop_best/fmeasureoverSampleSize.pdf}
}
\subfloat[RSVD]
{
\includegraphics[width=0.22\textwidth]{Figures-mt-200k-m5-mapped/SampleSize/thetaStar2/rhat_best/fmeasureoverSampleSize.pdf}
}
\caption{Performance of GANC(ARec, $\bm{\theta}^{G}$, Dyn) with OSLG optimization, as sample size (S) is varied. The accuracy recommender ARec is indicated in each sub-figure. Dataset is MT-200K.}
\label{fig:SampleSize2}
\end{figure*}
\else
\begin{figure}[b]
\centering
\subfloat[ARec is PSVD100]
{
\includegraphics[width=0.23\textwidth]{Figures-ml-1m/SampleSize/thetaStar2/pureSVD_best/fmeasureoverSampleSize.pdf}
}
\subfloat[ARec is PSVD10]
{
\includegraphics[width=0.23\textwidth]{Figures-ml-1m/SampleSize/thetaStar2/pureSVD_10/fmeasureoverSampleSize.pdf}
}
\caption{Performance of GANC(ARec, $\bm{\theta}^{G}$, Dyn) with OSLG optimization, as sample size (S) is varied. The accuracy recommender ARec is indicated in each sub-figure. Dataset is ML-1M.}
\label{fig:SampleSize}
\end{figure}
\fi
\subsection{Performance of GANC with Dyn coverage recommender}
\label{sec:perfOSLG}
When Dyn is integrated in GANC, we use OSLG optimization. We run variants of GANC that involve randomness (e.g., sampling-based variants) 10 times and report the average.
\vspace{4mm}
\noindent \textbf{Effect of sample size. }The sample size $S$ is a system-wide hyper-parameter in the OSLG algorithm, and should be determined w.r.t. preference for accuracy or coverage, and the accuracy recommender. For tuning $S$, we run experiments on ML-1M, and assess its effect on F-measure and coverage.
\iffullpaper
As shown in Figures~\ref{fig:SampleSize1} and~\ref{fig:SampleSize2}, increasing $S$, increases coverage and decreases the F-measure of most accuracy recommenders. Regarding RSVD, the scores output by this model lead to the initial decrease and later increase of F-measure. Since we want to maintain accuracy, we fix $S=500$ in the rest of our experiments, although a larger $S$ can be used.
\else
Figure~\ref{fig:SampleSize} shows the effect of increasing $S$ on coverage and F-measure for two of our base accuracy recommenders (other results are omitted but the trends are similar~\cite{ourFullVersion}). Since we want to maintain accuracy, we fix $S=500$ in the rest of our experiments, although a larger $S$ can be used.
\fi
\vspace{4mm}
\noindent \textbf{Effect of the user long-tail novelty preference model, the accuracy recommender, and their interplay. }
We evaluate GANC with Dyn coverage, i.e., GANC(ARec, $\bm{\theta}$, Dyn), while varying the accuracy recommender ARec, and the long-tail novelty preference model $\bm{\theta}$. We examine the following long-tail preference models:
\begin{itemize}
\item \textbf{Random} $\bm{\theta}^{R}$ randomly initializes $\theta^{R}_u$ (10 times per user)
\item \textbf{Constant} $\bm{\theta}^{C}$ assigns the same constant value $C$ to all users. We report results for $C=0.5$.
\item \textbf{Normalized Long-tail} $\bm{\theta}^{N}$ (Eq.~\ref{eq:nlt-risk}) measures the proportion of long-tail items the user has rated in the past.
\item \textbf{Tfidf-based} $\bm{\theta}^{T}$ (Eq.~\ref{eq:tfidf-risk}) incorporates user interest and popularity of items.
\item \textbf{Generalized} $\bm{\theta}^{G}$ (Eq.~\ref{eq:overallRiskUpdate}) incorporates user interest, popularity of items, and the preferences of other users.
\end{itemize}
Due to sampling ($S=500$), we run each variant 10 times (with random shuffling for $\bm{\theta}^C$) and average over the runs. We run the experiments on ML-1M.
Figure~\ref{fig:thetavsthetaStar} shows performance of GANC(ARec, $\bm{\theta}$, Dyn) as $\bm{\theta}$ and the accuracy recommender (ARec) are varied. Across all rows, as expected, the accuracy recommender on its own, typically obtains the best F-measure. Moreover, $\bm{\theta}^{R}$ and $\bm{\theta}^{C}$ often have the lowest F-measure. Different variants of GANC with $\bm{\theta}^{N},\bm{\theta}^{T}$, and $\bm{\theta}^{G}$ are generally in the middle, which shows that these preference estimates are better than $\bm{\theta}^{R}$ and $\bm{\theta}^{C}$ in terms of accuracy. For Stratified Recall, similar trends as accuracy are observed in the ranking of the algorithms. The trends are approximately the same as we vary the accuracy recommender in Figures~\ref{fig:thetavsthetaStar}.b,~\ref{fig:thetavsthetaStar}.c, and~\ref{fig:thetavsthetaStar}.d.
\begin{figure*}[p]
\centering
\subfloat[Accuracy recommender (ARec) is RSVD]
{
\includegraphics[width=0.88\textwidth]{Figures-ml-1m/metrics/sf_gini_over_N_impMetrics_cbr_rhat_best_500.pdf}
\label{fig:ThetaConfigs}
}
\subfloat[Accuracy recommender (ARec) is PSVD100]
{
\includegraphics[width=0.88\textwidth]{Figures-ml-1m/metrics/sf_gini_over_N_impMetrics_cbr_pureSVD_best_500.pdf}
\label{fig:ThetaConfigs}
}
\subfloat[Accuracy recommender (ARec) is PSVD10]
{
\includegraphics[width=0.88\textwidth]{Figures-ml-1m/metrics/sf_gini_over_N_impMetrics_cbr_pureSVD_10_500.pdf}
\label{fig:ThetaConfigs}
}
\subfloat[Accuracy recommender (ARec) is Pop]
{
\includegraphics[width=0.88\textwidth]{Figures-ml-1m/metrics/sf_gini_over_N_impMetrics_cbr_pop_best_500.pdf}
\label{fig:ThetaConfigs}
}
\caption{Performance of GANC(ARec, $\bm{\theta}$, Dyn), with fixed sample size $S =|500|$, different accuracy recommenders (ARec), and different long-tail preference models ($\bm{\theta}$). Dataset is ML-1M. The trends are approximately the same as we vary the accuracy recommender in Figures~\ref{fig:thetavsthetaStar}.a,~\ref{fig:thetavsthetaStar}.b,~\ref{fig:thetavsthetaStar}.c, and~\ref{fig:thetavsthetaStar}.d. In each row, ARec typically achieves the highest F-measure, but performs poorly w.r.t. coverage and gini. Variants of our framework that use $\bm{\theta}^{G}$, $\bm{\theta}^{T}$, $\bm{\theta}^{N}$, obtain higher f-measure levels compared to those that use $\bm{\theta}^{R}$ and $\bm{\theta}^{C}$. They also improve stratified recall, independent of the accuracy recommender. Stratified Recall emphasizes novelty and accuracy}
\label{fig:thetavsthetaStar}
\end{figure*}
\iffalse
\input{otherResults}
\fi
\section{Comparison with other recommendation models}
We conduct two rounds of experiments: first, we evaluate re-ranking frameworks that post-process rating-prediction models, then we study general top-$N$ recommendation algorithms. For GANC, we run variants that involve randomness (e.g., sampling-based variants) 10 times, and report the average.
\subsection{Comparison with re-ranking methods for rating-prediction}
\label{sec:re-rankingratingprediction}
Standard re-ranking frameworks typically use a rating prediction model as their accuracy recommender. In this section, we use RSVD as the underlying rating prediction model, and analyze performance across datasets with varying density levels. We compared the standard greedy ranking strategy of RSVD with
5D(RSVD), 5D(RSVD, A, RR),
RBT(RSVD, Pop), RBT(RSVD, Avg), PRA(RSVD,10), PRA(RSVD,20), GANC(RSVD, $\bm{\theta}^T$, Dyn), and GANC(RSVD, $\bm{\theta}^G$, Dyn). We report results for $N=5$, since users rarely look past the items at the top of recommendation sets. Table~\ref{tab:re-rankingREGSVD} shows top-$5$ recommendation performance.
\begin{table*}[pt]
\centering
\footnotesize
\begin{tabular}{lllllllc}
\toprule
&Alg.&F@5&S@5&L@5&C@5&G@5& Score\\
\toprule
\iffullpaper
\multirow{9}{*}{\rotatebox[origin=c]{90}{~ML-100K}}
\input{FiguresSum/Tables_ICDE/rMF-ml-100k-8_Partial-latex.txt}
\midrule
\fi
\multirow{9}{*}{\rotatebox[origin=c]{90}{~ML-1M}}
\input{FiguresSum/Tables_ICDE/rMF-ml-1m-8_Partial-latex.txt}
\midrule
\multirow{9}{*}{\rotatebox[origin=c]{90}{~ML-10M}}
\input{FiguresSum/Tables_ICDE/rMF-ml-10m-8_Partial-latex.txt}
\midrule
\multirow{9}{*}{\rotatebox[origin=c]{90}{~MT-200K}}
\input{FiguresSum/Tables_ICDE/rMF-mt-200k-m5-mapped-8_Partial-latex.txt}
\iffullpaper
\midrule
\multirow{9}{*}{\rotatebox[origin=c]{90}{~Netflix}}
\input{FiguresSum/Tables_ICDE/rMF-netflix-8_Partial-latex.txt}
\fi
\bottomrule
\end{tabular}
\caption{Top-5 recommendation performance for re-ranking a rating prediction model, RSVD. \iffullpaper \else We have omitted ML-100K and Netflix, since they obtain similar results as ML-1M and MT-200K, respectively. \fi
The metrics are (F)measure@5, (S)tratified Recall@5, (L)TAccuracy@5, (C)overage@5, and (G)ini@5. Bolded entries show the best value for each metric, with relative rank of each algorithm on each metric inside parenthesis. For all models, improving trade-offs is better on dense datasets. Regarding our two variants of GANC (with fixed sample size $S=500$), they outperform others in all metrics except LTAccuracy, in dense settings (ML-1M). On all datasets, our models obtain the lowest average rank across all metrics (last column). Overall, the results suggest a different accuracy recommender should be used in sparse settings. }
\label{tab:re-rankingREGSVD}
\end{table*}
Regarding RSVD, the model obtains high LTAccuracy, but under-performs all other models in coverage and gini. Essentially, RSVD picks a small subset of the items, including long-tail items, and recommends them to all the users. After all, RSVD model is trained by minimizing Root Mean Square Error (RMSE) accuracy measure, which is defined w.r.t. available data and not the complete data~\cite{steck2010training}. Therefore, when the model is used to choose a few items ($N$) from among \emph{all} available items, as is required in top-$N$ recommendation problems, it does not obtain good overall performance.
In dense settings (ML-1M), GANC outperforms other models in all metrics except LTAccuracy. In sparse settings, except on ML-10M, GANC has at least one variant in the top 2 methods w.r.t. \iffullpaper F-measure. \else F-measure (see~\cite{ourFullVersion}). \fi In both sparse and dense settings, except on ML-10M, GANC has at least one variant in the top 2 methods w.r.t. stratified recall. Other methods, e.g.,~5D, focus exclusively on LTAccuracy and reduce F-measure and stratified recall.
In summary, the performance of RSVD depends on the dataset density. On the sparse datasets, it does not provide accurate suggestions w.r.t. F-measure, and subsequent re-ranking models make less accurate suggestions. Although another reason for the smaller F-measure values on datasets like ML-10M (and Netflix), is the larger item space size. Top-5 recommendation, corresponds to a very small proportion of the overall item space. Re-ranking a rating prediction model like RSVD, is mostly effective for dense settings. However, our framework is generic, and enables us to plug-in a different accuracy recommender. We show the results for this in the next section. Moreover, all re-ranking techniques increase coverage, but reduce accuracy. 5D(RSVD) obtains the highest novelty among all models, but reduces accuracy significantly. On most datasets, GANC significantly increases coverage and decreases gini, while maintaining reasonable levels of accuracy.
\subsection{Comparison with top-N item recommendation models}
\label{sec:top-nrecommendation}
\begin{figure*}[t]
\centering
\subfloat[]
{
\includegraphics[width=1\textwidth]{FiguresSum/sfLTAccuracyvsfmeasurezainab.pdf}
}
\caption{Accuracy vs Coverage vs Novelty. The head of the arrow shows our main model GANC(ARec, $\bm{\theta}^G$, Dyn) with sample size $S=500$, while the bottom shows the underlying accuracy recommender (ARec). On MT-200K ARec is Pop. On other datasets it is PSVD-100. Note, RSVD is consistently dominated by all other models in F-measure and coverage. }
\label{fig:pcn}
\end{figure*}
As shown previously, in sparse settings, re-ranking frameworks that rely on rating prediction models do not generate accurate solutions. In this section we plug-in a different accuracy recommender w.r.t. dataset density.
On MT-200K, we plug-in Pop. On all other datasets we plug-in PSVD100 as the accuracy recommender.
For GANC, we use three variants which differ in their coverage recommender: GANC(ARec, $\bm{\theta}^G$, Dyn), GANC(ARec, $\bm{\theta}^G$, Stat) and GANC(ARec, $\bm{\theta}^G$, Rand). We also compare to the generic re-ranking framework, PRA(ARec, 10). For both GANC and PRA, we always plug-in the same accuracy recommender. Furthermore, we compare with standard top-$N$ recommendation algorithms: Rand, Pop, RSVD, CofiR100, PSVD10, PSVD100.
Figure~\ref{fig:pcn} compares accuracy, coverage and novelty trade-offs. On all datasets, Rand achieves the best coverage and gini, but the lowest accuracy. Similar to~\cite{cremonesi2010performance,vargas2014improving}, we find the non-personalized method Pop, which takes advantage of the popularity bias of the data, is a strong contender in accuracy, but under-performs in coverage and novelty.
Regarding GANC, Figure~\ref{fig:pcn} shows the best improvements in coverage are obtained when we use either Rand or Dyn coverage recommenders. Stat is generally not a strong coverage recommender,~e.g, GANC(ARec, $\bm{\theta}^G$, Stat) obtains high novelty (LTAccuracy) on ML-10M, but does not lead to significant improvements in coverage. This is because Stat has constant gain for long-tail promotion and focuses exclusively on recommending (a small subset of the) long-tail items. Our main model is GANC(ARec, $\bm{\theta}^G$, Dyn). An interesting observation is that on MT-200K, both GANC(ARec, $\bm{\theta}^G$, Dyn) and GANC(ARec, $\bm{\theta}^G$, Rand), that use the non-personalized accuracy recommender Pop as ARec, are competitive with algorithms like PSVD100 or CofiR100.
\subsection{Regularized SVD configuration}
\label{sec:configurationofR-SVD}
\begin{table}[ht]
\centering
\scriptsize
\begin{tabular}{lllllllll}
\toprule
&\multicolumn{4}{c}{R-SVD} & \multicolumn{4}{c}{R-SVDN} \\
\cmidrule(r){2-5} \cmidrule(r){6-9}
{\bf Dataset} & $\eta$ & $\lambda$ & $g$ & RMSE & $\eta$ & $\lambda$ & $g$ & RMSE \\ \midrule
ML-100K &0.03 & 0.05 & 100 & 0.935 & 0.03 &0.05 & 100& 0.935\\
ML-1M & 0.03 & 0.05 & 100 & 0.868 & 0.03 & 0.05 & 100 & 0.875 \\
ML-10M &0.003 & 0.005 & 20 & 0.872 & 0.003 & 0.005& 20 &0.872 \\
MT-200k & 0.01 & 0.01 & 40 & 0.761 &0.01 &0.01& 40 & 0.761 \\
Netflix & 0.002 & 0.05 & 100 & 0.979 & 0.002 & 0.05 & 100 & 0.979 \\
\bottomrule
\end{tabular}
\caption{R-SVD and R-SVDN parameters on different datasets. $g$ is the number of latent factors, $\eta$ is the learning rate, $\lambda$ is the L2-reqularization coefficient.}
\label{tab:DatasetStatsticsFull}
\end{table}
\iffalse
\begin{table*}[t]
\centering
\scriptsize
\begin{tabular}{llllllllllllllll}
\toprule
&&&&&&&& \multicolumn{4}{c}{R-SVD} & \multicolumn{4}{c}{R-SVDN} \\
\cmidrule(r){9-12} \cmidrule(r){13-16}
{\bf Dataset} & {\bf $|\mathcal{D}|$} & {\bf $|\mathcal{U}|$} & {\bf $|\mathcal{I}|$} & d$\%$ & $\mathcal{L} \%$ & {\bf $\kappa$} & {\bf $\tau$ } & $\eta$ & $\lambda$ & $g$ & RMSE & $\eta$ & $\lambda$ & $g$ & RMSE \\ \midrule
MovieLens & 100K & 943& 1682 & 6.30\% & 66.98 \% &0.5 & 20 & 0.03 & 0.05 & 100 & 0.9347 & 0.03 &0.05 & 100& 0.9347\\
MovieLens & 1M & 6,040& 3,706 & 4.47\% & 67.58 \% & 0.5 & 20 & 0.03 & 0.05 & 100 & 0.8684 & 0.03 & 0.05 & 100 & 0.875 \\
MovieLens & 10M & 69,878 & 10,677 & 1.34\%& 84.31 \% & 0.5 & 20& 0.003 & 0.005 & 20 & 0.8719 & 0.003 & 0.005& 20 &0.8719 \\
MT-200k-m5 & 172,506 & 7,969 & 13,864 & 0.16\%& 86.84 \% & 0.8 & 5 & 0.01 & 0.1 & 40 & 1.4786 &0.01 &0.1& 40 & 1.4785 \\
MT-200k-m5-mapped & 172,506 & 7,969 & 13,864 & 0.16\%& 86.84 \% & 0.8 & 5 & 0.01 & 0.01 & 40 & 0.761 &0.01 &0.01& 40 & 0.761 \\
MT-200k-m20 & 96,788 & 1,564 & 11,729 & 0.53\% & 77.61\% & 0.5 & 30 & 0.01 & 0.01 & 8 & 1.521 & 0.01 & 0.01 & 8 &1.5209\\
MT-200k-m20-mapped & 96,788 & 1,564 & 11,729 & 0.53\% & 77.61\% & 0.5 & 30 & 0.01 & 0.01 & 8 & 0.7822 & 0.01 & 0.01 & 8 & 0.7822 \\
Netflix & 98,754,394 & 459,497 & 17,770 &1.21\% & 88.27 \% & - & -& 0.002 & 0.05 & 100 & 0.9788 & 0.002 & 0.05 & 100 & 0.9789 \\
\bottomrule
\end{tabular}
\caption{Datasets description and parameters. $\kappa$ is the train-test split ratio, $\tau$ is the minimum \# ratings per user in the dataset, $\mathcal{D}$. Density is $\text{d}\%= ( |\mathcal{D}| / |\mathcal{U}| * |\mathcal{I}|) \times 100\%$. Long-tail percentage is $\mathcal{L}\% = (|\mathcal{L}| / |\mathcal{I}^\trainset|) \times 100\%$. For R-SVD and P-SVD, $g$ is the number of latent factors, $\eta$ is the learning rate, $\lambda (\lambda =\lambda_Q=\lambda_P)$ is the L2-regularization coefficients. For P-SVD, $g^{'}$ the number of latent factors. MT-200k-m20 to MT-200k-m30 }
\label{tab:DatasetStatsticsFull}
\end{table*}
\fi
Table~\ref{tab:DatasetStatsticsFull} provides details for the setup of Regularized SVD (R-SVD) and the same model with non-negative constraints (R-SVDN). We use \texttt{LIBMF}~\cite{zhuang2013fast} with L2-Norm as the loss function, and L2-regularization, and SGD for optimization. We performed 10-fold cross validation and tested: number of latent factors $g \in \{8, 20, 40, 50, 80, 100\}$, L2-regularization coefficients $\lambda \in \{0.001, 0.005, 0.01, 0.05, 0.1\}$, learning rate $\eta \in \{0.002,0.003,0.01, 0.03\}$. For each dataset, we used the parameters that led to best performance.
\iffalse
\subsection{Other baselines configuration}
provides the details for algorithm parameters in different datasets. We conducted experiments over the parameter space of the various algorithms and report the parameters that led to the best performance in Table~\ref{tab:DatasetStatsticsFull}.
For CofiRank, we experimented with both regression (squared) loss (Cofi$^R$) and NDCG loss (Cofi$^N$). We use the parameter values provided in the paper~\cite{weimer2007maximum}, 100 dimensions and $\lambda =10$, and default values for other parameters (source code). Similar to \cite{balakrishnan2012collaborative,volkovs2012collaborative}, we found Cofi$^R$ to perform consistently better than Cofi$^N$ in our experiments on ML-1M and MT-200K. We only report results for Cofi$^R$. For the Resource allocation re-ranking~\cite{ho2014likes} method, we implemented and ran all four variants with default values set according to~\cite{ho2014likes} and MF parameters set according to Table~\ref{tab:DatasetStatsticsFull}. For PureSVD we use Python's \texttt{sparsesvd} module and tested $g^{'} \in \{10, 20, 40, 60, 100, 150, 200, 300\}$.
\fi
\section{Introduction}
The \textit{proceedings} are the records of a conference.
ACM seeks to give these conference by-products a uniform,
high-quality appearance. To do this, ACM has some rigid
requirements for the format of the proceedings documents: there
is a specified format (balanced double columns), a specified
set of fonts (Arial or Helvetica and Times Roman) in
certain specified sizes (for instance, 9 point for body copy),
a specified live area (18 $\times$ 23.5 cm [7" $\times$ 9.25"]) centered on
the page, specified size of margins (1.9 cm [0.75"]) top, (2.54 cm [1"]) bottom
and (1.9 cm [.75"]) left and right; specified column width
(8.45 cm [3.33"]) and gutter size (.83 cm [.33"]).
The good news is, with only a handful of manual
settings\footnote{Two of these, the {\texttt{\char'134 numberofauthors}}
and {\texttt{\char'134 alignauthor}} commands, you have
already used; another, {\texttt{\char'134 balancecolumns}}, will
be used in your very last run of \LaTeX\ to ensure
balanced column heights on the last page.}, the \LaTeX\ document
class file handles all of this for you.
The remainder of this document is concerned with showing, in
the context of an ``actual'' document, the \LaTeX\ commands
specifically available for denoting the structure of a
proceedings paper, rather than with giving rigorous descriptions
or explanations of such commands.
\section{The {\secit Body} of The Paper}
Typically, the body of a paper is organized
into a hierarchical structure, with numbered or unnumbered
headings for sections, subsections, sub-subsections, and even
smaller sections. The command \texttt{{\char'134}section} that
precedes this paragraph is part of such a
hierarchy.\footnote{This is the second footnote. It
starts a series of three footnotes that add nothing
informational, but just give an idea of how footnotes work
and look. It is a wordy one, just so you see
how a longish one plays out.} \LaTeX\ handles the numbering
and placement of these headings for you, when you use
the appropriate heading commands around the titles
of the headings. If you want a sub-subsection or
smaller part to be unnumbered in your output, simply append an
asterisk to the command name. Examples of both
numbered and unnumbered headings will appear throughout the
balance of this sample document.
Because the entire article is contained in
the \textbf{document} environment, you can indicate the
start of a new paragraph with a blank line in your
input file; that is why this sentence forms a separate paragraph.
\subsection{Type Changes and {\subsecit Special} Characters}
We have already seen several typeface changes in this sample. You
can indicate italicized words or phrases in your text with
the command \texttt{{\char'134}textit}; emboldening with the
command \texttt{{\char'134}textbf}
and typewriter-style (for instance, for computer code) with
\texttt{{\char'134}texttt}. But remember, you do not
have to indicate typestyle changes when such changes are
part of the \textit{structural} elements of your
article; for instance, the heading of this subsection will
be in a sans serif\footnote{A third footnote, here.
Let's make this a rather short one to
see how it looks.} typeface, but that is handled by the
document class file. Take care with the use
of\footnote{A fourth, and last, footnote.}
the curly braces in typeface changes; they mark
the beginning and end of
the text that is to be in the different typeface.
You can use whatever symbols, accented characters, or
non-English characters you need anywhere in your document;
you can find a complete list of what is
available in the \textit{\LaTeX\
User's Guide}\cite{Lamport:LaTeX}.
\subsection{Math Equations}
You may want to display math equations in three distinct styles:
inline, numbered or non-numbered display. Each of
the three are discussed in the next sections.
\subsubsection{Inline (In-text) Equations}
A formula that appears in the running text is called an
inline or in-text formula. It is produced by the
\textbf{math} environment, which can be
invoked with the usual \texttt{{\char'134}begin. . .{\char'134}end}
construction or with the short form \texttt{\$. . .\$}. You
can use any of the symbols and structures,
from $\alpha$ to $\omega$, available in
\LaTeX\cite{Lamport:LaTeX}; this section will simply show a
few examples of in-text equations in context. Notice how
this equation: \begin{math}\lim_{n\rightarrow \infty}x=0\end{math},
set here in in-line math style, looks slightly different when
set in display style. (See next section).
\subsubsection{Display Equations}
A numbered display equation -- one set off by vertical space
from the text and centered horizontally -- is produced
by the \textbf{equation} environment. An unnumbered display
equation is produced by the \textbf{displaymath} environment.
Again, in either environment, you can use any of the symbols
and structures available in \LaTeX; this section will just
give a couple of examples of display equations in context.
First, consider the equation, shown as an inline equation above:
\begin{equation}\lim_{n\rightarrow \infty}x=0\end{equation}
Notice how it is formatted somewhat differently in
the \textbf{displaymath}
environment. Now, we'll enter an unnumbered equation:
\begin{displaymath}\sum_{i=0}^{\infty} x + 1\end{displaymath}
and follow it with another numbered equation:
\begin{equation}\sum_{i=0}^{\infty}x_i=\int_{0}^{\pi+2} f\end{equation}
just to demonstrate \LaTeX's able handling of numbering.
\subsection{Citations}
Citations to articles \cite{bowman:reasoning,
clark:pct, braams:babel, herlihy:methodology},
conference proceedings \cite{clark:pct} or
books \cite{salas:calculus, Lamport:LaTeX} listed
in the Bibliography section of your
article will occur throughout the text of your article.
You should use BibTeX to automatically produce this bibliography;
you simply need to insert one of several citation commands with
a key of the item cited in the proper location in
the \texttt{.tex} file \cite{Lamport:LaTeX}.
The key is a short reference you invent to uniquely
identify each work; in this sample document, the key is
the first author's surname and a
word from the title. This identifying key is included
with each item in the \texttt{.bib} file for your article.
The details of the construction of the \texttt{.bib} file
are beyond the scope of this sample document, but more
information can be found in the \textit{Author's Guide},
and exhaustive details in the \textit{\LaTeX\ User's
Guide}\cite{Lamport:LaTeX}.
This article shows only the plainest form
of the citation command, using \texttt{{\char'134}cite}.
This is what is stipulated in the SIGS style specifications.
No other citation format is endorsed or supported.
\subsection{Tables}
Because tables cannot be split across pages, the best
placement for them is typically the top of the page
nearest their initial cite. To
ensure this proper ``floating'' placement of tables, use the
environment \textbf{table} to enclose the table's contents and
the table caption. The contents of the table itself must go
in the \textbf{tabular} environment, to
be aligned properly in rows and columns, with the desired
horizontal and vertical rules. Again, detailed instructions
on \textbf{tabular} material
is found in the \textit{\LaTeX\ User's Guide}.
Immediately following this sentence is the point at which
Table 1 is included in the input file; compare the
placement of the table here with the table in the printed
dvi output of this document.
\begin{table}
\centering
\caption{Frequency of Special Characters}
\begin{tabular}{|c|c|l|} \hline
Non-English or Math&Frequency&Comments\\ \hline
\O & 1 in 1,000& For Swedish names\\ \hline
$\pi$ & 1 in 5& Common in math\\ \hline
\$ & 4 in 5 & Used in business\\ \hline
$\Psi^2_1$ & 1 in 40,000& Unexplained usage\\
\hline\end{tabular}
\end{table}
To set a wider table, which takes up the whole width of
the page's live area, use the environment
\textbf{table*} to enclose the table's contents and
the table caption. As with a single-column table, this wide
table will ``float" to a location deemed more desirable.
Immediately following this sentence is the point at which
Table 2 is included in the input file; again, it is
instructive to compare the placement of the
table here with the table in the printed dvi
output of this document.
\begin{table*}
\centering
\caption{Some Typical Commands}
\begin{tabular}{|c|c|l|} \hline
Command&A Number&Comments\\ \hline
\texttt{{\char'134}alignauthor} & 100& Author alignment\\ \hline
\texttt{{\char'134}numberofauthors}& 200& Author enumeration\\ \hline
\texttt{{\char'134}table}& 300 & For tables\\ \hline
\texttt{{\char'134}table*}& 400& For wider tables\\ \hline\end{tabular}
\end{table*}
\subsection{Figures}
Like tables, figures cannot be split across pages; the
best placement for them
is typically the top or the bottom of the page nearest
their initial cite. To ensure this proper ``floating'' placement
of figures, use the environment
\textbf{figure} to enclose the figure and its caption.
This sample document contains examples of \textbf{.eps}
and \textbf{.ps} files to be displayable with \LaTeX. More
details on each of these is found in the \textit{Author's Guide}.
\begin{figure}
\centering
\epsfig{file=fly.eps}
\caption{A sample black and white graphic (.eps format).}
\end{figure}
\begin{figure}
\centering
\epsfig{file=fly.eps, height=1in, width=1in}
\caption{A sample black and white graphic (.eps format)
that has been resized with the \texttt{epsfig} command.}
\end{figure}
As was the case with tables, you may want a figure
that spans two columns. To do this, and still to
ensure proper ``floating'' placement of tables, use the environment
\textbf{figure*} to enclose the figure and its caption.
and don't forget to end the environment with
{figure*}, not {figure}!
\begin{figure*}
\centering
\epsfig{file=flies.eps}
\caption{A sample black and white graphic (.eps format)
that needs to span two columns of text.}
\end{figure*}
Note that either {\textbf{.ps}} or {\textbf{.eps}} formats are
used; use
the \texttt{{\char'134}epsfig} or \texttt{{\char'134}psfig}
commands as appropriate for the different file types.
\begin{figure}
\centering
\psfig{file=rosette.ps, height=1in, width=1in,}
\caption{A sample black and white graphic (.ps format) that has
been resized with the \texttt{psfig} command.}
\vskip -6pt
\end{figure}
\subsection{Theorem-like Constructs}
Other common constructs that may occur in your article are
the forms for logical constructs like theorems, axioms,
corollaries and proofs. There are
two forms, one produced by the
command \texttt{{\char'134}newtheorem} and the
other by the command \texttt{{\char'134}newdef}; perhaps
the clearest and easiest way to distinguish them is
to compare the two in the output of this sample document:
This uses the \textbf{theorem} environment, created by
the\linebreak\texttt{{\char'134}newtheorem} command:
\newtheorem{theorem}{Theorem}
\begin{theorem}
Let $f$ be continuous on $[a,b]$. If $G$ is
an antiderivative for $f$ on $[a,b]$, then
\begin{displaymath}\int^b_af(t)dt = G(b) - G(a).\end{displaymath}
\end{theorem}
The other uses the \textbf{definition} environment, created
by the \texttt{{\char'134}newdef} command:
\newdef{definition}{Definition}
\begin{definition}
If $z$ is irrational, then by $e^z$ we mean the
unique number which has
logarithm $z$: \begin{displaymath}{\log e^z = z}\end{displaymath}
\end{definition}
Two lists of constructs that use one of these
forms is given in the
\textit{Author's Guidelines}.
There is one other similar construct environment, which is
already set up
for you; i.e. you must \textit{not} use
a \texttt{{\char'134}newdef} command to
create it: the \textbf{proof} environment. Here
is a example of its use:
\begin{proof}
Suppose on the contrary there exists a real number $L$ such that
\begin{displaymath}
\lim_{x\rightarrow\infty} \frac{f(x)}{g(x)} = L.
\end{displaymath}
Then
\begin{displaymath}
l=\lim_{x\rightarrow c} f(x)
= \lim_{x\rightarrow c}
\left[ g{x} \cdot \frac{f(x)}{g(x)} \right ]
= \lim_{x\rightarrow c} g(x) \cdot \lim_{x\rightarrow c}
\frac{f(x)}{g(x)} = 0\cdot L = 0,
\end{displaymath}
which contradicts our assumption that $l\neq 0$.
\end{proof}
Complete rules about using these environments and using the
two different creation commands are in the
\textit{Author's Guide}; please consult it for more
detailed instructions. If you need to use another construct,
not listed therein, which you want to have the same
formatting as the Theorem
or the Definition\cite{salas:calculus} shown above,
use the \texttt{{\char'134}newtheorem} or the
\texttt{{\char'134}newdef} command,
respectively, to create it.
\subsection*{A {\secit Caveat} for the \TeX\ Expert}
Because you have just been given permission to
use the \texttt{{\char'134}newdef} command to create a
new form, you might think you can
use \TeX's \texttt{{\char'134}def} to create a
new command: \textit{Please refrain from doing this!}
Remember that your \LaTeX\ source code is primarily intended
to create camera-ready copy, but may be converted
to other forms -- e.g. HTML. If you inadvertently omit
some or all of the \texttt{{\char'134}def}s recompilation will
be, to say the least, problematic.
\section{Conclusions}
This paragraph will end the body of this sample document.
Remember that you might still have Acknowledgments or
Appendices; brief samples of these
follow. There is still the Bibliography to deal with; and
we will make a disclaimer about that here: with the exception
of the reference to the \LaTeX\ book, the citations in
this paper are to articles which have nothing to
do with the present subject and are used as
examples only.
\section{Acknowledgments}
This section is optional; it is a location for you
to acknowledge grants, funding, editing assistance and
what have you. In the present case, for example, the
authors would like to thank Gerald Murray of ACM for
his help in codifying this \textit{Author's Guide}
and the \textbf{.cls} and \textbf{.tex} files that it describes.
\bibliographystyle{abbrv}
\subsection{Analysis of Fully Sequential Dynamic Coverage}
\label{sec:submodularmonotoneproof}
In this section, we show the problem of finding a top-$N$ collection $\mathcal{P} = \{ \mathcal{P}_u \}_{u=1}^ {|\mathcal{U}|} $ that maximizes Eq.~\ref{eq:overallValueFunction}, is an instance of maximizing a submodular function subject to a matroid constraint.
\vspace{4mm}
\noindent \textbf{Matroids.}
A set system is a pair ($\mathcal{I}, \mathcal{F}$), where $\mathcal{I}$ denotes a ground set of elements and $\mathcal{F} = \{\mathcal{A}: \mathcal{A} \subseteq \mathcal{I}\}$, is a collection of subsets of $\mathcal{I}$.
A set system is an independence system if it satisfies
\begin{enumerate*}
\item $\emptyset \in \mathcal{F}$,
\item $\mathcal{A} \subseteq \mathcal{B} \in \mathcal{F} \text{ then } \mathcal{A} \in \mathcal{F}$.
\end{enumerate*}
A \textit{matroid} is an independence system that also satisfies the property $\mathcal{A} ,\mathcal{B} \in \mathcal{F} \text{ and } |\mathcal{B}| > |\mathcal{A}| \text{ then } \exists i \in \mathcal{B} \setminus \mathcal{A} \text{ with } \mathcal{A} \cup \{i\} \in \mathcal{F}$. A \textit{uniform matroid}, is a special class of matroids that satisfies $\mathcal{F} = \{\mathcal{A}: \mathcal{A} \subseteq \mathcal{I}, |\mathcal{A}| \leq N \}$, that is all basis are maximal. A \textit{partition matroid} satisfies $\mathcal{F} = \{\mathcal{A}: \mathcal{A} = \cup_{i=1}^{N} \mathcal{A}_i, \mathcal{A}_i \subseteq \mathcal{I}_i, |\mathcal{A}_i| \leq l_i, \cup \mathcal{I}_i = \mathcal{I}\}$.
\begin{lemma}
\label{lemma1}
The constraint of recommending $N$ items to each user, corresponds to a partition matroid over the users.
\end{lemma}
\begin{proof}
Define a new ground set $\mathcal{N} = \{(u,i) : u \in \mathcal{U}, i \in \mathcal{I} \}$. Define $\mathcal{N}_u = \{(u,i): i \in \mathcal{I} \} , u \in \mathcal{U}$ and let $l_u=N, \forall u \in \mathcal{U}$. Let $\mathcal{M} =(\mathcal{U}, \mathcal{F})$ where $\mathcal{F} = \{ \mathcal{P}^{'}: \mathcal{P}^{'}=\cup_{u \in \mathcal{U}} \mathcal{P}^{'}_u, \mathcal{P}^{'}_u \subseteq \mathcal{N}_u, |\mathcal{P}^{'}_u| \leq l_u, \cup \mathcal{N}_u = \mathcal{N}\}$. $\mathcal{P}^{'}$ form independent sets of a partition matroid.
\end{proof}
\vspace{4mm}
\noindent \textbf{Submodularity and Monotonicity.}
Let $\mathcal{I}$ denote a ground set of items. Given a set function $f:2^{\mathcal{I}} \rightarrow \mathbb{R}$, $\delta(i|\mathcal{A}) := f(\mathcal{A} \cup\{i\}) - f(\mathcal{A})$ is the marginal gain of $f$ at $\mathcal{A}$ with regard to item $i$. Furthermore, $f$ is submodular if and only if $\delta(i|\mathcal{A}) \geq \delta(i|\mathcal{B}), \forall \mathcal{A}\subseteq \mathcal{B} \subseteq \mathcal{I}, \forall i \in \mathcal{I}\setminus \mathcal{B}$. It is modular if $f(\mathcal{A} \cup {i})$ = $f(\mathcal{A}) + f(i)$, $\forall \mathcal{A} \subset \mathcal{I}, i \in \mathcal{I} \setminus \mathcal{A}$. In addition, $f$ is monotone increasing if $ f(\mathcal{A}) \le f(\mathcal{B}), \forall \mathcal{A}\subseteq \mathcal{B}\subseteq \mathcal{I}$. Equivalently, a function is monotone increasing if and only if $\forall \mathcal{A} \subseteq \mathcal{I}$ and $i \in \mathcal{I}$, $\delta(i|\mathcal{A}) \geq 0$~\cite{krause2012submodular}.
Submodular functions have the following concave composition property:
\begin{theorem}
Using dynamic coverage, the objective function $v(.)$ in Eq.\ref{eq:overallValueFunction} is submodular monotone increasing w.r.t. sets of user-item pairs.
\end{theorem}
\begin{proof}Consider the ground set $\mathcal{N}$, defined in Lemma~\ref{lemma1}. Based on any set $\mathcal{P}^{'} \subseteq \mathcal{N}$, define $\mathcal{P}^{'}_{u} = \{ i | (u,i) \in \mathcal{P}^{'}\}$. We can rewrite the objective function with dynamic coverage as
\begin{align}
v(\mathcal{P}^{'}) &= \sum_u v_u(\mathcal{P}^{'}_{u})\nonumber \\
&= \sum_u (1-\theta_u) a(\mathcal{P}^{'}_{u}) + \theta_{u} c(\mathcal{P}^{'}_{u}) \nonumber \\
&= \sum_u (1-\theta_u) \sum_{i \in \mathcal{P}^{'}_{u}} a(i) + \theta_{u} \sum_{i \in\mathcal{P}^{'}_{u}} c(i) \label{formula-l1} \\
&= \sum_u (1-\theta_u) \sum_{i \in \mathcal{P}^{'}_{u}} \hat{r}_{ui} + \theta_{u} \sum_{i \in \mathcal{P}^{'}_{u}} \frac{1}{\sqrt{1+f_i^{\mathcal{P}^{'}}}}
\end{align}
where $f_{i}^{\mathcal{P}^{'}}$ is the number of times item $i$ is recommended in $\mathcal{P}^{'}$. For submodularity consider any $\mathcal{A} \subseteq \mathcal{B} \subset \mathcal{N}$, and a pair $(u,i) \in \mathcal{N} \setminus \mathcal{B}$. We have
\begin{align*}
f_i^{\mathcal{A}} & \leq f^{\mathcal{B}}_i \\
\frac{1}{\sqrt{1+f_i^{\mathcal{A}}}} & \geq \frac{1}{\sqrt{1+f^{\mathcal{B}}_i}} \\
(1-\theta_u) \hat{r}_{ui} + \theta_u \frac{1}{\sqrt{1+f_i^{\mathcal{A}}}} & \geq (1-\theta_u) \hat{r}_{ui} + \theta_u \frac{1}{\sqrt{1+f^{\mathcal{B}}_i}} \\
\delta(i|\mathcal{A}) & \geq \delta(i|\mathcal{B})
\end{align*}
Therefore, due to the submodularity of the coverage function, the overall value function $v(.)$ is submodular.
For monotonicity, both $a(.)$ and $c(.)$ map a set of items $\mathcal{P}_u$ to the $[0,1]$ range, and are additive in terms of the number of items (line~\ref{formula-l1}). So, they are both monotonically increasing, i.e., adding a new element $i \in \mathcal{I} \setminus \mathcal{P}_u$ to the set $\mathcal{P}_{u}$ can only increase their value. Since $\theta_{u} $ is also in $[0,1]$, $v_{u}(.)$ is monotonically increasing. $v(.)$ is therefore submodular monotone increasing since it is a sum of submodular monotone increasing functions.\end{proof}
\subsection{Effect of test ranking protocol on performance metrics}
\label{test-protocol-effect}
\begin{figure}[t]
\centering
\subfloat[All unrated items ranking protocol]{\includegraphics[width=0.4\textwidth]{Figures/crossValidation/sfLTAccuracyvsfmeasure_rankp_all_items.pdf}}
\subfloat[Rated test-items ranking protocol]{\includegraphics[width=0.4\textwidth]{Figures/crossValidation/sfLTAccuracyvsfmeasure_rankp_test_only.pdf}}
\subfloat[All unrated items ranking protocol]{\includegraphics[width=0.4\textwidth]{Figures/crossValidation/sfLTAccuracyvsprecision_rankp_all_items.pdf}}
\subfloat[Rated test-items ranking protocol]{\includegraphics[width=0.4\textwidth]{Figures/crossValidation/sfLTAccuracyvsprecision_rankp_test_only.pdf}}
\caption{Comparing the trade-offs for top-5 recommendation, when using different ranking protocols. Dataset is ML-100K.}
\label{fig:CP-LC-tradeoffs-ml-100k}
\end{figure}
In our empirical study, we studied off-line recommendation performance of top-$N$ recommendation algorithms from three perspectives: accuracy, novelty, and coverage (Section~\ref{sec:ExpSetup}). The choice of \emph{test ranking protocol}~\cite{steck2013evaluation} is also an important aspect in off-line evaluations. The test ranking protocol describes which items in the test set are ranked for each user~\cite{steck2013evaluation}. We use the definitions in~\cite{steck2013evaluation}:
\begin{itemize}
\item \textbf{Rated test-items ranking protocol}: for each user, we only rank the observed items in the test set of that user.
\item \textbf{All unrated items ranking protocol}: for each user, we rank all items that do not appear in the train set of that user.
\end{itemize}
\begin{figure}[t]
\centering
\subfloat[All unrated items ranking protocol]{\includegraphics[width=0.4\textwidth]{Figures-ml-1m/crossValidation/sfLTAccuracyvsfmeasure_rankp_all_items.pdf}}
\subfloat[Rated test-items ranking protocol]{\includegraphics[width=0.4\textwidth]{Figures-ml-1m/crossValidation/sfLTAccuracyvsfmeasure_rankp_test_only.pdf}}
\subfloat[All unrated items ranking protocol]{\includegraphics[width=0.4\textwidth]{Figures-ml-1m/crossValidation/sfLTAccuracyvsprecision_rankp_all_items.pdf}}
\subfloat[Rated test-items ranking protocol]{\includegraphics[width=0.4\textwidth]{Figures-ml-1m/crossValidation/sfLTAccuracyvsprecision_rankp_test_only.pdf}}
\caption{Comparing the trade-offs for top-5 recommendation, when using different ranking protocols. Dataset is ML-1M.}
\label{fig:CP-LC-tradeoffs-ml-1m}
\end{figure}
In~\cite{steck2013evaluation}, it was shown that the choice of test ranking protocol can affect accuracy measurements considerably. Specifically, accuracy is measured either by error metrics (e.g., RMSE and MAE) or ranking metrics (e.g., recall and precision) in recommendation settings ~\cite{steck2013evaluation}. Error metrics are defined w.r.t. the observed user feedback only. Rating prediction models that optimize these metrics in the train phase, e.g., R-SVD, typically adopt the rated test-items ranking protocol in the test phase. However, error metrics are not precise indicators of accuracy, since they only consider the subset of items that have feedback. But in real-world applications, the system must find and rank a few items ($N$) from among \emph{all} items~\cite{cremonesi2010performance,steck2013evaluation}.
Ranking metrics can be measured on the observed user feedback, or on \emph{all} items. When measured on the observed user feedback, these metrics can be strongly biased because of the popularity bias of datasets~\cite{agarwal_chen_2016,cremonesi2010performance,steck2011item,vargas2014improving,steck2013evaluation}. Therefore, in top-$N$ recommendation settings, these metrics are measured using the all-items ranking protocol, to better reflect accuracy as experienced by users in real-world applications~\cite{steck2013evaluation,vargas2014improving}.
We extend the empirical study of~\cite{steck2013evaluation} by evaluating the effect of the test ranking protocol on accuracy, coverage, and novelty. We use standard accuracy-focused CF models (introduced in Section~\ref{sec:related-work}). We set $N=5$, and ran experiments on ML-100K and Ml-1M datasets, shown in Figures~\ref{fig:CP-LC-tradeoffs-ml-100k} and~\ref{fig:CP-LC-tradeoffs-ml-1m}, respectively.
\balance
We analyze Figure~\ref{fig:CP-LC-tradeoffs-ml-1m}, which shows the results on the ML-1M dataset (Figure~\ref{fig:CP-LC-tradeoffs-ml-100k} has similar trends). The first observation is that all algorithms obtain higher F-measure scores using the rated test-item ranking protocol. In particular, for the all unrated items ranking protocol, Figure~\ref{fig:CP-LC-tradeoffs-ml-1m}.a, F-measure lies in $[0,0.2]$ (with the corresponding precision in $[0,0.5]$ in Figure~\ref{fig:CP-LC-tradeoffs-ml-1m}.c ).
For the rated test-items ranking protocol F-measure lies in $[0.2,0.4]$ (with precision in $[0.6,0.9]$) . As a specific example, consider Rand which randomly suggests items according to the ranking protocol. As expected, random suggestion from among all items has low F-measure and precision. However, random suggestion from among the test items of each user, leads to an average F-measure of almost $0.25$ (precision approximately $0.6$). This demonstrates the bias of the rated test-items ranking protocol.
Similar to~\cite{cremonesi2010performance}, we observe Pop is a strong contender in accuracy metrics, using both test protocols~\cite{cremonesi2010performance}. Recent work in~\cite{liu2017experimental} also confirmed that Pop outperformed more sophisticated algorithms for tourists datasets, that are sparse and where the users have few and irregular interests (only visit popular locations).
In addition, although R-SVD and R-SVDN are less accurate using the all unrated items ranking protocol, they obtain the highest F-measure scores using the rated test-items ranking protocol. This is because these models are optimized w.r.t. the observed user feedback. Therefore, the rated test-items ranking protocol is to their advantage because it also considers only the observed user feedback.
Coverage is also affected by the ranking protocol. The rated test-items ranking protocol results in better coverage for all algorithms except Random. This is because random suggestion from among a user's test items, is a more constrained algorithm compared to random from among all train items.
Regarding the effect of the ranking protocol on LTAccuracy, it lies in $[0,1]$ for the all unrated test items ranking protocol, but drops to $[0,0.2]$ for the rated test-items ranking protocol.
Regarding the trade-off between metrics, irrespective of the ranking protocol, we observe that Pop makes accurate yet trivial recommendations that lack novelty, as indicated by the low LTaccuracy and coverage in Figure~\ref{fig:CP-LC-tradeoffs-ml-1m}. For the PureSVD models (P-SVD), on ML-100K and ML-1M, increasing the number of factors reduces F-measure, and results in an increase in coverage and LTAccuracy. Among all baselines, CoFiRank with regression loss (CofiR10, CofiR100) has reasonable coverage, precision, and long-tail accuracy.
Overall, our experiments in this section confirm the findings of prior work~\cite{cremonesi2010performance,steck2013evaluation,agarwal_chen_2016}: due to the popularity bias of recommendation datasets, rank-based precision is strongly biased when it is measured using the rated test-items ranking protocol. This is demonstrated by the results of Pop, which achieves an F-measure of $0.3$ on ML-100K and ML-1M, with even higher precision scores on those datasets. It outperforms personalized models like CoFiRank. However, using the all-items ranking protocol, the performance of these models aligns better with expectation. Following prior research on top-$N$ recommendation ~\cite{steck2013evaluation,vargas2014improving}, we conducted the experiments in Section~\ref{sec:Experiments} using the all-items ranking protocol.
\section{Long-tail novelty preference}
\label{sec:lt-pref}
We begin this section by introducing our notation. We then describe various models for measuring user long-tail novelty preference (Section~\ref{sec:simple-lt-pref})
\iffullpaper
\begin{figure*}[t]
\centering
\subfloat[ML-100K]
{
\includegraphics[scale=0.27]{./Figures/general/popoverthetaTNR.pdf}
\label{fig:ML10m-pop-vs-number-ratings}
}
\subfloat[ML-1M]
{
\includegraphics[scale=0.27]{./Figures-ml-1m/general/popoverthetaTNR.pdf}
\label{fig:ML1m-pop-vs-number-ratings}
}
\subfloat[ML-10M]
{
\includegraphics[scale=0.27]{./Figures-ml-10m/general/popoverthetaTNR.pdf}
\label{fig:ML10m-pop-vs-number-ratings}
}
\subfloat[MT-200K]
{
\includegraphics[scale=0.27]{Figures-mt-200k-m5-mapped/general/popoverthetaTNR.pdf}
\label{fig:MT-pop-vs-number-ratings}
}
\subfloat[Netflix]
{
\includegraphics[scale=0.27]{FiguresSum/CombinedHistograms/popoverthetaTNR.pdf}
\label{fig:MT-pop-vs-number-ratings}
}
\caption{For each user $u$, we consider the set of items rated by $u$ in train $\mathcal{I}_{u}^{\trainset}$, and compute its average popularity $ \bar{a} =\frac{1 }{|\mathcal{I}_{u}^{\trainset}|} \sum_{i \in \mathcal{I}_{u}^{\trainset}} f_i^{\mathcal{R}}$. The x-axis shows the binned normalized $|\mathcal{I}_{u}^{\trainset}|$, while the y-axis plots the mean of the corresponding $\bar{a}$ values. The average popularity of items rated decreases as the number of items rated increases. }
\label{fig:pop-vs-no-items}
\end{figure*}
\else
\begin{figure}[t]
\centering
\subfloat[ML-1M]
{
\includegraphics[scale=0.33]{./Figures-ml-1m/general/popoverthetaTNR.pdf}
\label{fig:ML1m-pop-vs-number-ratings}
}
\subfloat[Netflix]
{
\includegraphics[scale=0.33]{FiguresSum/CombinedHistograms/popoverthetaTNR.pdf}
\label{fig:MT-pop-vs-number-ratings}
}
\caption{For each user $u$, we consider $\mathcal{I}_{u}^{\trainset}$, the set of items rated by $u$ in train, and compute its average popularity $ \bar{a} =\frac{1 }{|\mathcal{I}_{u}^{\trainset}|} \sum_{i \in \mathcal{I}_{u}^{\trainset}} f_i^{\mathcal{R}}$. The x-axis shows the binned normalized $|\mathcal{I}_{u}^{\trainset}|$, while the y-axis plots the mean of the corresponding $\bar{a}$ values. The average popularity of items rated decreases as the number of items rated increases. }
\label{fig:pop-vs-no-items}
\end{figure}
\fi
\input{DataModel}
\subsection{Simple long-tail novelty preference models}
\label{sec:simple-lt-pref}
Users have different preferences for discovering long-tail items. Given the train set $\mathcal{R}$, we need a measure of the user's willingness to explore less popular items. Let $\theta_u^m$ denote user $u$'s preference for long-tail novelty as measured by model $m$.
Figure~\ref{fig:pop-vs-no-items} plots the average popularity of rated items vs.~the number of rated items (or \emph{user activity}) for
\iffullpaper
our datasets.
\else
ML-1M and Netflix.
\fi
As user activity increases, the average popularity of rated items decreases. This motivates an \textit{Activity} measure $\simpleRisk = \vert \mathcal{I}_{u}^{\trainset} \vert$. But, most users only rate a few items, and $\simpleRisk$ does not indicate whether those items were long-tail or popular.
Instead, we can define a \textit{Normalized Long-tail} measure
\begin{align}
\small\theta_u^{N} = \frac{ \vert \mathcal{I}_{u}^{\trainset} \cap \mathcal{L} \vert}{\vert \mathcal{I}_{u}^{\trainset} \vert}
\label{eq:nlt-risk}
\end{align}
which is the fraction of long-tail items in the user's rated items. The higher this fraction, the higher her preference for long-tail items. However, $\theta_u^{N}$ does not capture the user's interest (e.g,~rating) in the items, and does not distinguish between the various long-tail items.
To resolve both problems, we can use similar notions as in TFIDF~\cite{salton1988term}. The rating an item receives from a particular user reflects its importance for that user. To capture the discriminative power of the item among the set of users and control for the fact that some items are generally more popular, we also incorporate an inverse popularity factor ($|\mathcal{U}_{i}^{\trainset}|$) that is logarithmically scaled. We define \textit{TFIDF-based} measure using
\begin{align}
\small
\theta_u^{T} = \frac{ 1}{\vert \mathcal{I}_{u}^{\trainset} \vert} \sum_{i \in \mathcal{I}_{u}^{\trainset}} r_{ui} \log \left( \frac{|\mathcal{U}|}{ |\mathcal{U}_{i}^{\trainset}|} \right)
\label{eq:tfidf-risk}
\end{align}
This measure increases proportionally to the user rating $r_{ui}$, but is also counterbalanced by the popularity of the item. A higher $\theta_u^{T}$ shows more preference for less popular items.
Although $\theta_u^{T}$ considers both the user interest $r_{ui}$, and the item popularity $|\mathcal{U}_{i}^{\trainset}|$, it has no indication about the preferences of the users in $\mathcal{U}_{i}^{\trainset}$.
To address this limitation, observe Eq.~\ref{eq:tfidf-risk} can be re-written as
\begin{align}
\small
\theta_u^{T} = \frac{ 1}{\vert \mathcal{I}_{u}^{\trainset} \vert} \sum_{i \in \mathcal{I}_{u}^{\trainset}} \theta_{ui} = \frac{ \sum_{i \in \mathcal{I}_u} w_i \theta_{ui}}{ \sum_{i \in \mathcal{I}_u} w_i }
\label{eq:tfidf-risk-rewrite}
\end{align}
where $\theta_{ui} = r_{ui} \log \left( \frac{|\mathcal{U}|}{|\mathcal{U}_{i}^{\trainset}|} \right)$ is a \textit{per-user-item} long-tail preference value, and $w_{i} = 1$ for all items. Basically, $\theta_u^{T}$ gives equal importance to all items and is a crude average of $\theta_{ui}$.
We can generalize the idea in Eq.~\ref{eq:tfidf-risk-rewrite}. Specifically, for each user, we consider a \textit{generalized long-tail novelty} preference estimate, $\theta_u^G$. We assume $\theta_u^G$ is a weighted average of $\theta_{ui}$. However, rather than imposing equal weights, we define $w_i$ to indicate an \textit{item importance} weight. Our second assumption is that an item is important when its users do not regard it as a mediocre item; when their preference for that item deviates from their generalized preference. In other words, an item $i$ is important when $\sum_{u \in \mathcal{U}_{i}^{\trainset}} (\theta_{ui} - \theta_u^G)^2$ is large. Since $w_i$ and $\theta^G_u$ influence each other, below we describe how to learn these variables in a joint optimization objective.
\subsection{Learning generalized long-tail novelty preference}
\label{sec:learning-lt-pref}
\iffalse
\begin{align}
\small
\epsilon = \sum_{i \in \mathcal{I}^\trainset} \sum_{u \in \mathcal{U}_{i}^{\trainset}} w_i \epsilon_{ui}^2 = \sum_{i \in \mathcal{I}^\trainset} \sum_{u \in \mathcal{U}_{i}^{\trainset}} w_i \big( \theta_{ui} - \theta_{u}^G \big)^2
\label{eq:totalSquaredError}
\end{align}
\fi
We define $\epsilon_{i} = \big[ \sum_{u \in \mathcal{U}_{i}^{\trainset}} 1- \big( \theta_{ui} -\theta_u^G\big)^2 \big] $ as the \textit{item mediocrity coefficient}. Assuming $|\theta_{ui} - \theta_u^G| \leq 1$ (explained later), the maximum of $\epsilon_i$ is obtained when $\theta_{ui} = \theta_u^G$. We formulate our objective as:
\begin{align}
\ O(\mathbf{w},\bm{\theta}^G)= \sum_{i \in \mathcal{I}^\trainset } w_i \big[ \sum_{u \in \mathcal{U}_{i}^{\trainset}} 1- \big( \theta_{ui} -\theta_u^G\big)^2 \big] = \sum_{i \in \mathcal{I}^\trainset } w_i \epsilon_i \nonumber
\end{align}
which is the total weighted mediocrity. Here, $ \mathcal{I}^\trainset$ are the items in train, $\mathcal{U}_{i}^{\trainset}$ denotes users that rated item $i$ in the train set (Section~\ref{sec:Notation}), and $\theta_{ui}$ is the per-user-item preference value, computed from rating data. Our objective has two unknown variables: $\bm{\theta}^G \in \mathbb{R}^{|\mathcal{U}|}$, $\mathbf{w} \in \mathbb{R}^{|\mathcal{I}|}$.
We use an alternating optimization approach for optimizing $\mathbf{w}$ and $\bm{\theta}^G$. When optimizing w.r.t. $\mathbf{w}$, we must minimize the objective function in accordance with our intuition about $w_i$. In particular, for larger mediocrity coefficient, we need smaller weights. On the other hand, when optimizing w.r.t. $\bm{\theta}^G$, we need to increase the closeness between $\theta_u^G$ and all $\theta_{ui}$'s, which is aligned with our intuition about $\theta_u^G$. So, we have to maximize the objective function w.r.t. $\bm{\theta}^G$. Our final objective is a minimax problem:
\begin{align}
&\min_{\mathbf{w}} \max_{\bm{\theta}^G} & O(\mathbf{w},\bm{\theta}^G) - \lambda_1 \sum_{i \in \mathcal{I}^\trainset } \log{w_i}
\label{eq:thetaStarOpt}
\end{align}
\iffalse
\begin{align}
\min_{\mathbf{w}} \max_{\bm{\theta}^G}\ O(\mathbf{w},\bm{\theta}^G)= \sum_{i \in \mathcal{I}^\trainset } w_i \big[ \sum_{u \in \mathcal{U}_{i}^{\trainset}} - \big( \theta_{ui} -\theta_u^G\big)^2 \big]
\label{eq:thetaStarOpt}
\end{align}
\fi
where we have added a regularizor term $\sum_{i \in \mathcal{I}^\trainset } \log{ w_i}$ to prevent $w_i$ from approaching 0~\cite{li2015discovery}.
When $\bm{\theta}^G$ is fixed, we need to solve a minimization problem involving only $\mathbf{w}$. By taking the derivative w.r.t. $w_i$ we have
\begin{align}
w_i = \frac{\lambda_1}{ \sum_{u \in \mathcal{U}_{i}^{\trainset}} 1 - \big(\theta_{ui} -\theta_u^G\big)^2 } = \frac{\lambda_1}{\epsilon_i}
\label{eq:weightUpdate}
\end{align}
When $\mathbf{w}$ is fixed, we need to solve a maximization problem involving $\bm{\theta}^G$. Taking the derivative w.r.t. $\theta_u^G$ we derive
\begin{align}
\theta_u^G =\frac{\sum_{i \in \mathcal{I}_{u}^{\trainset}} w_i \theta_{ui}}{\sum_{i \in \mathcal{I}_{u}^{\trainset}} w_i}
\label{eq:overallRiskUpdate}
\end{align}
Essentially, Eq.~\ref{eq:weightUpdate} characterizes an item's weight, based on the item mediocrity. The higher the mediocrity, the lower the weight. Moreover, for every user $u$, $\theta_u^G$ is a weighted average of all $\theta_{ui}$. Note, in Eq.~\ref{eq:overallRiskUpdate}, $\theta_u^G=\theta_u^{T}$ when $w_i =1$ for all items. Our generalized $\theta_u^G$ incorporates both the user interest and popularity of items (via $\theta_{ui}$), and the preferences of other users of the item (via $w_i$). Furthermore, since we need $|\theta_{ui} - \theta_u^G| \leq 1$, and prefer $\theta_u^G \in [0,1]$, we project all $\theta_{ui}$ to the $ [0,1]$ interval before applying the algorithm. We also set $\lambda_1=1$.
\iffalse ICDE Submission
\subsection{Learning generalized novelty preference}
\label{sec:learning-lt-pref}
We want to learn a generalized long-tail preference estimate $\theta_u^G$ for each user such that $\sum_{u \in \mathcal{U}} \sum_{i \in \mathcal{I}_{u}^{\trainset}} w_i \theta_{ui} \approx \sum_{u \in \mathcal{U}} \sum_{i \in \mathcal{I}_{u}^{\trainset}} w_i \theta_u^G $ holds for all users. We define the \textit{per-user-item error} as $\epsilon_{ui} = w_i ( \theta_{ui} - \theta_u^G)$. Our objective is to minimize the total squared error
\begin{align}
\small
\epsilon = \sum_{i \in \mathcal{I}^\trainset} \sum_{u \in \mathcal{U}_{i}^{\trainset}} \epsilon_{ui}^2 = \sum_{i \in \mathcal{I}^\trainset} \sum_{u \in \mathcal{U}_{i}^{\trainset}} w_i^2 \big( \theta_{ui} - \theta_{u}^G \big)^2
\label{eq:totalSquaredError}
\end{align}
where $ \mathcal{I}^\trainset$ are the items in train, $\mathcal{U}_{i}^{\trainset}$ denotes users that rated item $i$ in the train set (Section~\ref{sec:Notation}), and $\theta_{ui}$ is computed from rating data. The objective has two unknown variables: $\bm{\theta}^G \in \mathbb{R}^{|\mathcal{U}|}$, $\mathbf{w} \in \mathbb{R}^{|\mathcal{I}|}$. Since $\mathbf{w}=0$ is a trivial solution for Eq.~\ref{eq:totalSquaredError}, we impose a relaxed constraint $\sum_{i \in \mathcal{I}^\trainset } w_i=1$ which requires at least one non-zero weight. Note, our objective is equivalent to a minmax problem as follows:
\begin{align}
\min_{\mathbf{w}} \max_{\bm{\theta}^G}\ O(\mathbf{w},\bm{\theta}^G)= \sum_{i \in \mathcal{I}^\trainset } w_i^2 \big[ \sum_{u \in \mathcal{U}_{i}^{\trainset}} - \big( \theta_{ui} -\theta_u^G\big)^2 \big]
\label{eq:thetaStarOpt}
\end{align}
Furthermore, we introduce an $L_2$-regularizor for $\mathbf{w}$ to prevent over-fitting, e.g., it prevents large weights when $\big( \theta_{ui} -\theta_u^G\big)^2$ is close to zero and brings numerical stability for the computations.
We also add another regularizor that is proportionate to the frequency of the item, i.e., when the item is popular, the weight should be small. Our final objective is:
\begin{align}
&\min_{\mathbf{w}} \max_{\bm{\theta}^G} & O(\mathbf{w},\bm{\theta}^G) + \sum_{i \in \mathcal{I}^\trainset } w_i ^2 + \sum_{i \in \mathcal{I}^\trainset }\sum_{u \in \mathcal{U}_{i}^{\trainset}} w_i^2 & \nonumber \\
&s.t. &\sum_{i \in \mathcal{I}^\trainset } w_i=1 &
\label{eq:thetaStarOpt}
\end{align}
To solve Eq.~\ref{eq:thetaStarOpt} we use alternating optimization methods~\cite{koren2009matrix}, which iterates between fixing one set of values and solving for the other until convergence. Specifically, when $\theta^G$ is fixed, we need to solve a minimization problem involving only $\mathbf{w}$ with the constraint $\sum_{i \in \mathcal{I}^\trainset } w_i=1$. We use the method of lagrange multipliers ($\lambda$). By taking the derivative w.r.t. $w_i$ we have
\begin{align}
w_i = \frac{\lambda}{ 2 \Big( \sum_{u \in \mathcal{U}_{i}^{\trainset}} 1 - \big(\theta_{ui} -\theta_u^G\big)^2 \Big) + 2 }
\label{eq:weightUpdate}
\end{align}
and from the constraint we derive
\begin{align}
\lambda = \bigg( \sum_{i \in \mathcal{I}^\trainset } \Big( 2 \Big( \sum_{u \in \mathcal{U}_{i}^{\trainset}} 1 - \big( \theta_{ui} -\theta_u^G \big)^2 \Big) + 2 \Big)^{-1}\bigg)^{-1}
\end{align}
When $\mathbf{w}$ is fixed, we need to solve a maximization problem involving $\bm{\theta}^G$. Taking the derivative w.r.t. $\theta_u^G$ we derive
\begin{align}
\theta_u^G =\frac{\sum_{i \in \mathcal{I}_{u}^{\trainset}} w_i^2 \theta_{ui}}{\sum_{i \in \mathcal{I}_{u}^{\trainset}} w_i^2}
\label{eq:overallRiskUpdate}
\end{align}
Regarding Eq.~\ref{eq:weightUpdate}, $( \theta_{ui} -\theta_u^G)^2$ measures the deviation of user $u$ from her generalized long-tail preference, for item $i$. Essentially, Eq.~\ref{eq:weightUpdate} characterizes an item's weight, based on the deviation of all the users who rated that item from their generalized long-tail preference, i.e,~$\sum_{u \in \mathcal{U}_{i}^{\trainset}} ( \theta_{ui} -\theta_u^G)^2$. An item has a higher weight when the users who rated that item deviate a lot from their generalized preference. Moreover, in Eq.~\ref{eq:overallRiskUpdate}, $\theta_u^G=\theta_u^{T}$ when $w_i =1$ for all items. Since we prefer $\theta_u^G \in [0,1]$ we project all $\theta_{ui}$ to the $ [0,1]$ interval before applying the algorithm.
\fi
\iffalse
\textcolor{red}{ One way to characterize an item's riskiness level is to measure the deviation of all the users who rated that item from their aggregate risk degree. Note, $\|\theta_{ui} -\theta_u^G\|^2$ measures the deviation of user $u$ from her aggregate risk for item $i$. To capture this intuition, we introduce the combined error as:
\begin{align}
\small
\epsilon = \sum_{i \in \mathcal{I}} \sum_{u \in \mathcal{U}_{i}^{\trainset}} w_i \theta_{ui} - \sum_{i \in \mathcal{I}} \sum_{u \in \mathcal{U}_i} w_i \theta_{u}^G
\end{align}
Our objective is to minimize the square of the error term, i.e., $\min \| \epsilon \|^2$.
}
\fi
\iffalse
in the following manner:
\begin{align}
\small
\min \ \| \sum_{i \in \mathcal{I}} \sum_{u \in \mathcal{U}_i} w_i \theta_{ui} - \sum_{i \in \mathcal{I}} \sum_{u \in \mathcal{U}_i} w_i \theta_{u}^G \|^2
\label{eq:minWeightedDistance}
\end{align}
Furthermore, to simplify the objective function, we introduce an upper bound. It can be shown that for a constant $C$,
we have:
\begin{align}
\small
\| \epsilon \|^2 &= \| \sum_{i \in \mathcal{I}} \sum_{u \in \mathcal{U}_i} w_i \theta_{ui} - \sum_{i \in \mathcal{I}} \sum_{u \in \mathcal{U}_i} w_i \theta_{u}^G \|^2 \label{eq:minWeightedDistance}\\ &=
\| \sum_{i \in \mathcal{I}} \sum_{u \in \mathcal{U}_i}w_i (\theta_{ui}-\theta_{u}^G) \|^2 \\&\leq
C \sum_{i \in \mathcal{I}} \sum_{u \in \mathcal{U}_i} w_i^2\| (\theta_{ui}-\theta_{u}^G)\|^2\label{eq:upperBound}
\end{align}
Rather than minimize Eq.~\ref{eq:minWeightedDistance}, we minimize upper bound Eq.~\ref{eq:upperBound}.
\fi
\iffalse
we propose the following objective function,
\begin{align}
&\min_{\mathbf{w}} \max_{\bm{\theta}^G} & \alpha \sum_{i \in \mathcal{I}^\trainset } w_i^2 \sum_{u \in \mathcal{U}_{i}^{\trainset}} C - \|\theta_{ui} -\theta_u^G\|^2 + \sum_{i \in \mathcal{I}^\trainset }\|w_i\|^2 & \nonumber \\
&s.t. &\sum_{i \in \mathcal{I}^\trainset } w_i=1 &
\label{eq:thetaStarOpt}
\end{align}
where $\theta^G \in \mathbb{R}^{|\mathcal{U}|}$ is the aggregate user risk degrees, and $\mathbf{w} \in \mathbb{R}^{|\mathcal{I}|}$ is the factor-per-item weights. Here, $C$ is a constant that is chosen to ensure $ C - \|\theta_{ui} -\theta_u^G\|^2 \geq 0$.
The first term captures the main intuition: when the value of $\sum_{u \in \mathcal{U}_{i}^{\trainset}} \|\theta_{ui} -\theta_u^G\|^2$ is large, $ C - \|\theta_{ui} -\theta_u^G\|^2$ is small, larger weights are assigned to $w_i$ to minimize the loss function, and vice versa.
We use the square of the $w_i$ to bound the minimization problem.
The second term is a regularization constraint to prevent over-fitting, e.g., it prevents large weights when $\|\theta_{ui} -\theta_u^G\|^2$ is close to C, and brings numerical stability for the computations.
The constraint $\sum_{i \in \mathcal{I}^\trainset } w_i=1$ prevents the trivial solution $\mathbf{w}=0$ and imposes the constraint at least one weight is not zero. $\alpha$ is a trade-off parameter.
\fi
\iffalse
\subsection{Dirichlet-based Risk}
Recall, long tail items are denoted by $\mathcal{I}^{\mathcal{L}} \subset \mathcal{I}$. Assume the ratings $\mathcal{R}^{\mathcal{I}}$ are a set of $|\mathcal{R}|$ draws from a multinomial random variable $R$. The ratings come from a vocabulary of size $|\mathcal{U}|$. The parameter vector of the vocabulary $\pmb{\theta}$ can be modelled with a Dirichlet distribution, $\pmb{\theta} \sim \text{Dir} (\pmb{ \theta|\alpha})$. The posterior of the parameter given the observations $\mathcal{R}$ can be obtained as follows:
\begin{align*}
p(\theta| \mathcal{R}^L, \alpha) &= \prod_{n=1}^{N=|\mathcal{R}^L|} \frac{p(r_n|\theta) p(\theta|\alpha)}{\int_{n=1}^{N} p(r_n|\theta) p(\theta|\alpha) d\theta } \\
&=\frac{1}{Z} \prod_{u=1}^{|\mathcal{U}|} \theta_u^{n(u)} \frac{1}{\Delta(\alpha)} \theta_u^{\alpha_u-1}\\
&=\text{Dir}(\theta|\alpha + n)
\end{align*}
We use the expectation of the Dirichlet distribution, i.e., $E[\theta_u] = \frac{\alpha_u + n(u)}{\sum_{u \in \mathcal{U}} \alpha_u + n(u)}$ as an indicator of the user $u$'s risk degree. Note, for each user this translates to the number of long tail items rated normalized by the the total number of long tail ratings in the train data.
\textcolor{red}{ \textbf{Heuristic Risk. }To discriminate among users who have rated the same number of long-tail items, we can consider popularity of items and the values of user ratings. The rating an item receives from a particular user reflects its importance for that user. However, to capture the discriminative power of the item among the set of users and control for the fact that some items are generally more popular, we also incorporate an inverse popularity factor ($|\mathcal{U}_{i}^{\trainset}|$)
\begin{equation}
\small
\theta_u^{H} = \frac{ 1}{\vert \mathcal{I}_{u}^{\trainset} \vert} \sum_{i \in \mathcal{I}_{u}^{\trainset}} \frac{r_{ui}}{|\mathcal{U}_{i}^{\trainset}|}
\label{eq:heuristic-risk}
\end{equation}
where the users train ratings are normalized,~i.e., $r_{ui} \in [0,1]$ This measure increases proportionally to the rating a user has given an item, but is also counterbalanced by the popularity of the item. A higher value for $\theta_u^{H}$ corresponds to a higher preference for less popular items.
}
\fi
\iffalse
To resolve both problems, we can use similar notions as in TFIDF~\cite{salton1988term}, and define a \textit{TFIDF-based} measure
\begin{align}
\small
\theta_u^{T} = \frac{ 1}{\vert \mathcal{I}_{u}^{\trainset} \vert} \sum_{i \in \mathcal{I}_{u}^{\trainset}} r_{ui} \log \big( \frac{|\mathcal{U}|}{ |\mathcal{U}_{i}^{\trainset}|} \big)
\label{eq:tfidf-risk}
\end{align}
The rating an item receives from a particular user $r_{ui}$ reflects its importance for that user. To capture the discriminative power of the item among the set of users and control for the fact that some items are generally more popular, Eq.~\ref{eq:tfidf-risk} also incorporates an inverse popularity factor ($|\mathcal{U}_{i}^{\trainset}|$) that is logarithmically scaled
This measure increases proportionally to the rating a user has given an item, but is also counterbalanced by the popularity of the item. A higher $\theta_u^{T}$ shows more preference for less popular items.
\fi | {'timestamp': '2018-03-02T02:04:54', 'yymm': '1803', 'arxiv_id': '1803.00146', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00146'} | arxiv |
\section{Conclusion}
\label{sec:conclude}
In this paper, we describe our experience of implementing \textit{Story Forest}, a news content organization system at Tencent, which is designed to discover events from vast streams of trending and breaking news and organize events in sensible story trees in an online manner. Our system is specifically tailored for fast processing massive amounts of breaking news data, whose story structures can most likely be captured by either a tree, a timeline or a flat structure.
We propose a two-layer graph-based document clustering algorithm to extract fine-grained events from vast long documents.
Our system further organizes the events into story trees with efficient online algorithms upon the arrival of daily news data.
We conducted extensive performance evaluation based on 60 GB of real-world (Chinese) news data, although our ideas are not language-dependent and can easily be extended to other languages, through detailed pilot user experience studies.
Extensive results suggest that our clustering procedure is significantly more effective at accurate event extraction than existing algorithms.
83\% of the event links generated by Story Forest are logically correct as compared to an accuracy of 33\% generated by more complex story graphs, demonstrating the ability of our system to organize trending news events into a logical structure that appeals to human readers.
\section{Evaluation}
\label{sec:eval}
\begin{figure}[t]
\hspace{7mm}
\includegraphics[width=3.2in]{figure/doc_count}
\vspace{-5mm}
\caption{The number of documents on different days in the dataset.}
\label{fig:docAmount}
\vspace{-5mm}
\end{figure}
We evaluate the performance of our system based on 60 GB of Chinese news documents collected from all the major Internet news providers in China, such as Tencent and Sina, in a three-month period from October 1, 2016 to December 31, 2016 covering different topics in the open domain. Fig.~\ref{fig:docAmount} shows the amounts of documents on different days in the dataset. The average number of documents in one day during that period is $164,922$. For the following experiments, we use the data in the first $7$ days for parameter tuning. The remaining data serves as the test set.
\subsection{Evaluate Event Clustering}
\label{subsec:eval-clustering}
We first evaluate the performance of our two-layer graph-based document clustering procedure for event extraction. We manually annotated a test dataset that consists of $3500$ news documents with ground-truth event labels, and compare our algorithm with the following methods:
\begin{itemize}
\item \textbf{LDA + Affinity Propagation}: extract the 1000-dimensional LDA vector of each document, and cluster them by the Affinity Propagation clustering algorithm \cite{guan2011text}.
\item \textbf{KeyGraph}: the original KeyGraph algorithm \cite{sayyadi2013graph} for document clustering, without the second-layer clustering based on document graphs and document-pair relationship classifier.
\end{itemize}
We use the homogeneity, completeness, and V-measure score \cite{rosenberg2007v} as the evaluation metrics of clustering results.
Homogeneity is larger if each cluster contains only members from a single class. The completeness is maximized if all members of a ground true class are assigned to the same cluster.
The V-measure is the harmonic mean between homogeneity and completeness:
$
\text{V-measure} = \frac{2 \times \text{homogenity} \times \text{completeness}}{\text{homogenity} + \text{completeness}}
$
\begin{table}
\caption{Comparing different event clustering methods.}
\label{tab:clusterResult}
\begin{tabular}{llll}
\toprule
Algorithm & Homogeneity & Completeness & \text{V-measure}\\
\midrule
Our approach & $\mathbf{0.960}$ & $0.965$ & $\mathbf{0.962}$ \\
KeyGraph & $0.554$ & $\mathbf{0.989}$ & $0.710$\\
LDA + AP & $0.620$ & $0.947$ & $0.749$\\
\bottomrule
\end{tabular}
\vspace{-5mm}
\end{table}
Table \ref{tab:clusterResult} shows that our approach achieves the best V-measure compared with other methods, partly due to the fact that our method achieves the highest homogeneity score, which is $0.96$. This implies that most of the document clusters (events) we obtain are pure: each event only contains documents that talk about the same event. In comparison, the homogeneity for the other two methods is much lower. The reason is that we adopt two layers of graph-based clustering to group documents into events with more appropriate granularity.
Yet, the completeness of our approach is a little bit smaller than that of KeyGraph, which is reasonable, as we further split the clusters with the second layer document-graph-based clustering supervised by the document-pair relationship classifier. Considering the significant improvement in homogeneity, the loss in completeness is ignorable.
\subsection{Story Forest vs. Other Story Structures}
\label{subsec:eval-storytree}
We evaluate different event timeline and story generation algorithms on the large 3-month news dataset through pilot user evaluation. To make fair comparisons, the same preprocessing and event extraction procedures before developing story structures are adopted for all methods, with 261 stories detected from the dataset.
The only difference is how to construct the story structure given a set of event nodes.
We compare our online Story Forest system with the following existing algorithms:
\begin{itemize}
\item \textbf{Flat Cluster (Flat):} this method clusters related events into a story without revealing the relationships between events, which approximates some previous works in TDT \cite{yang2002multi, allan1998line}.
\item \textbf{Story Timeline (Timeline):} this method organizes events linearly according to the timestamps of events \cite{sayyadi2009event,sayyadi2013graph}.
\item \textbf{Story Graph (Graph):} this method calculates a connection strength for every pair of events and connect the pair if the score exceeds a threshold \cite{yang2009discovering}.
\item \textbf{Event Threading (Thread):} this algorithm appends each new event to its most similar earlier event \cite{nallapati2004event}. The similarity between two events is measured by the TF-IDF cosine similarity of the event centroids.
\end{itemize}
\begin{figure*}[t]
\centering
\subfigure[Percentage of incorrect edges]{
\includegraphics[width=2.3in]{figure/cdf_incorrect_edge_ratio}
\label{fig:edge}
}
\hspace{-3mm}
\subfigure[Percentage of inconsistent paths]{
\includegraphics[width=2.3in]{figure/cdf_inconsistent_path_ratio}
\label{fig:path}
}
\hspace{-3mm}
\subfigure[Number of times rated as the most readable structure]{
\includegraphics[width=2.3in]{figure/bar_best_alg}
\label{fig:whole}
}
\vspace{-3mm}
\caption{Comparing the performance of different story structure generation algorithms.}
\label{fig:compareAlgs}
\vspace{-4mm}
\end{figure*}
\begin{figure*}[t]
\centering
\subfigure[Histogram of the number of events in each story]{
\includegraphics[width=2.3in]{figure/hist_num_event}
\label{fig:num-event}
}
\hspace{-3mm}
\subfigure[Histogram of the number of paths in each story]{
\includegraphics[width=2.3in]{figure/hist_num_paths}
\label{fig:num-path}
}
\hspace{-3mm}
\subfigure[Numbers of different story structures]{
\includegraphics[width=2.3in]{figure/bar_structure_type}
\label{fig:story-type}
}
\vspace{-3mm}
\caption{The characteristics of the story structures generated by the Story Forest system.}
\label{fig:analysisTree}
\vspace{-4mm}
\end{figure*}
\begin{table}
\caption{Comparing different story structure generation algorithms.}
\label{tab:structureResult}
\begin{tabular}{llllll}
\toprule
& Tree & Flat & Thread & Timeline & Graph\\
\midrule
Correct edges & $\mathbf{82.8\%}$ & $73.7\%$ & $66.8\%$ & $58.3\%$ & $32.9\%$ \\
Consistent paths & $\mathbf{77.4\%}$ & $-$ & $50.1\%$ & $29.9\%$ & $-$\\
Best structure & $\mathbf{187}$ & $88$ & $84$ & $52$ & $19$\\
\bottomrule
\end{tabular}
\vspace{-3mm}
\end{table}
We enlisted $10$ human reviewers, including product managers, software engineers and senior undergraduate students, to blindly evaluate the results given by different approaches. Each individual story was reviewed by $3$ different reviewers. When the reviewers' opinions are different, they will discuss to give a final result. For each story, the reviewers answered the following questions for each of the $5$ different structures generated by different schemes:
\begin{enumerate}
\item Do all the documents in each story cluster truly talk about the same story (\textit{yes} or \textit{no})? Continue if \textit{yes}.
\item Do all the documents in each event node truly talk about the same event (\textit{yes} or \textit{no})? Continue if \textit{yes}.
\item For each story structure given by different algorithms, how many edges correctly represent the event connections?
\item For each story structure given by story forest, event threading and story timeline, how many paths from ROOT to any leaf node exist in the graph? And how many such paths are logically coherent?
\item Which algorithm generates the structure that is the best in terms of revealing the story's underlying logical structure?
\end{enumerate}
Note that for question (3), the total number of edges for each tree equals to the number of events in that tree. Therefore, to make a fair comparison, for the story graph algorithm, we only retain the $n$ edges with the top scores, where $n$ is the number of events in that story graph.
We first report the clustering effectiveness of our system in the pilot user evaluation on the $3$-month dataset. Among the 261 stories, 234 of them are pure story clusters (\textit{yes} to question $1$), and furthermore there are 221 stories only contains pure event nodes (\textit{yes} to question $2$). Therefore, the final accuracy to extract events (\textit{yes} to both question $1$ and $2$) is $84.7\%$.
Next, we compare the output story structures given by different algorithms from three aspects: the correct edges between events, the logical coherence of paths, and the overall readability of different story structures. Fig.~\ref{fig:edge} compares the CDFs of incorrect edge percentage under different algorithms. As we can see, Story Forest significantly outperforms the other $4$ baseline approaches.
As shown in Table~\ref{tab:structureResult}, for $58\%$ story trees, all the edges in each tree are reviewed as correct, and the average percentage of correct edges for all the story trees is $82.8\%$. In contrast, the average correct edge percentage given by the story graph algorithm is $32.9\%$.
An interesting observation is that the average percentage of correct edges given by the simple flat structure is $73.7\%$, which is a special case of our tree structures.
This can be explained by the fact that most real-world breaking news that last for a constrained time period are not as complicated as a novel with rich logical structure, and a flat structure is often enough to depict their underlying logic.
However, for stories with richer structures and a relatively longer timeline, Story Forest gives better result than other algorithms by comprehensively considering the event similarity, path coherence and time gap, while other algorithms only consider parts of all the factors.
For path coherence, Fig.~\ref{fig:path} shows the CDFs of percentages of inconsistent paths under different algorithms.
Story Forest gives significantly more coherent paths: the average percentage of coherent paths is $77.4\%$ for our algorithm, and is $50.1\%$ and $29.9\%$, respectively, for event threading and story timeline. Note that path coherence is meaningless for flat or graph structure.
Fig.~\ref{fig:whole} plots overall readability of different story structures. Among the $221$ stories, the tree-based Story Forest system gives the best readability on $187$ stories, which is much better than all other approaches. Different algorithms can generate the same structure. For example, the Story Forest system can also generate a flat structure, a timeline, or a same structure as the event threading algorithm does. Therefore, the sum of the numbers of best results given by different approaches is bigger than $221$. It's worth noting that the flat and timeline algorithms also give $88$ and $52$ most readable results, which again indicates that the logic structures of a large portion of real-world news stories can be characterized by simple flat or timeline structures, which are special cases of story trees. And complex graphs are often an overkill.
We further inspect the story structures generated by Story Forest. Fig.~\ref{fig:num-event} and Fig.~\ref{fig:num-path} plot the distributions of the number of events and the number of paths in each story tree, respectively. The average numbers of events and paths are $4.07$ and $2.71$, respectively. Although the tree structure includes the flat and timeline structures as special cases, among the $221$ stories, Story Forest generates $77$ flat structures and $54$ timelines, while the remaining $90$ structures generated are still story trees. This implies that Story Forest is versatile and can generate diverse structures for real-world news stories, depending on the logical complexity of each story.
\subsection{Algorithm Complexity and Overhead}
\label{subsec:complexity}
\begin{figure}[t]
\hspace{7mm}
\includegraphics[width=3.2in]{figure/date_time}
\vspace{-5mm}
\caption{The running time of our system on the 3-month news dataset.}
\label{fig:timeComplexity}
\vspace{-5mm}
\end{figure}
In this section, we discuss the complexity of each step in our system. For a time slot (e.g., in our case is one day), let $N_d$ be the number of documents, $N_w$ the number of unique words in corpora, note $N_w << N_d$, $N_e$ the number of different events, $N_s$ the number of different stories, and $N_k$ represents the maximum number of unique keywords in a document.
As discussed in \cite{sayyadi2013graph}, building keyword graph requires $\mathcal{O}(N_d N_k + N_w^2)$ complexity, and community detection based on betweenness centrality requires $\mathcal{O}(N_w^3)$. The complexity of assigning documents to keyword communities is $\mathcal{O}(N_d N_k N_e)$. So by far the total complexity is $\mathcal{O}(N_dN_k N_e + N_w^3)$. There exist other community detection algorithms requiring only $\mathcal{O}(N_w^2)$, such as the algorithm in \cite{radicchi2004defining}. Thus we can further improve efficiency by using faster community detection algorithms.
After clustering documents by keyword communities, for each cluster the average number of documents is $\sfrac{N_d}{N_e}$. The pair-wise document relation classification is implemented in $\mathcal{O}((\sfrac{N_d}{N_e})^2)$. The complexity of the next document graph splitting operation is $\mathcal{O}((\sfrac{N_w}{N_e})^3)$. Therefore, the total complexity is $\mathcal{O}(N_e((\sfrac{N_d}{N_e})^2 + (\sfrac{N_w}{N_e})^3))$. Our experiments show that usually $1 \leq \sfrac{N_d}{N_e} \leq 100$. Combining with $N_w << N_d$, the complexity is now approximately $\mathcal{O}(N_e)$.
To grow story trees with new events, the complexity of finding the related story tree for each event is of $\mathcal{O}(N_s T)$, where $T$ is the history length to keep existing stories and delete older stories. If no existing related story, creating a new story requires $\mathcal{O}{(1)}$ operations. Otherwise, the complexity of updating a story tree is $\mathcal{O}(T \sfrac{N_e}{N_s})$. In summary, the complexity of growing story trees is $\mathcal{O}(N_eT (N_s + \sfrac{N_e}{N_s})) \approx \mathcal{O}(T N_e N_s)$, as our experience on the Tencent news dataset shows that $1 \leq \sfrac{N_e}{N_s} \leq 200$. Our online algorithm to update story structure requires $\mathcal{O}(\sfrac{N_e}{N_s})$ complexity and delivers a consistent story development structure, while most existing offline optimization based story structure algorithms require at least $\mathcal{O}((\sfrac{N_e}{N_s})^2)$ complexity and disrupt the previously generated story structures.
Fig.~\ref{fig:timeComplexity} shows the running time of our \textit{Story Forest} system on the $3$ months news dataset. The average time of processing each day's news is around $26$ seconds, and increases linearly with number of days.
For the offline keyword extraction module, the processing efficiency is approximately $50$ documents per second. The performance of keyword extraction module is consistent with time and doesn't require frequently retraining. The LDA model is incrementally retrained every day to handle new words. For keyword extraction, the efficiency of event clustering and story structure generation can be further improved by a parallel implementation.
\section{Introduction}
\label{sec:intro}
With information explosion in the fast-paced modern society, tremendous volumes of articles on trending and breaking news are being generated on a daily basis by various Internet media providers, e.g., Yahoo! News, CNN, Tencent News, Sina News, etc. In the meantime, it becomes increasingly difficult for normal readers to digest such a large amount of streaming news information. Search engines perform document retrieval from large corpora based on user-defined queries that specify what are interesting to the user. However, they do not provide a natural way for users to view what is going on. Furthermore, search engines return a list of ranked documents and do not provide structural summaries of trending topics or breaking news.
An emerging alternative way to visualize news corpora without pre-specified queries is to organize and present news articles through event timelines \cite{yan2011evolutionary, wang2016socially}, event threads \cite{nallapati2004event}, event evolution graphs \cite{yang2009discovering}, or information maps \cite{shahaf2012trains,shahaf2013information,xu2013summarizing}. However, till today few existing news information organization techniques are turned into large-scale deployment due to several reasons:
First of all, despite research efforts in Topic Detection and Tracking (TDT) \cite{yang2002multi, allan1998line}, it remains challenging to extract distinguishable ``events'' at a proper granularity, as building blocks of the news graph, from today's vast amount of open-domain daily news. The news articles may cover extremely diverse topics and contain redundant information about a same conceptual event published by different sources. For example, simply connecting individual articles \cite{shahaf2012trains} or named entities \cite{faloutsos2004fast} in a graph will lead to redundant and entangled information. On the other hand, connecting co-occuring keyword sets in an information map \cite{shahaf2013information} can greatly reduce the fine details of news graphs. But even with the keyword graph, a user still needs to put additional efforts to understand the large number of articles associated with each keyword set.
Second, many recently proposed event graphs or information maps try to link events in an arbitrary evolution graph \cite{yang2009discovering} or permitting intertwining branches in the information map \cite{shahaf2013information}. However, we would like to point out that such overly complex graph structures do not make it easy for users to quickly visualize and understand news data. In fact, unlike a novel or a complex story about a celebrity queried from a search engine, most breaking news stories follow one of a few typical developing structures. In fact, for breaking news summary that will appeal to commercial uses, simple story structures are preferred.
Most importantly, most existing event timeline or event graph generation schemes are based on \emph{offline} optimization over the entire news corpora, while for a system that visualizes breaking news, it is desirable to ``grow'' the stories in an online fashion without disrupting or restructuring the previously generated stories. On one hand, online computation can prevent repeated processing of older documents. On the other hand, an online scheme can deliver a consistent story development structure to users, so that users can quickly visualize what's new in the hot events that they are trying to follow. Furthermore, given the vast amount of collected daily news data, the entire online computation to identify new events and extend the existing story graphs will incur less delay.
In this paper, we present our experience of implementing \textit{StoryForest}, which is a comprehensive system to organize vast amounts of breaking news data into easily readable story trees of events in an online fashion.
We make careful design choices for each component in this large system, with the following contributions:
First, our system can accurately cluster massive amounts of long news documents into conceptually clean events through a novel two-layer document clustering procedure that leverages a wide range of feature engineering and machine learning techniques, mainly including keyword extraction, keyword community detection, a pre-trained classifier to detect whether two documents are talking about the same event, and a graph-based document clustering procedure. On a labeled news dataset, our proposed text clustering procedure significantly outperforms a number of existing text clustering schemes.
Second, our system further groups the discovered events into stories, where each story is represented by a \emph{tree} of events. A link between two events indicates the temporal migration or a causal relationship between two events. Compared with existing story generation systems such as StoryGraph \cite{yang2009discovering} and MetroMap \cite{shahaf2012trains}, we propose an online algorithm to evolve story trees incrementally based on daily news, without any churn of reforming the graph when new data arrive.
As a result, each story is presented in one of several easy-to-view structures, i.e., either a linear timeline, a flat structure, or a tree with branches, which we believe are sufficient to represent story structures of most breaking news.
Finally, we evaluated the performance of our system based on 60 GB of Chinese news documents collected from all the major Internet news providers in China (including Tencent, Sina, WeChat, Sohu, etc.) in a three-month period from October 1, 2016 to December 31, 2016, covering extremely diverse topics in the open domain.
We also conducted a detailed and extensive pilot user experience study for (long) news document clustering and news story generation to evaluate how our system as well as several baseline schemes conform to the habit of human readers.
According to the pilot user experience study, our system outperforms multiple state-of-the-art news clustering and story structure generation systems such as KeyGraph \cite{sayyadi2013graph} and StoryGraph \cite{yang2009discovering} in terms of logical validity of the generated story structures, as well as the conceptual purity of each identified event and story. Experiments show that the average time for our Java-based system to finish event clustering and story structure generation based on the daily data is less than $30$ seconds on a MacBook Pro with a 2 GHz Intel Core i7 processor, and 8 GB memory. Therefore, our system proves to be highly efficient and practical.
It is worth mentioning that our work represents the first system that is able to efficiently process vast amounts of Chinese news data into organized story structures, although our proposed algorithms and schemes are also applicable to news data in English (and other languages) by simply replacing the word segmentation and NLP tools with the counterparts for the corresponding language.
\begin{figure*}
\includegraphics[width=6.7in]{figure/CaseStudy}
\caption{The story tree of ``2016 U.S. presidential election.''}
\label{fig:CaseStudy}
\vspace{-2mm}
\end{figure*}
\section{Problem Definition and Notations}
\label{sec:problem}
We first present some definitions of key concepts in the top-down hierarchy: \textit{topic} $\rightarrow$ \textit{story} $\rightarrow$ \textit{event} to be used in this paper.
\begin{definition}
\textit{Event}: an event $\mathcal{E}$ is a set of one or several documents that contain highly similar information.
\end{definition}
\begin{definition}
\textit{Story}: a story $\mathcal{S}$ is a tree of events that revolve around a group of specific persons and happen at certain places during specific times. A directed edge from event $\mathcal{E}_1$ to $\mathcal{E}_2$ indicates a temporal evolution or a logical connection from $\mathcal{E}_1$ to $\mathcal{E}_2$.
\end{definition}
\begin{definition}
\textit{Topic}: a topic consists of a set of stories that are highly correlated or similar to each other.
\vspace{-1mm}
\end{definition}
Each topic may contain multiple story trees, and each story tree consists of multiple logically connected events.
In our work, events (instead of news documents) are the smallest atomic units. Each event is also assumed to belong to a single story and contains partial information about that story.
For instance, considering the topic \textit{American presidential election}, \textit{2016 U.S. presidential election} is a story within this topic, and \textit{Trump and Hilary's first television debate} is an event within this story.
We now introduce some notations and describe our problem formally. Given a news document stream $D = \{ \mathcal{D}_1, \mathcal{D}_2, \ldots, \mathcal{D}_t,\ldots \}$, where $\mathcal{D}_t$ is the set of news documents collected on time period $t$, our objective is to: a) cluster all news documents $D$ into a set of events $E = \{ \mathcal{E}_1, \ldots, \mathcal{E}_{|E|} \}$, and b) connect the extracted events to form a set of stories $S = \{ \mathcal{S}_1, ..., \mathcal{S}_{|S|} \}$. Each story $\mathcal{S} = (E, L)$ contains a set of events $E$ and a set of links $L$, where $L_{i,j} := <\mathcal{E}_i, \mathcal{E}_j>$ denotes a directed link from event $\mathcal{E}_i$ to $\mathcal{E}_j$, which indicates a temporal evolution or logical connection relationship.
Furthermore, we require the events and story trees to be extracted in an online or incremental manner. That is, we extract events from each $\mathcal D_t$ individually when the news corpus $\mathcal D_t$ arrives in time period $t$, and \emph{merge} the discovered events into the existing story trees that were found at time $t-1$. This is a unique strength of our scheme as compared to prior work, since we do not need to repeatedly process older documents and can deliver a set of evolving yet logically consistent story trees to users.
\begin{figure}
\includegraphics[width=3.4in]{figure/StoryStructures}
\caption{Different structures to characterize a story.}
\vspace{-2mm}
\label{fig:storyStructures}
\vspace{-2mm}
\end{figure}
For example, Fig.~\ref{fig:CaseStudy} illustrates the story tree of ``2016 U.S. presidential election''. The story contains $20$ nodes, where each node indicates an event in 2016 U.S. election, and each link indicates a temporal evolution or a logical connection between two events.
The index number on each node represents the event sequence over the timeline. There are $6$ paths within this story tree, where the path $1 \rightarrow 20$ indicates the whole presidential election process, branch $3 \rightarrow 6$ is about Hilary's health conditions, branch $7 \rightarrow 13$ talks about television debates, $14 \rightarrow 18$ depicts the investigation into Hilary's ``mail door'', etc. As we can see, by modeling the evolutionary and logical structure of a story into a story tree, users can easily grasp the logic of news stories and learn the main information quickly.
Let us represent each story by an empty root node $s$ from which the story is originated, and denote each event by an event node $e$. The events in a story can be organized in one of the following four structures shown in Fig. \ref{fig:storyStructures}: a) a flat structure that does not include dependencies between events; b) a timeline structure that organizes events by their timestamps; c) a graph structure that checks the connection between all pairs of events and maintains a subset of most strong connections; d) a tree structure, which represents a story's evolving structure by a tree.
Compared with a tree structure, sorting events by timestamps omits the logical connection between events, while using directed acyclic graphs to model event dependencies without considering the evolving consistency of the whole story can leads to unnecessary connections between events.
Through extensive user experience studies in Sec.~\ref{sec:eval}, we show that tree structures are the most effective way to represent breaking news stories as compared to other structures, including the more complex graph structures.
\section{Related Work}
\label{sec:related}
There are mainly two research lines that are highly related to our work: Text Clustering and Story Structure Generation.
The problem of text clustering has been well studied by researchers \cite{aggarwal2012survey,jing2005subspace,jing2010knowledge,guan2011text}. The most popular way is first extracting specific text features, such as TF-IDF, from documents, and then apply general clustering algorithms such as k-means. The selection of different feature and setting of algorithm parameters plays a key role in the final performance of clustering \cite{liu2005comparative}. There are also approaches which utilize the document keywords co-occurrence information to construct a keyword graph, and clustering documents by applying community detection techniques on the keyword graph \cite{sayyadi2013graph}. \cite{Mele2017Event} combines topic modeling, named-entity recognition, and temporal analysis to detect event clusters from news streams. \cite{Chakrabarti2010Evolutionary} proposed an evolutionary clustering framework to cluster data over time. A more comprehensive study of different text clustering algorithms can be found in \cite{aggarwal2012survey}.
The Topic Detection and Tracking (TDT) research spot news events and group by topics, and track previously spotted news events by attaching related new events into the same cluster \cite{allan1998line,allan2012topic,yang2009discovering,sayyadi2013graph}. However, the associations between related events are not defined or interpreted by TDT techniques.
To help users capture the developing structure of events, different approaches have been proposed. \cite{nallapati2004event} proposed the concept of \textit{Event Threading}, and tried a series of strategies based on similarity measure to capture the dependencies among events. \cite{yang2009discovering} combines the similarity measure between events, temporal sequence and distance between events, and document distribution along the timeline to score the relationship between events, and models the event evolution structure by a directed acyclic graph (DAG).
The above research works measure and model the relationship between events in a pairwise manner. However, the overall story consistency is not considered.
The \textit{Metro Map} model proposed in \cite{shahaf2013information} defines metrics such as coherence and diversity for story quality evaluation, and identifies lines of documents by solving an optimization problem to maximize the topic diversity of storylines while guarantee the coherence of each storyline.
However, new documents are being generated all the time, and systems that are able to catch related news and update story structures in an online manner are desired.
As studies based on unsupervised clustering techniques \cite{yan2011evolutionary} perform poorly in distinguishing storylines with overlapped events \cite{hua2016automatical},
more recent works introduce different Bayesian models to generate storyline. However, they often ignore the intrinsic structure of a story \cite{huang2013optimized} or fail to properly model the hidden relations \cite{zhou2015unsupervised}. \cite{hua2016automatical} proposes a hierarchical Bayesian model for storyline generation, and utilize twitter hashtags to ``supervise'' the generation process. However, the Gibbs sampling inference of the model is time consuming, and such twitter data is not always available for every news stories.
\section{The Story Forest System}
\label{sec:system}
\begin{figure*}
\includegraphics[width=6.7in]{figure/System}
\caption{An overview of the system architecture of \textit{Story Forest}.}
\label{fig:system}
\vspace{-0mm}
\end{figure*}
An overview of our \textit{Story Forest} system is shown in Fig.~\ref{fig:system}, which mainly consists of three components: preprocessing, document clustering and story tree update, divided into 5 steps. First, the input news document stream will be processed by a variety of NLP and machine learning tools, mainly including document filtering, word segmentation and keyword extraction. Second, steps 2--3 will cluster documents into events in a novel 2-layer procedure as follows.
For news corpus $\mathcal D_t$ in each time period $t$, we form a keyword graph \cite{sayyadi2013graph} from these documents based on keyword co-occurrence, and extract topics as subgraphs from the keyword graph using community detection algorithms. The topics with few keywords will be discarded. After each topic is found, we find all the documents associated with the topic, and further cluster these documents into events through a semi-supervised document clustering procedure aided by a pre-trained document-pair relationship classifier.
Finally, in steps 4--5 we update the story trees (formed previously) by either inserting each discovered event into an existing story tree at the right place, or creating a new story tree if the event does not belong to any existing story. Note that each topic may contain multiple story trees and each story tree consists of logically connected events.
We will explain the design choices of each component in detail in the following.
\subsection{Preprocessing}
\label{subsec:preprocessing}
When a new set of news documents arrives, we need to clean, filter documents, and extract features that will be helpful to the steps that follow.
Our preprocessing module mainly includes the following three steps, which are critical to the overall system performance:
\textbf{Document filtering}: unimportant documents with content length smaller than a threshold (20 characters) will be discarded.
\textbf{Word segmentation}: we segment the title and body of each document using Stanford Chinese Word Segmenter \textit{Version 3.6.0} \cite{chang2008optimizing}, which has proved to yield excellent performance on Chinese word segmentation tasks. Note that for data in a different language, the corresponding word segmentation tool in that language can be used instead.
\textbf{Keyword extraction}: extracting keywords from each document to represent the main concepts of the document is quite critical to the performance and efficiency of the entire system. We found that traditional keyword extraction approaches, such as TF-IDF based keyword extraction and TextRank \cite{mihalcea2004textrank}, are not sufficient to achieve good performance for real-world news data. For example, the TF-IDF based method measures each word's importance by frequency information; it cannot detect keywords that yet have a relatively low frequency. The TextRank algorithm utilizes the word co-occurrence information and is able to handle such cases. However, its efficiency is relatively low, with time cost increasing significantly as the document length increases.
\begin{table}
\caption{Features for the classifier to extract keywords.}
\label{tab:features}
\begin{tabular}{lp{5.5cm}}
\toprule
Type & Features\\
\midrule
Word feature & Named entity or not, location name or not, contains angle brackets or not. \\
Structural feature & TF-IDF, whether appear in title, first occurrence position in document, average occurrence position in document, distance between first and last occurrence positions, average distance between word adjacent occurrences, percentage of sentences that contains the word, TextRank score.\\
Semantic feature & LDA\tablefootnote{We trained a $1000$-dimensional LDA model based on news data collected from January 1, 2016 to May 31, 2016 that contains $300,000+$ documents.
}\\
\bottomrule
\end{tabular}
\vspace{-3mm}
\end{table}
\begin{figure}
\includegraphics[width=3.0in]{figure/KeywordClassify}
\caption{The classifier to extract keywords.}
\vspace{-1mm}
\label{fig:keywordClassify}
\vspace{-3mm}
\end{figure}
To efficiently and accurately extract keywords, we constructed a supervised learning system to classify whether a word is a keyword or not for a document.
In particular, we manually labeled the keywords of $10,000+$ documents, including $20,000+$ positive keyword samples and $350,000+$ negative samples.
Table~\ref{tab:features} lists the main features that we found critical to the binary classifier.
A straightforward idea is to input the raw features listed above to a Logistic Regression (LR). However, as a linear classifier, LR relies on careful feature engineering.
To reduce the impact of human judgement in feature engineering, we combine a Gradient Boosting Decision Tree (GBDT) with the LR classifier to get the binary yes/no classification result, as shown in Fig. \ref{fig:keywordClassify}. GBDT, as a nonlinear model, can automatically discover useful cross features or feature combinations from raw features and discretize continuous features.
The output of the GBDT will serve as the input of the LR classifier. Finally, the LR classifier will determine whether a word is a keyword or not for the document in question. We also tried SVM as the classifier in the second layer instead of LR and observed similar performance. Our final keyword extraction precision and recall rate are $0.83$ and $0.76$, while they are $0.72$ and $0.76$ respectively if we don't add the GBDT component.
\subsection{Document Clustering and Event Extraction}
\label{subsec:eventClustering}
After document preprocessing, we need to extract events. Event extraction here is essentially a fine-tuned document clustering procedure to group conceptually similar documents into events. Although clustering studies are often subjective in nature, we show that our carefully designed procedure can significantly improve the accuracy of event clustering, conforming to human understanding, based on a manually labeled news dataset.
To handle the high accuracy requirement for long news text clustering, we propose a $2$-layer clustering approach based on both keyword graphs and document graphs.
\textit{First}, we construct a large keyword co-occurrence graph \cite{sayyadi2013graph} $\mathcal{G}$. Each node in $\mathcal{G}$ is a keyword $w$ extracted by the scheme described in Sec.~\ref{subsec:preprocessing}, and each undirected edge $e_{i,j}$ indicates that $w_i$ and $w_j$ have ever co-occured in a same document.
Edges that satisfy two conditions will be kept and other edges will be dropped: the times of co-occurrence shall be above a minimum threshold (we use $3$ in our system), and the conditional probabilities of the occurrence $\Pr\{w_j| w_i\}$ and $\Pr\{w_i | w_j\}$ also need to be bigger than a predefined threshold (we use $0.15$), where the conditional probability $\Pr\{w_j| w_i\}$ represents the probability that $w_j$ occurs in a document if the document contains word $w_i$.
\textit{Second}, we perform community detection in the constructed keyword graph. This step aims to split the whole keyword graph $\mathcal{G}$ into communities $C = \{\mathcal{C}_1, \mathcal{C}_1, ..., \mathcal{C}_{|C|}\}$, where each community $\mathcal{C}_i$ contains the keywords for a certain topic (to which multiple stories may be associated).
The benefit of using community detection in the keyword graph is that each keyword can appear in multiple communities, which makes sense in reality.
We also tried another method of clustering keywords by \textit{Word2Vec}.
However, the performance is worse than community detection based on co-occurrence graphs. The reason is that using word vectors tends to cluster the words with similar semantic meanings. However, unlike articles in a specialized domain, in long news documents in the open domain, it is highly possible that keywords with different semantic meanings can co-occur in the same event.
To detect keyword communities, we utilize the \emph{betweenness centrality score} \cite{sayyadi2013graph} of edges to measure the strength of each edge in the keyword graph. An edge's betweenness score is defined as the number of shortest paths between all pairs of nodes that pass through it. An edge between two communities is expected to achieve a high betweenness score. Edges with high betweenness score will be removed iteratively to extract communities. The iterative splitting process will stop until the number of nodes in each sub-graph is smaller than a predefined threshold, or until the maximum betweenness score of all edges in the sub-graph is smaller than a threshold that depends on the sub-graph's size. We refer interested readers to \cite{sayyadi2013graph} for more details about community detection.
After we obtain the keyword communities, we calculate the cosine similarity between each document and a keyword community. The documents are represented by TF-IDF vectors. As a keyword community is a bag of words, it can also be considered as a document. We assign each document to the keyword community which gives the highest similarity and the similarity is above a predefined threshold. Up to now, we have finished document clustering in the first layer, i.e., the documents are grouped according to topics.
\textit{Third}, we further perform the second-layer document clustering within each topic to obtain fine-grained events. We also call this process \emph{event clustering}. An event only contains documents that talk about the same semantic event. To yield fine-grained event clustering, unsupervised learning is not sufficient.
Instead, we adopt a supervised-learning-guided clustering procedure in the second layer.
Specifically, we train an SVM classifier to determine whether a pair of documents are talking about the same event or not using a bunch of document-pair features as the input, including the cosine similarities of content TF-IDF and TF vectors, the cosine similarities of title TF-IDF and TF vectors, the similarity of the first sentences in the two documents, etc.
For each pair of documents within a same topic, we decide whether to connect them or not according to the prediction made by the document-pair relationship classifier mentioned above. Hence, the documents in each topic will form a document graph. We then apply the same community detection algorithm mention above to such document graphs.
Note that the graph-based clustering on the second layer is highly efficient, since the number of documents contained in each topic is significantly smaller after the first-layer document clustering.
In a nutshell, our 2-layer scheme groups documents into topics based on keyword community detection and further groups the documents within each topic into fine-grained events. For each event $\mathcal{E}$, we also record the set of keywords $\mathcal{C}_{\mathcal{E}}$ of the topic (keyword community) which it belongs to, which will be helpful in the subsequent story tree development.
\subsection{Growing Story Trees Online}
\label{sec:tree}
Given the set of extracted events for a particular topic, we further organize these events into multiple stories under this topic in an online manner. Each story is represented by a \textit{Story Tree} to characterize the evolving structure of that story.
Upon the arrival of a new event and given an existing story forest, our online algorithm to grow the story forest mainly involves two steps: a) identifying the story tree to which the event belongs; b) updating the found story tree by inserting the new event at the right place.
If this event does not belong to any existing story, we create a new story tree.
{\bf a) Identifying the related story tree.}
Given a set of new events $E_t = \{\mathcal{E}_1, \mathcal{E}_2, ..., \mathcal{E}_{|E_t|}\}$ at time period $t$ and an existing story forest $\mathcal{F}_{t-1} = \{ \mathcal{S}_1, \mathcal{S}_2, ..., \mathcal{S}_{|\mathcal{F}_{t-1}|}\}$ that has been formed during previous $t-1$ time periods, our objective is to assign each new event $\mathcal{E} \in E_t$ to an existing story tree $\mathcal{S} \in \mathcal{F}_{t-1}$. If no story in the current story forest matches that event, a new story tree will be created and added to the story forest.
We apply a two-step strategy to decide whether a new event $\mathcal{E}$ belongs to an existing story tree $\mathcal{S}$ formed previously.
First, as described at the end of Sec. \ref{subsec:eventClustering}, event $\mathcal{E}$ has its own keyword set $\mathcal{C}_{\mathcal{E}}$.
Similarly, for the existing story tree $\mathcal{S}$, there is an associated keyword set $\mathcal{C}_{\mathcal{S}}$ that is a union of all the keyword sets of the events in that tree.
Then, we can calculate the compatibility between event $\mathcal{E}$ and story tree $\mathcal{S}$ as the Jaccard similarity coefficient between $\mathcal{C}_{\mathcal{S}}$ and $\mathcal{C}_{\mathcal{E}}$:
$
\text{compatibility}(\mathcal{C}_{\mathcal{S}}, \mathcal{C}_{\mathcal{E}}) = \frac{|\mathcal{C}_{\mathcal{S}} \cap \mathcal{C}_{\mathcal{E}}|}{|\mathcal{C}_{\mathcal{S}} \cup \mathcal{C}_{\mathcal{E}}|}.
$
If the compatibility is bigger than a threshold, we further check whether at least a document in event $\mathcal{E}$ and at least a document in story tree $\mathcal{S}$ share $n$ or more common words in their titles (with stop words removed). If yes, we assign event $\mathcal{E}$ to story tree $\mathcal{S}$. Otherwise, they are not related. In our experiments, we set $n=1$.
If the event $\mathcal{E}$ is not related to any existing story tree, a new story tree will be created.
\begin{figure}
\includegraphics[width=3.3in]{figure/NodeOperation}
\caption{Three types of operations to place a new event into its related story tree.}
\label{fig:nodeOperations}
\vspace{-2mm}
\end{figure}
{\bf b) Updating the related story tree.} After a related story tree $\mathcal{S}$ has been identified for the incoming event $\mathcal{E}$, we perform one of the 3 types of operations to place event $\mathcal{E}$ in the tree: \textit{merge}, \textit{extend} or \textit{insert}, as shown in Fig.~\ref{fig:nodeOperations}.
The \textit{merge} operation merges the new event $\mathcal{E}$ into an existing event node in the tree. The \textit{extend} operation will append event $\mathcal{E}$ as a child node to an existing event node in the tree. Finally, the \textit{insert} operation directly appends event $\mathcal{E}$ to the root node of story tree $\mathcal{S}$. Our system chooses the most appropriate operation to process the incoming event based on the following procedures.
{\bf \emph{Merge}}: we merge $\mathcal{E}$ with an existing event in the tree, if they essentially talk about the same event.
This can be achieved by checking whether the centroid documents of the two events are talking about the same thing using the document-pair relationship classifier described in Sec.~\ref{subsec:eventClustering}. The centroid document of an event is simply the concatenation of all the documents in the event.
{\bf\emph{Extend}} \emph{and} {\bf \emph{Insert}}: if event $\mathcal{E}$ does not overlap with any existing event, we will find the parent event node in $\mathcal{S}$ to which it should be appended.
We calculate the \emph{connection strength} between the new event $\mathcal{E}$ and each existing event $\mathcal{E}_j \in \mathcal{S}$ based on three factors: 1) the time distance between $\mathcal{E}$ and $\mathcal{E}_j$, 2) the compatibility of the two events, and 3) the \emph{storyline coherence} if $\mathcal{E}$ is appended to $\mathcal{E}_j$ in the tree, i.e.,
\begin{align}
\label{eqn:linkScore}
\begin{split}
\text{ConnectionStrength}(\mathcal{E}_j, \mathcal{E}) :=\ \text{compatibility}(\mathcal{E}_j, \mathcal{E}) \times \\
\text{coherence}(\mathcal{L}_{\mathcal{S}\to\mathcal{E}_j\to \mathcal{E}}) \times \text{timePenalty}(\mathcal{E}_j, \mathcal{E}).
\end{split}
\end{align}
Now we explain the three components in the above equation one by one. \emph{First}, the compatibility between two events $\mathcal{E}_i$ and $\mathcal{E}_j$ is given by
\begin{equation}
\text{compatibility}(\mathcal{E}_i, \mathcal{E}_j) = \frac{\text{TF}(d_{c_i}) \cdot \text{TF}(d_{c_{j}})}{\|\text{TF}(d_{c_i})\| \cdot \|\text{TF}(d_{c_{j}})\|},
\end{equation}
where $d_{c_i}$ is the centroid document of event $\mathcal{E}_i$.
Furthermore, the storyline of $\mathcal{E}_j$ is defined as the path in $\mathcal{S}$ starting from the root node of $\mathcal{S}$ ending at $\mathcal{E}_j$ itself, denoted by $\mathcal{L}_{\mathcal{S}\rightarrow \mathcal{E}_j}$. Similarly, the storyline of $\mathcal{E}$ appended to $\mathcal{E}_j$ is denoted by $\mathcal{L}_{\mathcal{S}\rightarrow \mathcal{E}_j\rightarrow\mathcal{E}}$.
For a storyline $\mathcal{L}$ represented by a path
$\mathcal{E}^0\to \ldots \to \mathcal{E}^{|\mathcal{L}|}$, where $\mathcal{E}^0 := \mathcal S$, its \textit{coherence} \cite{xu2013summarizing} measures the theme consistency along the storyline, and is defined as
\begin{equation}
\text{coherence}(\mathcal{L}) = \frac{1}{|\mathcal{L}|}\sum_{i=0}^{|\mathcal{L}|-1} \text{compatibility}(\mathcal{E}^i, \mathcal{E}^{i+1}),
\end{equation}
Finally, the bigger the time gap between two events, the less possible that the two events are connected. We thus calculate time penalty by
\begin{align}
\text{timePenalty}(\mathcal{E}_j, \mathcal{E}) = \begin{cases}
e^{\delta \cdot (t_{\mathcal{E}_j} - t_{\mathcal{E}})}
&\ \text{if } t_{\mathcal{E}_j} - t_{\mathcal{E}} < 0\\
0 &\ \text{otherwise}\\
\end{cases}
\end{align}
where $t_{\mathcal{E}_j}$ and $t_{\mathcal{E}}$ are the timestamps of event $\mathcal{E}_j$ and $\mathcal{E}$ respectively. The timestamp of an event is the minimum timestamp of all the documents in the event.
We calculate the connection strength between the new event $\mathcal{E}$ and every event node $\mathcal{E}_j \in \mathcal{S}$ using \eqref{eqn:linkScore}, and append event $\mathcal{E}$ to the existing $\mathcal{E}_j$ that leads to the maximum connection strength.
If the maximum connection strength is lower than a threshold value, we \textit{insert} $\mathcal{E}$ into story tree $\mathcal{S}$ by directly appending it to the root node of $\mathcal{S}$. In other words, \emph{insert} is a special case of \emph{extend}.
| {'timestamp': '2018-03-02T02:06:02', 'yymm': '1803', 'arxiv_id': '1803.00189', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00189'} | arxiv |
\subsubsection*{\small Article Type: Advanced Review}
\hfill \break
\thanks
\subsubsection*{Abstract}
\end{center}
The problem of complex data analysis is a central topic of modern statistical science and learning systems and is becoming of broader interest with the increasing prevalence of high-dimensional data. The challenge is to develop statistical models and autonomous algorithms that are able to acquire knowledge from raw data for exploratory analysis, which can be achieved through clustering techniques or to make predictions of future data via classification (i.e., discriminant analysis) techniques. Latent data models, including mixture model-based approaches are one of the most popular and successful approaches in both the unsupervised context (i.e., clustering) and the supervised one (i.e, classification or discrimination).
Although traditionally tools of multivariate analysis, they are growing in popularity when considered in the framework of functional data analysis (FDA). FDA is the data analysis paradigm in which the individual data units are functions (e.g., curves, surfaces), rather than simple vectors. In many areas of application, including signal and image processing, functional imaging, bio-informatics, etc., the analyzed data are indeed often available in the form of discretized values of functions or curves (e.g., time series, waveforms) and surfaces (e.g., 2d-images, spatio-temporal data). This functional aspect of the data adds additional difficulties compared to the case of a classical multivariate (non-functional) data analysis. We review and present approaches for model-based clustering and classification of functional data. We derive well-established statistical models along with efficient algorithmic tools to address problems regarding the clustering and the classification of these high-dimensional data, including their heterogeneity, missing information, and dynamical hidden structure.
The presented models and algorithms are illustrated on real-world functional data analysis problems from several application area.
\clearpage
\renewcommand{\baselinestretch}{1.5}
\normalsize
\section{Introduction}
\label{sec:Introduction}
The problem of complex data analysis is a central topic of modern statistics and statistical learning systems and is becoming of broader interest, from both a methodological and a practical point of view, in particular within the big data context. The objective is to develop well-established statistical models and autonomous efficient algorithms that aim at acquiring knowledge from raw data while addressing problems regarding the data complexity, including heterogeneity, high dimensionality, dynamical behaviour, and missing information. We can distinguish methods for exploratory analysis, which rely on clustering and segmentation techniques, and methods that aim at making predictions for future data, achieved via classification (i.e., discriminant analysis) techniques. Most statistical methodologies involve vector-valued data where the individual data units are finite dimensional vectors $\boldsymbol{x}_i\in \mathbb{R}^d$, and generally with no intrinsic structure. However, in many application domains, the individual data units are best described as entire functions (i.e., curves or surfaces) rather than finite dimensional vectors. Figure \ref{fig: functional data sets} shows examples of functional data from different application area.
\vspace*{-.1cm}
\begin{figure}[H]
\centering
\begin{tabular}{ccc}
\includegraphics[scale=.27]{phonemes-aa-ao-dcl-iy-sh} & \includegraphics[scale=.27]{tecator-data-2} & \includegraphics[scale=.27]{yeast-cellcycle-data.eps} \\
(a) & (b) & (c)\\
\includegraphics[scale=.27]{satellite-data-2.eps} & \includegraphics[scale=.27]{switch_curves} & \includegraphics[scale=.27]{real_new_2006_2}\\
(d) & (e) & (f)
\end{tabular}
\vspace*{-.3cm}
\caption{\label{fig: functional data sets} Examples of functional data sets.}
\end{figure}
Fig. \ref{fig: functional data sets} (a) shows the phonemes data set\footnote{Phonemes data from \url{http://www.math.univ-toulouse.fr/staph/npfda/} is a part of the original one available at \url{http://www-stat.stanford.edu/ElemStatLearn}} which is related to a speech recognition problem, namely the phoneme classification problem, studied in \cite{Hastie95penalizeddiscriminant,Ferraty2003,Delaigle2012,Chamroukhi-PWRM-2016,Chamroukhi-RobustEMMixReg2016}. The data correspond to log-periodograms constructed from recordings available at different equispaced frequencies for the five phonemes: ``sh" as in ``she", ``dcl" as in ``dark", ``iy" as in ``she", ``aa" as in ``dark", and ``ao" as in ``water". The figure shows 1000 phoneme log-periodograms. The aim is to predict the phoneme class for a new log-periodogram.
Fig. \ref{fig: functional data sets} (b) shows the Tecator data\footnote{Tecator data are available at \url{http://lib.stat.cmu.edu/datasets/tecator}.} which consist of near infrared (NIR) absorbance spectra of 240 meat samples with $100$ observations for each spectrum. The NIR spectra are recorded on a Tecator Infratec food and feed Analyzer working in the wavelength range $850-1050$ nm.
This data set was studied in \cite{HebrailEtAl2010,chamroukhi_et_al_neurocomp2010,Chamroukhi-PWRM-2016,Chamroukhi-IJCNN-2011,Chamroukhi-FMDA-neucomp2013,Chamroukhi-HDR-2015}. The problem of clustering the data was considered in \cite{Chamroukhi-PWRM-2016,Chamroukhi-HDR-2015,Chamroukhi-IJCNN-2011,HebrailEtAl2010} and the problem of discrimination was considered in \cite{chamroukhi_et_al_neurocomp2010,Chamroukhi-FMDA-neucomp2013}.
The figure shows $n=240$ functions.
The yeast cell cycle data set shown in Fig. \ref{fig: functional data sets} (c) is a part of the original yeast cell cycle data that represent the fluctuation of expression levels of
$n$ genes over 17 time points corresponding to two cell cycles from \cite{Cho1998}. This data set has been used to demonstrate the effectiveness of clustering techniques for time course Gene expression data in bio-informatics such as in \cite{YeungMBC2001, Chamroukhi-PWRM-2016,Chamroukhi-PWRM-2016,Chamroukhi-RobustEMMixReg2016}.
The figure shows $n=384$ functions\footnote{We consider the standardized subset constructed by \cite{YeungMBC2001} available in \url{http://faculty.washington.edu/kayee/model/}. The complete data are available from \url{http://genome-www.stanford.edu/cellcycle/}.}.
The Topex/Poseidon radar satellite data\footnote{Satellite data are available at \url{http://www.lsp.ups-tlse.fr/staph/npfda/npfda-datasets.html}.}
(Fig. \ref{fig: functional data sets} (d)) represent registered echoes by the satellite Topex/Poseidon around an area of 25 kilometers over the Amazon River and contain $n=472$ waveforms of the measured echoes, sampled at $m=70$ (number of echoes).
These data have been studied namely in \cite{DaboNiang2007,HebrailEtAl2010, Chamroukhi-PWRM-2016,Chamroukhi-RobustEMMixReg2016} in a clustering context.
Other examples of spatial functional data are the zebrafish brain calcium images studied in \cite{Nguyen2016MixSSR,Nguyen-SADM-2017,Nguyen-MixAR-2016,Chamroukhi-BSSRM-2015}.
Fig. \ref{fig: functional data sets} (e) and Fig. \ref{fig: functional data sets} (f) shows functional data related to the diagnosis of complex systems. They are two different data sets of curves obtained from a diagnosis application of high-speed railway switches. Each curve represents the consumed power by the switch motor during each switch operation and the aim is to predict the state of the switch given a new operation data, or to cluster the times series to discover possible defaults. These data were studied in \cite{Chamroukhi-PWRM-2016,Chamroukhi-FMDA-neucomp2013,Chamroukhi-MixRHLP-2011,chamroukhi_et_al_neurocomp2010,chamroukhi_et_al_NN2009}.
Fig. \ref{fig: functional data sets} (e) shows $n=120$ curves where each curve consists of $m=564$ observations and
Fig. \ref{fig: functional data sets} (f) shows $n=146$ curves where each curve consists of $m=511$ observations.
In addition to the fact that these data represent underlying functions, the individuals can further present an underlying hidden structure due to the original data generative process. For example, Fig. \ref{fig: functional data sets}(e) and Fig. \ref{fig: functional data sets}(f) clearly show that the curves exhibit an underlying non-stationary behaviour. Indeed, for these data, each curve represent the consumed power during a underlying process with several electro-mechanical regimes, and as shown in Fig \ref{fig: switch curve examples}, the functions present smooth and/or abrupt regime changes.
\begin{figure}[H]
\centering
\includegraphics[scale=.3]{switch-curve-class-1-example}
\includegraphics[scale=.3]{switch-curve-class-2-example}
\includegraphics[scale=.3]{switch-curve-class-3-example}
\caption{\label{fig: switch curve examples} Examples of individual curves from Fig. \ref{fig: functional data sets}(e)}
\end{figure}\noindent
This ``functional" aspect of the data adds additional difficulties in the analysis. Indeed, a classical multivariate (non functional) analysis ignores the structure of individual data units, which are in, functional data analysis, longitudinal data, with possible underlying longitudinal structure. There is therefore a need to formulate ``functional'' models that explicitly integrate the functional form of the data, rather than directly and simply considering the data as vectors to apply classical multivariate analysis methods, which may lead to a loss of information.
The general paradigm of analyzing such data is known as functional data analysis (FDA) \citep{RamsayAndSilvermanFDA2005,ramsayandsilvermanAppliedFDA2002,FerratyANDVieuBook}.
The core philosophy of FDA is to treat the data not as multivariate observations but as (discretized) values of possibly smooth functions.
FDA is indeed the paradigm of data analysis in which the individuals are functions (e.g., curves or surfaces) rather than vectors of reduced dimension and the statistical approaches for FDA allow such structures of the data to be exploited.
The goals of FDA, like in multivariate data analysis, may be exploratory for example by clustering or segmentation when the curves arise from sub-populations, or when each individual function is itself composed of heterogeneous functional components such as those curves that are shown in Fig \ref{fig: switch curve examples}, or decisional for example to make prediction on future data, that is, via supervised classification techniques. Additional background on FDA, examples and analysis techniques can be found for example in \cite{RamsayAndSilvermanFDA2005}.
Within the field of FDA, we consider the problems of functional data clustering and classification.
Latent data models, in particular finite mixture models \citep{McLachlan2000FMM,SylviaFruhwirthBook2006,TitteringtonBookMixtures}, known in multivariate analysis by their well-established theoretical background, flexibility, easy interpretation and associated efficient estimation tools in many problems particularly in cluster and discriminant analyses, say the
the expectation-maximization (EM) algorithm \citep{dlr, McLachlanEM2008} or the minorization-maximization (MM) algorithm \citep{HunterLangeMM04,NguyenMMtuto2017}. They are taking a growing investigation for adapting them to the framework of FDA.
See for example
\cite{Chamroukhi-PWRM-2016,
Nguyen-SADM-2017,
Nguyen-MixAR-2016,
Nguyen2016MixSSR,
Nguyen2014MixSSR,
Chamroukhi-FMDA-neucomp2013,
Chamroukhi-BSSRM-2015,
Devijver2014-MBC-FDA,
Jacques2014,
Chamroukhi-MixRHLP-2011,
Bouveyron2011,
LiuANDyangFunctionalDataClustering,
GaffneyANDsmythNIPS2004,
garetjamesJASA2003,
garetjamesANDtrevorhastieJRSS2001}.
This paper focuses on FDA and provides an overview of original approaches for mixture model-based clustering/segmentation and classification of functional data, particularly curves with regime changes.
The methods on which we focus here rely on generative functional regression models, which are based on the finite mixture formulation with tailored component densities.
Our contributions to FDA consist of latent data models, particularly the finite mixture modeling in the framework of functional data and proposed models to deal with the problem of functional data clustering, as in
\citep{Chamroukhi-PWRM-2016,Nguyen-MixAR-2016,Nguyen-SADM-2017,
Nguyen2016MixSSR,Chamroukhi-HDR-2015,
Chamroukhi-BSSRM-2015,
Nguyen2014MixSSR,
Chamroukhi-MixRHLP-2011,
Chamroukhi-FMDA-neucomp2013,
Chamroukhi-IJCNN-2011}
and the problem of functional data classification, as in
\citep{chamroukhi_et_al_neurocomp2010,
Chamroukhi-FMDA-neucomp2013,
Nguyen2016MixSSR}.
First, we consider the regression mixtures of \citep{Chamroukhi-RobustEMMixReg2016,Chamroukhi-IJCNN-2013}.
The approach provides a framework for fully unsupervised learning of functional regression mixture models (MixReg) where the component numbers may be unknown. The developed approach consists of a penalized maximum likelihood estimation problem that can be solved by a robust EM-like algorithm.
Polynomial, spline and B-spline versions of the approach are described.
Secondly, we consider the mixed effects regression framework for FDA of \cite{Nguyen2016MixSSR,Nguyen2014MixSSR} and \cite{Chamroukhi-BSSRM-2015}. In particular, we consider the application of such a framework for clustering spatial functional data.
We introduce both spatial spline regression model with mixed-effects (SSR)and
Bayesian SSR (BSSR) for modeling spatial function data. The SSR models are based on Nodal basis functions for spatial regression and accommodates both common mean behavior for the data through a fixed-effects component, and variability inter-individuals via a random-effects component. Then, in order to model populations of spatial functional data issued from heterogeneous groups, we introduced mixtures of spatial spline regressions with mixed-effects (MSSR) and Bayesian MSSR (BMSSR). %
Thirdly, we consider the analysis of unlabeled functional data that might present a hidden longitudinal structure. More specifically, we proposed mixture-model based cluster and discriminant analyzes based on latent processes to deal with functional data presenting smooth and/or abrupt regime changes.
The heterogeneity of a population of functions arising in several sub-populations is naturally accommodated by a mixture distribution, and the dynamic behavior within each sub-population, generated by a non-stationary process typically governed by a regime change, is captured via a dedicated latent process. Here the latent process is modeled by either a Markov chain or a logistic process, or as a deterministic piecewise segmental process.
We presented a mixture model with piecewise regression components (PWRM) for simultaneous clustering and segmentation of univariate regime changing functions \citep{Chamroukhi-PWRM-2016}.
Then, we formulated the problem from a full generative prospective by proposing the mixture of hidden Markov model regressions (MixHMMR) \citep{Chamroukhi-IJCNN-2011,Chamroukhi-HDR-2015} and the mixture of regressions with hidden logistic processes (MixRHLP) \citep{Chamroukhi-MixRHLP-2011,Chamroukhi-FMDA-neucomp2013}, which offers additional attractive features including the possibility to deal with smooth dynamics within the curves.
We also presented discriminant analyzes for homogeneous groups of functions \citep{chamroukhi_et_al_neurocomp2010} as well as for heterogeneous groups \citep{Chamroukhi-FMDA-neucomp2013}.
The discriminant analysis is adapted for functions that might be organized in homogeneous or heterogeneous groups and further exhibit a non-stationary behavior due to regime changes.
\bigskip
The remainder of this paper is organized as follows. In Section \ref{sec: FMM formulation for FDA}, we present the general mixture modeling framework for functional data clustering and classification.
Then, in Section \ref{sec:MixReg}, we present the regression mixture models for functional data clustering, including the standard regression mixture, the regularized one and the regression mixture with fixed and mixed effects which may be applied to both longitudinal and spatial data. We then present finite mixtures for simultaneous functional data clustering and segmentation. Here, we consider three main models. The first is the piecewise regression mixture model (PWRM) presented in Section \ref{sec:PWRM}.
In Section \ref{sec:MixHMMR}, we then present the mixture of hidden Markov model regressions (MixHMMR) model.
Section \ref{sec:MixRHLP} is dedicated to the mixture of regression models with hidden logistic processes (MixRHLP).
Finally, In Section \ref{sec:FMDA-MixRHLP}, we derive a some formulations for functional discriminant analysis, in particular, the functional mixture discriminant analysis with hidden process regression (FMDA).
Numerous illustrative examples of our models and algorithms are provided throughout the article.
\section{Mixture modeling framework for functional data}
\label{sec: FMM formulation for FDA}
Let $(Y_1(x), Y_2(x),\ldots,Y_n(x))$, $x\in \mathcal{T} \subset \mathbb{R}$, be a random sample of $n$ independently and identically distributed (i.i.d) functions where $Y_i(x)$ is the response for the $i$th individual given some predictor $x$, for example the time in time series.
The $i$th individual function $(i=1,\ldots,n)$ is supposed to be observed at the independent abscissa values $(x_{i1},\ldots,x_{im_i})$ with $x_{ij}\in \mathcal{T}$ for $j=1,\ldots,m_i$ and $x_{i1}<\ldots<x_{im_i}$. The analyzed data are often available in the form of discretized values of functions or curves (e.g., time series, waveforms) and surfaces (e.g., 2D-images, spatio-temporal data).
Let $\mathcal{D} = ((\boldsymbol{x}_1,\boldsymbol{y}_1),\ldots,(\boldsymbol{x}_n,\boldsymbol{y}_n))$ be an observed sample of these functions where each individual curve $(\boldsymbol{x}_i,\boldsymbol{y}_i)$ consists of the $m_i$ responses $\boldsymbol{y}_i = (y_{i1},\ldots,y_{im_i})$ for the predictors $(x_{i1},\ldots,x_{im_i})$.
\subsection{The functional mixture model}
\label{ssec: FunMM}
We now consider the finite mixture modeling framework for analysis of functional data.
\citep{McLachlan2000FMM,TitteringtonBookMixtures,SylviaFruhwirthBook2006}. The finite mixture model decomposes the probability density of the observed data as a convex sum of a finite number of component densities. The mixture model for functional data, which will be referred to hereafter as the ``functional mixture model", whose components are dedicated to functional data modeling and assumes that the observed pairs $(\boldsymbol{x},\boldsymbol{y})$
are generated from $K\in \mathbb{N}$ (possibly unknown) tailored functional probability density components and are governed by a hidden categorical random variable $Z\in [K]=\{1,\ldots,K\}$ that indicates the component from which a particular observed pair is drawn.
Thus, the functional mixture model can be defined by the following parametric density function: %
\begin{eqnarray}
f(\boldsymbol{y}_i|\boldsymbol{x}_i;\boldsymbol{\varPsi}) &=& \sum_{k=1}^K \alpha_k f_k(\boldsymbol{y}_i|\boldsymbol{x}_i; \boldsymbol{\varPsi}_k)
\label{eq:FunMM}
\end{eqnarray}that is parameterized by the parameter vector $\boldsymbol{\varPsi} \in \mathbb{R}^{\nu_{\boldsymbol{\varPsi}}}$ ($\nu_{\boldsymbol{\varPsi}} \in \mathbb{N}$) defined by
\begin{equation}
\boldsymbol{\varPsi} = (\pi_1,\ldots,\pi_{K-1},\boldsymbol{\varPsi}^T_1,\ldots,\boldsymbol{\varPsi}^T_K)^T
\label{eq:parameter vector FunMM}
\end{equation}where the $\alpha_k$s defined by $\alpha_k = \mathbb{P}(Z_i = k)$
are the mixing proportions such that $\alpha_k>0$ for each $k$ and $\sum_{k=1}^K \alpha_k = 1$,
and $\boldsymbol{\varPsi}_k$ ($k=1,\ldots,K$) is the parameter vector of the $k$th component density.
In mixture modeling for FDA, each of the component densities $f_k(\boldsymbol{y}_i|\boldsymbol{x}_i;\boldsymbol{\varPsi}_k)$ which is the short notation of $f(\boldsymbol{y}_i|\boldsymbol{x},Z_i=k;\boldsymbol{\varPsi})$ can be chosen to sufficiently represent the functions for each group $k$, for example tailored regressors explaining the response $\boldsymbol{y}$ by the covariate $\boldsymbol{x}$ and may be the ones of polynomial (B-)spline regression, regression using wavelet bases etc or Gaussian process regressions.
\bigskip
Finite mixture models \citep{McLachlan2000FMM,SylviaFruhwirthBook2006,TitteringtonBookMixtures}, have been thoroughly studied in the multivariate analysis literature.
There has been a strong emphasis on incorporating aspects of functional data analytics into the construction of such models. The resulting models are better able to handle functional data structures and are referred to as functional mixture models.
See for example
\citep{
Gaffney99trajectoryclustering,
garetjamesANDtrevorhastieJRSS2001,
garetjamesJASA2003,
GaffneyThesis,
GaffneyANDsmythNIPS2004,
LiuANDyangFunctionalDataClustering,
chamroukhi_et_al_NN2009,
Chamroukhi-PhD-2010,
chamroukhi_et_al_neurocomp2010,
Chamroukhi-MixRHLP-2011,
Chamroukhi-FMDA-neucomp2013,
Devijver2014-MBC-FDA,
Jacques2014,
Chamroukhi-BSSRM-2015,
Nguyen-MixAR-2016,
Chamroukhi-PWRM-2016,
Nguyen2016MixSSR}.
In the case of model-based curve clustering, there are a variety of modelling approaches; for example: the regression mixture approaches \citep{Gaffney99trajectoryclustering, GaffneyThesis}, including polynomial regression and spline regression, or random effects polynomial regression as in \cite{GaffneyANDsmythNIPS2004} or (B-)spline regression as in \cite{LiuANDyangFunctionalDataClustering}.
When clustering sparsely sampled curves, one may use the mixture approach based on
splines as in \cite{garetjamesJASA2003}.
In \cite{Devijver2014-MBC-FDA} and \cite{Giacofci2012}, the clustering is performed by filtering the data via a wavelet basis instead of a (B-)spline basis.
Another alternative, which concerns mixture-model based clustering of multivariate functional data, is that in which the clustering is performed in the space of reduced functional principal components \citep{Jacques2014}.
Other alternatives are the K-means based clustering for functional data by using B-spline bases \citep{Abraham2003} or wavelet bases as in \cite{Antoniadis2013}.
ARMA mixtures have also been considered in \cite{XiongY04} for time series clustering.
Beyond these (semi-)parametric approaches, one can also cite non-parametric statistical methods \citep{Ferraty2003} %
using kernel density estimators \citep{Delaigle2012}, or those using mixture of Gaussian processes regression
\citep{ShiMT05-Hierarchical-GPR,ShiW08,ShiGPR_Book2011}
or those using hierarchical Gaussian process mixtures for regression \citep{ShiGPR_Book2011, ShiMT05-Hierarchical-GPR}.
In functional data discrimination,
the generative approaches for functional data related to this work are essentially based on functional linear discriminant analysis using splines, including B-splines as in \cite{garetjamesANDtrevorhastieJRSS2001},
or are based on mixture discriminant analysis \citep{hastieANDtibshiraniMDA} in the context of functional data by relying on B-spline bases as in \cite{Gui-FMDA}. \cite{Delaigle2012} have also addressed the functional data discrimination problem from an non-parametric prospective using a kernel based method.
\subsection{Maximum likelihood estimation framework via the EM algorithm}
\label{ssec: EM-FunMM}
The parameter vector $\boldsymbol{\varPsi}$ of the FunMM (\ref{eq:FunMM}) can be estimated by maximizing the observed data log-likelihood
thanks to the desirable asymptotic properties of the maximum likelihood estimator (MLE), and to the effectiveness of the available algorithmic tools to compute such estimators, in particular the EM algorithm.
Given an i.i.d sample of $n$ observed functions $\mathcal{D} = ((\boldsymbol{x}_1,\boldsymbol{y}_1),\ldots,(\boldsymbol{x}_n, \boldsymbol{y}_n))$, the log-likelihood of $\boldsymbol{\varPsi}$ given the observed data $\mathcal{D}$ is given by:
\begin{equation}
\log L(\boldsymbol{\varPsi}) = \sum_{i=1}^{n}\log \sum_{k=1}^{K} \alpha_k f_k(\boldsymbol{y}_{i}|\boldsymbol{x}_i;\boldsymbol{\varPsi}_{k}).
\label{eq:log-lik FunMM}
\end{equation}The maximization of this log-likelihood can not be performed in a closed form.
By using the EM algorithm, we can obtain a consistent root of (\ref{eq:log-lik FunMM}).
The EM algorithm \citep{dlr,McLachlanEM2008} or its extensions, have many good desirable properties including stability and convergence guarantees (see \citep{dlr,McLachlanEM2008} for more details), can be used to iteratively maximize the log-likelihood function.
The EM algorithm for maximization of (\ref{eq:log-lik FunMM}) firstly requires the construction of the complete data log-likelihood
\begin{equation}
\log L_c(\boldsymbol{\varPsi}) = \sum_{i=1}^{n}\sum_{k=1}^{K} Z_{ik} \log \left[\alpha_k f_k(\boldsymbol{y}_{i}|\boldsymbol{x}_i;\boldsymbol{\varPsi}_{k})\right]
\label{eq:complete log-lik FunMM}
\end{equation}where $Z_{ik}$ is an indicator binary-valued variable such that $Z_{ik}=1$ if $Z_i=k$ (i.e., if the $i$th curve $(\boldsymbol{x}_i,\boldsymbol{y}_i)$ is generated from the $k$th mixture component) and $Z_{ik}=0$ otherwise.
Thus, the EM algorithm for the FunMM in its general form runs as follows. After starting with an initial solution $\boldsymbol{\varPsi}^{(0)}$, the EM algorithm for the functional mixture model alternates between the two following steps until convergence (e.g., when there is no longer a significant change in the relative variation of the log-likelihood).
\paragraph{E-step}
\label{ssec: E-step EM-FunMM} This step computes the expectation of the complete-data log-likelihood (\ref{eq:complete log-lik FunMM}), given the observed data $\mathcal{D}$ and a current parameter vector $\boldsymbol{\varPsi}^{(q)}$:
\begin{eqnarray}
Q(\boldsymbol{\varPsi};\boldsymbol{\varPsi}^{(q)}) = \mathbb{E}\left[\log L_c(\boldsymbol{\varPsi})|\mathcal{D};\boldsymbol{\varPsi}^{(q)}\right]
= \sum_{i=1}^{n}\sum_{k=1}^{K}\tau_{ik}^{(q)} \log \left[\alpha_k f_k(\boldsymbol{y}_{i}|\boldsymbol{x}_i;\boldsymbol{\varPsi}_{k})\right]
\label{eq:Q-function FunMM}
\end{eqnarray}where
{\small\begin{equation}
\tau_{ik}^{(q)}= \mathbb{P}(Z_i=k|\boldsymbol{y}_{i},\boldsymbol{x}_i;\boldsymbol{\varPsi}^{(q)}) = \frac{\alpha_k^{(q)} f_k(\boldsymbol{y}_{i}|\boldsymbol{x}_i;\boldsymbol{\varPsi}^{(q)}_{k})}{f(\boldsymbol{y}_{i}|\boldsymbol{x}_i;\boldsymbol{\varPsi}^{(q)})}
\label{eq:FunMM post prob}
\end{equation}}is the posterior probability that the curve $(\boldsymbol{x}_i,\boldsymbol{y}_i)$ is generated by the $k$th cluster. This step therefore only requires the computation of the posterior component memberships $\tau^{(q)}_{ik}$ $(i=1,\ldots,n)$ for each of the $K$ components.
\paragraph{M-step}
\label{ssec: M-step EM-MixReg}
This step updates the value of the parameter vector $\boldsymbol{\varPsi}$ by maximizing the $Q$-function (\ref{eq:Q-function FunMM}) with respect to $\boldsymbol{\varPsi}$, that is by computing the parameter vector update
\begin{equation}
\boldsymbol{\varPsi}^{(q+1)} = \arg \max_{\boldsymbol{\varPsi}} Q(\boldsymbol{\varPsi};\boldsymbol{\varPsi}^{(q)}).
\label{eq:parameter update EM-FunMM}
\end{equation}
The updates of the mixing proportions correspond to those of the standard mixture model given by:
\begin{equation}
\alpha_{k}^{(q+1)} = \frac{1}{n}\sum_{i=1}^n \tau_{ik}^{(q)}
\label{eq:EM-FunMM pi_k update}
\end{equation}while the mixture components parameters' updates $(\boldsymbol{\varPsi}_{k})$ depend on the chosen functional mixture compnents $f_k(\boldsymbol{y}_{i}|\boldsymbol{x}_i;\boldsymbol{\varPsi}_k)$. %
The EM algorithm always monotonically increases the log-likelihood \citep{dlr,McLachlanEM2008}. The sequence of parameter estimates generated by the EM algorithm converges toward a local maximum of the log-likelihood function \citep{Wu-convergence-EM}.
The EM algorithm has a number of advantages, including its numerical stability, simplicity of implementation and reliable convergence. In addition, by using adapted initialization, one may attempt to globally maximize the log-likelihood function. In general, both the E- and M-steps have simple forms when the complete-data probability density function is from the exponential family \citep{McLachlanEM2008}.
Some of the drawbacks of the EM algorithm are that it is sometimes slow to converge; and in some problems, the E- or M-step may be analytically intractable. Fortunately, there exists extensions of the EM framework that can tackle these problems \citep{McLachlanEM2008}.
\subsection{Model-based functional data clustering}
Once the model parameters have been estimated, a soft partition of the data into $K$ clusters, represented by the estimated posterior probabilities $\widehat \tau_{ik} = \mathbb{P}(Z_i=k|\boldsymbol{x}_i,\boldsymbol{y}_i;\widehat\boldsymbol{\varPsi})$, is obtained. A hard partition can also be computed according to the Bayes' optimal allocation rule, that is, by assigning each curve to the component having the
highest estimated a posteriori probability $\tau_{ik}$ defined by (\ref{eq:FunMM post prob}), given the MLE $\hat{\boldsymbol{\varPsi}}$ of $\boldsymbol{\varPsi}$, that is:
\begin{equation}
\widehat{z}_i = \arg \max_{1\leq k \leq K} \tau_{ik}(\widehat{\boldsymbol{\varPsi}}), \quad (i=1,\ldots,n)
\label{eq:MAP rule FunMM}
\end{equation}where $\widehat{z}_i$ denotes the estimated cluster label for the $i$th curve.
\subsection{Model-based functional data classification}
\label{sec:FDClass-FunMM}
In cluster analysis of functional data the aim was to explore a functional data set to automatically determine groupings of individual curves where the potential group labels are unknown.
In Functional Data Discriminant Analysis (FDDA), i.e., functional data classification, the problem is the one of predicting the group label $C_i\in [G]=\{1,\ldots,G \}$ ($G \in \mathbb{N}$) of new observed unlabeled individual $(\boldsymbol{x}_i,\boldsymbol{y}_i)$ describing a function, based on a training set of labeled individuals :
$\mathcal{D}=((\boldsymbol{x}_1,\boldsymbol{y}_1,c_1),\ldots,(\boldsymbol{x}_n,\boldsymbol{y}_n,c_n))$ where $c_i \in [G]$ denotes the class label of the $i$th individual.
Based on a probabilistic model, like in model-based clustering approach described previously, it is easy to derive a model-based discriminant analysis. In model-based discriminant analysis method, the discrimination task consists of estimating the class-conditional density $f(\boldsymbol{y}_i|C_i,\boldsymbol{x}_i;\boldsymbol{\varPsi}_g)$ and the prior class probabilities $\mathbb{P}(C_i)$ from the training set, and predicting the class label $\widehat{c}_i$ for new data $(\boldsymbol{x}_i,\boldsymbol{y}_i)$ by using the following Bayes' optimal allocation rule:
\begin{equation}
\widehat{c}_i=\arg \max_{1\leq g\leq G} \mathbb{P}(C_i=g|\boldsymbol{x}_i,\boldsymbol{y}_i;\boldsymbol{\varPsi})
\label{eq:MAP rule for FDA classification}
\end{equation}where the posterior class probabilities are defined by
\begin{equation}
\mathbb{P}(C_i=g|\boldsymbol{x}_i,\boldsymbol{y}_i;\boldsymbol{\varPsi})= \frac{w_g f_g(\boldsymbol{y}_i|\boldsymbol{x}_i;\boldsymbol{\varPsi}_g)}{\sum_{g'=1}^{G}w_{g'}f_{g'}(\boldsymbol{y}_i|\boldsymbol{x}_i;\boldsymbol{\varPsi}_{g'})} ,
\end{equation}where $w_g = \mathbb{P}(C_i=g)$ is the proportion of class $g$ in the training set and $\boldsymbol{\varPsi}_g$ the parameter vector of the conditional density denoted by $f_g(\boldsymbol{y}_i|\boldsymbol{x}_i;\boldsymbol{\varPsi}_{g}) = f(\boldsymbol{y}_i|\boldsymbol{x}_i,C_i=g;\boldsymbol{\varPsi})$, which accounts for the functional aspect of the data.
\\
Functional linear discriminant analysis (FLDA) \cite{garetjamesANDtrevorhastieJRSS2001,chamroukhi_et_al_neurocomp2010}, analogous to the well-known linear Gaussian discriminant analysis, arises when we model each class-conditional density with a single component model (i.e. when $G=1$), for example a polynomial, spline or a B-spline regression model, or a regression model with a hidden logistic process (RHLP) in the case of cuves with regime changes.
FLDA approaches are more adapted to homogeneous classes of curves and are not suitable to deal with heterogeneous classes, that is, when each class is itself composed of several sub-populations of functions.
The more flexible approach in such a case is to rely on the idea of mixture discriminant analysis (MDA) as introduced by \cite{hastieANDtibshiraniMDA} for multivariate data discrimination.
An initial construction of functional mixture discriminant analysis, motivated by the complexity of the time course gene expression functional data, was proposed by \cite{Gui-FMDA} and is based on B-spline regression mixtures.
However, the use of polynomial or spline regressions for class representation, as studied for example in \cite{chamroukhi_et_al_neurocomp2010}, may be more suitable for different types of curves. In case of curves exhibiting a dynamical behavior through regime changes, one may utilize functional mixture discriminant analysis (FMDA) with hidden logistic process regression \citep{Chamroukhi-FMDA-neucomp2013,Chamroukhi-IJCNN-2012}, in which the class-conditional density for a function is given by a hidden process regression model \citep{Chamroukhi-FMDA-neucomp2013,Chamroukhi-IJCNN-2012}.
\subsection{Choosing the number of clusters: model selection}
\label{ssec: model selection}
The problem of choosing the number of clusters can be seen as a model selection problem. The model selection task consists of choosing a suitable compromise between flexibility so that a reasonable fit to the available data is obtained, and over-fitting. This can be achieved by using a criterion that represents this compromise. In general, we choose an overall score function that is explicitly composed of two terms: a term that measures the goodness of fit of the model to the data, and a penalization term that governs the model complexity.
In this maximum likelihood estimation framework of parametric probabilistic models, the goodness of fit of a model $\mathcal{M}$ to the data can be measured through the log-likelihood $\log L(\boldsymbol{\varPsi}_\mathcal{M})$, while the model complexity can be measured via the number of free parameters $\nu_\mathcal{M}$. This yields an overall score function of the form
\begin{equation*}
\text{Score}(\mathcal{M}) = \log L(\boldsymbol{\varPsi}_\mathcal{M}) - \text{Penalty}(\nu_\mathcal{M})
\label{eq:model selection score}
\end{equation*}to be maximized over the set of model candidates.
The Bayesian Information Criterion (BIC) \citep{BIC} and the Akaike Information Criterion (AIC) \citep{AIC} are the most commonly used criteria for model selection in probabilistic modeling.
The criteria have the respective forms $\text{BIC}(\mathcal{M}) = \log L(\boldsymbol{\varPsi}_\mathcal{M}) - \nu_{\mathcal{M}} \log(n)/2$ and $\text{AIC}(\mathcal{M}) = \log L(\boldsymbol{\varPsi}_\mathcal{M}) - \nu_{\mathcal{M}}$. The log-likelihood is defined by (\ref{eq:log-lik FunMM}) and the $\nu_\mathcal{M}$ is given by the dimension of (\ref{eq:parameter vector FunMM}).
\section{Regression mixtures for functional data clustering}
\label{sec:MixReg}
\subsection{The model}
The finite regression mixture model \citep{Quandt1972, QuandtANDRamsey1978, DeVeaux1989, JonesANDMcLachlan1992, Gaffney99trajectoryclustering, VieleANDTong2002, FariaANDSoromenho2010, Chamroukhi-PhD-2010, YoungANDHunter, HunterANDYoung}
provides a way to model data arising from a number of unknown classes of conditional relationships.
A common way to model conditional dependence in observed data is to use regression.
The response for the $i$th individual $Y_i$, given the mixture component (treated as cluster here) $k$, is modeled as
a regression function corrupted by some noise, typically an i.i.d standard zero-mean unit-variance Gaussian noise and denoted as $E_{i}$:
\begin{equation}
Y_{i}(x) = \boldsymbol{\beta}^T_k \mathbf{x}_i + \sigma_k E_{i}(x),
\label{eq:regression model}
\end{equation}where $\boldsymbol{\beta}_k \in \mathbb{R}^p$ is the usual unknown regression coefficients vector describing the sub-population mean of cluster $Z_i=k$,
$\mathbf{x}_i \in \mathbb{R}^p$ is some independent vector of predictors constructed from $x$, and $\sigma_k >0$ corresponds to the standard deviation of the noise.
The regression matrix construction depends on the chosen type of regression, for example: it may be Vandermonde for a polynomial regression (i.e., $\mathbf{x}_i(x) = (1,x_{ij},x_{ij}^2,\ldots,x_{ij}^{d})^T$) or a spline regression matrix for splines \citep{deboor1978,ruppert_etal_semiparametricregression}.
Then, the observations $\boldsymbol{y}_i$ given the regression predictors $\boldsymbol{x}_i$ are distributed according to the normal regression model:
\begin{eqnarray}
f_k(\boldsymbol{y}_i|\boldsymbol{x}_i;\boldsymbol{\varPsi}_k)
= \mathcal{N} (\boldsymbol{y}_{i};\mathbf{X}_i \boldsymbol{\beta}_k, \sigma_k^2\textbf{I}_{m_i}),
\label{eq:regression dist of y}
\end{eqnarray}where the unknown parameter vector of this component-specific density is given by $\boldsymbol{\varPsi}_k=(\boldsymbol{\beta}^T_{k}, \sigma_{k}^2)^T$ which is composed of the regression coefficients vector and the noise variance, and $\mathbf{X}_i=(\mathbf{x}_{i1},\mathbf{x}_{i2},\ldots,\mathbf{x}_{im_i})^T$ is an $m_i \times p$ known regression design matrix with $\textbf{I}_{m_i}$ denotes the $m_i \times m_i$ identity matrix.
To deal with functional data arising from a finite number of groups, the regression mixture model assumes that each mixture component $k$ is a conditional component density $f_k \big(\boldsymbol{y}_i|\boldsymbol{x}_i;\boldsymbol{\varPsi}_k \big)$ of a regression model with parameters $\boldsymbol{\varPsi}_k$ of the the form (\ref{eq:regression dist of y}).
This includes polynomial, spline, and B-spline regression mixtures, see for example \cite{Chamroukhi-RobustEMMixReg2016,DeSarboAndCron1988, JonesANDMcLachlan1992, GaffneyThesis}.
These models are considered here and the Gaussian regression mixture is defined by the following conditional mixture density:
{\small\begin{eqnarray}
f(\boldsymbol{y}_i|\boldsymbol{x}_i;\boldsymbol{\varPsi}) &= &\sum_{k=1}^K \alpha_k \ \mathcal{N} (\boldsymbol{y}_{i};\mathbf{X}_i \boldsymbol{\beta}_k,\sigma_k^2\textbf{I}_{m_i}).
\label{eq:MixReg}
\end{eqnarray}}The regression mixture model parameter vector is given by $\boldsymbol{\varPsi} = (\alpha_1,\ldots,\alpha_{K-1},\boldsymbol{\varPsi}^T_1,\ldots,\boldsymbol{\varPsi}^T_K)^T$.
The use of regression mixtures for density estimation as well as for cluster and discriminant analyses, requires the estimation the mixture parameters.
The problem of fitting regression mixture models is a widely studied problem in statistics and machine learning, particularly for cluster analysis. It is usually performed by maximizing the log-likelihood
\begin{equation}
\log L(\boldsymbol{\varPsi}) =
\sum_{i=1}^n \log \sum_{k=1}^K \alpha_k \ \mathcal{N} (\boldsymbol{y}_{i};\mathbf{X}_i \boldsymbol{\beta}_k,\sigma_k^2\textbf{I}_{m_i})
\label{eq:log-lik PRM}
\end{equation}by using the EM algorithm \citep{JonesANDMcLachlan1992,dlr, Gaffney99trajectoryclustering,GaffneyThesis,McLachlanEM2008,Chamroukhi-RobustEMMixReg2016}.
\subsection{Maximum likelihood estimation via the EM algorithm}
\label{ssec: EM-MixReg}
The log-likelihood (\ref{eq:log-lik PRM}) is iteratively maximized by using the EM algorithm.
After starting with an initial solution $\boldsymbol{\varPsi}^{(0)}$,
the EM algorithm for the functional regression mixture model alternates between the two following steps until convergence.
\paragraph{E-step}
\label{ssec: E-step EM-MixReg}
This step computes
constructs the expected complete-data log-likelihood function
\begin{eqnarray}
Q(\boldsymbol{\varPsi};\boldsymbol{\varPsi}^{(q)}) = \sum_{i=1}^{n}\sum_{k=1}^{K}\tau_{ik}^{(q)} \log \big[\alpha_k \, \mathcal{N} (\boldsymbol{y}_i;\mathbf{X}_i \boldsymbol{\beta}_{k},\sigma^2_{k}\textbf{I}_{m_i})\big],
\label{eq:Q-function MixReg}
\end{eqnarray}which only requires computing the posterior component memberships $\tau^{(q)}_{ik}$ $(i=1,\ldots,n)$ for each of the $K$ components, that is, the posterior probability that the curve $(\boldsymbol{x}_i,\boldsymbol{y}_i)$ is generated by the $k$th cluster, as defined in (\ref{eq:FunMM post prob}):
\begin{equation}
\tau_{ik}^{(q)} = \alpha_k^{(q)} \mathcal{N}\big(\boldsymbol{y}_i;\mathbf{X}_i \boldsymbol{\beta}^{T(q)}_{k},\sigma^{2(q)}_{k}\textbf{I}_{m_i}\big) / \sum_{h=1}^K \alpha_{h}^{(q)} \mathcal{N}(\boldsymbol{y}_i;\mathbf{X}_i \boldsymbol{\beta}^{(q)}_{h},\sigma^{2(q)}_{h}\textbf{I}_{m_i}).
\label{eq:MixReg post prob}
\end{equation
\paragraph{M-step}
\label{ssec: M-step EM-MixReg}
This step updates the value of the parameter vector $\boldsymbol{\varPsi}$ by maximizing (\ref{eq:Q-function MixReg}) with respect to $\boldsymbol{\varPsi}$, that is by computing the parameter vector update
$\boldsymbol{\varPsi}^{(q+1)}$ given by (\ref{eq:parameter update EM-FunMM}).
The mixing proportions updates are given by (\ref{eq:EM-FunMM pi_k update}).
Then, the regression parameters are updated by maximising (\ref{eq:Q-function MixReg}) with respect to $(\boldsymbol{\beta}_{k},\sigma^2_{k})$. This corresponds to analytically solving $K$ weighted least-squares problems where the weights are the posterior probabilities $\tau_{ik}^{(q)}$ and the updates are given by:
{\small\begin{eqnarray}
\boldsymbol{\beta}_k^{(q+1)} &=& \Big[\sum_{i=1}^{n}\tau^{(q)}_{ik} \mathbf{X}^T_i\mathbf{X}_i \Big]^{-1} \sum_{i=1}^{n}\tau^{(q)}_{ik} \mathbf{X}_i^T \boldsymbol{y}_i,
\label{eq:EM-MixReg beta_k update}\\
\sigma_k^{2(q+1)} &=& \frac{1}{\sum_{i=1}^{n}\tau^{(q)}_{ik} m_i} \sum_{i=1}^{n}\tau^{(q)}_{ik} \parallel \boldsymbol{y}_i - \mathbf{X}_i\boldsymbol{\beta}^{(q+1)}_k\parallel^2.
\label{eq:EM-MixReg sigma_k update}
\end{eqnarray}}Then, once the model parameters have been estimated, a soft partition of the data into $K$ clusters, represented by the estimated posterior cluster probabilities $\hat \tau_{ik}$, is obtained. A hard partition can also be computed according to the Bayes' optimal allocation rule (\ref{eq:MAP rule FunMM}).
Selecting the number of mixture components can be addressed by using some model selection criteria (e.g. AIC or BIC as discussed in section \ref{ssec: model selection}, to choose one model from a set of pre-estimated candidate models.
In the next section, we revisit these functional mixture models and their estimation from another prospective by considering regularized MLE rather than standard MLE. This particularly attempts to address the issue of MLE via the EM algorithm which requires careful initialization, and allows for model selection via regularization.
Indeed, it is well-known that care is required when initializing any EM algorithm.
The EM algorithm also requires the number of mixture component to be given a priori. The problem of selecting the number of mixture components in this case can be addressed by using some model selection criteria (e.g. AIC or BIC as discussed previously) to choose one from a set of pre-estimated candidate models.
Here we propose a penalized MLE approach carried out via a robust EM-like algorithm which simultaneously infers the model parameters, the model structure and the partition \citep{Chamroukhi-RobustEMMixReg2016,Chamroukhi-IJCNN-2013}, and in which the initialization is simple. This is a fully-unsupervised algorithm for fitting regression mixtures.
\subsection{Regularized regression mixtures for functional data
\label{sec: proposed robust EM-Mix-Reg}
It is well-known that care is required when initializing any EM algorithm. If the initialization is not carefully performed, then the EM algorithm may lead to unsatisfactory results. See for example \cite{biernacki_etal_startingEM_CSDA03, Reddy:2008, Robust-EM-GMM} for discussions. Thus, fitting regression mixture models with the standard EM algorithm may yield poor estimations if the model parameters are not initialized properly. EM algorithm initialization in general can be performed via random partitioning of the data, or by computing a partition from another clustering algorithm such as $K$-means, Classification EM (CEM) \citep{McLachlanCEM1982,celeux_et_diebolt_SEM_85}, Stochastic EM \citep{celeuxetgovaert92-CEM}, etc, or by initializing the EM algorithm with a number of iterations of the EM algorithm, itself.
Several approaches have been proposed in the literature in order to overcome the initialization problem, and to make the EM algorithm for Gaussian mixture models robust with regard initialization, see for example \cite{biernacki_etal_startingEM_CSDA03, Reddy:2008, Robust-EM-GMM}. Further details about choosing starting values for the EM algorithm for Gaussian mixtures can be found in \cite{biernacki_etal_startingEM_CSDA03}.
In addition to sensitivity regarding the initialization, the EM algorithm requires the number of mixture components (clusters in a clustering context) to be known. While the number of components can be chosen by some model selection criteria such as the BIC, the AIC, or the Integrated Classification Likelihood (ICL) criterion \citep{ICL}, or resampling methods such as bootstrapping \citep{McLachlan1987}, this requires performing a post-estimation model selection procedure, to choose among a set of pre-estimated candidate models.
Some authors have considered alternative approaches in order to estimate the unknown number of mixture components in Gaussian mixture models, for example by an adapted EM algorithm such as in \cite{FigueiredoUnsupervisedlearningMixtures} and \cite{Robust-EM-GMM} or from a Bayesian prospective \citep{RichardsonANDGreen97} by reversible jump MCMC.
However, in general, these two issues have been considered separately. Among the approaches that consider the problem of robustness with regard to initial values and the one of estimating the number of mixture components, in the same algorithm, there is the EM algorithm proposed by \cite{FigueiredoUnsupervisedlearningMixtures}. The aforementioned EM algorithm is capable of selecting the number of components and attempts reduce the sensitivity with regard to initial values by optimizing a minimum message length (MML) criterion, which is a penalized log-likelihood. It starts by fitting a mixture model with a large number of clusters and discards invalid clusters as the learning proceeds. The degree of validity of each cluster is measured through the penalization term, which includes the mixing proportions, to deduce whether if the cluster is small or not to be discarded, and therefore to reduce the number of clusters.
More recently, in \cite{Robust-EM-GMM}, the authors developed a robust EM-like algorithm for model-based clustering of multivariate data using Gaussian mixture models that simultaneously addresses the problem of initialization and the one of estimation of the number of mixture components. That algorithm overcomes some initialization drawback of the EM algorithm proposed in \cite{FigueiredoUnsupervisedlearningMixtures}.
As shown in \cite{Robust-EM-GMM}, the problem regarding initialization is more serious for data with a large number of clusters.
However, these presented model-based clustering approaches, including those in \cite{Robust-EM-GMM} and \cite{FigueiredoUnsupervisedlearningMixtures}, are concerned with vector-valued data. When the data are curves or functions, such methods are not appropriate. The functional mixture models of form (\ref{eq:FunMM}), are better able to handle functional data structures.
By using such functional mixture models, we thus can overcome the limitations of the EM algorithm for model-based functional data clustering by regularizing the estimation objective (\ref{eq:log-lik PRM}).
The presented approach as developed in \cite{Chamroukhi-IJCNN-2013,Chamroukhi-RobustEMMixReg2016}, is in the same spirit of the EM-like algorithm presented in \cite{Robust-EM-GMM}, but by extending the idea to the case of functional data (curve) clustering, rather than multivariate data clustering.
This leads to a regularized estimation of the regression mixture models (including splines or B-splines) of form (\ref{eq:MixReg}) and the resulting EM-like algorithm is robust to initialization and automatically estimates the optimal number of clusters as the learning proceeds.
Rather than maximizing the standard log-likelihood (\ref{eq:log-lik PRM}), we proposed a penalized log-likelihood function constructed by penalizing the log-likelihood by a regularization term related to the model complexity, defined by:
\begin{equation}
\mathcal{J}(\lambda,\boldsymbol{\varPsi}) = \log L(\boldsymbol{\varPsi}) - \lambda H(\mathbf{Z}), \quad \lambda \geq 0,
\label{eq:penalized log-lik for MixReg}
\end{equation}where $\log L(\boldsymbol{\varPsi})$ is the log-likelihood maximized by the standard EM algorithm for regression mixtures (see Eq. (\ref{eq:log-lik PRM})), $\lambda \geq 0$ is a parameter that controls the complexity of the fitted model, and $\mathbf{Z} = (Z_1,\ldots,Z_n)$.
%
This penalized log-likelihood function allows to control the complexity of the model fit through the roughness penalty $H(\mathbf{Z})$ accounting for the model complexity.
As the model complexity is related to the number of mixture components and therefore the structure of the hidden variables $Z_i$ (recall that $Z_i $ represents the class label of the $i$th curve), we chose to use the entropy of the hidden variable $Z_i$ as penalty. The framework of selecting the number of mixture components in model-based clustering by using an entropy-based regularization of the log-likelihood is discussed in \cite{baudry2015}.
The penalized log-likelihood criterion is therefore derived as follows.
The (differential) entropy of $Z_i$ is defined by:
$ H(Z_i)
= - \sum_{k=1}^K \mathbb{P}(Z_i=k) \log \mathbb{P}(Z_i=k)
= - \sum_{k=1}^K \alpha_k \log \alpha_k$ and the total entropy for $\mathbf{Z}$ is therefore additive and equates to
{\small\begin{equation}
H(\mathbf{Z}) =- \sum_{i=1}^n\sum_{k=1}^K \alpha_k \log \alpha_k,
\label{eq:entropy of z}
\end{equation}}
The penalized log-likelihood function (\ref{eq:penalized log-lik for MixReg}) allows for simultaneous control of the complexity of the model fit through the roughness penalty $\lambda \, H(\mathbf{Z})$. The entropy term $H(\mathbf{Z})$ measures the complexity of a fitted model for $K$ clusters. When the entropy is large, the fitted model is rougher, and when it is small, the fitted model is smoother. The non-negative smoothing parameter $\lambda$ establishes a trade-off between closeness of fit to the data and the smoothness of fit. As $\lambda$ decreases, the fitted model tends to be less complex, and we get a smoother fit.
The proposed robust EM-like algorithm to maximize the penalized log-likelihood $\mathcal{J}(\lambda, \boldsymbol{\theta})$ for regression mixture density estimation and model-based curve clustering is presented in \cite{Chamroukhi-IJCNN-2013,Chamroukhi-RobustEMMixReg2016}.
The E-step computes the posterior component membership probabilities according to (\ref{eq:MixReg post prob}).
Then, the M-step updates the value of the parameter vector $\boldsymbol{\varPsi}$.
The mixing proportions updates are given by (see for example Appendix B in \cite{Chamroukhi-RobustEMMixReg2016} for more calculation details):
{\small\begin{equation}
\alpha_{k}^{(q+1)} = \frac{1}{n}\sum_{i=1}^n \tau_{ik}^{(q)} + \lambda \alpha_{k}^{(q)}\Big(\log \alpha_{k}^{(q)} - \sum_{h=1}^K\alpha_{h}^{(q)}\log \alpha_{h}^{(q)}\Big)\cdot
\label{eq:Robust EM-MixReg pi_k update}
\end{equation}}
We remark here that the update of the mixing proportions (\ref{eq:Robust EM-MixReg pi_k update}) is close to the standard EM algorithm update for a mixture model (\ref{eq:EM-FunMM pi_k update}) for very small value of $\lambda$. However, for a large value of $\lambda$, the penalization term will play its role in order to make clusters competitive and thus allows for discarding invalid clusters and enhancing actual clusters.
Then, the parameter elements $\boldsymbol{\beta}_{k}$ and $\sigma^2_{k}$ are updated by analytically solving weighted least-squares problems where the weights are the posterior probabilities $\tau_{ik}^{(q)}$ and the updates are given by (\ref{eq:EM-MixReg beta_k update}) and (\ref{eq:EM-MixReg sigma_k update}),
where the posterior probabilities $\tau^{(q)}_{ik}$ are computed using the updated mixing proportions derived in (\ref{eq:Robust EM-MixReg pi_k update}).
The reader is referred to \cite{Chamroukhi-IJCNN-2013,Chamroukhi-RobustEMMixReg2016} for implementation details.
\bigskip
These regression models discussed until now have been constructed by relying of deterministic parameters which account for fixed effects that model the mean behavior of a population of homogeneous curves. However, in some situations, it is necessary to take into account possible random effects governing the inter-individual behavior. This is in general achieved by random effects regression or mixed effects regressions \citep{Nguyen2014MixSSR,Chamroukhi-BSSRM-2015,Nguyen2016MixSSR}, that is, a regression model accounting for fixed effects, to which a random effects component is added. In a model-based clustering context, this is achieved by deriving mixtures of these mixed-effects models, for example the mixture of linear mixed models of \cite{CeleuxMLMM2005}.
Despite the growing investigation for adapting multivariate mixture to the framework of FDA as described before, the most investigated type of data however is univariate or multivariate functions. The problem of learning from spatial functional data, that is, surfaces, is still under studied.
For example, one can cite the following recent approaches on the subject
\citep{Malfait2003,Ramsay2011,Sangalli2013} and in particular, the very recent approaches proposed in \cite{Nguyen2014MixSSR,Chamroukhi-BSSRM-2015,Nguyen2016MixSSR} for clustering and classification of surfaces based on the
regression spatial spline regression as in \cite{Sangalli2013} via mixture of linear mixed-effects model framework of \cite{CeleuxMLMM2005}.
\subsection{Regression mixtures with mixed-effects
\subsubsection{Regression with mixed-effects}
The mixed-effects regression models (see for example \cite{LairdAndWare1982},
\cite{VerbekeAndLesaffre1996} and \cite{XuAndHedeker2001}), are appropriate when the standard regression model (with fixed-effects) can not sufficiently explain the variability in repeated measures data. For example, when representing dependent data arising from related individuals or when data are gathered over time on the same individuals. In such cases, mixed-effects regression models are more appropriate as they include both fixed-effects and random-effects terms. In the linear mixed-effects regression model, considering a matrix notation, the $m_i \times 1$ response $\boldsymbol{Y}_i$ is modeled as:
\begin{equation}
\boldsymbol{Y}_i = \mathbf{X}_i \boldsymbol{\beta} + \mathbf{T}_i \boldsymbol{B}_i+ \boldsymbol{E}_i
\label{eq:mixed-effects regression}
\end{equation}where the $p \times 1$ vector $\boldsymbol{\beta}$ is the usual unknown fixed-effects regression coefficients vector describing the population mean,
$\boldsymbol{B}_i$ is a $q\times 1$ vector of unknown subject-specific regression coefficients corresponding to individual effects, independently and identically distributed (i.i.d) according to the normal distribution $\mathcal{N}(\boldsymbol{\mu}_i,\mathbf{R}_i)$ and independent from the $m_i \times 1$ error terms $\boldsymbol{E}_i$ which are distributed according to $\mathcal{N}(\bO,\boldsymbol{\Sigma}_i)$, and
$\mathbf{X}_i$ and $\mathbf{T}_i$ are respectively $m_i \times p$ and $m_i \times q$ known covariate matrices (it is possible that $\mathbf{X}_i=\mathbf{T}_i$).
A common choice for the noise covariance matrix is the homoskedastic model $\boldsymbol{\Sigma}_i = \sigma^2\textbf{I}_{m_i}$ where $\textbf{I}_{m_i}$ denotes the $m_i \times m_i$ identity matrix.
Thus, under this model, the joint distribution of the observations $\boldsymbol{Y}_i$ and the random effects $\boldsymbol{B}_i$ is the following joint multivariate normal distribution (see for example \cite{XuAndHedeker2001}):
\begin{eqnarray}
\left[\begin{array}{c}
\boldsymbol{Y}_i \\
\boldsymbol{B}_i
\end{array} \right] \sim
\mathcal{N}\left(
\left[\begin{array}{c}
\mathbf{X}_i \boldsymbol{\beta} + \mathbf{T}_i \boldsymbol{\mu}_i \\
\boldsymbol{\mu}_i
\end{array} \right],
\left[\begin{array}{cc}
\sigma^2 \textbf{I}_{m_i} + \mathbf{T}_i \mathbf{R}_{i} \mathbf{T}_i^T & \mathbf{T}_i \mathbf{R}_{i}\\
\mathbf{R}_{i} \mathbf{X}_i^T & \mathbf{R}_{i}
\end{array} \right]
\right).
\label{eq:joint of y and b mixed-effects}
\end{eqnarray}Then, from (\ref{eq:joint of y and b mixed-effects}) it follows that the observations $\boldsymbol{Y}_i$ are marginally distributed according to the following normal distribution (see \cite{VerbekeAndLesaffre1996} and \cite{XuAndHedeker2001}):
\begin{eqnarray}
f(\boldsymbol{y}_i|\mathbf{X}_i,\mathbf{T}_i;\boldsymbol{\varPsi}) = \mathcal{N} (\boldsymbol{y}_{i};\mathbf{X}_i \boldsymbol{\beta} + \mathbf{T}_i \boldsymbol{\mu}_i, \sigma^2\textbf{I}_{m_i} + \mathbf{T}_i \mathbf{R}_i \mathbf{T}_i^T).
\label{eq:marginal of y mixed-effects regression}
\end{eqnarray}
\subsubsection{Mixture of regressions with mixed-effects}
The regression model with mixed-effects (\ref{eq:mixed-effects regression}) can be integrated into a finite mixture framework to deal with regression data arising from a finite number of groups.
The resulting mixture of regressions model with linear mixed-effects \citep{VerbekeAndLesaffre1996,XuAndHedeker2001,CeleuxMLMM2005,NgEtAll2006} is a mixture model where every component $k$ ($k=1,\ldots, K$) is a regression model with mixed-effects given by (\ref{eq:mixed-effects regression}), where $K$ is the number of mixture components. Thus, the observation $\boldsymbol{Y}_i$, conditioned on each component $k$, is modeled as:
\begin{equation}
\boldsymbol{Y}_{i} = \mathbf{X}_i \boldsymbol{\beta}_k + \mathbf{T}_i \boldsymbol{B}_{ik} + \boldsymbol{E}_{ik},
\label{eq:mixture of regressions with mixed-effects}
\end{equation}
where $\boldsymbol{\beta}_k$, $\boldsymbol{B}_{ik}$ and $\boldsymbol{E}_ {ik}$ are respectively the fixed-effects regression coefficients,
the random-effects regression coefficients for individual $i$,
and the error terms, for component $k$.
The random-effect coefficients $\boldsymbol{B}_{ik}$
are i.i.d according to $\mathcal{N}(\boldsymbol{\mu}_{ki},\mathbf{R}_{ki})$ and are independent from the error terms $\boldsymbol{E}_{ik}$ which follow the distribution $\mathcal{N}(\bO,\sigma_k^2\textbf{I}_{m_i})$.
Thus, conditional on the component $Z_i =k$, the observation $\boldsymbol{Y}_i$ and the random effects $\boldsymbol{B}_i$
given the predictors have the following joint multivariate normal distribution:
\begin{eqnarray}
\left[\begin{array}{c}
\boldsymbol{Y}_i \\
\boldsymbol{B}_i
\end{array} \right]\Bigg|_{Z_i =k} \sim
\mathcal{N}\left(
\left[\begin{array}{c}
\mathbf{X}_i \boldsymbol{\beta} + \mathbf{T}_i \boldsymbol{\mu}_k \\
\boldsymbol{\mu}_k
\end{array} \right],
\left[\begin{array}{cc}
\sigma_{k}^2 \textbf{I}_{m_i} + \mathbf{T}_i \mathbf{R}_{ki} \mathbf{T}_i^T & \mathbf{T}_i \mathbf{R}_{ki}\\
\mathbf{R}_{ki} \mathbf{X}_i^T & \mathbf{R}_{ki}
\end{array} \right]
\right)
\label{eq:joint of y and b mixture of mixed-effects}
\end{eqnarray}and thus the observations $\boldsymbol{Y}_i$ are marginally distributed according to the following normal distribution:
\begin{eqnarray}
f(\boldsymbol{y}_i|\mathbf{X}_i,\mathbf{T}_i, Z_i = k;\boldsymbol{\varPsi}_k) = \mathcal{N} (\boldsymbol{y}_{i};\mathbf{X}_i \boldsymbol{\beta}_k + \mathbf{T}_i \boldsymbol{\mu}_{ki}, \mathbf{T}_i \mathbf{R}_{ki} \mathbf{T}_i^T + \sigma_k^2\textbf{I}_{m_i}).
\label{eq:marginal of y mixed-effects regression}
\end{eqnarray}The unknown parameter vector of (\ref{eq:marginal of y mixed-effects regression}) is given by:
\linebreak $\boldsymbol{\varPsi}_k=(\boldsymbol{\beta}^T_{k}, \sigma_{k}^2, \boldsymbol{\mu}^T_{k1},\ldots,\boldsymbol{\mu}^T_{kn}, \text{vech}(\mathbf{R}_{k1})^T,\ldots, \text{vech}(\mathbf{R}_{kn})^T)^T$.
Thus, the marginal distribution of $\boldsymbol{Y}_i$, unconditional on component memberships, is given by the following spatial spline regression mixture model with mixed effects (SSRM) defined by:
\begin{equation}
f(\boldsymbol{y}_i|\mathbf{X}_i,\mathbf{T}_i;\boldsymbol{\varPsi}) = \sum_{k=1}^K \alpha_k \, \mathcal{N} (\boldsymbol{y}_{i};\mathbf{X}_i \boldsymbol{\beta}_k + \mathbf{T}_i \boldsymbol{\mu}_{ki}, \mathbf{T}_i \mathbf{R}_{ki} \mathbf{T}_i^T + \sigma_k^2\textbf{I}_{m_i})
\label{eq:density of mixture of regressions with mixed-effets (MRMM)}.
\end{equation}
\subsubsection{Model inference}
The unknown mixture model parameter vector
$\boldsymbol{\varPsi} = (\alpha_1,\ldots,\alpha_{K-1},\boldsymbol{\varPsi}^T_1,\ldots,\boldsymbol{\varPsi}^T_K)^T$ is estimated by maximizing the log-likelihood
\begin{equation}
\log L(\boldsymbol{\varPsi}) = \sum_{i=1}^n \log \sum_{k=1}^K \alpha_k \, \mathcal{N} (\boldsymbol{y}_{i};\mathbf{X}_i \boldsymbol{\beta}_k + \mathbf{T}_i \boldsymbol{\mu}_{ki}, \mathbf{T}_i \mathbf{R}_{ki} \mathbf{T}_i^T + \sigma_k^2\textbf{I}_{m_i})
\label{eq:log-lik MRMM}
\end{equation}via the usual EM algorithm as in \cite{VerbekeAndLesaffre1996,XuAndHedeker2001,CeleuxMLMM2005,NgEtAll2006,Nguyen2014MixSSR,Nguyen2016MixSSR} or by the common Bayesian inference alternative, that is, the maximum a posteriori (MAP) estimation \cite{Chamroukhi-BSSRM-2015} which is promoted to avoid singularities and degeneracies of the MLE as highlighted namely in \cite{Stephens-thesis-97,snoussi-djafari-penalized-likelihood2001, snoussi-djafari-degeneracy2005,FraleyAndRaftery-2005} and \cite{FraleyAndRaftery-2007} by regularizing the likelihood through a prior distribution over the model parameter space. The MAP estimator is in general constructed by using Markov Chain Monte Carlo (MCMC) sampling, such as the Gibbs sampler (e.g., see \cite{Neal93-MCMC,rafterygibbs,Bensmail-model-based-clust97,Marin2005Bayes-modeling-inference-mixtures,Robert2011}).
For the Bayesian analysis of regression data, \cite{LenkANDDeSarbo2000} introduced a Bayesian inference for finite mixtures of generalized linear models with random effects. In their mixture model, each component is a regression model with a random-effects component constructed for the analysis of multivariate regression data.
The EM algorithm for MLE can be found in \cite{Nguyen2014MixSSR,Nguyen2016MixSSR} and the Bayesian inference technique using Gibbs sampling can be found in \cite{Chamroukhi-BSSRM-2015}.
\subsection{Choosing the order of regression and spline knots number and locations}
In polynomial regression mixtures, the order of regression can be chosen by cross-validation techniques as in \cite{GaffneyThesis}.
However, in some situations, the polynomial regression mixture (PRM) model may be too simple to capture the full structure of the data, in particular for curves with high non-linearity or with regime changes, even if the PRM can provide a useful first-order approximation of the data structure. (B-)spline regression models can provide a more flexible alternative.
In such models, one may need to choose the spline order as well as the number of knots and their locations. The most widely used orders are $M$ = 1, 2, and 4 \citep{hastieTibshiraniFreidman_book_2009}. For smooth function approximation, cubic (B-)splines, which correspond to an order of $4$, are sufficient to approximate smooth functions.
When the data contain irregularities, such as non smooth piecewise functions, a linear spline (of order 2) is more adapted.
The order $1$ can be chosen for piecewise constant data.
Concerning the choice of the number of knots and their locations, a common choice is to place knots uniformly over the domain of $x$. In general more knots are needed for functions with high variability or regime changes.
One can also use automatic techniques for the selection of the number of knots and their locations, such as the method that is reported in \cite{GaffneyThesis}.
In \cite{KooperbergANDStone1991}, the knots are placed at selected order statistics of the sample data and the number of knots is determined by minimizing a variant of the AIC.
The general goal is to use a sufficient number of knots to fit the data while at the same time to avoid over-fitting and to not make the computation demand excessive.
The presented algorithm can be easily extended to handle this type of automatic selection of spline knots placement, but as the unsupervised clustering problem itself requires much attention and is difficult, it is wiser to fix the number and location of knots prior to analysis of the data. In our analyses, knot sequences are uniformly placed over the domain of $x$. The studied problems insensitive to the number and location of knots.
\subsection{Experiments}
\label{sec:RobustEm-MixReg Experiments}
The proposed unsupervised algorithm for fitting regression mixtures was evaluated in \cite{Chamroukhi-RobustEMMixReg2016,Chamroukhi-IJCNN-2013} for the three regression mixture models, that is, polynomial, spline, and B-spline regression mixtures, respectively abbreviated as PRM, SRM, and bSRM. We performed experiments on several simulated data sets, the Breiman wavefrom Benchmark \citep{Breiman1984} and three real-world data sets covering three different application area: phoneme recognition in speech recognition, clustering gene expression time course data for bio-informatics, and clustering radar waveform data.
The evaluation is performed in terms of estimating the actual partition by considering the estimated number of clusters and the clustering accuracy when the true partition is known. In such case, since the context is unsupervised, we compute the misclassification error rate by comparing the true labels to each of the $K!$ permutations of the obtained labels, and by retaining the permutation corresponding to the minimum error.
Here we illustrate the algorithm for clustering some simulated and real data sets.
\subsubsection{Simulations
We consider the waveform curves of \cite{Breiman1984} that has also been studied in \cite{hastieANDtibshiraniMDA} and elsewhere. The waveform data is a three-class problem where each curve is generated as follows:
$Y_i(t)=uh_k(t) + (1-u)h_k(t) + E_i(t)$ for class $k$
where $u$ is a uniform random variable on $(0,1)$, $h_1(t)=\max (6-|t-11|,0)$; $h_2(t)=h_1(t-4)$; $h_3(t)=h_1(t+4)$
and $E_i(t)$ is a zero-mean unit-variance Gaussian noise variable. The temporal interval considered for each curve is $[1;21]$ with a constant period of sampling of 1.
Figure
\ref{fig. robust EM-bSRM waveform results} shows the corresponding clustering of the waveform data via the polynomial, spline, and B-spline regression mixtures.
Each sub-figure corresponds to a cluster. The solid line corresponds to the estimated mean curve and the dashed lines correspond to the approximate normal confidence interval computed as plus and minus twice the estimated standard deviation of the regression point estimates.
The number of clusters is correctly estimated by the proposed algorithm for three models. For this data, the spline regression models provide slightly better results in terms of clusters approximation than the polynomial regression mixture (here $p=4$).
\begin{figure}[!h]
\hspace{-.5cm}
\begin{tabular}{cccc}
\includegraphics[width=4cm]{waveform-data.eps} &
\includegraphics[width=3.9cm]{waveform-RobustEM-bSRM-cluster-1.eps} &
\includegraphics[width=3.9cm]{waveform-RobustEM-bSRM-cluster-2.eps} &
\includegraphics[width=3.9cm]{waveform-RobustEM-bSRM-cluster-3.eps}\\
(a) & (b) & (c) & (d)
\end{tabular}
\caption{\label{fig. robust EM-bSRM waveform results}Original waveform data (a) and clustering results obtained by the proposed robust EM-like algorithm and the bSRM model with a cubic b-spline of three knots. (b)-(d): each sub-figure corresponds to a cluster.}
\end{figure}%
Table \ref{tab. clustering results waveform data} presents the clustering results averaged over 20 different sample of 500 curves. It includes the estimated number of clusters, the misclassification error rate, and the absolute error between the true clusters proportions and variances and the estimated ones.
We compared the algorithm for the proposed models to two standard clustering algorithms: $K$-means clustering, and clustering using GMMs. The GMM density of the observations was assumed to have the form $f(\boldsymbol{y}_i;\{\boldsymbol{\mu}_k,\sigma_k^2\}) = \sum_{k=1}^K \alpha_k \mathcal{N}(\boldsymbol{y}_i;\boldsymbol{\mu}_k;\sigma_k^2 \textbf{I}_{m_i})$. We note that, for these two algorithms, the number of clusters was fixed to the true value (i.e., $K=2$). For GMMs, the number of clusters can be chosen by using model selection criteria such as the BIC. These criteria require a post-estimation step, which consists of selecting a model from pre-estimated models with different number of components. For all the models, the actual number of clusters is correctly retrieved. The misclassification error rate as well as the parameter estimation errors are slightly better for the spline regression models, in particular the B-spline regression mixture. On the other hand, it can be seen that the regression mixture models with the proposed EM-like algorithm outperform the standard $K$-means and standard GMM algorithms.
Unlike the GMM algorithm, which requires a two-step procedure to estimate both the number of clusters and the model parameter, the proposed algorithm simultaneously infers the model parameter values and its optimal number of components.
\begin{table}[htbp]
\centering
{\footnotesize
\begin{tabular}{|c c c c c c|}
\hline
& $K$-means & GMM & PRM & SRM & bSRM\\
\hline
Misc. Error Rate & 6.2 $\pm$ (0.24)\% & 5.90 $\pm$ (0.23)\% & 4.31 $\pm$ (0.42)\% & 2.94 $\pm$ (0.88)\% & 2.53 $\pm$ (0.70)\\
\hline
\end{tabular}}
\caption{\label{tab. clustering results waveform data}Clustering results for the waveform data.}
\end{table}
In Fig. \ref{fig: robust EM-MixReg stored-K pen-loglik waveform}, one can see the variation of the estimated number of clusters as well as the value of the objective function from one iteration to another. These results highlight the capability of the proposed algorithm to provide an accurate partitioning with an optimal number of clusters.
\begin{figure}[!h]
\centering
\includegraphics[width=5cm]{waveform-RobustEM-bSRM-stored_K.eps}
\includegraphics[width=5cm]{waveform-RobustEM-bSRM-penLikelihood.eps}
\caption{\label{fig: robust EM-MixReg stored-K pen-loglik waveform}Variation of the number of clusters and the value of the objective function as a function of the iteration index for the bSRM models for the waveform data.}
\end{figure}
\bigskip
In summary, the number of clusters is correctly estimated by the proposed algorithm for three proposed models. The spline regression models provide slightly better results in terms of cluster approximations than the polynomial regression mixture. Furthermore, the regression mixture models with the proposed EM-like algorithm outperform the standard $K$-means and GMM clustering methods.
\subsubsection{Phonemes data}
The phonemes data set used in \cite{Ferraty2003}\footnote{Data from \url{http://www.math.univ-toulouse.fr/staph/npfda/}}
is a sample of that which is available from \url{https://web.stanford.edu/~hastie/ElemStatLearn/datasets/} and which was described and used namely in \cite{Hastie95penalizeddiscriminant}.
The application context related to this data set is a phoneme classification problem. The phonemes data correspond to log-periodograms $y$ constructed from recordings available at different equispaced frequencies $x$ for different phonemes. The data set contains five classes corresponding to the following five phonemes: ``sh" as in ``she", ``dcl" as in ``dark", ``iy" as in ``she", ``aa" as in ``dark", and ``ao" as in ``water". For each phoneme we have 400 log-periodograms at a 16-kHz sampling rate. We only retain the first 150 frequencies from each subject as to conform with \cite{Ferraty2003}. This data set has been considered in a phoneme discrimination problem as in \cite{Hastie95penalizeddiscriminant} and \cite{Ferraty2003}, where the aim was to predict the phoneme class for a new log-periodogram.
Here we reformulate the problem into a clustering problem where the aim is to automatically group the phonemes data into classes. We therefore assume that the cluster labels are missing. We also assume that the number of clusters is unknown. Thus, the proposed algorithm will be assessed in terms of estimating both the actual partition and the optimal number of clusters from the data.
The number of phoneme classes (five) is correctly estimated by the three models.
The SRM results are closely similar to those provided by the bSRM model.
The spline regression models provide better results in terms of classification error (14.2 \%) and clusters approximation than the polynomial regression mixture.
In functional data modeling, splines are indeed more adapted than simple polynomial modeling.
The number of clusters decreases very rapidly from $1000$ to $51$ for the polynomial regression mixture model, and to 44 for the spline and B-spline regression mixture models. The majority of superfluous clusters are discarded at the beginning of the learning process.
Then, the number of clusters gradually decreases from one iteration to the next for the three models and the algorithm converges toward a partition with the correct number of clusters for the three models after at most $43$ iterations.
Figure \ref{fig. robust EM-bSRM phonemes results} shows the $1000$ phonemes used log-periodograms (upper-left) and the clustering partition obtained by the proposed unsupervised algorithm with the bSRM model.
\begin{figure}[!h]
\centering
\begin{tabular}{ccc}
\includegraphics[width=4.2cm]{phonemes-data.eps}&
\includegraphics[width=4.2cm]{phonemes-RobustEM-bSRM-cluster-2.eps}&
\includegraphics[width=4.2cm]{phonemes-RobustEM-bSRM-cluster-3.eps}\\
\includegraphics[width=4.2cm]{phonemes-RobustEM-bSRM-cluster-5.eps}&
\includegraphics[width=4.2cm]{phonemes-RobustEM-bSRM-cluster-1.eps}&
\includegraphics[width=4.2cm]{phonemes-RobustEM-bSRM-cluster-4.eps}
\end{tabular}
\caption{\label{fig. robust EM-bSRM phonemes results}Phonemes data and clustering results obtained by the proposed robust EM-like algorithm and the bSRM model with a cubic B-spline of seven knots for the phonemes data. The five sub-figures correspond to the automatically retrieved clusters which correspond to the phonemes ``ao", ``aa", ``yi", ``dcl", ``sh".}
\end{figure}
\subsubsection{Yeast cell cycle data}
In this experiment, we consider the yeast cell cycle data set of \cite{Cho1998}. The original yeast cell cycle data represent the fluctuation of expression levels of approximately 6000 genes over 17 time points corresponding to two cell cycles \cite{Cho1998}.
This data set has been used to demonstrate the effectiveness of clustering techniques for time course Gene expression data in bio-informatics such as model-based clustering as in \cite{YeungMBC2001}.
We used the standardized subset constructed by \cite{YeungMBC2001} available in \url{http://faculty.washington.edu/kayee/model/}\footnote{The complete data are from \url{http://genome-www.stanford.edu/cellcycle/}.}. This data set referred to as the subset of the 5-phase criterion in \cite{YeungMBC2001}
contains $n=384$ gene expression levels over $m=17$ time points.
The usefulness of the cluster analysis in this case is therefore to automatically reconstruct this five class partition.
Both the PRM and the SRM models provide similar partitions with four clusters. Two of the original classes were merged into one cluster via both models.
Note that some model selection criteria in \cite{YeungMBC2001} also provide four clusters in some situations.
However, the bSRM model correctly infers the actual number of clusters. The adjusted Rand index (ARI)\footnote{The adjusted Rand index measures the similarity between two data clusterings.
It has a value between 0 and 1, with 0 indicating that the two partitions do not agree on any pair of observations and 1 indicating that the data clusters are exactly the same. For more details on the Rand index, see \cite{Rand1971}.} for the obtained partition equals $0.7914$ which indicates that the partition is quite well defined.
Fig.
\ref{fig: functional data sets} (c) shows the $384$ curves of the yeast cell cycle data.
The clustering results obtained for the bSRM model are shown in Figure \ref{fig. robust EM-bSRM yeast-cellcycle results}.
\begin{figure}[!h]
\begin{tabular}{ccccc}
\hspace{-.5cm}
\includegraphics[width=3cm]{yeast-cellcycle-RobustEM-bSRM-cluster-5.eps}&
\includegraphics[width=3cm]{yeast-cellcycle-RobustEM-bSRM-cluster-1.eps}&
\includegraphics[width=3cm]{yeast-cellcycle-RobustEM-bSRM-cluster-3.eps}&
\includegraphics[width=3cm]{yeast-cellcycle-RobustEM-bSRM-cluster-2.eps}&
\includegraphics[width=3cm]{yeast-cellcycle-RobustEM-bSRM-cluster-4.eps}\\
(a) & (b) & (c) & (d) & (e)
\end{tabular}
\caption{\label{fig. robust EM-bSRM yeast-cellcycle results}Clustering results obtained by the proposed robust EM-like algorithm and the bSRM model with a cubic B-spline of 7 knots for the yeast cell cycle data. Each sub-figure corresponds to a cluster.}
\end{figure}
\subsubsection{Handwritten digit clustering using the SSRM model}
The spatial spline regression mixture model model is applied namely in model-based surface clustering in \cite{Chamroukhi-BSSRM-2015,Nguyen2016MixSSR}.
We applied the SSRM on a subset of the ZIPcode data set \cite{hastieTibshiraniFreidman_book_2009}, which was subsampled from the MNIST data set \citep{LecunMnist}. The data set contains 9298 16 by 16 pixel gray scale images of Hindu-Arabic handwritten numerals distributed as described in \cite{Chamroukhi-BSSRM-2015,Nguyen2016MixSSR}. Each individual contains $m=256$ observations with values in the range $[-1,1]$.
We run the Gibbs sampler on a subset of $1000$ digits randomly chosen from the Zipcode testing set with the distribution given in \cite{Chamroukhi-BSSRM-2015}. We used $d=8 \times 8$ NBFs, which corresponds to the quarter of the resolution of the images in the Zipcode data set.
Fig. \ref{fig:BMMSSR12} shows the cluster means for $K=12$ clusters obtained by the proposed BMSSR model.
We can see that the model is able to recover the digits including subgroups of the digit $0$ and the digit $5$.
\begin{figure}[!h]
\centering
\includegraphics[scale=0.25]{DigitClusteringBMSSR.eps}
\caption{Cluster means obtained by the proposed BMSSR model with $K=12$ components.}
\label{fig:BMMSSR12}
\end{figure}
\section{Latent process regression mixtures for functional data clustering and segmentation}
\label{sec: FDclustSeg}
In the previous section we presented regression mixtures models adapted for clustering an unlabeled set of smooth functions.
We now focus on functions arising in curves with regimes changes, possibly smooth, for which these regression mixture models, as mentioned before, however do not address the problem of regime changes.
In the models we present, the mixture component density $f_k(\boldsymbol{y}|\boldsymbol{x})$ in (\ref{eq:FunMM}) is itself assumed to exhibit a complex structure consisting of sub-components, each one associated with a regime.
In what follows, we investigate three choices for this component specific density, that is, first a piecewise regression density (PWR), then a hidden Markov regression (HMMR) density and finally a regression model with hidden logistic process (RHLP) density.
\subsection{Mixture of piecewise regressions for functional data clustering and segmentation}
\label{sec:PWRM}
The idea described here and proposed in \cite{Chamroukhi-PWRM-2016} is in the same spirit of the one proposed by \cite{HebrailEtAl2010} for curve clustering and optimal segmentation based on a piecewise regression model that allows for fitting several constant (or polynomial) models to each cluster of functional data with regime changes.
However, unlike the distance-based approach of \cite{HebrailEtAl2010}, which uses a $K$-means-like algorithm, the proposed model provides a general probabilistic framework to address the problem. Indeed, in the proposed approach, the piecewise regression model is included into a mixture framework to generalize the deterministic $K$-means like approach. As a result, both soft clustering and hard clustering are possible.
We also provide two algorithms for learning the model parameters. The first one is a dedicated EM algorithm to obtain a soft partition of the data and an optimal segmentation by maximizing the log-likelihood.
The EM algorithm provides a natural way to conduct maximum likelihood estimation of a mixture model, including the proposed piecewise regression mixture. The second algorithm consists in maximizing a specific classification likelihood criterion by using a dedicated CEM algorithm in which the curves are partitioned in a hard manner and optimally segmented simultaneously as the learning proceeds. The $K$-means-like algorithm of \cite{HebrailEtAl2010} is shown to be a particular case of the proposed CEM algorithm if some constraints are imposed on the piecewise regression mixture.
\subsubsection{The model}
The piecewise regression mixture model (PWRM) assumes that each discrete curve sample $(\boldsymbol{x}_i,\boldsymbol{y}_i)$ is generated by a piecewise regression model among $K$ models, with a prior probability $\alpha_k$, that is, each component density in (\ref{eq:FunMM}) is the one of a piecewise regression model,
defined by:
\begin{equation}
f_k(\boldsymbol{y}_i|\boldsymbol{x}_i;\boldsymbol{\varPsi}_k) = \prod_{r=1}^{R_k} \prod_{j \in I_{kr}}\mathcal{N} (y_{ij};\boldsymbol{\beta}_{kr}^T\boldsymbol{x}_{ij},\sigma_{kr}^2)
\label{eq:Conditional distribution in MixPWR}
\end{equation}where
$I_{kr} = (\xi_{kr},\xi_{k,r+1}]$ represents the element indices of segment (regime) $r$ ($r=1,\ldots,R_k$) for component (cluster) $k$, $R_k$ being the corresponding number of segments,
$\boldsymbol{\beta}_{kr}$ is the vector of its polynomial coefficients and $\sigma^2_{kr}$ the associated Gaussian noise variance.
Thus, the PWRM density if defined by:
\begin{equation}
f(\boldsymbol{y}_i|\boldsymbol{x}_i;\boldsymbol{\varPsi}) = \sum_{k=1}^K \alpha_k \prod_{r=1}^{R_k} \prod_{j \in I_{kr}}\mathcal{N} (y_{ij};\boldsymbol{\beta}_{kr}^T\boldsymbol{x}_{ij},\sigma_{kr}^2),
\label{eq:piecewise regression mixture}
\end{equation}where the parameter vector is given by \linebreak $\boldsymbol{\varPsi} = (\alpha_1,\ldots,\alpha_{K-1},\boldsymbol{\theta}^T_1,\ldots,\boldsymbol{\theta}^T_K,\boldsymbol{\xi}^T_1,\ldots,\boldsymbol{\xi}^T_K)^T$ with $\boldsymbol{\theta}_k=(\boldsymbol{\beta}^T_{k1},\ldots,\boldsymbol{\beta}^T_{k{R_k}},\sigma_{k1}^2,\ldots,\sigma_{k{R_k}}^2)^T$ and $\boldsymbol{\xi}_k=(\xi_{k1},\ldots,\xi_{k,{R_k}+1})^T$ are respectively
the vector of all the polynomial coefficients and noise variances, and the vector of transition points which define the segmentation of cluster $k$. The proposed mixture model is therefore suitable for clustering and optimal segmentation of complex-shaped curves. More specifically, by integrating the piecewise polynomial regression into the mixture framework, the resulting model is able to approximate curves from different clusters. Furthermore, the problem of regime changes within each cluster of curves is addressed as well due to the optimal segmentation provided by dynamic programming for each piecewise regression component. These two simultaneous outputs are clearly not provided by the standard generative curve clustering approaches, namely the regression mixtures. On the other hand, the PWRM is a probabilistic model and as it will be shown in the following, generalizes the deterministic $K$-means-like algorithm.
We derived two approaches for learning the model parameters. The former is an estimation approach and consists iof maximizing the likelihood via a dedicated EM algorithm. A soft partition of the curves into $K$ clusters is then obtained by maximizing the posterior component probabilities. The latter however focuses on the classification and optimizes a specific classification likelihood criterion through a dedicated CEM algorithm. The optimal curve segmentation is performed via dynamic programming.
In the classification approach, both the curve clustering and the optimal segmentation are performed simultaneously as the CEM learning proceeds.
We show that the classification approach using the PWRM model with the CEM algorithm is the probabilistic generalization of the deterministic $K$-means-like algorithm proposed in \cite{HebrailEtAl2010}.
\subsubsection{Maximum likelihood estimation via a dedicated EM
\label{ssec: ML estimation vi EM for the piecewise polynomial regression mixture}
In MLE approach, the parameter estimation is performed by monotonically maximizing the log-likelihood
\begin{eqnarray}
\log L(\boldsymbol{\varPsi}) = \sum_{i=1}^n \log \sum_{k=1}^K \alpha_k \prod_{r=1}^{R_k} \prod_{j \in I_{kr}}\mathcal{N}\left(y_{ij};\boldsymbol{\beta}_{kr}^T\boldsymbol{x}_{ij},\sigma_{kr}^2\right),
\label{eq:log-lik for the mixture of piecewise regression}
\end{eqnarray}iteratively via the EM algorithm \citep{Chamroukhi-PWRM-2016}. In the EM framework, the
complete-data log-likelihood that will be denoted by $\log L_c(\boldsymbol{\varPsi},\mathbf{z})$, and which represents the log-likelihood of the parameter vector given the observed data, completed by the unknown variables representing the component labels $\mathbf{Z} = (Z_1,\ldots,Z_n)$, is given by:
\begin{equation}
\log L_c(\boldsymbol{\varPsi},\mathbf{z}) = \sum_{i=1}^{n}\sum_{k=1}^{K} Z_{ik} \log \alpha_k + \sum_{i=1}^{n} \sum_{k=1}^{K} \sum_{r=1}^{R_k} \sum_{j\in I_{kr}} Z_{ik} \log \mathcal{N} (y_{ij};\boldsymbol{\beta}^T_{kr} \boldsymbol{x}_{ij},\sigma^2_{kr}).
\label{eq:complete log-lik for PWRM}
\end{equation}The EM algorithm for the PWRM model (EM-PWRM) alternates between the two following steps until convergence:
\paragraph{The E-step}
\label{ssec: E-step of the EM algorithm for the piecewise regression mixture}
computes the $Q$-function
\begin{eqnarray}
Q(\boldsymbol{\varPsi},\boldsymbol{\varPsi}^{(q)}) &=& \mathbb{E}\big[\log L_c(\boldsymbol{\varPsi};\mathcal{D},\mathbf{z})|\mathcal{D};\boldsymbol{\varPsi}^{(q)}\big] \nonumber \\
&=& \sum_{i=1}^{n}\sum_{k=1}^{K} \tau_{ik}^{(q)} \log \alpha_k \! + \! \sum_{i=1}^{n} \sum_{k=1}^{K} \sum_{r=1}^{R_k} \!\! \sum_{j\in I_{kr}} \!\! \tau_{ik}^{(q)} \! \log \mathcal{N} (y_{ij};\boldsymbol{\beta}^T_{kr} \boldsymbol{x}_{ij},\sigma^2_{kr})
\label{eq:Q-function for the mixture of piecewise regression}
\end{eqnarray}
where the posterior component membership probabilities $\tau^{(q)}_{ik}$ $(i=1,\ldots,n)$ for each of the $K$ components are given by
\begin{equation}
\tau_{ik}^{(q)} = \mathbb{P}(Z_i=k|\boldsymbol{y}_{i},\boldsymbol{x}_i;\boldsymbol{\varPsi}^{(q)}) = \alpha_k^{(q)}f_k\big(\boldsymbol{y}_i|\boldsymbol{x}_i;\boldsymbol{\varPsi}^{(q)}_{k}\big)\Big/\sum_{k'=1}^K\alpha_{k'}^{(q)}f_{k'}\big(\boldsymbol{y}_i|\boldsymbol{x}_i;\boldsymbol{\varPsi}^{(q)}_{k'}\big).
\label{eq:post prob tau_ik of the cluster k for the mixture of piecewise regression}
\end{equation}
\paragraph{The M-step}
\label{par: M-step of the EM algorithm for the PWRM} computes the parameter vector update $\boldsymbol{\varPsi}^{(q+1)}$ by maximizing the $Q$-function with respect to $\boldsymbol{\varPsi}$, that is:
$\boldsymbol{\Psi}^{(q+1)} = \arg \max_{\boldsymbol{\varPsi}} Q(\boldsymbol{\varPsi},\boldsymbol{\varPsi}^{(q)})$.
The mixing proportions are updated as in standard mixtures and their updates are given by (\ref{eq:EM-FunMM pi_k update}). The maximization of the $Q$-function with respect to (w.r.t) $\boldsymbol{\varPsi}_k$, that is, w.r.t the piecewise segmentation $\{I_{kr}\}$ of component (cluster) $k$ and the corresponding piecewise regression representation through $\{\boldsymbol{\beta}_{kr},\sigma_{kr}^2\}$, $(r=1,\ldots,R_k)$, corresponds to a weighted version of the piecewise regression problem for a set of homogeneous cruves as described in \cite{Chamroukhi-PWRM-2016}, with the weights being the posterior component membership probabilities $\tau_{ik}^{(q)}$.
The maximization simply consists in solving a weighted piecewise regression problem where the optimal segmentation of each cluster $k$, represented by the parameters $\{\boldsymbol{\xi}_{kr}\}$ is performed by running a dynamic programming procedure. Finally, the regression parameters are updated as:
{\begin{eqnarray}
\boldsymbol{\beta}^{(q+1)}_{kr} & = & \Big[ \sum_{i=1}^n \tau_{ik}^{(q)} \mathbf{X}_{ir}^T \mathbf{X}_{ir} \Big]^{-1} \sum_{i=1}^n \mathbf{X}_{ir}\boldsymbol{y}_{ir} \\
\label{eq:EM estimate of reg coeff beta_kr for the PWRM}
\sigma_{kr}^{2(q+1)} &=& \frac{1}{ \sum_{i=1}^n\sum_{j\in I_{kr}^{(q)}} \tau_{ik}^{(q)}} \sum_{i=1}^n \tau_{ik}^{(q)} |\!|\boldsymbol{y}_{ir}-\mathbf{X}_{ir} \boldsymbol{\beta}^{(q+1)}_{kr}|\!|^2
\label{eq:EM estimeate of variance sigma^2_kr for the PWRM}
\end{eqnarray}where $\boldsymbol{y}_{ir}$ is the segment (regime) $r$ of the $i$th curve, that is the observations $\{y_{ij}|j\in I_{kr}\}$ and
$\mathbf{X}_{ir}$ is its associated design matrix with rows $\{\boldsymbol{x}_{ij}|j\in I_{kr}\}$.
Thus, the proposed EM algorithm for the PWRM model provides a soft partition of the curves into $K$ clusters through the posterior probabilities $\tau_{ik}$, each soft cluster is optimally segmented into regimes with indices $\{I_{kr}\}$. Upon convergence of the EM algorithm, a hard partition of the curves can then be deduced by applying the rule (\ref{eq:MAP rule FunMM}).
\subsubsection{Maximum classification likelihood estimation via a dedicated CEM}
\label{ssec: ML estimation vi EM for the piecewise polynomial regression mixture}
Here we present another scheme to achieve both model estimation (including the segmentation) and clustering. It consists of a maximum classification likelihood approach which uses the Classification EM (CEM) algorithm. The CEM algorithm (see for example \citep{celeuxetgovaert92-CEM}) is the same as the so-called classification maximum likelihood approach as described earlier in \cite{McLachlanCEM1982} and dates back to the work of \cite{Scott71Symons}. The CEM algorithm was initially proposed for model-based clustering of multivariate data.
We adopt it here in order to perform model-based curve clustering within the proposed PWRM model framework. The resulting CEM simultaneously estimates the PWRM parameters and the cluster allocations by maximizing the complete-data log-likelihood (\ref{eq:complete log-lik for PWRM}) w.r.t both the model parameters $\boldsymbol{\varPsi}$ and the partition represented by the vector of cluster labels $\mathbf{z}$, in an iterative manner, by alternating between the two following steps:
\paragraph{Step 1}
\label{par: Step 1 of CEM for the piecewise regression mixture}
Update the cluster labels given the current model parameter $\boldsymbol{\varPsi}^{(q)}$ by maximizing the complete-data log-likelihood (\ref{eq:complete log-lik for PWRM}) w.r.t the cluster labels $\mathbf{z}$:
$\mathbf{z}^{(q+1)} = \arg \max_\mathbf{z} \log L_c(\boldsymbol{\varPsi}^{(q)},\mathbf{z})$.
\paragraph{Step 2}
\label{par: Step 2 of CEM for the piecewise regression mixture}
Given the estimated partition defined by $\mathbf{z}^{(q+1)}$, update the model parameters by maximizing (\ref{eq:complete log-lik for PWRM}) w.r.t to $\boldsymbol{\varPsi}$:
$\boldsymbol{\varPsi}^{(q+1)} = \arg \max_{\boldsymbol{\varPsi}} \log L_c(\boldsymbol{\varPsi},\mathbf{z}^{(q+1)})$.
Equivalently, the CEM algorithm consists in integrating a classification step (C-step) between the E- and the M- steps of the EM algorithm presented previously.
The C-step computes a hard partition of the $n$ curves into $K$ clusters by applying the Bayes' optimal allocation rule (\ref{eq:MAP rule FunMM}).
The difference between this CEM algorithm and the previously derived EM one is that the posterior probabilities $\tau_{ik}$ in the case of the EM-PWRM algorithm are replaced by the cluster label indicators $Z_{ik}$ in the CEM-PWRM algorithm; The curves being assigned in a hard way rather than in a soft way.
By doing so, the CEM monotonically maximizes the complete-data log-likelhood (\ref{eq:complete log-lik for PWRM}).
Another attractive feature of the proposed PWRM model is that when it is estimated by the CEM algorithm, as shown in \cite{Chamroukhi-PWRM-2016}, it is equivalent to a probabilistic generalization of the $K$-means-like algorithm of \cite{HebrailEtAl2010}.
Indeed, maximizing the complete-data log-likelihood (\ref{eq:complete log-lik for PWRM}) optimized by the proposed CEM algorithm for the PWRM model, is equivalent to minimizing the following distortion criterion w.r.t the cluster labels $\mathbf{z}$, the segments indices $I_{kr}$ and the segments constant means $\mu_{kr}$, which is exactly the criterion optimized by the $K$-means-like algorithm:
$\mathcal{J} \big(\mathbf{z}, \{ \mu_{kr},I_{kr}\}\big) = \sum_{k=1}^K \sum_{r=1}^{R_k} \sum_{i|Z_i=k} \sum_{j\in I_{kr}} \big(y_{ij}-\mu_{kr}\big)^2$
if the following constraints are imposed: $\alpha_k = \frac{1}{K}$ $\forall K$ (identical mixing proportions);
$\sigma^2_{kr} = \sigma^2$ $\forall r=1,\ldots,{R_k}$ and $\forall k=1,\ldots,K$;
(isotropic and homoskedastic model); and a piecewise constant approximation of each segment rather than a polynomial approximation. The proposed CEM algorithm for piecewise polynomial regression mixture is therefore the probabilistic version for hard curve clustering and optimal segmentation of the $K$-means-like algorithm.
\subsubsection{Experiments}
\label{sec: Experiments PWRM}
The performance of the PWRM with both the EM and CEM algorithms is studied in \cite{Chamroukhi-PWRM-2016} by comparing it to the polynomial regression mixture models (PRM) \citep{GaffneyThesis}, the standard polynomial spline regression mixture model (PSRM) \citep{GaffneyThesis, Gui-FMDA, LiuANDyangFunctionalDataClustering} and the piecewise regression model implemented via the $K$-means-like algorithm \citep{HebrailEtAl2010}. We also included comparisons with standard model-based clustering methods for multivariate data including the GMM.
The algorithms have been evaluated in terms of curve classification and approximation accuracy.
The used evaluation criteria are the classification error rate between the true partition (when it is available) and the estimated partition, and the intra-cluster inertia defined as
$\sum_{k=1}^K\sum_{i=1|\widehat{Z}_i=k}^n|\!|\boldsymbol{y}_i-\widehat{\mathbf{y}}_k|\!|^2$, where $\widehat{Z}_i$ is the estimated cluster label of the $i$th function and $\widehat{\mathbf{y}}_k= (\widehat{y}_{kj})_{j=1,\ldots,m}$ is the estimated mean function of cluster $k$.
Table \ref{table. calssif and inertia results for simulations unifPWRM} gives the obtained intra-cluster inertia
\begin{table}[H]
\centering
\small
\begin{tabular}{lcccccc}
\hline
GMM & PRM & PSRM & $K$-means-like & EM-PWRM & CEM-PWRM \\
\hline
\hline
19639 & 25317 & 21539 & 17428 & 17428 & 17428\\
\hline
\end{tabular}
\caption{\label{table. calssif and inertia results for simulations unifPWRM}Intra-class inertia for the simulated curves}
\end{table}and Figure \ref{fig. MCER results for simulations} shows the obtained misclassification error rate for different noise levels.
\begin{figure}[H]
\centering
\includegraphics[width=7cm]{MCER_simulations}
\caption{\label{fig. MCER results for simulations}The misclassification error rate versus the noise level variation.}
\end{figure
In these simulation studies, in the situations for which all the considered algorithms have close clustering accuracy,
the standard model-based clustering approach using the GMM have poor performance in terms of curves approximation. This is due to the fact that using the GMM is not appropriate for this context as it does not take into account the functional structure of the curves and computes an overall mean curve.
On the other hand, the proposed probabilistic model, when trained with the EM algorithm (EM-PWRM) or with the CEM algorithm (CEM-PWRM), as well as the $K$-means-like algorithm of \cite{HebrailEtAl2010}, as expected, provide the nearly identical results in terms of clustering and segmentation. This is attributed to the fact that the $K$-means PWRM approach is a particular case of the proposed probabilistic approach.
The best curves approximation, however, are those provided by the PWRM models. The GMM mean curves are simply over all means, and the PRM and the PSRM models, as they are based on continuous curve prototypes, do not account for the segmentation, unlike the PWRM models which are well adapted to perform simultaneous curve clustering and segmentation.
When we varied the noise level, for levels, the results are very similar. However, as the noise level increases, the misclassification error rate increases faster for the other models compared to the proposed PWRM model. The EM and the CEM algorithm for the proposed approach provide very similar results with a slight advantage for the CEM version, which can be attributed to the fact that CEM is by construction tailored to the classification.
When the proposed PWRM approach is used, the misclassification error can be improved by 4\%
compared to the $K$-means like approach, about 7\%
compared to both the PRM and the PSRM, an more that 15\% compared to the standard multivariate GMM.
In addition, when the data have non-uniform mixing proportions, the $K$-means based approach can fail namely in terms of segmentation.
This is attributed to the fact that the $K$-means-like approach for PWRM is constrained as it assumes the same proportion for each cluster, and does not sufficiently take into account the heteroskedasticity within each cluster compared to the PWRM model.
For model selection, the ICL was used on simulated data. We remarked that when using the proposed EM-PWRM and CEM-PWRM approaches, the correct model ay be selected up to 10\% more of the time than when compared to the $K$-means-like algorithm for piecewise regression.
The number of regimes was underestimated with only around 10\% for the proposed EM and CEM algorithms, while the number of clusters is correctly estimated. However, the $K$-means-like approach overestimates the number of clusters in 12\% of cases.
These results highlight an advantage of the fully-probabilistic approach compared to the $K$-means-like approach.
\paragraph{Application to real curves.}
In \cite{Chamroukhi-PWRM-2016} the model was also applied on real curves from three different data sets, railway switch curves, the Tecator curves, and the Topex/Poseidon satellite data as studied in \cite{HebrailEtAl2010}. The actual partitions for these data are unknown and we used the intra-class inertia as well as a qualitative assessment of the results.
The first studied curves are the railway switch curves from a diagnosis application of the railway switches. Briefly, the railway switch is the component that enables (high speed) trains to be guided from one track to another at a railway junction, and is controlled by an electrical motor. The considered curves are the signals of the consumed power during the switch operations. These curves present several changes in regime due to successive mechanical motions involved in each switch operation.
A preliminary data preprocessing task is to automatically identify homogeneous groups (typically, curves without defect and curves with possible defect (we assumed $K=2$).
%
The database used is composed of $n=146$ real curves sampled at $m=511$ time points.
The number of regression components was set to $R = 6$ in accordance with the number of electromechanical phases of these switch operations and the degree of the polynomial regression $p$ was set to $3$ which is appropriate for the different regimes in the curves.
The obtained results show that, for the CEM-PWRM approach, the two obtained clusters do not have the same characteristics with quite clearly different shapes and may correspond to two different states of the switch mechanism.
According to experts, this can be attributed to a default in the measurement process, rather than a default of the switch itself. The device used for measuring the power would have been used slightly differently for this cluster of curves.
The obtained intra-cluster inertia results, as shown in table \ref{tab.inertia PWRM}, are also better for the proposed CEM-PWRM algoritm, compared to the considered alternatives.
\begin{table}
\centering
\begin{tabular}{ccccc}
\hline
GMM & PRM & EPSRM & $K$-means-like & CEM-PWRM\\
721.46 & 738.31 & 734.33 & 704.64 & 703.18 \\
\hline
\end{tabular}\caption{\label{tab.inertia PWRM}Intra-cluster inertia for the railway switch curves.}
\end{table}
This confirms that the piecewise regression mixture model has an advantage for providing homogeneous and well-approximated clusters from curves with regime changes.
The second data set is the Tecator data ($n=240$ spectra with $m=100$ for each spectrum).
This data set was considered in \cite{HebrailEtAl2010} and in our experiment we consider the same setting, that the data set is summarized with six clusters ($K=6$), each cluster being composed of five linear regimes (segments) ($R=5, p=1$).
The retrieved clusters are informative (see Fig. \ref{fig. CEM-PWRM clustering Tecator}) in the sense that the shapes of the clusters are clearly different, and the piecewise approximation is in concordance with the shape of each cluster.
On the other hand, the obtained result is very close to the one obtained by \cite{HebrailEtAl2010} by using the $K$-means-like approach. This is not surprising and confirms that the proposed CEM-PWRM algorithm is a probabilistic alternative for the $K$-means-like approach.
\begin{figure}[!h]
\centering
\includegraphics[width=12cm]{tecator-clustering-CEM-PWRM.eps}
\caption{\label{fig. CEM-PWRM clustering Tecator}Clusters and the corresponding piecewise prototypes for each cluster obtained with the CEM-PWRM algorithm for the Tecator data set.}
\end{figure}
The third data set is the Topex/Poseidon radar satellite data ($n=472$ waveforms sampled at $m=70$ echoes).
We considered the same number of clusters ($K=20$) and a piecewise linear approximation of four segments per cluster as used in \cite{HebrailEtAl2010}.
We note that, in our approach, we directly apply the proposed CEM-PWRM algorithm to raw the satellite data without a preprocessing step. However, in \cite{HebrailEtAl2010}, the authors used a two-fold scheme. They first perform a topographic clustering step using the Self Organizing Map (SOM), and then apply their $K$-means-like approach to the results of the SOM.
The proposed CEM-PWRM algorithm for the satellite data provide clearly informative clustering and segmentation which reflect the general behavior of the hidden structure of this data set (see Fig. \ref{fig. CEM-PWRM clustering Satellite}). The structure is indeed more clear when observing the mean curves of the clusters (prototypes) than when observing the raw curves. The piecewise approximation thus helps to better understand the structure of each cluster of curves from the obtained partition, and to more easily infer the general behavior of the data set.
On the other hand, the result is similar to the one found in \cite{HebrailEtAl2010}. Most of the profiles are present in the two results. There is a slight difference that can be attributed to the fact that the result in \cite{HebrailEtAl2010} is provided from a two-stage scheme which includes and additional pre-clustering step using the SOM, instead of directly applying the piecewise regression model to the raw data.
\begin{figure}[!h]
\centering
\includegraphics[height= 13cm,width=12cm]{satellite-clustering-CEM-PWRM-3.eps}
\caption{\label{fig. CEM-PWRM clustering Satellite}Clusters and the corresponding piecewise prototypes for each cluster obtained with the CEM-PWRM algorithm for the satellite data set.}
\end{figure}
\subsection{Mixture of hidden Markov model regressions
\label{sec:MixHMMR}
The mixture of piecewise regressions presented previously can be seen as not being completely generative, since the transition points, while assumed to be unknown and determined automatically from the data, are not governed by a probability distribution.
This however achieves the clustering and segmentation aims and was useful to show that $K$-means based alternatives may be particular cases of such models.
%
The aim now is to build a fully-generative model. It is natural to think, as previously for the univariate case, that for each group, the regimes governing the observed curves follow a discrete hidden process, typically a hidden Markov chain.
%
By doing so, it is assumed that, within each cluster $k$, the observed curve is governed by a hidden process which enables for switching from one state to another among $R_k$ states following a homogeneous Markov chain, which leads to the mixture of hidden Markov models introduced by \cite{Smyth96}.
Two different approaches can be adopted for estimating this mixture of HMMs. The first one is the $K$-means-like approach for hard clustering used in \cite{Smyth96} and in which the optimized function is the complete-data log-likelihood. The resulting clustering scheme consists of assigning sequences to clusters at each iteration and using only the sequences assigned to a cluster for re-estimation of the HMM parameters related to that cluster.
The second one is the soft clustering approach described in \cite{Alon2003} where the model parameters are estimated in a maximum likelihood framework by the EM algorithm.
The model we propose here can be seen as an extension of the model-based clustering approach via mixture of standard HMMs introduced by \cite{Smyth96}, where each HMM state has a conditional Gaussian density with simple scalar mean,
by considering polynomial regressors, and by performing MLE using an EM algorithm, rather that $K$-means. In addition, the use of polynomial regime modeling rather than simple constant means should be indeed more suitable for fitting the non-linear regimes governing the time series, and the MLE procedure should better capture the uncertainty regarding the curve assignments due to the soft posterior component memberships. We refer to the proposed methodology as mixture of hidden Markov model regressions (MiXHMMR) \citep{Chamroukhi-IJCNN-2011,Chamroukhi-HDR-2015}.
\subsubsection{The model}
The proposed mixture of HMM regressions (MixHMMR) assumes that each curve is issued from one of $K$ components of a mixture, where conditional on each component $k$ $(k=1,\ldots,K)$, the curve is distributed according to an $R_k$-state hidden Markov model regression.
That is, unlike the homogeneous regression model (\ref{eq:regression model}), this model assumes that given the label $Z_i=k$ of the component generating the $i$th curve, and given the state $H_{ij}=r$ $(r=1,\ldots,R_k)$, the $j$th observation $Y_i(t) = y_{ij}$ (e.g., the one observed at time $t_{ij}$ in the case of temporal data) is generated according to a Gaussian polynomial regression model with regression coefficient vector $\boldsymbol{\beta}_{kr}$ and noise variance $\sigma^2_{kr}$:
\begin{equation}
Y_{i}(t) = \boldsymbol{\beta}^T_{kr}\mathbf{x}_{i}(t) + \sigma_{kr}E_{i}(t), \quad E_{i}(t) \sim \mathcal{N}(0,1
\label{eq:HMM regression model}
\end{equation}where $\mathbf{x}_{i}(t)$ is a covariate vector, the $E_{ij}$ are independent random variables distributed according to a standard zero-mean unit-variance Gaussian distribution and the hidden state sequence $\boldsymbol{H}_i=(H_{i1},\ldots,H_{im_i})$ for each mixture component $k$ is assumed to be Markov chain with initial state distribution $\boldsymbol{\pi}_k$ with components $\pi_{kr} = \mathbb{P}(H_{i1} =r|Z_i =k)$ $(r=1,\ldots,R_k)$ and transition matrix $\mathbf{A}_k$ whose general term is $A_{k\ell r} = \mathbb{P}(H_{ij}=r|H_{i,j-1}=\ell, Z_i =k)$.
Thus, the change from one regime to another is governed by the hidden Markov Chain. Note that if the time series we aim to model consist of successive contiguous regimes, one may use a left-right model \citep{Rabiner86anintroductionHMM,Rabiner1989} by imposing order constraints on the hidden states via constraints on the transition probabilities.
From (\ref{eq:HMM regression model}), it follows that the response $\boldsymbol{y}_i$ for the predictor $(\mathbf{x}_i)$, conditional on each mixture component $Z_i=k$ is therefore distributed according to a HMM regression distribution, defined by:
\begin{equation}
f_k(\boldsymbol{y}_i|\boldsymbol{x}_i;\boldsymbol{\varPsi}_k) = \sum_{\boldsymbol{H}_i} \mathbb{P}(H_{i1};\boldsymbol{\pi}_k)\prod_{j=2}^{m_i}\mathbb{P}(H_{ij}|H_{i,j-1};\boldsymbol{A}_k) \times \prod_{j=1}^{m_i}\mathcal{N}(y_{ij};\boldsymbol{\beta}^T_{kh_{ij}}\boldsymbol{x}_j,\sigma_{kh_{ij}}^2)
\label{eq:Conditional distribution in MixHMMR}
\end{equation}with parameter vector $\boldsymbol{\varPsi}_k= (\boldsymbol{\pi}^T_k,{\text{vec}(\boldsymbol{A}_k)}^T,\boldsymbol{\beta}^T_{k1},\ldots,\boldsymbol{\beta}^T_{kR},\sigma_{k1}^2,\ldots,\sigma_{kR}^2)^T$.
Finally, the distribution of a curve $(\boldsymbol{x}_i,\boldsymbol{y}_i$) is defined by the following MixHMMR density:
\begin{equation}
f(\boldsymbol{y}_i |\boldsymbol{x}_i;\boldsymbol{\varPsi}) =\sum_{k=1}^K \alpha_k f_k(\boldsymbol{y}_i|\boldsymbol{x}_i;\boldsymbol{\varPsi}_k)
\label{eq:MixHMMR model}
\end{equation}described by the parameter vector
$\boldsymbol{\varPsi} = (\alpha_1,\ldots,\alpha_{K-1}, \boldsymbol{\varPsi}^T_1,\ldots,\boldsymbol{\varPsi}^T_K)^T$.
\subsubsection{Maximum likelihood estimation via a dedicated EM
\label{sec: parameter estimation}
The MixHMMR parameter vector $\boldsymbol{\varPsi}$ is estimated by monotonically maximizing the log-likelihood
\begin{equation}
\log L(\boldsymbol{\varPsi})
= \sum_{i=1}^n \log \sum_{k=1}^K \alpha_k \sum_{\boldsymbol{H}_i} \mathbb{P}(H_{i1};\boldsymbol{\pi}_k)\prod_{j=2}^{m_i}\mathbb{P}(H_{ij}|H_{i,j-1};\boldsymbol{A}_k) \times \prod_{j=1}^{m_i}\mathcal{N}(y_{ij};\boldsymbol{\beta}^T_{kh_{ij}}\boldsymbol{x}_j,\sigma_{kh_{ij}}^2)
\label{eq:log-likelihood MixHMMR model}
\end{equation}by using a dedicated EM algorithm as devoloped in \cite{Chamroukhi-IJCNN-2011,Chamroukhi-HDR-2015}.
By introducing the two indicator binary variables for indicating the cluster memberships and the regime memberships for a given cluster, that is,
$Z_{ik}=1$ if $Z_i=k$ (i.e., $\boldsymbol{y}_i$ belongs to cluster $k$) and $Z_{ik}=0$ otherwise,
and
$H_{ijr}=1$ if $H_{ij}=r$ (i.e., the $i$th time series $\boldsymbol{y}_i$ belongs to cluster $k$ and its $j$th observation $y_{ij}$ at time $t_j$ belongs to regime $r$) and $H_{ijr}=0$ otherwise,
the complete-data likelihood of $\boldsymbol{\varPsi}$ can be written as:
{\footnotesize \begin{eqnarray}
\log L_c(\boldsymbol{\varPsi})
&=&
\sum_{k=1}^K \Big[ \sum_{i} Z_{ik} \log \alpha_k + \sum_{i,r} Z_{ik} H_{i1r} \log \pi_{kr}
+ \sum_{i,j=2,r,\ell} Z_{ik} H_{ijr} H_{i(j-1)\ell} \log \mathbf{A}_{k \ell r}
\nonumber \\
&&
+ \sum_{i,j,r} Z_{ik} H_{ijr}\log \mathcal{N} (y_{ij};\boldsymbol{\beta}^T_{kr}\boldsymbol{x}_{j},\sigma^2_{kr}) \Big]\cdot
\end{eqnarray}}The EM algorithm for the MixHMMR model starts from an initial parameter $\boldsymbol{\varPsi}^{(0)}$ and alternates between the two following steps until convergence:
\paragraph{The E-Step} computes the conditional expected complete-data log-likelihood:
$Q(\boldsymbol{\varPsi},\boldsymbol{\varPsi}^{(q)}) = \mathbb{E}\big[\log L_c(\boldsymbol{\varPsi})|\mathcal{D};\boldsymbol{\varPsi}^{(q)}\big]$
which is given by:
{\small \begin{equation}
Q(\boldsymbol{\varPsi},\boldsymbol{\varPsi}^{(q)}) =\sum_{k,i} \tau_{ik}^{(q)} \log \alpha_k
+
\sum_{k} \Big[
\sum_{r,i} \tau_{ik}^{(q)} \big[\gamma^{(q)}_{i1r} \log \pi_{kr} + \sum_{j=2,\ell} \xi^{(q)}_{ij\ell r} \log A_{k \ell r}\big]
+
\sum_{r,i,j}^{m_i} \tau_{ik}^{(q)} \gamma^{(q)}_{ijr}\log \mathcal{N} (y_{ij};\boldsymbol{\beta}^T_{kr}\boldsymbol{x}_{j},\sigma^2_{kr})
\Big]
\label{eq:Q-function for the MixHMMR model}
\end{equation}}and therefore only requires the computation of the posterior probabilities $\tau^{(q)}_{ik}$, $\gamma^{(q)}_{ijr}$ and $\xi^{(q)}_{ij\ell r}$ defined as:
\begin{itemize}
\item $\tau^{(q)}_{ik} =\mathbb{P}(Z_i=k|\boldsymbol{y}_i,\boldsymbol{x}_i;\boldsymbol{\varPsi}^{(q)})$ is the posterior probability that the $i$th curve belongs to the $k$th mixture component;
\item $\gamma^{(q)}_{ijr} = \mathbb{P}(H_{ij}=r|\boldsymbol{y}_i,\boldsymbol{x}_i;\boldsymbol{\varPsi}_k^{(q)})$ is the posterior probability of the $r$th polynomial regime in the mixture component (cluster) $k$;
\item $\xi^{(q)}_{ij\ell r} = \mathbb{P}(H_{ij}=r, H_{i(j-1)}=\ell|\boldsymbol{y}_i,\boldsymbol{x}_i;\boldsymbol{\varPsi}_k^{(q)})$ is the joint posterior probability of having the regime $r$ at time $t_j$ and the regime $\ell$ at time $t_{j-1}$ in cluster $k$.
\end{itemize}
The E-step probabilities $\gamma^{(q)}_{ijr}$ and $\xi^{(q)}_{ij \ell r}$ for each time series $\boldsymbol{y}_i$ $(i=1,\ldots,n)$ are computed recursively by using the forward-backward algorithm (see \cite{Rabiner86anintroductionHMM,Rabiner1989,Chamroukhi-IJCNN-2011}). The posterior probabilities $\tau_{ik}^{(q)}$ are given by:
\begin{equation}
\tau^{(q)}_{ik} = \alpha_k^{(q)} f_k(\boldsymbol{y}_i|\boldsymbol{x}_i;\boldsymbol{\varPsi}^{(q)}_k)\Big/\sum_{k'=1}^K \alpha_{k'}^{(q)}f_{k'}(\boldsymbol{y}_i|\boldsymbol{x}_i;\boldsymbol{\varPsi}^{(q)}_{k'}),
\label{eq:cluster post prob for the MixHMMR}
\end{equation}where the conditional probability distribution $f_k(\boldsymbol{y}_i|\boldsymbol{x}_i;\boldsymbol{\varPsi}^{(q)}_k)$ is the one of an HMM regression likelihood (given by (\ref{eq:Conditional distribution in MixHMMR})) and is obtained after the forward procedure when fitting a standard HMM.
\paragraph{The M-Step}
\label{par: M-step of the EM algorithm for the MixHMMR model}
computes the parameter vector update $\boldsymbol{\varPsi}^{(q+1)} $ by maximizing the expected complete-data log-likelihood, that is $\boldsymbol{\varPsi}^{(q+1)} = \arg \max_{\boldsymbol{\varPsi}} Q(\boldsymbol{\varPsi},\boldsymbol{\varPsi}^{(q)}).$
The maximization w.r.t the mixing proportions is the one of a standard mixture model and the updates are given by (\ref{eq:EM-FunMM pi_k update}).
The maximization w.r.t the Markov chain parameters $(\boldsymbol{\pi}_k, \mathbf{A}_k)$ correspond to a weighted version of updating the parameters of the Markov chain in a standard HMM where the weights in this case are the posterior component membership probabilities $\tau^{(q)}_{ik}$. The updates are given by:
\begin{eqnarray*}
\pi_{kr}^{(q+1)} &=& \frac{\sum_{i=1}^{n} \tau_{ik}^{(q)} \gamma^{(q)}_{i1r}}{\sum_{i=1}^{n} \tau_{ik}^{(q)}},
\label{eq:initial state prob update for the MixHMMR} \\
A^{(q+1)}_{k\ell r}&=& \frac{\sum_{i=1}^{n} \sum_{j=2}^{m_i} \tau_{ik}^{(q)} \xi^{(q)}_{ij\ell r}}{\sum_{i=1}^{n} \sum_{j=2}^{m_i} \tau_{ik}^{(q)} \gamma^{(q)}_{ijr}}\cdot
\label{eq:trans mat update for the MixHMMR}
\end{eqnarray*}
Finally, the maximization w.r.t the regression parameters $\boldsymbol{\beta}_{kr}$ consists of analytically solving weighted least-squares problems
and the one w.r.t the noise variances $\sigma_{kr}^{2}$
consists in a weighted variant of the problem of estimating the variance of a univariate Gaussian density. The weights consist of both the posterior cluster probabilities $\tau_{ik}$ and the posterior regime probabilities $\gamma^{(q)}_{ijr}$ for each cluster $k$. The parameter updates are given by:
\begin{eqnarray}
{\boldsymbol{\beta}}_{kr}^{(q+1)}
&=& \Big[\sum_{i=1}^{n} \tau_{ik}^{(q)} \mathbf{X}_i^T \mathbf{W}_{ikr}^{(q)}\mathbf{X}_i\Big]^{-1} \sum_{i=1}^{n} \tau_{ik}^{(q)} \mathbf{X}_i^T\mathbf{W}_{ikr}^{(q)} \boldsymbol{y}_i,
\label{eq:regression param update for the MixHMMR} \\
\sigma_{kr}^{2(q+1)}
&=& \frac{\sum_{i=1}^{n} \tau_{ik}^{(q)} |\!| \sqrt{\mathbf{W}_{ikr}^{(q)}} (\boldsymbol{y}_i - \mathbf{X}_i \boldsymbol{\beta}_{kr}^{(q+1)}) |\!|^2}{ \sum_{i=1}^n \tau_{ik}^{(q)} \text{trace}(\mathbf{W}_{ikr}^{(q)}) },
\label{eq:variance update for the MixHMMR}
\end{eqnarray}where $\mathbf{W}_{ikr}^{(q)}$ is an $m_i$ by $m_i$ diagonal matrix whose diagonal elements are the weights $\{\gamma_{ijr}^{(q)}; j=1,\ldots,m_i\}$.
It can be seen that here, the parameters for each regime are updated from the whole curve
weighted by the posterior regime memberships $\{\gamma_{ijr}\}$, while in the previously presented piecewise regression model, they are only updated from the observations assigned to that regime, that is, in a hard manner. This may better take into account possible uncertainty regarding whether the regime change in abrupt or not.
\subsubsection{Experiments}
The performance of the developed MixHMMR model was studied in \cite{Chamroukhi-IJCNN-2011}
by comparing it to the regression mixture model, the standard mixture of HMMs, as well as two standard multidimensional data clustering algorithms: the GMM and $K$-means.
\paragraph{Simulation results}
The evaluation criteria are used in the simulations are the misclassification error rate between the true simulated partition and the estimated partition and the intra-cluster inertia.
From the obtained results, it was observed that the proposed approach provides more accurate classification results and smaller intra-class inertias compared to the considered alternatives.
For example, the MixHMMR provides a clustering error 3\% less than the standard mixture of HMMs, which is the most competitive model, and more than 10\% less compared to standard multivariate clustering alternatives.
Applying the MixHMMR for clustering time series with regime changes also provided accurate results in terms of clustering and approximation of each cluster of time series.
This is attributed to the fact that the proposed MixHMMR model, with its flexible generative formulation, addresses better both the problem of time series heterogeneities by the mixture formulation and the dynamical aspect within each homogeneous set of time series via the underlying Markov chain. It was also observed that the standard GMM and standard $K$-means are not well suitable for this kind of functional data.
\paragraph{Clustering the real time series of switch operations}
The model was also applied in \cite{Chamroukhi-IJCNN-2011} to a real problem of clustering time series for a railway diagnosis application.
The data set contains $n=115$ curves, each resulting from $R=6$ operations electromechanical process. We applied the model with cubic polynomials (which was enough to approximate each regime) and applied it with $K=2$ clusters in order to separate curves that would correspond to a defective operating state and curves corresponding to a normal operating state.
%
Since the true class labels are unknown, we only considered the intra-class inertias as wall as a graphical inspection by observing the obtained partitions and each cluster approximation.
The algorithm provided a partition of curves where the cluster shapes are clearly different (see Figure \ref{fig. real time series clustering results}) and might correspond to two different states of the switch mechanism. According to experts, one cluster could correspond to a default in the measurement process.
These results are also in concordance with those obtained by the previously introduced piecewise regression mixture model; the partitions are nearly identical.
\begin{figure}[!h]
\centering
\includegraphics[scale=.3]{real_new_2006_2}
\includegraphics[scale=.301]{real_new_2006_2_clusters}
\caption{\label{fig. real time series clustering results}
Clustering of switch operation time series obtained with the MixHMMR model.}
\end{figure}
The introduced MixHMMR model
is particularly appropriate for clustering curves with various changes in regime and rely on a suitable generative formulation. The experimental results demonstrated the benefit of the proposed approach as compared to existing alternative methods, including the regression mixture model and the standard mixture of hidden Markov models. It also represents a fully-generative alternative to the previously described mixture of piecewise regressions.
While the model is a fully-generative one, one disadvantage is that as each hidden regime sequence is a Markov chain, the regime residence time is geometrically distributed, which is not adapted especially for long duration regimes, which might be the case for regimes of the analyzed functional data. However, we notice that this issue is more pronounced for the standard mixture of HMMs. In the proposed MixHMMR model, the fact that the conditional distribution rely on polynomial regressors, contribute to stabilize this effect by providing well-structured regimes even when they are activated for a long time period.
For modeling different state length distributions, one might also use a non-homogeneous Markov chain as in \cite{Diebold1994,Hughes-et-al-nonhomHMM}, that is, a Markov chain with time-dependent transition probabilities.
The model proposed in the next section addresses the problem by using a logistic process rather than a Markov which, which provides more flexibility.
\subsection{Mixture of hidden logistic process regressions}
\label{sec:MixRHLP}
We saw in Section \ref{sec:PWRM} that a first natural idea to cluster and segment complex functional data arising in curves with regime changes is to use piecewise regression integrated into a mixture formulation. This model however does not define a probability distribution over the change points and in practice may be time consuming especially for large time series.
A first full generative alternative is to use mixtures of HMMs or the one more adapted for structured regimes in time series, that is, the proposed mixture of HMM regressions, seen in the previous section.
However, if we look at how are we dealing with the quality of regime changes, that is, particularly regarding their smoothness, it appears that for the piecewise approach, it handles only abrupt changes, and for the HMM-based approach, while the posterior regime probabilities can be seen as soft partitions for the regimes and hence in some sense accomodate smoothness, there is no explicit formulation regarding the nature of transition points and the smoothness of the resulting estimated functions. On the other hand, the regime residence time is necessarily geometrically distributed in these HMM-based models which might result in the fact that a transition may occur even within structured observations of the same regime.
This was what we saw in some obtained results in \cite{Chamroukhi-MHMMR-2013} when applying the HMM models, especially the standard HMM.
Using polynomial regressors for the state conditional density is a quite sufficient way to stabilize this behavior. The modeling can be further improved by adopting a process that explicitly takes into account the smoothness of transitions in the process governing the regime changes.
Here, we present a model which attempts to overcome this by using a logistic process rather than a Markov process.
The resulting model is a mixture of regressions with hidden logistic processes (MixRHLP) \citep{Chamroukhi-MixRHLP-2011,Chamroukhi-FMDA-neucomp2013}.
\subsubsection{The model}
In the proposed mixture of regression models with hidden logistic processes (MixRHLP) \citep{Chamroukhi-MixRHLP-2011,Chamroukhi-FMDA-neucomp2013}, each of the functional mixture components (\ref{eq:FunMM}) is an RHLP \citep{chamroukhi_et_al_NN2009,chamroukhi_et_al_neurocomp2010}.
As presented in \cite{chamroukhi_et_al_NN2009,Chamroukhi-HDR-2015}, the conditional distribution of a curve is defined by an RHLP:
\begin{equation}
f_k(\boldsymbol{y}_i|\boldsymbol{x}_i;\boldsymbol{\varPsi}_k) = \prod_{j=1}^{m_i} \sum_{r=1}^{R_k}\pi_{kr}(x_j;\mathbf{w}_{k})\mathcal{N}\big(y_{ij};\boldsymbol{\beta}_{kr}^T \boldsymbol{x}_{j},\sigma_{kr}^{2} \big)
\label{eq:RHLP}
\end{equation}whose parameter vector is
$\boldsymbol{\varPsi}_{k} = (\mathbf{w}^T_k,\boldsymbol{\beta}^T_{k1},\ldots,\boldsymbol{\beta}^T_{kR_{k}},\sigma^2_{k1},\ldots,\sigma^2_{kR_k})^T$ and where the distribution of the discrete variable $H_{ij}$ governing the hidden regimes is assumed to be logistic
\begin{equation}
\pi_{kr}(x_j;\mathbf{w}_k) = \mathbb{P}(H_{ij}=r|Z_i = k,x_j;\mathbf{w}_{k}) = \frac{\exp{(w_{kr0} + w_{kr1}x_j)}}{\sum_{r'=1}^{R_{k}}\exp{(w_{kr'0} + w_{kr'1} x_j)}},
\label{eq:logistic prob for regime g k r}
\end{equation}whose parameter vector is $\mathbf{w}_k = (\boldsymbol{w}^T_{k1},\ldots,\boldsymbol{w}^T_{kR_k-1})^T$ where $\boldsymbol{w}_{kr}=(w_{kr0},w_{kr1})^T$ being the $2$-dimensional coefficient vector for the $r$th logistic component with $\boldsymbol{w}_{kR_k}$ being the null vector.
This choice is due to the flexibility of the logistic function in both determining the regime transition points and accurately modeling abrupt and/or smooth regimes changes. Indeed, as shown in \cite{chamroukhi_et_al_NN2009,chamroukhi_et_al_neurocomp2010}, the logistic function (\ref{eq:logistic prob for regime g k r}) parameters $(w_{kr0}, w_{kr1})$ control the regime transition points and the quality of regime (smooth or abrupt). Remark that here we used a linear logistic function for contiguous regime segmentation.
The RHLP model can be seen as a Mixture of Experts \citep{NguyenChamroukhi-MoE} where the experts are polynomial regressors and the gating network is a logistic tranformation of a linear function of the predictor $x$ (e.g., the time $t$ in time series). To highlight the flexibility of this modeling based on the RHLP model \citep{chamroukhi_et_al_NN2009}, Fig. \ref{fig:RHLP illustration} shows the RHLP model (\ref{eq:RHLP}) fitted to each of the three railway switch operation curves shown in Fig. \ref{fig: switch curve examples} where each operation signal is composed of five successive movements, each of them is associated with a regime in the RHLP model. The provided results show both flexible segmentation via tha the logistic probabilities (middle) and the approximation (top and bottom).
\begin{figure}[htbp]
\centering
\begin{tabular}{ccc}
\includegraphics[height = 2.5cm,width=3.7cm]{switch-curve-class-1-and-RHLP-polynomials} &
\includegraphics[height = 2.5cm,width=3.7cm]{switch-curve-class-2-and-RHLP-polynomials} &
\includegraphics[height = 2.5cm,width=3.7cm]{switch-curve-class-3-and-RHLP-polynomials} \\
\includegraphics[height = 2.5cm,width=3.7cm]{switch-curve-class-1-and-RHLP-logistic-prob} &
\includegraphics[height = 2.5cm,width=3.7cm]{switch-curve-class-2-and-RHLP-logistic-prob} &
\includegraphics[height = 2.5cm,width=3.7cm]{switch-curve-class-3-and-RHLP-logistic-prob}\\
\includegraphics[height = 2.5cm,width=3.7cm]{switch-curve-class-1-and-RHLP-model}&
\includegraphics[height = 2.5cm,width=3.7cm]{switch-curve-class-2-and-RHLP-model}&
\includegraphics[height = 2.5cm,width=3.7cm]{switch-curve-class-3-and-RHLP-model}
\end{tabular}
\caption{Results obtained with the proposed RHLP on a real switch operation time series: The signal and the polynomial regimes (top), the corresponding estimated logistic proportions (middle) and the obtained mean curve (bottom).}
\label{fig:RHLP illustration}
\end{figure}Given the defined model for each of the $K$ components, the resulting of a curve has the following MixRHLP form:
{\small \begin{equation}
f(\boldsymbol{y}_i|\boldsymbol{x}_i;\boldsymbol{\varPsi})
= \sum_{k=1}^{K} \alpha_{k} \prod_{j=1}^{m_i} \sum_{r=1}^{R_{k}}\pi_{kr}(x_j;\mathbf{w}_{k})\mathcal{N}\big(y_{ij};\boldsymbol{\beta}_{kr}^T \boldsymbol{x}_{j},\sigma_{kr}^{2} \big)
\label{eq:MixRHLP}
\end{equation}}with parameter vector
$\boldsymbol{\varPsi} =(\alpha_1,\ldots,\alpha_{K-1},\boldsymbol{\varPsi}^T_1,\ldots,\boldsymbol{\varPsi}^T_{K})^T$.
Notice that the key difference between the proposed MixRHLP and the standard regression mixture model is that the proposed model uses a generative hidden process regression model (RHLP) for each component rather than polynomial or spline components; The RHLP is itself based on a dynamic mixture formulation. Thus, the proposed approach is more adapted for accomodating the regime changes within curves during time.
\subsubsection{Maximum likelihood estimation via a dedicated EM algorithm}
\label{sec: parameter estimation by EM mixture functional rhlp}
The unknown parameter vector $\boldsymbol{\varPsi}$ is estimated
from an independent sample of unlabeled curves $\mathcal{D} =((\boldsymbol{x}_1,\boldsymbol{y}_1),\ldots,(\boldsymbol{x}_n,\boldsymbol{y}_n))$ by monotonically maximizing the following log-likelihood
{ \begin{equation}
\log L(\boldsymbol{\varPsi})
= \!\!\sum_{i=1}^n \log \sum_{k=1}^{K} \alpha_{k} \prod_{j=1}^{m_i} \sum_{r=1}^{R_{k}}\pi_{kr}(x_j;\mathbf{w}_{k})\mathcal{N}\big(y_{ij};\boldsymbol{\beta}_{kr}^T \boldsymbol{x}_{j},\sigma_{kr}^{2} \big)\nonumber
\label{eq:loglik MixFRHLP}
\end{equation}}via a dedicated EM algorithm.
The EM scheme requires the definition of the complete-data log-likelihood. The complete-data log-likelihood for the proposed MixRHLP model, given the observed data which we denote by $\mathcal{D}$, the hidden component labels $\mathbf{Z}$, and the hidden process $\{\mathbf{H}_{k}\}$ for each of the $K$ components, is given by:
{ \begin{eqnarray}
\log L_c(\boldsymbol{\varPsi}) = \sum_{i=1}^n \sum_{k=1}^{K} Z_{ik} \log \alpha_{k} + \sum_{i=1}^n \sum_{j=1}^{m_i}\sum_{k=1}^{K}\sum_{r=1}^{R_k} Z_{ik} H_{ijr} \log \left[\pi_{kr}(x_j;\mathbf{w}_k)
\mathcal{N}\left(y_{ij};{\boldsymbol{\beta}}^{T}_{kr}\boldsymbol{x}_{j},\sigma^2_{kr}\right)\right].
\label{eq:complete log-lik for the MixRHLP}
\end{eqnarray}}The EM algorithm for the MixRHLP model (EM-MixRHLP) starts with an initial parameter $\boldsymbol{\varPsi}^{(0)}$ and alternates between the two following steps until convergence:
\paragraph{The E-step}
\label{par: E-step mixture of rhlp and EM}
computes the expected complete-data log-likelihood, given the observations $\mathcal{D}$, and the current parameter estimation $\boldsymbol{\varPsi}^{(q)}$ and is given by:
{\begin{eqnarray}
\!\!\!\!\!\!\!\! Q(\boldsymbol{\varPsi},\boldsymbol{\varPsi}^{(q)}) & =& \mathbb{E}\left[\log L_c(\boldsymbol{\varPsi})\big|\mathcal{D};\boldsymbol{\varPsi}^{(q)}\right]\nonumber \\
& = &
\sum_{i=1}^n\!\sum_{k=1}^{K} \!\! \tau_{ik}^{(q)} \log \alpha_{k} +\sum_{i=1}^n \! \sum_{k=1}^{K}\! \sum_{j=1}^{m_i}\! \sum_{r=1}^{R_{k}}\!\!
\tau_{ik}^{(q)}\gamma^{(q)}_{ijr} \log \left[\pi_{kr}(x_j;\mathbf{w}_{k})
\mathcal{N} \left(y_{ij};{\boldsymbol{\beta}}^{T}_{kr}\boldsymbol{x}_{j},\sigma^2_{kr} \right)\right]\!\cdot
\label{eq:Q-function for the MixRHLP}
\end{eqnarray}}As shown in the expression of $Q(\boldsymbol{\varPsi},\boldsymbol{\varPsi}^{(q)})$, this step simply requires the calculation of each of the posterior component probabilities, that is, the probability that the $i$th observed curve originates from component $k$ which is given by applying Bayes' theorem:
{ \begin{equation}
\tau_{ik}^{(q)}
= \mathbb{P}(Z_{i}=k|\boldsymbol{y}_i,\boldsymbol{x}_i;\boldsymbol{\varPsi}_{k}^{(q)})
= \alpha_{k}^{(q)} f_k(\boldsymbol{y}_i |\boldsymbol{x}_i;\boldsymbol{\varPsi}^{(q)}_{k})\Big/\sum_{k\prime =1}^{K} \alpha_{k'}^{(q)}f_{k'}(\boldsymbol{y}_i |\boldsymbol{x}_i;\boldsymbol{\varPsi}^{(q)}_{k\prime}
\label{eq:MixRHLP clusters post prob}
\end{equation}}where the conditional densities are given by (\ref{eq:RHLP}),
and the posterior regime probabilities given a mixture component, that is, the probability that the observation $y_{ij}$, for example at time $x_j$ in a temporal context, originates from the $r$th regime of component $k$, which is given by applying the Bayes' theorem:
\begin{equation}
\gamma^{(q)}_{ijr}
= \mathbb{P}(H_{ij}=r|Z_{i}=k, y_{ij}, t_j;\boldsymbol{\varPsi}^{(q)}_{k})
=\frac{\pi_{kr}(x_j;\mathbf{w}_{k}^{(q)})\mathcal{N}(y_{ij};\boldsymbol{\beta}^{T(q)}_{kr}\boldsymbol{x}_{j},\sigma^{2(q)}_{kr})}
{\sum_{r\prime=1}^{R_{k}}\pi_{kr\prime}(x_j;\mathbf{w}_{k}^{(q)})\mathcal{N}(y_{ij};\boldsymbol{\beta}^{T(q)}_{kr\prime}\boldsymbol{x}_{j},\sigma^{2(q)}_{k r\prime})}\cdot
\label{eq:MixRHLP regimes post prob}
\end{equation}It can be seen that here the posterior regime probabilities are computed directly without need of a forward-backward recursion as in the Markovian model.
\paragraph{The M-step}
\label{par: M-step mixture of rhlp and EM}
updates the value of the parameter vector $\boldsymbol{\varPsi}$ by maximizing the $Q$-function (\ref{eq:Q-function for the MixRHLP}) w.r.t $\boldsymbol{\varPsi}$, that is:
$\boldsymbol{\varPsi}^{(q+1)} = \arg \max_{\boldsymbol{\varPsi}} Q(\boldsymbol{\varPsi},\boldsymbol{\varPsi}^{(q)}).$
The mixing proportions updates are given as in the case of standard mixtures by (\ref{eq:EM-FunMM pi_k update})
The maximization w.r.t the regression parameters consists in separate analytic solutions of weighted least-squares problems where the weights are the product of the posterior probability $\gamma^{(q)}_{ik}$
of component $k$ and the posterior probability $\gamma^{(q)}_{ijr}$
of regime $r$.
Thus, the updating formula for the regression coefficients and the variances are respectively given by (\ref{eq:regression param update for the MixHMMR}) and (\ref{eq:variance update for the MixHMMR}).
These updates are indeed the same those of the MixHMMR model, the only difference in that posterior cluster and regime memberships are calculated in a different way because of the different modeling for the hidden categorical variable $H$ representing the regime. It follows a Markov chain for the MixHMMR model and a logistic process for the MixRHLP model.\\
Finally, the maximization w.r.t the logistic processes' parameters $\{\mathbf{w}_{k}\}$ consists in solving multinomial logistic regression problems weighted by the posterior probabilities $\tau_{ik}^{(q)}\gamma^{(q)}_{i j r}$ which we solve with a multi-class IRLS algorithm (see for example \citep{Chamroukhi-IJCNN-2009} for more detail on IRLS).
The parameter update $ {\mathbf{w}}_{k}^{(q+1)} $ is then taken at convergence of the IRLS algorithm.
\subsubsection{Experiments}
The clustering accuracy of the proposed algorithm was evaluated using experiments carried out on simulated time series and real-world time series issued from a railway application. See for example \cite{Chamroukhi-MixRHLP-2011}. The obtained results are compared with those provided by the standard mixture of regressions and the $K$-means-like clustering approach based on piecewise regression \cite{HebrailEtAl2010}.
Two criteria were used: the misclassification error between the true partition and the estimated partition, and the intra-cluster inertia.
\paragraph{Simulation results}
The results in terms of misclassification error and intra-cluster inertia have shown that the proposed EM-MixRHLP algorithm outperforms the EM when used with regression mixtures. Although the misclassification percentages of the two approaches are close in particular in some situations, particularly for a small noise variance, the intra-cluster inertia differs from about $10^4$. The misclassification provided by the regression mixture EM algorithm more rapidly increases with the noise variance level, compared to the proposed EM-MixRHLP approach.
When the noise variance increases, the intra-cluster inertia obtained by the two approaches naturally increases, but the increase is less pronounced for the proposed approach compared to the regression mixture alternative.
In addition, the obtained results showed that, as expected, contrary to the proposed model, the regression mixture model cannot accurately model time series which are subject to changes in regime.
For model selection using BIC, the overall performance of the proposed algorithm is better than that of the regression mixture EM algorithm and the $K$-means like approach.
\paragraph{Experiments using real railway time series}
We used $n=140$ times series issued from a railway diagnosis application.
The specificity of the time series to be analyzed in this context as mentioned before is that they are subject to various changes in regime as a result of the mechanical movements involved in a switching operation. We accomplished this clustering task using our EM-MixRHLP algorithm, designed for estimating the parameters of a mixture of hidden process regression models.
We compared the proposed EM algorithm to the regression mixture EM algorithm and the $K$-means like algorithm for piecewise regression.
The obtained results, as shwon in Fig. \ref{fig.MixRHLP switch data} show that the proposed regression approach provides the smallest intra-cluster inertia and misclassification rate.
\begin{figure}[H]
\centering
\includegraphics[width=13cm]{intra-class-inertia-MixRHLP}
\caption{Misclassification error and intra-cluster inertia in relation to the noise level
\label{fig.MixRHLP switch data}}
\end{figure}Note that a CEM derivation of the current version is direct and obvious, and consists in assigning the curves in a hard way during the EM iterations, rather than in a soft way as what is done now via the posterior cluster memberships. One can further extend this to the regimes, by assigning the observations to the regimes also in a hard way, especially in the case where there are only abrupt change points in order to promote the segmentation.
\section{Functional Data Discriminant Analysis}
\label{sec:FMDA-MixRHLP}
The previous sections were dedicated to cluster analysis of functional data where the aim was to explore a functional data set to automatically determine groupings of individual curves where the potential group labels are unknown.
Here, we investigate the problem of prediction for functional data, specifically, the one of predicting the group label $C_i$ of a newly observed unlabeled individual $(\boldsymbol{x}_i,\boldsymbol{y}_i)$ describing a function, based on a training set of labeled data
$\mathcal{D}=((\boldsymbol{x}_1,\boldsymbol{y}_1,c_1),\ldots,(\boldsymbol{x}_n,\boldsymbol{y}_n,c_n))$
as described in Section \ref{sec:FDClass-FunMM}.
Two different approaches are possible to accomplish the discriminant task, depending on how the class-conditional densities are modeled.
\subsection{Functional linear discriminant analysis}
\label{ssec: FLDA state of the art}
The first approach is referred to as linear discriminant analysis (FLDA), first proposed in \cite{garetjamesANDtrevorhastieJRSS2001} for irregularly sampled curves, and arises when, in the prediction rule (\ref{eq:MAP rule for FDA classification}), we model each class-conditional density with a single component model, for example a polynomial, spline or a B-spline regression model
with $\mathbf{X}_i$ is the design matrix of the chosen regression type and $\boldsymbol{\varPsi}_g = (\boldsymbol{\beta}^T_g,\sigma_g^2)^T$ the parameter vector of class $g$.
However, for curves with regime changes, these models are not appropriate. In \cite{chamroukhi_et_al_neurocomp2010}, the proposed FLDA with hidden process regression, in which each class is modeled with the regression model with a hidden logistic process (RHLP) that accounts for regime changes through the tailored the class-specific density given by:
\begin{equation}
f(\boldsymbol{y}_i|C_{i}=g,\boldsymbol{x}_i;\boldsymbol{\varPsi}_g) = \prod_{j=1}^{m_i} \sum_{r=1}^{R_g}\pi_{gr}(t_j;\mathbf{w}_{g})\mathcal{N}\big(y_{ij};\boldsymbol{\beta}_{gr}^T \boldsymbol{x}_{j},\sigma_{gr}^{2} \big)
\label{eq:RHLP for classification}
\end{equation}where $\boldsymbol{\varPsi}_{g} = (\mathbf{w}^T_g,\boldsymbol{\beta}^T_{g1},\ldots,\boldsymbol{\beta}^T_{gR_{g}},\sigma^2_{g1},\ldots,\sigma^2_{gR_g})^T$ is the parameter vector of class $g$.
In this FLDA context, each class estimation itself involves an unsupervised task regarding the hidden regimes, which is performed by an EM algorithm as presented in \cite{chamroukhi_et_al_neurocomp2010}.
However, the FLDA approaches are more suited to homogeneous classes of curves and are not appropriate for dealing with dispersed classes, that is, when each class is itself composed of several sub-populations of curves.
\subsection{Functional mixture discriminant analysis}
The more flexible way in such a context of heterogeneous classes of functions is to rely on the idea of mixture discriminant analysis (MDA) for heterogeneous groups, introduced by \cite{hastieANDtibshiraniMDA} for multivariate data discrimination.
Indeed, while the global discrimination task is supervised, in some situations, it may include an unsupervised task which in general relates clustering possibly dispersed classes into homogeneous sub-classes.
In many areas of application of classification, a class may itself be composed of several unknown (unobserved) sub-classes.
For example, in handwritten digit recognition, there are several characteristic ways to write a digit, and therefore a creation of several sub-classes within the class of a digit itself, which may be modeled using a mixture density as in \cite{hastieANDtibshiraniMDA}. In complex systems diagnosis applications, for example when we have to decide between two classes, say without or with defect, one would have only the class labels indicating just either with or without defect, however no labels according to how a defect would happen, namely the type of defect, the degree of defect, etc.
Another example is the one of gene function classification based on time course gene expression data. As stated in \cite{Gui-FMDA} when considering the complexity of the gene functions, one functional class may include genes which involve one or more biological profiles.
Describing each class as a combination of sub-classes is therefore necessary to provide realistic class representation, rather than providing a rough representation through a simple class-conditional density.
Here we consider the classification of functional data, particularly curves with regime changes, into classes arising from sub-populations.
It is therefore assumed that each class $g$ $(g=1,\ldots,G)$ has a complex shape arising from $K_g$ homogeneous sub-classes. Furthermore, each sub-class $k$ $(k=1,\ldots,K_g)$ of class $g$ is itself governed by $R_{gk}$ unknown regimes $(r=1,\ldots,R_{gk})$.
In such a context, the global discrimination task includes a two-level unsupervised task. The first one is the one that attempts to automatically cluster possibly dispersed classes into several homogeneous clusters (i.e., sub-classes), and the second aims at automatically determining the regime locations of each sub-class, which is a segmentation task.
A first idea on functional mixture discriminant analysis, motivated by the complexity of the time course gene expression functional data was proposed by \cite{Gui-FMDA} and is based on B-spline regression mixtures.
However, using polynomial or spline regressions for class representation, as studied for example in \cite{chamroukhi_et_al_neurocomp2010} is better suited for smooth and stationary curves. the case where curves exhibit a dynamical behavior through abrupt changes, one may relax the spline regularity constraints, which leads to the previously developed MixPWR model (see Section \ref{sec:PWRM}).
Thus, in such context the generative functional mixture models presented previously can also be used as class-conditional densities, that is,
the MiHMMR, and the MixRHLP presented respectively in Sections \ref{sec:MixHMMR} and \ref{sec:MixRHLP}.
Here we only focus on the use of the mixture of RHLP since it is also dedicated to clustering and is flexible and explicitly integrates the smooth and/or abrupt regime changes via the logistic process.
This leads to functional mixture discriminant analysis (FMDA) with hidden logistic process regression \citep{Chamroukhi-FMDA-neucomp2013,Chamroukhi-IJCNN-2012}, in which the class-conditional density for a function is given by a MixRHLP (\ref{eq:MixRHLP}):
{\small \begin{eqnarray}
f(\boldsymbol{y}_i|C_i = g, \boldsymbol{x}_i;\boldsymbol{\varPsi}_g) & =& \sum_{k=1}^{K_g} \mathbb{P}(Z_i = k|C_i = g) f(\boldsymbol{y}_i|C_i = g, Z_i = k,\boldsymbol{x}_i;\boldsymbol{\varPsi}_{gk}) \nonumber \\
&=& \sum_{k=1}^{K_g} \alpha_{gk} \prod_{j=1}^m \sum_{r=1}^{R_{gk}}\pi_{gkr}(x_j;\mathbf{w}_{gk})\mathcal{N}\big(y_{ij};\boldsymbol{\beta}_{gkr}^T \boldsymbol{x}_{j},\sigma_{gkr}^{2} \big),
\label{eq:MixRHLP-FMDA}
\end{eqnarray}}where $\boldsymbol{\varPsi}_g =(\alpha_{g1},\ldots,\alpha_{gK_g},\boldsymbol{\varPsi}^T_{g1},\ldots,\boldsymbol{\varPsi}^T_{gK_g})^T$ is the parameter vector for class $g$, $\alpha_{gk} = \mathbb{P}(Z_i = k|C_i = g)$ is the proportion of component $k$ of the mixture for group $g$ and $\boldsymbol{\varPsi}_{gk}$ the parameter
vector of its RHLP component density.
Then, once we have an estimate $\hat{\boldsymbol{\varPsi}}_{g}$ of the parameter vector of the functional mixture density MixRHLP (provided by the EM algorithm described in the previous section) for each class, a new discretely sampled curve $(\boldsymbol{y}_i,\boldsymbol{x}_i)$ is then assigned to the class maximizing the posterior probability, i.e, the Bayes' optimal allocation rule (\ref{eq:MAP rule for FDA classification}).
\subsection{Experiments}
\label{sec:FMDA experiments}
The proposed FMDA approach was evaluated in \cite{Chamroukhi-FMDA-neucomp2013} on simulated data and real-world data from a railway diagnosis application.
We performed comparisons with alternative functional discriminant analysis approaches using polynomial regression (FLDA-PR) or a spline regression (FLDA-SR) model \citep{garetjamesANDtrevorhastieJRSS2001}, and the FLDA one that uses a single RHLP model per class (FLDA-RHLP) as in \cite{chamroukhi_et_al_neurocomp2010}. We also performed comparisons with alternative FMDA approaches that use polynomial regression mixtures (FMDA-PRM), and spline regression mixtures (FMDA-SRM) as in \cite{Gui-FMDA}.
Two evaluation criteria were used: the misclassification error rate computed by a $5$-fold cross-validation procedure, which evaluates the discrimination performance,
and the mean squared error between the observed curves and the estimated mean curves, which is equivalent to the intra-cluster inertia, and evaluates the performance of the approaches with respect to the curves modeling and approximation.
\paragraph{Simulation results}
The obtained results have shown that the proposed FMDA-MixRHLP approach accurately decomposes complex-shaped classes into homogeneous sub-classes of curves and account for underlying hidden regimes for each sub-class.
Furthermore, the flexibility of the logistic process used to model the hidden regimes allows for accurately approximating both abrupt and/or smooth regime changes within each sub-class.
We also notice that the FLDA approach with spline or polynomial regression, provide poor approximations in the case of non-smooth regime changes compared to alternatives.
The FLDA with RHLP accounts better for the regime changes, however, not surprising, for complex classes having sub-classes, it provides unsatisfactory results.
This is confirmed upon observing the obtained intra-cluster inertia results.
Indeed, the smallest intra-cluster inertia is obtained for the proposed FMDA-MixRHLP approach which outperforms the alternative FMDA based on polynomial regression mixtures (FMDA-PRM) and spline regression mixtures (FMDA-SRM). This performance is attributed to the flexibility of the MixRHLP model due to the logistic process which is appropriate for modeling the regime changes.
Also, in terms of curve classification, the FMDA approaches provide better results compared to the FLDA approaches. This is due to the fact that using a single model for complex-shaped classes (i.e., when using FLDA approaches) is not sufficient as it does not take into account the class heterogeneity when modeling the class-conditional density. On the other hand, the proposed FMDA-MixRHLP approach provides better modeling that results in more accurate class predictions.
\paragraph{Experiments on real data}Here the assessed data are from a railway diagnosis application as studied in \cite{chamroukhi_et_al_NN2009,chamroukhi_et_al_neurocomp2010,Chamroukhi-MixRHLP-2011}.
The data are the curves of the instantaneous electrical power consumed during the switch actuation period.
The database is composed of $n=120$ labeled real switch operation curves. Each curve consists of $m=564$ discretely sampled pairs. Two classes were considered, where the first one is composed by the curves with no defect or with a minor defect and the second class contains curves without defect. The goal is therefore to provide an accurate automatic modeling especially for the first class which is henceforth dispersed into two sub-classes. The proposed method ensure both an accurate decomposition of the complex-shaped class into sub-classes and at the same time, a good approximation of the underlying regimes within each homogeneous set of curves. The logistic process probabilities are close to $1$ when the regression model seems to be the best fit for the curves and vary over time according to the smoothness degree of regime transition.
Figure \ref{fig: switch-curves-MixRHLP results} shows modeling results provided by the proposed FMDA-MixRHLP for each of the two classes.
We see that the proposed method ensure both an accurate decomposition of the complex-shaped class into sub-classes and at the same time, a good approximation of the underlying regimes within each homogeneous set of curves. This also illustrates the clustering and segmentation using the MixRHLP presented in the previous section.
\begin{figure}[htbp]
\centering
{\small \begin{tabular}{ccc}
\includegraphics[width=4.27cm,height=3 cm]{result_switch_curves_class1}&
&
\includegraphics[width=4.27cm,height=3 cm]{result_switch_curves_class2}
\\
(a) & & (b) \\
\includegraphics[width=4.27cm,height=3 cm]{result_switch_curves_subclass1}&
\includegraphics[width=4.27cm,height=3 cm]{result_switch_curves_subclass2}&
\includegraphics[width=4.27cm,height=3 cm]{result_switch_curves_regressors_class2}
\\
(c) & (d) & (e) \\
\includegraphics[width=4.27cm,height=3 cm]{result_switch_curves_regressors_subclass1}
&
\includegraphics[width=4.27cm,height=3 cm]{result_switch_curves_regressors_subclass2}
&
\includegraphics[width=4.27cm,height=2.8 cm]{result_switch_curves_regime_prob_class2}
\\
(f) & (g) & (h) \\
\includegraphics[width=4.27cm,height=2.8 cm]{result_switch_curves_regime_prob_subclass1}
&
\includegraphics[width=4.27cm,height=2.9 cm]{result_switch_curves_regime_prob_subclass2}\\
(i) & (j)
\end{tabular}}
\caption{\label{fig: switch-curves-MixRHLP results}
Results obtained with the proposed FMDA-MiXRHLP for the real switch operation curves.
The estimated clusters (sub-classes) for class 1 and the corresponding mean curves (a); Then, we show separately each sub-class of class 1 with the estimated mean curve presented in a bold line (c,d), the polynomial regressors (degree $p=3$) (f,g) and the corresponding logistic proportions that govern the hidden processes (i,j). Similarly, for class 2, we show the estimated mean curve in bold line (b), the polynomial regressors (e) and the corresponding logistic proportions (h).}
\end{figure}
%
The obtained classification results,
while they were similar for the FMDA approaches, are significantly different in terms of curve approximation, for which the proposed FMDA-MixRHLP approach clearly outperforms the alternative ones. This is attributed to the fact that the use of polynomial regression mixtures for FMDA-PRM or spline regression mixtures (FMDA-SRM) is less able to fit the regime changes when compared to the proposed model.
The proposed approach provides the better results, but also has more parameters
to estimate compared to the alternatives.
But note that, for this dataset, in terms of required computational effort to train each of the compared methods, the FLDA approaches are faster than the FMDA ones. In FLDA, both the polynomial regression and the spline regression approaches are analytic and do not require a numerical optimization scheme.
The FLDA-RHLP approach is based on an EM algorithm which is
much faster compared to piecewise regression which uses dynamic programming.
The alternative FMDA approaches using polynomial regression mixture and spline regression mixture are also fast and the EM algorithm used for that models requires only few seconds to converge in practice.
However, these approaches are clearly not suitable for the regime change problem. To do that, one needs to built a piecewise regression-based model which requires dynamic programming and therefore may require more computational time especially for large curves, and is mainly appropriate for abrupt regime changes.
The training procedure for the proposed MixFRHLP-FMDA approach is not especially time consuming, the training for the data of class 1 (which is the more complex class), requires a mean computational time of around up to three minutes in Matlab software using a laptop CPU of 2Ghz and 8GB of memory.
\section{Conlusions}
\label{sec:Conclusion}
Functional data analysis is an important topic in statistics. Latent data modeling is a powerful paradigm for the analysis of complex data with unknown hidden structures, and thus for the cluster and the discriminant analyses of heterogeneous data.
We presented mixture model-based approaches and demonstrated the inferential capabilities of such models for the analysis of functional data.
We demonstrated how to conduct clustering, classification and regression in such situations.
We studied the regression mixtures and presented a new robust EM-like algorithm for fitting regression mixtures and
model-based curve clustering. The approach optimizes a penalized log-likelihood and overcomes both the problem of sensitivity to initialization and determining the optimal number of clusters for standard EM for regression mixtures.
This constitutes an interesting fully-unsupervised approaches that simultaneously infers the model and its optimal number of components.
We also considered the problem of modeling and clustering of spatial functional data using dedicated regression mixture model with mixed effects.
The experimental results on simulated data and real-world data demonstrate the benefit of the proposed approach for applications in curve and surface clustering.
We then studied the problem of simultaneous clustering and segmentation of functions governed by regime changes. We introduced a new probabilistic approach based on a piecewise polynomial regression mixture (PWRM) for simultaneous clustering and optimal segmentation of curves with regime changes. We provided two algorithms for parameter estimation.
The first (EM-PWRM) consists of using the EM algorithm to maximize the observed data log-likelihood and the latter (CEM-PWRM) is a CEM algorithm to maximize the complete-data log-likelihood. We showed that the CEM-PWRM algorithm is a probabilistic generalization of the $K$-means-like algorithm of \cite{HebrailEtAl2010}.
However, it is worth to mention that if the aim is density estimation, the EM version is suggested since the CEM provides biased estimators but is well-tailored to the segmentation/clustering end.
The obtained results demonstrated the benefit of the proposed approach in terms of both curve clustering, and piecewise approximation and segmentation of the regimes of each cluster. In particular, the comparisons with the $K$-means-like algorithm approach confirm that the proposed CEM-PWRM is an interesting probabilistic alternative.
We note that in some practical situations involving continuous functions the proposed piecewise regression mixture, in its current formulation, may lead to discontinuities between segments for the piecewise approximation. This may be avoided by slightly modifying the algorithm by adding an interpolation step as performed in \cite{HebrailEtAl2010}.
Then, the introduced mixture of polynomial regression models governed by hidden Markov chains is particularly appropriate for clustering curves with various changes in regime and rely on a suitable generative formulation. The experimental results demonstrated the benefit of the proposed approach as compared to existing alternative methods, including the regression mixture model and the standard mixture of hidden Markov models. It also represents a fully-generative alternative to the previously described mixture of piecewise regressions.
While the model in its current version only concerns univariate time series, we believe that its extension to the multivariate case requires little additional effort.
We then presented a new mixture model-based approach for clustering and segmentation of univariate functional data with changes in regime. This approach involves modeling each cluster using a particular regression model whose polynomial coefficients vary across the range of the inputs, typically time, according to a discrete hidden process. The transition between regimes is smoothly controlled by logistic functions. The maximum likelihood estimate of the model parameter is conducted via a dedicated EM algorithm. The proposed approach can also be regarded as a clustering approach, which operates by finding groups of time series having common changes in regime.
The experimental results, both from simulated time series and from a real-world application, show that the proposed approach is an efficient means for clustering univariate time series with changes in regime.
Note that a CEM derivation of the current version is direct and obvious, and consists in assigning the curves in a hard way during the EM iterations, rather than in a soft way as what is done now via the posterior cluster memberships. One can further extend this to the regimes, by assigning the observations to the regimes also in a hard way, especially in the case where there are only abrupt change points in order to promote the segmentation.
Then, in the framework of model selection, in a such extension, as well as for the current version of the model, it would be interesting to derive an ICL type criterion \citep{ICL} which is known to be suited to the clustering and segmentation objectives.
Finally, the presented mixture model-based approach for functional data discrimination includes unsupervised tasks that relate clustering dispersed classes and determining possible underlying unknown regimes for each sub-class. It is therefore suggested for the classification of curves organized in sub-groups and presenting a non-stationary behaviour arising in regime changes.
Furthermore, the proposed functional discriminant analysis approach, as it uses a hidden logistic process regression model for each class, is particularly adapted for modeling abrupt and smooth regime changes.
Each class is trained in an unsupervised way by a dedicated EM algorithm.
\renewcommand{\baselinestretch}{1.3}
\normalsize
\setlength{\bibsep}{0.1pt}
\bibliographystyle{apalike
{
| {'timestamp': '2018-03-05T02:06:32', 'yymm': '1803', 'arxiv_id': '1803.00276', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00276'} | arxiv |
\section{#1} \vspace{-1.5mm}}
\newcommand{\SubSection}[1]{\vspace{-1.2mm} \subsection{#1} \vspace{-1.2mm}}
\newcommand{\SubSubSection}[1]{\vspace{-3mm} \subsubsection{#1} \vspace{-1mm}}
\setcounter{page}{1}
\begin{document}
\title{Joint Pixel and Feature-level Domain Adaptation in the Wild}
\author{Luan Tran$^1$\thanks{The work was conducted as part of Luan Tran's internship at NEC Labs America during summer 2017.}
\hspace{0.08in} Kihyuk Sohn$^{2}$
\hspace{0.08in} Xiang Yu$^2$
\hspace{0.08in} Xiaoming Liu$^1$
\hspace{0.08in} Manmohan Chandraker$^{2,3}$
\vspace{1mm} \\
\hspace{0.15in} $^{1}$Michigan State University
\hspace{0.15in} $^{2}$NEC Labs America
\hspace{0.15in} $^{3}$UC San Diego\\
}
\maketitle
\thispagestyle{empty}
\begin{abstract}
\vspace{-0.1in}
Recent developments in deep domain adaptation have allowed knowledge transfer from a labeled source domain to an unlabeled target domain at the level of intermediate features or input pixels. We propose that advantages may be derived by combining them, in the form of different insights that lead to a novel design and complementary properties that result in better performance. At the feature level, inspired by insights from semi-supervised learning in a domain adversarial neural network, we propose a novel regularization in the form of domain adversarial entropy minimization. Next, we posit that insights from computer vision are more amenable to injection at the pixel level and specifically address the key challenge of adaptation across different semantic levels. In particular, we use 3D geometry and image synthesization based on a generalized appearance flow to preserve identity across higher-level pose transformations, while using an attribute-conditioned CycleGAN to translate a single source into multiple target images that differ in lower-level properties such as lighting. We validate on a novel problem of car recognition in unlabeled surveillance images using labeled images from the web, handling explicitly specified, nameable factors of variation through pixel-level and implicit, unspecified factors through feature-level adaptation. Extensive experiments achieve state-of-the-art results, demonstrating the effectiveness of complementing feature and pixel-level information via our proposed domain adaptation method.
\end{abstract}
\vspace{-0.1in}
\Section{Introduction}
\label{sec:intro}
Deep learning has made an enormous impact on many applications in computer vision such as generic object recognition~\cite{krizhevsky2012imagenet,simonyan2014very,szegedy2015going,he2016deep}, fine-grained categorization~\cite{wah2011caltech,krause20133d,schroff2015facenet}, object detection \cite{Lin_etal_2017b,Lin_etal_2017a,Liu_etal_2016,Redmon_etal_2016,Ren_etal_2015} and semantic segmentation \cite{Chen_etal_2017,Shelhamer_etal_2017}. Much of its success is attributed to the availability of large-scale labeled training data~\cite{deng2009imagenet,guo2016ms}. However, this is hardly true in many practical scenarios: since annotation is expensive, most data remains unlabeled. Consider car recognition problem from surveillance images, where factors such as camera angle, distance, lighting or weather condition are different across locations. It is not feasible to exhaustively annotate all these images. Meanwhile, there already exist abundant labeled data from web domain~\cite{krause20133d,yang2015large,gebru2017scalable}, but with very different image characteristics that precludes direct transfer of discriminative CNN-based classifiers. For instance, web images might be from catalog magazines with professional lighting and ground-level camera poses, while surveillance images can originate from cameras atop traffic lights in challenging lighting and weather conditions.
\begin{figure}[t]
\centering
\includegraphics[width=0.8\linewidth]{teasar_small.pdf}
\vspace{-0.1in}
\caption{\small Our framework for unsupervised domain adaptation at multiple semantic levels: for \emph{feature-level}, we bring insights from semi-supervised learning to obtain highly discriminative domain-invariant representations; at \emph{pixel-level}, we leverage complementary domain-specific vision insights e.g. geometry and attributes.\label{fig:teaser_small}}
\vspace{-0.25in}
\end{figure}
Unsupervised domain adaptation (UDA) is a promising tool for overcoming the lack of labeled training data in target domains. The goal of UDA is to transfer a classifier from the source to target domain. Several approaches aim to match distributions between source and target domains at different levels of representations, such as feature \cite{tzeng2014deep,tzeng2015simultaneous,ganin2016domain,Sohn_2017_ICCV} or pixel levels \cite{taigman2016unsupervised,shrivastava2016learning,zhu2017unpaired,Bousmalis_2017_CVPR}. Certain adaptation challenges are better handled in the feature space, but feature-level DA is a black-box algorithm for which adding domain-specific insights during adaptation is more difficult than in pixel space. On the contrary, pixel space is much higher-dimensional than feature space and the optimization problem is significantly under-determined without proper constraints. It has been an open challenge how to effectively combine them. Here we address this challenge by leveraging complementary tools that are inherently better-suited at each level (Figure~\ref{fig:teaser_small}).
Specifically, we posit that feature-level DA is more amenable to techniques from semi-supervised learning, while pixel-level DA allows domain-specific insights from computer vision. In Section~\ref{sec:domadapt}, we present our feature-level DA method that improves upon the state-of-the-art domain adversarial neural network (DANN)~\cite{ganin2016domain}. We extend an instance of SSL algorithm~\cite{salimans2016improved} to feature-level DA and show its equivalence to DANN (Figure~\ref{fig:domadv}). This opens the door to tools such as entropy minimization~\cite{grandvalet2005semi}, thus, we propose a domain adversarial entropy regularization that achieves highly discriminative and domain-invariant representations.
A challenge for pixel-level adaptation is to simultaneously transform source image properties at higher and lower semantic levels. We argue that proper incorporation of vision insights is needed to tackle this. In Section~\ref{sec:appflow}, we present pixel-level adaptation by image translation and synthesization that can make use of vision concepts to deal with different factors of variation, such as photometric or perspective transformations (Figure \ref{fig:teasar}).\footnote{Our framework is unsupervised DA in the sense that we don't require a recognition label from the target domain for training, but it demands for additional annotations to inject insights from vision concepts.} To handle low-level transformations, we propose an attribute-conditioned CycleGAN that extends \cite{zhu2017unpaired} to generate multiple target images with different attributes. To handle high-level identity-preserving pose transformations, we propose to use a warping-based image synthesization, such as appearance flow~\cite{zhou2016view}. To overcome semantic gaps between synthetic and real images, we propose a generalization of appearance flow with sparse keypoints as a domain bridge.
In Section~\ref{sec:exp}, we evaluate our framework on surveillance images of the comprehensive cars (CompCars) dataset~\cite{yang2015large} by defining an experimental protocol with web images as labeled source domain and surveillance images as unlabeled target domain. We propose to handle explicitly specified, nameable factors of variation such as pose and lighting through pixel-level DA, while other non-specified nuisance factors are handled by feature-level DA. We achieve $\mathbf{84.69}\%$ top-1 accuracy, reducing error by $\mathbf{66.0}\%$ from a model trained only on the source domain. We present ablation studies to demonstrate the importance of each adaptation component by extensively evaluating performances with various mixes of components. We further validate the effectiveness of our proposed feature-level DA methods on standard UDA benchmarks, achieving state-of-the-art error rates on three out of four experimental settings.
In summary, the main contributions of this work are:
\vspace{-0.2cm}
\begin{tight_itemize}
\item{A novel UDA method to adapt at multiple levels from pixel to feature, with insights for each type of adaptation.}
\item{For feature-level DA, a connection of DANN to a semi-supervised variant, motivating a novel regularization through domain adversarial entropy minimization.}
\item{For pixel-level DA, an attribute-conditioned CycleGAN to translate a single source image into multiple target images with different low-level attributes properties, along with a warping-based image synthesization for identity-preservation across pose translations.}
\item{Improved generalization of appearance flow from synthetic to real domains using keypoints as domain bridges.}
\item{A new experimental protocol on car recognition in surveillance domain, with detailed analysis of various modules and efficacy of our proposed UDA framework.}
\item{State-of-the-art performance on standard UDA benchmarks with our feature-level DA methods.}
\end{tight_itemize}
\vspace{-0.1in}
\Section{Related Work}
\label{sec:related}
\Paragraph{Unsupervised Domain Adaptation.}
Following theoretical developments of domain adaptation~\cite{ben2007analysis,ben2010theory}, a major challenge for UDA problems is to define a proper metric measuring the domain difference. The maximum mean discrepancy~\cite{uda-long2013,tzeng2014deep,fernando2015joint,tzeng2015simultaneous,sun2016deep}, which measures the difference based on kernels, and more recently the domain adversarial neural network~\cite{ganin2016domain,bousmalis2016domain,Bousmalis_2017_CVPR,Sohn_2017_ICCV}, which measures the difference using discriminator, have been successful. Noticing a similarity in problem settings between UDA and SSL, there have been attempts to better transfer classifier by aligning domains beyond matching global statistics. For example, an additional loss formulation such as entropy regularization~\cite{grandvalet2005semi} has been used in addition to domain adversarial loss for efficient label transfer~\cite{long2016unsupervised,luo_nips17_label}. We establish a connection between two frameworks by augmenting an instance of SSL based on generative adversarial network (GAN)~\cite{springenberg2015unsupervised,salimans2016improved,dai2017good} and further extend to combine techniques in a unified framework.
\Paragraph{Image-to-Image Translation.}
Hertzmann et al.~\cite{hertzmann2001image} employs a non-parametric texture model on a single input-output image pair to create image filter effects. With the successes of GAN on image generation~\cite{goodfellow2014generative,radford2015unsupervised}, conditional variants of GAN~\cite{mirza2014conditional} have been successfully adopted to image-to-image translation problems in both paired~\cite{isola2017image} and unpaired~\cite{shrivastava2016learning,taigman2016unsupervised,zhu2017unpaired} training settings. Our model extends the work of \cite{zhu2017unpaired} for image translation in unpaired settings to generate multiple outputs using a control variable~\cite{yan2016attribute2image}.
\Paragraph{Combining feature and pixel levels.}
A combination of pixel and feature level adaptation also been in attempted in contemporary work of \cite{hoffman2017cycada}, however, we differ in a few important ways. Specifically, we go further in using insights from semi-supervised learning that allow novel regularizations for feature-level adaptation, while exploiting 3D geometry and attribute-based conditioning in GANs to simultaneously handle high-level pose and low-level lighting variations, repsectively. Our experiments include a detailed study of the complementary benefits, as well as the effectiveness of various adaptation modules. While \cite{hoffman2017cycada} consider problems such as semantic segmentation, we study a car recognition problem that highlights the need for adaptation across various levels. Finally, we also obtain state-of-the-art results on standard UDA benchmarks.
\begin{figure*}[t]
\centering
\includegraphics[width=0.9\linewidth]{teasar.pdf}
\vspace{-0.1in}
\caption{\small Overview of our framework on car model recognition for surveillance images using labeled web data and unlabeled surveillance data. Images captured by surveillance cameras have a different distribution from web images in terms of nameable factors of variation, such as viewpoint (e.g., camera elevation) or lighting conditions (e.g., day or night) as well as other nuisance factors. We cast the problem into an unsupervised domain adaptation framework by integrating pixel-level adaptation for perspective and photometric transformations, with feature-level adaptation for other nuisance factors.\label{fig:teasar}}
\vspace{-0.2in}
\end{figure*}
\Paragraph{Perspective Transformation.}
Previous works~\cite{yang2015weakly,kulkarni2015deep,tatarchenko2015single} propose encoder-decoder networks to directly generate output images of target viewpoint. Adversarial training for perspective transformation~\cite{Tran_2017_CVPR,Yin_2017_ICCV} has demonstrated good performance on disentangling viewpoint from other appearance factors, but there are still concept switches in unpaired settings. Instead of learning the output distribution, \cite{zhou2016view,Park_2017_CVPR} proposed a warping-based viewpoint synthesization by estimating a dense pixel-level flow field called appearance flow. We extend to improve generalization to real images using synthetic-to-real domain invariant representations such as 2D keypoints.
\Section{Feature-level Domain Adaptation}
\label{sec:domadapt}
We introduce a domain adversarial neural network with semi-supervised learning (SSL) objective ({DANN-SS}, Figure~\ref{fig:domadv-ss}) motivated from SSL of generative adversarial network~\cite{salimans2016improved}. We show equivalence to standard DANN objective~\cite{ganin2016domain} upto a difference in discriminator parameterization and discuss an advantage of the proposed formulation (Section~\ref{sec:domadapt-semisup}). Through this connection to SSL, Section~\ref{sec:domadapt-entreg} proposes a domain adversarial entropy minimization ({DANN-EM}) that incorporates the idea of entropy minimization~\cite{grandvalet2005semi} into domain adversarial learning framework.
\Paragraph{Notation.}
Let $\mathcal{X}_{\text{S}},\mathcal{X}_{\text{T}}{\subset}\mathcal{X}$ be source and target datasets and $\mathcal{Y}{=}\{1,\cdots,N\}$ be the set for class label. Let $f{:}\mathcal{X}{\rightarrow}\mathbb{R}^{K}$ be the feature extraction function, e.g., CNN, with parameters $\theta_{f}$ that takes input $x$ and maps into $K$-dimensional vector.
\SubSection{Domain Adversarial Training for UDA}
\label{sec:domadapt-dann}
We first revisit the formulation of standard DANN~\cite{ganin2016domain}. The goal of domain adversarial training is to make feature representation $f(x)$ between domains indistinguishable so that the classifier learned from labeled source data can be transferred to target domain. This can be achieved through a domain discriminator $D:\mathbb{R}^{K}\rightarrow [0,1]$ that tells whether the representations from two domains are still distinguishable, and $f$ is trained to fool $D$ while classifying the source data correctly. The learning objective is written as:
\begin{align}
\max_{\theta_{c}}&\{\mathcal{L}_{\text{C}} {=}\;\mathbb{E}_{\mathcal{X}_{\text{S}}} \log C(f(x), y)\}\nonumber\\
\max_{\theta_{d}}&\{\mathcal{L}_{\text{D}} {=}\;\mathbb{E}_{\mathcal{X}_{\text{S}}} \log (1{-}D(f(x))) + \mathbb{E}_{\mathcal{X}_{\text{T}}} \log D(f(x))\} \nonumber
\end{align}
\begin{align}
\max_{\theta_{f}}&\{\mathcal{L}_{\text{F}} {=}\;\mathcal{L}_{\text{C}} + \lambda \mathbb{E}_{\mathcal{X}_{\text{T}}} \log (1{-}D(f(x)))\}. \label{eq:dann}
{\vspace{-2mm}}
\end{align}
Here, $C{:}\mathbb{R}^{K}{\times}\mathcal{Y} \rightarrow [0,1]$ is a class score function that outputs the probability of data $x$ being a class $y$ among $N$ categories, i.e., $P(y|f(x);\theta_{c})$ and $\lambda$ balances between classification and domain discrimination. The parameters $\{\theta_{c},\theta_{d},\theta_{f}\}$ are updated in turn using stochastic gradient descent.
\SubSection{Semi-Supervised Learning as DA Training}
\label{sec:domadapt-semisup}
We note that the problem setup of UDA is the same as that of SSL when we remove the notion of domains and consider two sets of training data, one labeled and the other unlabeled. With this in mind, we propose a new objective for UDA called {DANN-SS} motivated by the semi-supervised learning of generative adversarial network~\cite{salimans2016improved} whose learning objective is formulated as follows:
\begin{align}
{\vspace{-2mm}}
\max_{\theta_{c}}& \{\widetilde{\mathcal{L}}_{\text{C}}{=}\;\mathbb{E}_{\mathcal{X}_{\text{S}}}\log \widetilde{C}(y) + \mathbb{E}_{\mathcal{X}_{\text{T}}}\log \widetilde{C}(N{+}1)\}\label{eq:dann-semisup}\\
\max_{\theta_{f}}& \{\widetilde{\mathcal{L}}_{\text{F}}{=}\;\mathbb{E}_{\mathcal{X}_{\text{S}}}\log \widetilde{C}(y|\mathcal{Y})+\lambda\mathbb{E}_{\mathcal{X}_{\text{T}}}\log (1{-}\widetilde{C}(N{+}1)\}, \nonumber
{\vspace{-2mm}}
\end{align}
where we omit $f(x)$ from $\widetilde{C}$ for clarity. The major difference is that the discriminator $D$ no longer exists but instead a classifier $\widetilde{C}$ has one more output entry than $C$ to perform both classification and domain discrimination. The auxiliary $({N{+}1})^{\text{st}}$ class is reserved for the target domain and the domain of class score function $\widetilde{C}$ is $\mathbb{R}^{K}\times \mathcal{Y}\cup\{{N{+}1}\}$. The conditional score function in $\widetilde{\mathcal{L}}_{\text{F}}$ is written as follows:
\begin{equation}
{\vspace{-2mm}}
\widetilde{C}(y|\mathcal{Y}) = \widetilde{C}(y)/(1{-}\widetilde{C}(N{+}1)). \label{eq:cond_class_score}
{\vspace{-2mm}}
\end{equation}
\Paragraph{Relation to DANN.}
It is straightforward to see $\widetilde{\mathcal{L}}_{\text{F}}{=}{\mathcal{L}}_{\text{F}}$ since the first term of $\widetilde{\mathcal{L}}_{\text{F}}$ is for $N$-way classification score on the source data and the second term is for log-probability of the target data not being classified as a target class. We show $\widetilde{\mathcal{L}}_{\text{C}}=\mathcal{L}_{\text{C}} + \mathcal{L}_{\text{D}}$ by reformulating $\widetilde{C}(y)$ using Eq~\eqref{eq:cond_class_score}:
\begin{align*}
{\vspace{-2mm}}
\widetilde{\mathcal{L}}_{\text{C}} & = \mathbb{E}_{\mathcal{X}_{\text{S}}}\log \widetilde{C}(y|\mathcal{Y}) \\
& + \mathbb{E}_{\mathcal{X}_{\text{S}}}\log (1{-}\widetilde{C}(N{+}1)) + \mathbb{E}_{\mathcal{X}_{\text{T}}}\log \widetilde{C}(N{+}1).
{\vspace{-2mm}}
\end{align*}
Now it is clear that two formulations are equivalent with the constraints on the domain classification score $D{=}\widetilde{C}(N{+}1)$ and the class score $C(y){=}\widetilde{C}(y|\mathcal{Y})$.
Although it appears to be a subtle difference, we believe that joint parameterization of classifier and discriminator has a benefit over separate parameterization. For example, {DANN-SS} optimizes the decision boundary between source and target domain while looking at the classification boundaries, so they can be better regularized. Moreover, features may become more classifiable, i.e., in low entropy region for classifier, after $f$ is updated. As will be discussed in Section~\ref{sec:exp}, we also observe a significant empirical advantage of the {DANN-SS} parameterization over that of DANN.
\SubSection{Domain-Adversarial Entropy Regularization}
\label{sec:domadapt-entreg}
A reparameterization of DANN provides a new insight on how to adapt to target domain by taking into account the classifier. However, the adversarial objective of $\widetilde{\mathcal{L}}_{\text{F}}$ assumes no prior on the classification distribution for the target data. Instead, we can strengthen it by enforcing the class prediction distribution to be ``peaky'' while avoiding peakiness at the target class. To this end, we incorporate the idea of entropy minimization~\cite{grandvalet2005semi} into {DANN-SS} as follows:
\begin{align*}
\max_{\theta_{f}}& \{\widehat{\mathcal{L}}_{\text{F}}{=}\;\mathbb{E}_{\mathcal{X}_{\text{S}}}\log \widetilde{C}(y|\mathcal{Y}) +\tau\mathbb{E}_{\mathcal{X}_{\text{T}}}\sum_{i=1}^{N} \widetilde{C}(i)\log \widetilde{C}(i)\}. \end{align*}
Note that we parameterize the classifier in the same way as {DANN-SS} and it is trained with the same objective. On the contrary, the second term of $\widehat{\mathcal{L}}_{\text{F}}$ is changed from $\widetilde{\mathcal{L}}_{\text{F}}$. To better understand, we investigate the second term of $\widehat{\mathcal{L}}_{\text{F}}$ in more detail by reorganizing as follows:
\begin{align}
&\;(1{-}\widetilde{C}(N{+}1))\sum_{i=1}^{N} \widetilde{C}(i|\mathcal{Y})\log \widetilde{C}(i|\mathcal{Y})\nonumber\\
&\;+(1{-}\widetilde{C}(N{+}1))\log (1{-}\widetilde{C}(N{+}1)). \label{eq:daer_sub}
\end{align}
The maximum of Eq~\eqref{eq:daer_sub} is obtained when 1) $\widetilde{C}(i){=}1$ for some $i{<}N{+}1$ or 2) $\widetilde{C}(N{+}1){=}1$. However, the second solution is opposite to our intention and we prevent this by adding an adversarial objective of $\widetilde{\mathcal{L}}_{\text{F}}$ into $\widehat{\mathcal{L}}_{\text{F}}$ as follows:
\begin{equation}
\lambda\mathbb{E}_{\mathcal{X}_{\text{T}}}\Big[\gamma\sum_{i=1}^{N} \widetilde{C}(i)\log \widetilde{C}(i) + \log (1{-}\widetilde{C}(N{+}1))\Big]. \label{eq:daer_sub2}
\end{equation}
where we parameterize $\tau=\lambda\times\gamma$ to be consistent with $\widetilde{\mathcal{L}}_{\text{F}}$. We provide more analysis on Eq~\eqref{eq:daer_sub} and \eqref{eq:daer_sub2} in the supplementary material, simply noting here that the {DANN-EM} formulation lends significant empirical benefits in Section \ref{sec:exp}.
\begin{figure}[t]
\centering
\subfigure[DANN (baseline)]{\includegraphics[height=1.15in]{domadv-dann.pdf}\label{fig:domadv-dann}}\hspace{0.15in}
\subfigure[{DANN-SS}]{\includegraphics[height=1.15in]{domadv-ss.pdf}\label{fig:domadv-ss}}
\vspace{-0.15in}
\caption{\small (a) Standard DANN with $N$-way model classifier and binary domain discriminator and (b) the proposed {DANN-SS} with $(N{+}1)$-way classifier used for both model classification and domain discrimination. CNN and classifiers are updated in turn (dotted boxes) while fixing the others (solid boxes).\label{fig:domadv}}
\vspace{-0.2in}
\end{figure}
\Section{Pixel-level Cross-Domain Image Translation}
\label{sec:appflow}
As is common for neural nets, DANN is a black-box algorithm and adding an extra domain-specific insight is difficult. On the other hand, certain challenges in domain adaptation can be better handled in image space. In this section, we introduce additional tools for domain adaptation at multiple semantic levels to deal with different factors of variation, such as photometric or perspective transformation. To achieve this, we propose significant extensions to prior works on CycleGAN \cite{zhu2017unpaired} and appearance flows \cite{zhou2016view}.
We describe with an illustrative application of car recognition in surveillance domain where the only labeled data is from web domain. The pipeline of our example is in Figure~\ref{fig:teasar}.
\SubSection{Photometric Transformation by CycleGAN}
\label{sec:domadapt_pix}
As noticed from Figure~\ref{fig:teasar}, images from surveillance domain have disparate color statistics from web images as they might acquired outdoors at different times with significant lighting variations. CycleGAN~\cite{zhu2017unpaired} is proposed as a promising tool for image translation by disentangling low-level statistics from geometric structure through cycle consistency and can generate an image of the same geometric structure but with the style of target domain. A limitation, however, is that it generates a single output when there could be multiple output styles. Thus, we propose an attribute-conditioned CycleGAN (AC-CycleGAN) that generates diverse output images with the same geometric structure by incorporating a conditioning variable into the CycleGAN's generators.
Let $\mathcal{A}$ be the set of attributes in the target domain $\mathcal{X}_{\text{T}}$, e.g., day or night. We learn a generator $G{:}\mathcal{X}_{\text{S}}{\times}\mathcal{A}\ {\rightarrow}\ \mathcal{X}_{\text{T}}$ that translates a source image into a target image with certain style $a{\in}\mathcal{A}$ by fooling an attribute-specific discriminator $D_{a}{:}G(\mathcal{X}_{\text{S}},a)\ {\cup}\ \mathcal{X}_{\text{T}_{a}}\ {\rightarrow}\ [0,1]$, where $\mathcal{X}_{\text{T}_{a}}\ {\in}\ \mathcal{X}_{\text{T}}$ is a set of target images with attribute $a$. The learning objectives are:
\begin{align*}
\max_{\theta_{d_{a}}}\{\mathcal{L}_{D_{a}} &{=} \mathbb{E}_{\mathcal{X}_{\text{T}_{a}}}\log D_{a}(x) + \mathbb{E}_{\mathcal{X}_{\text{S}}}\log (1{-}D_{a}(G(x,a)))\}\\
\max_{\theta_{g}}\{\mathcal{L}_{G} &{=} \mathbb{E}_{\mathcal{X}_{\text{S}}}\mathbb{E}_{\mathcal{A}}\log D_{a}(G(x,a))\}
\end{align*}
We use multiple discriminators to prevent competition between different attribute configurations, but it is feasible to have a single discriminator with $(|\mathcal{A}|{+}1)$-way domain classification loss~\cite{taigman2016unsupervised}. Also, one might afford to have multiple generators per attribute $G(x,a){=}G_{a}(x)$ without sharing parameters, for a small number of attribute configurations.\footnote{Empirically, using two separate generators for day and night performs better than a single generator (please see supplementary material).}
Since the optimization problem is underdetermined, we add constraints like cycle consistency~\cite{zhu2017unpaired} as follows:
\begin{equation}
\mathbb{E}_{\mathcal{A}}\left\{\mathbb{E}_{\mathcal{X}_{\text{S}}}\Vert F(G(x, a),a){-}x\Vert_{1} + \mathbb{E}_{\mathcal{X}_{\text{T}_{a}}}\Vert G(F(x,a),a){-}x\Vert_{1}\right\}\nonumber
\end{equation}
where we define an inverse generator $F{:}\mathcal{X}_{\text{T}}{\times}\mathcal{A}{\rightarrow}\mathcal{X}_{\text{S}}$ that maps generated output images back to the source domain, i.e., $F(G(x, a), a) {=} x$. We also use a patchGAN~\cite{isola2017image,zhu2017unpaired} for discriminators that make real or fake decisions from local patches and UNet~\cite{isola2017image} for generators, each of which contributes to preserve geometric structure of an input image.
\SubSection{Perspective Transformation}
Besides color differences, we also observe significant differences in camera perspective (Figure~\ref{fig:teasar}). In this section, we deal with perspective transformations using an image warping based on a pixel-level dense flow called appearance flow (AF)~\cite{zhou2016view}. Specifically, we propose to improve the generalization of AF estimation network (AFNet) trained on 3D CAD rendered images to real images by utilizing a robust representation across domains, i.e. 2D keypoints.
\Paragraph{Appearance Flow.}
Zhou et al.~\cite{zhou2016view} propose to estimate a dense flow of pixels between two images of different viewpoints. Once estimated, synthesization is done by simply reorganizing pixels using bilinear sampling~\cite{jaderberg2015spatial} as follows:
\begin{equation}
I_{p}^{i,j}{=}\sum_{(h,w) \in N} I_s^{h,w}(1{-}|F_y^{i,j}{-}h|) (1{-}|F_x^{i,j}{-}w|),\label{eqn:af}
\end{equation}
where $I_{s}$ is an input image, $I_{p}$ is an output image, $F{=}(F_{x}, F_{y})$ is a learned pixel-level flow field in horizontal and vertical directions called appearance flow and $N$ denotes the 4-pixel neighborhood of ($F_{x}^{i,j}, F_{y}^{i,j}$). Unlike neural network based image synthesization methods~\cite{tatarchenko2015single}, AF-based transformation may have a better chance of preserving object identity, since all pixels of an output image are from an input image and no new information, such as learned priors in the decoder network, is introduced.
A limitation of AF estimation network (AFNet), however, is that it requires image pairs $(I_{s}, I_{t})$ with perspective being the only factor of variation. Since it is infeasible to collect such a highly controlled dataset of real images at large-scale, rendered images from 3D CAD models are used for the training of AFNet, but this incurs a generalization issue when applied to the real images at test time.
\Paragraph{Keypoint-based Robust Estimation of AF.}
\label{sec:appflow-kpt}
To make the AFNet generalizable to real images, we propose to use an invariant representation between rendered and real images, such as object keypoints. Although sparse, we argue that, for objects like cars, 2D keypoints contain sufficient information to reconstruct rough geometry of the entire object. Besides, keypoint estimation can be done robustly across synthetic and real domains even when the keypoint localization network is trained only on the synthetic data~\cite{li2016deep}. To this end, we propose a 2D keypoint-based AFNet (KFNet) that takes estimated 2D keypoints and the target viewpoint as the input pair, to generate flow fields $F$ for synthesization.
The training of KFNet can be done using rendered images. The trained KFNet can be readily applied to real images after a 2D keypoint estimation. Learning AF from a sparse keypoint representation is more difficult than learning from an image. To leverage the pretrained AFNet that produces a robust AF representation for rendered images, we propose to learn the KFNet by distilling knowledge from the AFNet. The learning objective is:
\begin{gather}
\min\{\mathcal{L} = \mathcal{L}_{\text{flow}} + \lambda\mathcal{L}_{\text{image}}\}\\
\mathcal{L}_{\text{flow}} = \Vert F_{\text{kpt}} - F_{\text{pix}}\Vert_{1}, \ \mathcal{L}_{\text{image}} = \Vert I_{p}(F_{\text{kpt}}, I_{s}) - I_{t} \Vert_{1} , \nonumber
\label{eqn:kf}
\end{gather}
where $F_{\text{kpt}}$ is an estimated appearance flow by KFNet and $F_{\text{pix}}$ is that by AFNet. Here, $I_{p}(F, I_{s})$ is the predicted image from $I_{s}$ using $F$ based on Eq~\eqref{eqn:af}. The training framework by distillation is visualized in Figure~\ref{fig:kfnet}.
\begin{figure}[t!]
\centering
\includegraphics[width=0.4\textwidth]{kfnet.pdf}
\vspace{-0.1in}
\caption{\small Training framework of keypoint-based appearance flow network (KFNet) by distilling knowledge from pretrained AFNet.}
\label{fig:kfnet}
\vspace{-0.2in}
\end{figure}
\begin{table*}[t]
\footnotesize
\begin{center}
\begin{tabular}{cccc cccccc}
\toprule
\multirow{2}{*}{ID} & \multirow{2}{*}{Perspective} & \multirow{2}{*}{Photometric} & \multirow{2}{*}{Feature-level DA} & \multirow{2}{*}{Top-1} & \multirow{2}{*}{Top-5} & \multicolumn{2}{c}{Day} & \multicolumn{2}{c}{Night} \\ \cmidrule(l){7-8} \cmidrule(l){9-10}
& & & & & & Top-1 & Top-5 & Top-1 & Top-5 \\ \midrule
M1 & \multicolumn{3}{c}{Baseline (web only)} & 54.98 & 69.62 & 72.67 & 86.71 & 19.87 & 35.68 \\
M2 & \multicolumn{3}{c}{Supervised (web + SV)} & 98.63 & 99.65 & 98.92 & 99.70 & 98.05 & 99.54 \\ \midrule
M3 & AF & -- & -- & 59.83 & 74.09 & 76.23 & 89.41 & 27.28 & 43.68 \\
M4 & KF & -- & -- & 61.89 & 75.21 & 77.72 & 90.01 & 30.47 & 45.85 \\
M5 & MKF & -- & -- & 64.49 & 78.51 & 78.47 & 90.27 & 36.73 & 55.15 \\
M6 & -- & {CycleGAN} & -- & 62.65 & 79.50 & 77.72 & 90.40 & 38.72 & 57.87\\
M7 & -- & AC-CycleGAN & -- & 67.65 & 82.11 & 79.17 & 90.88 & 44.79 & 64.69\\
M8 & -- & -- & DANN & 59.40 & 74.06 & 74.71 & 87.70 & 29.00 & 46.99 \\
M9 & -- & -- & {DANN-SS} & 67.49 & 80.33 & 80.38 & 92.40 & 41.89 & 56.36 \\
M10 & -- & -- & {DANN-EM} & 72.40 & 81.63 & 82.48 & 90.55 & 52.38 & 63.91 \\ \midrule
M11 & MKF & CycleGAN & -- & 71.15 & 84.90 & 81.51 & 92.05 & 50.59 & 70.71\\
M12 & MKF & AC-CycleGAN & -- & 77.38 & 89.66 & 81.76 & 91.72 & 68.69 & 85.56 \\
M13 & -- & AC-CycleGAN & DANN & 69.06 & 83.25 & 78.26 & 90.21 & 50.80 & 69.44 \\
M14 & -- & AC-CycleGAN & {DANN-SS} & 74.50 & 88.36 & 81.77 & 93.16 & 60.07 & 78.84 \\
M15 & -- & AC-CycleGAN & {DANN-EM} & 81.44 & 90.37 & 84.11 & 91.89 & 76.14 & 87.35 \\
M16 & MKF & -- & DANN & 64.96 & 79.95 & 77.75 & 90.10 & 39.56 & 59.82 \\
M17 & MKF & -- & {DANN-SS} & 74.79 & 86.76 & 82.52 & 92.42 & 59.44 & 75.53 \\
M18 & MKF & -- & {DANN-EM} & 83.63 & 91.13 & 85.65 & 92.05 & 79.61 & 89.31 \\
\midrule
M19 & MKF & AC-CycleGAN & DANN & 76.10 & 89.60 & 80.93 & 92.17 & 66.52 & 84.49 \\
M20 & MKF & AC-CycleGAN & {DANN-SS} & 83.80 & \textbf{93.02} & 85.49 & \textbf{93.50} & 80.45 & \textbf{92.06} \\
M21 & MKF & AC-CycleGAN & {DANN-EM} & \textbf{84.69} & 92.51 & \textbf{86.10} & 92.90 & \textbf{81.89} & 91.73 \\
\bottomrule
\end{tabular}
\end{center}
\vspace{-0.23in}
\caption{\small Car model recognition accuracy on CompCars Surveillance dataset of our proposed recognition system with different combinations of components, such as perspective transformation (Section~\ref{sec:appflow-kpt}), photometric transformation (Section~\ref{sec:domadapt_pix}), or feature-level domain adaptation (Section~\ref{sec:domadapt}). We consider pixel-based (AF), keypoint-based (KF) and with mask (MKF) for perspective transformation, naive and attribute-conditioned CycleGAN, and DANN, {DANN-SS} and {DANN-EM} as variations.\label{tab:recog}}
\vspace{-0.22in}
\end{table*}
\Section{Experimental Results}
\label{sec:exp}
In this section, we report empirical results of our proposed framework on the car model recognition in surveillance domain. In addition, we validate the effectiveness of our proposed feature-level DA methods in comparison to state-of-the-art methods on the standard UDA benchmark.
\SubSection{Recognizing Cars in Surveillance Domain}
\label{sec:exp-surveillance}
\Paragraph{Dataset.}
Comprehensive Cars dataset~\cite{yang2015large} offers two sets of data, one collected from web domain and the other collected from surveillance domain. The sample images from each domain are found in Figure~\ref{fig:teasar}. The dataset contains $52,083$ images from web domain across $431$ categories of car models and $44,481$ images\footnote{Note that only $32,119$ are labeled among $44,481$ images.} from surveillance domain across a smaller subset of $181$ categories of car models, where $70\%$ are used for training in both cases.
For data preprocessing, we crop and scale web images into $256{\times}256$ using provided bounding boxes while maintaining the aspect ratio. Since they are already cropped, surveillance images are simply scaled into $256{\times}256$. To train AFNet and KFNet, we render images from 3D CAD models from ShapeNet~\cite{shapenet2015}. Noting that the major perspective variation between web and surveillance images are camera elevation, we render into an image at different elevation levels ($0^{\circ}{\sim}30^{\circ}$) while adding a few azimuth variations ($\pm 15^{\circ}$).
\Paragraph{Evaluation.}
We report top-1 and top-5 accuracy on $9,630$ test images from surveillance dataset. The softmax scores are averaged between the center crop of size $224{\times}224$ and its horizontal flip to make a prediction. Noticing a huge accuracy drop on images taken at night, we also report classification accuracy for individual subsets of day and night.
We extensively evaluate the performance of the models by combining the proposed three adaptation components in different ways and study the impact of each component in Section~\ref{sec:exp-study}. Note that we consider synthesized images through AF or CycleGAN as labeled and therefore we incorporate them into source domain and the classification networks are trained accordingly. The ImageNet pretrained ResNet-18\footnote{\url{https://github.com/facebook/fb.resnet.torch/tree/master/pretrained}}~\cite{he2016deep} fine-tuned on the web dataset is our baseline network. The CNN and the classifier of all evaluated models are initialized with those of the baseline network. For {DANN-SS}, {DANN-EM} models, we initialize by adding one column to the weight matrix of classifier whose parameters are set with the mean of other columns, which we find working well in practice. The discriminator of DANN are randomly initialized. Due to space constraints, we leave further implementation details in the supplementary material.
\Paragraph{Performance.}
The summary results are given in Table~\ref{tab:recog}. Although it achieves state-of-the-art performance on the test set of web dataset ($96.43\%$ vs. $91.2\%$ from~\cite{yang2015large}), the baseline network suffers from generalization to surveillance images, resulting in only $54.98\%$ top-1 accuracy. Comparing to the performance of the model trained with target domain supervision ($98.65\%$), we could get a sense how different two domains are. Our proposed framework, M21, achieves $\mathbf{84.69}\%$ top-1 accuracy, which reduces the error by $\mathbf{66.0}\%$ from M1. We also verify the importance of individual components by training models after removing one component at a time. We achieve $81.44\%$ without perspective transformation (M15), $83.63\%$ without photometric transformation (M18), and $77.38\%$ (M12) without feature-level DA. Also, the feature-level DA (M10) improves the most comparing to other adaptation methods when used alone (M5, M7).
\begin{figure*}[htbp]
\begin{center}
\includegraphics[width=0.3\textwidth]{synth_01.pdf}\hspace{0.08in}
\includegraphics[width=0.3\textwidth]{synth_02.pdf}\hspace{0.08in}
\includegraphics[width=0.3\textwidth]{synth_03.pdf}
\vspace{-0.1in}
\caption{\small Visualization of synthesized images by perspective and photometirc transformations. For each web image from CompCars dataset, we show perspective transformed images at four camera elevation angles ($0^\circ{\sim}30^\circ$) using AFNet and 2D keypoint-based AFNet (KFNet), and with an estimated foreground mask (MKF). Then, we show photometic transformed images into day/night by AC-CycleGAN.\label{fig:af_visual}}
\vspace{-0.35in}
\end{center}
\end{figure*}
\SubSection{Ablation Study and Discussion}
\vspace{-0.02in}
\label{sec:exp-study}
In this section, we provide more in-depth analysis on the impact of each component of our system.
\vspace{-0.02in}
\SubSubSection{Analysis on Feature-level DA}
\label{sec:exp-dann}
\vspace{-0.02in}
We observe a clear trend that our feature-level DA methods significantly improves upon baselines without any feature-level DA or with standard DANN (e.g., \{M1, M8--M10\} or \{M12, M19--21\}), and {DANN-EM} further improves the performance over {DANN-SS}. One observation is that the top-5 accuracy of M21 is slightly worse than that of M20. This is somewhat expected side-effect of entropy minimization since it strengthens the confidence of the most confident class while suppressing the confidence of other classes.
\vspace{-0.07in}
\begin{figure}[htbp]
\begin{center}
\includegraphics[width=0.4\textwidth]{entropy.pdf}
\vspace{-0.1in}
\caption{\small Entropy of DANN (with different $\lambda$) and {DANN-SS}.\label{fig:entropy}}
\vspace{-0.25in}
\end{center}
\end{figure}
We look deeper into the relation between DANN and {DANN-SS} by monitoring the entropy of classification distribution for the target data. Although the entropy is not directly correlated with the recognition accuracy, we can relate it to the classifiability of samples since it tells how far the samples are from decision boundary towards centers. We report the entropy of M8 with different $\lambda$ and M9 in Figure~\ref{fig:entropy}. Starting from the same entropy, {DANN-SS} model reduces the entropy faster and converges at much lower value than DANN, while DANN shows the behavior of mode collapse when $\lambda$ is large. Even with carefully tuned $\lambda$, it doesn't reach at the entropy level of {DANN-SS}.
\vspace{-0.03in}
\SubSubSection{Complementarity of Components}
\label{sec:exp-complement}
\vspace{-0.02in}
As our system consists of three components that all aim at reducing the gap between domains, it is important to understand the complementarity of these components. We first observe that any combination of two brings significant performance improvement (e.g., M12, M15, M18 vs. M5, M7, M10). Specifically, combining perspective transformation (M5) and feature-level DA (M10) brings the most significant improvement (M18) with an increment of $11.23\%$.
However, combining AC-CycleGAN (M7) and feature-level DA (M10) brings less improvement even though each component alone has demonstrated larger improvement. We think that the factors of variation captured by feature-level DA are more complementary to those by perspective transformation than those by AC-CycleGAN. For example, perspective difference between web and surveillance domains is difficult to learn using standard network architectures; we need additional domain-specific tools like appearance flow. Also, the contrast in low-level statistics between domains such as color might be easier to learn for either CycleGAN or DANNs. Actually, color is one major factor of variation since web images tend to be day, whereas surveillance images include both day and night. Consequently, although CycleGAN shows more gain on night images when used alone ($44.79\%$ vs. $36.73\%$), it becomes less significant when combined with feature-level DA ($44.79\%{\rightarrow}76.14\%$) than that of perspective transformation module combined with feature-level DA ($36.73\%{\rightarrow}79.61\%$).
\vspace{-0.03in}
\SubSubSection{Perspective Transformation for CycleGAN}
\label{sec:exp-image-translation}
\vspace{-0.02in}
The success of CycleGAN~\cite{zhu2017unpaired} on unpaired image-to-image translation is attributed by several factors, such as autoencoding using cycle consistency loss, patch based discriminator, or the network architecture like UNet with skip connections. However, we find that applying CycleGAN naively to translate images from web to surveillance domain is not effective due to perspective difference. As in Figure~\ref{fig:naive_cyclegan_visual}, the CycleGAN maintains the geometric structure of an input, but doesn't adapt to the perspective of surveillance domain.
When we relax some constraints of CycleGAN (relaxed CycleGAN) such as receptive field size of patchGAN or skip connections, we start to see some perspective change in the third row of Figure~\ref{fig:naive_cyclegan_visual}, but we lose many details that are crucial for recognition tasks. Our proposed approach solves this challenge in two steps, first by explicitly disentangling the perspective variation using appearance flow and second by dealing with other variation factors (lighting and low-level color transformation) using CycleGAN. This results in high-quality synthesization of images from web to surveillance as in Figure~\ref{fig:af_visual} and significantly improved recognition performance ($67.65\%{\rightarrow}77.38\%$ from M7 to M12).
\begin{figure}[t]
\begin{center}
\subfigure[Comparison of CycleGANs with different constraints.]{\includegraphics[width=0.9\linewidth]{relaxedCycleGAN.pdf}\label{fig:naive_cyclegan_visual}}\vspace{-0.07in}
\subfigure[Attribute interpolation]{\includegraphics[width=0.9\linewidth]{interpolation.pdf}\label{fig:attribute_interpolation}}
\vspace{-0.17in}
\caption{\small Web to surveillance image translation of CycleGAN (a) with relaxed constraints and (b) with attribute interpolation.}
\vspace{-0.35in}
\end{center}
\end{figure}
\vspace{-0.03in}
\SubSubSection{Diverse Outputs with Attribute Interpolation}
\label{sec:exp-interpolation}
\vspace{-0.02in}
The AC-CycleGAN produces multiple outputs from a single input by changing latent code configuration. It allows to have at least twice as many synthesized labeled images as that of CycleGAN in our case and this directly translates into improved recognition performance (M12, $77.38\%$ vs. M11, $71.15\%$). Furthermore, the continuous interpolation of latent code~\cite{yan2016attribute2image} allows to generate continuous change in certain factors of variation, which in our case is the lighting condition. Figure~\ref{fig:attribute_interpolation} shows images generated with attribute interpolation. We observe gradual change in global (e.g., color tone) and local (e.g., pixel intensity of headlight) manners from day to night while preserving object identities.
\vspace{-0.05in}
\SubSubSection{Analysis on 2D Keypoint-based AF Estimation}
\label{sec:exp-diaf}
\vspace{-0.02in}
AFNet is trained on the rendered images of 3D CAD models and a performance degradation is expected when applied to real images. On the other hand, our KFNet uses $36$ 2D keypoints as an input and it is questionable whether estimating a per-pixel dense flow from sparse keypoints is even feasible. To demonstrate the feasibility, we compare the pixel-level L1 reconstruction error between rendered images and perspective transformed images at four elevations ($0^\circ$ to $30^\circ$) using AFNet and KFNet. We obtained $0.072$ error with KFNet and this is comparable with $0.071$ error with AFNet.\footnote{We normalize pixel values to be in $[0,1]$.}
Since we are not aware of any dataset with paired images of cars with elevation difference, we resort to qualitative comparison. We visualize transformed images of real data from CompCars dataset with AFNet and KFNet in Figure~\ref{fig:af_visual}. AFNet struggles to generalize on real images and generates distorted images with incorrect target elevation. Although sparse, 2D keypoints are more robust to domain shift from synthetic to real and are sufficient to preserve the object geometry while correctly transforming to target perspective. Finally, better recognition performance of the network trained with source and the perspective transformed images on the surveillance domain ($59.83\%{\rightarrow}61.89\%$ from M3 to M4) implies the superiority of the proposed KFNet-based perspective transformation.
\vspace{-0.02in}
\SubSection{Evaluation of DANNs on UDA Benchmark}
\label{sec:exp-uda-benchmark}
\vspace{-0.03in}
In addition to our observation from Table~\ref{tab:recog} (e.g., M12, M19--M21), we further validate the effectiveness of our feature-level DA methods to the baseline and others on standard UDA benchmark. We conduct experiments on 4 settings proposed by~\cite{ganin2016domain}. We evaluate the performance of the models using shallow~\cite{ganin2016domain,bousmalis2016domain} and deep~\cite{haeusser2017associative} network architectures. As suggested by~\cite{bousmalis2016domain}, we use $1,000$ ($430$ for GTSRB dataset) randomly selected labeled target domain images for validation. Details of experimental protocol are in the supplementary material. An unsupervised model selection, i.e., without using labeled examples from the target data, in UDA is an open question and we leave it for future work.
The results are provided in Table~\ref{tab:dann-comparison-soa}. {DANN-SS} demonstrates its superiority to DANN with gradient reversal~\cite{ganin2016domain} or DANN on domain separation network~\cite{bousmalis2016domain}. Note that we focus on the feature-level DA in this experiment and don't combine with any pixel-level adaptation as in~\cite{bousmalis2016domain,Bousmalis_2017_CVPR,hoffman2017cycada}. Moreover, {DANN-EM} improves upon {DANN-SS}, achieving state-of-the-art on 3 settings out of 4. Specifically, we observe even lower error ($4.92\%$) for Synth. Digits$\rightarrow$SVHN setting than that of supervisedly trained model on the target domain ($7.09\%$) reported by~\cite{haeusser2017associative} by utilizing an extra $531K$ unlabeled data from SVHN dataset~\cite{netzer2011reading}, which suggests that our method benefits from large-scale unlabeled data from target domain.
\begin{table}[t]
\begin{center}
\footnotesize
\begin{tabular}{lccccc}
\toprule
Method & network & M$\rightarrow$MM & S$\rightarrow$S & S$\rightarrow$M & S$\rightarrow$G \\ \midrule
RevGrad~\cite{ganin2016domain} & shallow & 23.33 & 8.91 & 26.15 & 11.35 \\
DSN~\cite{bousmalis2016domain} & shallow & 16.80 & 8.80 & 17.30 & 6.90 \\
ADA~\cite{haeusser2017associative} & deep & 10.47 & 8.14 & \textbf{2.40} & {2.34} \\ \midrule
source only & \multirow{4}{*}{shallow} & 31.72 & 12.78 & 31.61 & 4.37 \\
DANN & & 11.48 & 6.67 & 7.66 & 2.67 \\
{DANN-SS} & & 9.59 & 6.68 & 5.93 & 1.55 \\
{DANN-EM} & & \textbf{9.42} & \textbf{5.69} & \textbf{5.19} & \textbf{1.46} \\ \midrule
source only & \multirow{4}{*}{deep} & 32.10 & 12.95 & 36.26 & 5.47 \\
DANN & & \textbf{2.02} & 7.76 & 11.30 & 2.72 \\
{DANN-SS} & & \textbf{2.04} & 5.53 & 3.77 & 1.30 \\
{DANN-EM} & & \textbf{1.94} & \textbf{4.92} & {3.51} & \textbf{1.05} \\
\bottomrule
\end{tabular}
\end{center}
\vspace{-0.23in}
\caption{\small Evaluation on UDA benchmark, such as MNIST~\cite{lecun1998gradient} to MNIST-M~\cite{ganin2016domain} (M$\rightarrow$MM), Synth. Digits~\cite{ganin2016domain} to SVHN (S$\rightarrow$S), SVHN to MNIST (S$\rightarrow$M), or Synth. Signs~\cite{moiseev2013evaluation} to GTSRB~\cite{stallkamp2011german} (S$\rightarrow$G). Experiments are executed for 10 times with different random seeds and mean test set error rate is reported. The best performer and the ones within standard error are bold-faced.\label{tab:dann-comparison-soa}}
\vspace{-0.23in}
\end{table}
\Section{Conclusion}
\label{sec:conc}
With an observation that certain adaptation challenges are better handled in feature space and others are in pixel space, we propose an unsupervised domain adaptation framework by leveraging complementary tools that are better-suited for each type of adaptation challenge. Importance and complementarity of each component are demonstrated through extensive experiments on a novel application of car recognition in surveillance domain. We also demonstrate state-of-the-art performance on standard UDA benchmark with our proposed feature-level DA methods.
{\footnotesize
\bibliographystyle{ieee}
| {'timestamp': '2018-03-02T02:02:15', 'yymm': '1803', 'arxiv_id': '1803.00068', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00068'} | arxiv |
\section{Introduction}
Since 2010, GF has been applied to many computer vision and graphics problems such as image retargeting~\cite{Ding_CVPR_2011}, color transfer~\cite{Chia_TOG_2011} and video dehazing~\cite{Zhang_TVC_2011}.
Among them, multi-label system maybe one of the most suitable applications for GF to make full use of its efficiency and effectiveness because the heavy computation in multi-label system is in urgent need of a fast filtering tool. A typical multi-label system~\cite{Hosni_PAMI_2013} records the costs $c$ for choosing a label $l$ at coordinates $x$ and $y$ in a cost volume ($V(x, y, l) = c$) according to the input data. Then WTA (Winner-Takes-All) label selection strategy is exploited to determine the final label for each pixel $(x, y)$ after the aggregation (\ie guided image smoothing) step operated on each slice of the cost volume. Besides applying GF to the aggregation step of the multi-label system, we can also incorporate it into MRF models~\cite{Vineet_IJCV_2014, Xiao_ECCV_2006} since edge-aware filters adopted in these MRF models can be taken place by GF directly.
Due to the linear complexity and edge-preserving ability, GF is consider as the best choice~\cite{Hosni_PAMI_2013} among all candidate filters for the multi-label system. However, a blemish of GF is that the color image guided filtering algorithm is not very efficient.
More specifically, matrix inverse is a time-consuming operation, but GF needs to invert a $3 \times 3$ matrix for each pixel to calculate both coefficients $\vec{w}_{\mathfrak{p}}$ of Eq \eqref{eq:GF_linear_model}
\begin{scheme}[h]
\vspace{-0.3cm}
\begin{equation}
\bm{Z}({\mathfrak{q}}) = \sum_{i=1}^{3} \vec{w}_{\mathfrak{p}}(i) \bm{I}_{i}(\mathfrak{q}) + \vec{w}_{\mathfrak{p}}(0)
\label{eq:GF_linear_model}
\end{equation}
\vspace{-0.5cm}
\end{scheme}
and filtering result $\mathbf{Z}(\mathfrak{q})$ according to the $i$th channel $\bm{I}_{i}(\mathfrak{q})$ of a color input guidance $\bm{I}$. Fig~\ref{fig:preface:b} plots the run time of inverting $10^6$ matrices with increasing matrix size, where the matrix inverse algorithm is the built-in LU algorithms of OpenCV. We can observe that the run time increases with the size of matrix dramatically. Hence it is inefficient to apply GF to multi-label system with a multi-channel guidance, especially for a large channel number.
To decrease the execution time, the most straightforward method for GF is to launch a set of threads to invert matrices simultaneously. However this strategy is not very efficient on current hardwares. This is because 1, both CPU and GPU rely on SIMD (Single Instruction Multiple Data) architecture to boost performance; 2, branch instructions are inevitable for traditional matrix inversion methods such as LU algorithm~\cite{Hougardy_BOOK_2016}; 3, SIMD architecture cannot achieve the fastest speed to run branch instructions as these instructions require decomposing each vector into elements and processing them sequentially on the architecture. Fig~\ref{fig:preface:b} also illustrates the run time of inverting $10^6$ matrices simultaneously. The reported data is unsatisfactory. To avoid branch instructions, we can invert matrices according to the analytic solution of matrix inverse~\cite{Horn_BOOK_1985}. The fastest OpenCV implementation of GF takes this strategy to invert $3 \times 3$ matrices and successfully reduces the run time of inverting $10^6$ matrices to less than $100ms$. But the implementation complexity of the analytic solution increases with matrix size heavily. When the size of matrix becomes large, the method is no longer implementable manually. This explains why we miss the run time of this method in Fig~\ref{fig:preface:b}.
\begin{figure}[t]
\centering \vspace{-0.2cm}
\begin{subfigure}[b]{0.45\linewidth}
\includegraphics[width=\textwidth]{inv_compare}
\caption{Matrix Inverse}
\label{fig:preface:b}
\end{subfigure}
\begin{subfigure}[b]{0.45\linewidth}
\includegraphics[width=\textwidth]{PBP_compare}
\caption{Stereo Matching}
\label{fig:preface:a}
\end{subfigure}
\caption{\textbf{Matrix Inverse $\bm{\&}$ Stereo Matching:} (a) demonstrates the run time of inverting $10^6$ matrices with increasing size (b) illustrates the stereo matching results of GF with different guidances. }
\label{fig:preface} \vspace{-0.5cm}
\end{figure}
\textbf{We propose a hardware-efficient matrix inverse algorithm} to exploit the parallel computing power of hardwares to its full potential. The ability of our algorithm stems from two hardware-efficient operations: \emph{element-wise arithmetic calculations} and \emph{box filtering}. To compare with the built-in LU algorithm adopted by OpenCV, we collect run times of our algorithm implemented by Intel OpenCL and plot them in Fig~\ref{fig:preface:b}. The result proves that our method gets a substantial performance boost on Intel platform.
\textbf{We introduce nonlinearity to GF by synthesizing a polynomial multi-channel guidance from the input guidance} to conquer the drawback of the linear model of GF. The linear model usually underfits the
input data due to its simplicity and thus is apt to produce over-smoothed results. Fig~\ref{fig:preface:a} shows the stereo matching results under the guidance of a gray image and our synthesized multi-channel image. Obviously, the synthesized guidance produces better results. Note that the extra
run time in accompany with the nonlinear model can be reduced to an acceptable level by our hardware-efficient matrix inverse algorithm.
\textbf{Taking proposed polynomial guidance and new matrix inverse algorithm, we construct a hardware-efficient guided filter (HGF) for multi-label problem}. For presentation clarity, we organize the rest of this paper in following way. Section~\ref{sec:work} is devoted to introduce related work. In the next section, we present how to invert matrix efficiently and its application in computing regression coefficients. Section~\ref{sec:HGF},~\ref{sec:discussion} discuss HGF in details, including the hardware-efficient implementation and the method to synthesis polynomial guidances. Finally, we conduct comprehensive experiments to verify the superiority of HGF in section~\ref{sec:exp}.
\section{Related Work}
\label{sec:work}
\textbf{Acceleration:} People have already proposed many image guided filters such as the Bilateral Filter (BF)~\cite{Tomasi_ICCV_1998} and the Median Filter (MF)~\cite{Zhang_CVPR_2014} for edge-preserving smoothing. However, the benefit is not free. For example, the naive implementation of BF usually requires several minutes to filter a typical megapixel image. Several methods have been developed to accelerate the computation of bilateral filtering ~\cite{Durand_TOG_2002,Paris_IJCV_2009,Porikli_CVPR_2008,Yang_CVPR_2009,Gunturk_TIP_2011,Dai_TIP_2016} and as a result people obtained several orders of magnitude speedup. Similar to BF, MF can also effectively filter images while not strongly blurring edges. Although there is little work for speeding up weighted MF~\cite{Ma_ICCV_2013, Zhang_CVPR_2014}, unweighted MF has several solutions~\cite{Cline_ICIP_2007,Kass_TOG_2010,Perreault_TIP_2007,Weiss_TOG_2006}. Generally, the main idea of above accelerating methods focuses on reducing the computational complexity per pixel to the optimal $O(1)$. However, the minimal linear complexity of GF leaves no room to reduce the computational complexity further. To accelerate GF, He \etal~\cite{He_CoRR_2015} remind that GF can be sped up by subsampling to subset the amount of data processed. But this strategy inevitably introduces approximation error. A different way is to implement the algorithm of GF on VLSI directly~\cite{Kao_TCSVT_2014}. But Kao \etal~\cite{Kao_TCSVT_2014} only give a gray guidance based GF implementation as existing matrix inverse algorithms are too complicated to implement on hardware. Different from other algorithms, our hardware-efficient matrix inverse algorithm not only can fully exploit current parallel processors
but also can be easily implemented.
\textbf{Improvement:} Due to nice visual quality, fast speed, and ease of implementation, GF since its birth has received much effort to make it much better. In 2012, Lu \etal~\cite{Lu_CVPR_2012} pointed out that the box window adopted by GF is not geometric-adaptive and design a adaptive support region to take place of it. However, Tan \etal~\cite{Tan_CVPR_2014} argued that the new designed adaptive support region depends on the scanning order and put forward a further improvement for the support region. In addition, they introduced a quadratic spatial regularization term to GF. But the filtering speed is very slow because they employ traditional algorithms to invert $5 \times 5$ matrices. Later, Dai \etal~\cite{Dai_ICCV_2015} successfully incorporated spatial similarity into GF without significant performance degeneration. Unlike previous methods, Li \etal~\cite{Li_TIP_2015} modified GF to adapt it to suppress halo.
Through careful investigation, we can find that all these improvements do not make any modification for the gray/color guidance or incorporate more complicated nonlinear model to GF to achieve better results. This is because these modifications will increase the matrix size and therefore make the run time unacceptable. Note that even though all of them only take into account the linear model, their speeds are still slower than GF~\cite{Dai_ICCV_2015}. Benefiting from our hardware-efficient matrix inverse algorithm, we realizes these modifications in HGF without sacrificing efficiency.
\section{Technology Brief}
\label{sec:brief}
In this section, we outline our matrix inverse algorithm and its application in computing $\vec{w}_{\mathfrak{p}}$ in Eq~\eqref{eq:HGF_w1}. Before the formal discussion, we kindly remind readers to refer to Table~\ref{tab:symbol_conventions} for symbol conventions.
The key step of HGF is to calculate the vector $\vec{w}_{\mathfrak{p}}$ according to Eq~\eqref{eq:HGF_w1} which contains the matrix inverse operation $(\lambda \bm{E} + \bm{X}^T_{\mathfrak{p}} \bm{X}_{\mathfrak{p}} )^{-1}$.
\begin{figure}[h]
\vspace{-0.1cm}
\begin{equation}
\vec{w}_{\mathfrak{p}} = (\lambda \bm{E} + \bm{X}^T_{\mathfrak{p}} \bm{X}_{\mathfrak{p}} )^{-1}\bm{X}^T_{\mathfrak{p}} \vec{c}_{n+1, \mathfrak{p}}
\label{eq:HGF_w1}
\end{equation}
\vspace{-0.5cm}
\end{figure}
Here $\bm{E}$ denotes an identity matrix and $\bm{X}_{\mathfrak{p}} = [\vec{c}_{0, \mathfrak{p}}, \cdots, \vec{c}_{n, \mathfrak{p}}] $. As for the vector $\vec{c}_{i, \mathfrak{p}}$, we put $\vec{c}_{i, \mathfrak{p}} = [\bm{G}_{i}(\mathfrak{q}_1),\cdots, \bm{G}_{i }(\mathfrak{q}_{|\Omega_{\mathfrak{p}}|})]^T (0 \leq i \leq n+1) $ to record values $\bm{G}_i(\mathfrak{q}_k)$, where $ \mathfrak{q}_k \in \Omega_{\mathfrak{p}}$, $\Omega_{\mathfrak{p}}$ presents a neighborhood centered at the pixel $\mathfrak{p}$, $|\Omega_{\mathfrak{p}}|$ indicates the total number of pixels in $\Omega_{\mathfrak{p}}$ and $\bm{G}_i$ $(0 \leq i \leq n+1)$ is an image.
To invert $\lambda \bm{E} + \bm{X}^T_{\mathfrak{p}} \bm{X}_{\mathfrak{p}}$ efficiently, we will substitute $\lambda \bm{E} + \bm{X}^T_{\mathfrak{p}} \bm{X}_{\mathfrak{p}}$ with $\lambda \bm{E} + \sum_{i=0}^{n} \vec{c}_{i, \mathfrak{p}} \vec{c}_{i,\mathfrak{p}}^T $ by reformulating Eq~\eqref{eq:HGF_w1} as Eq~\eqref{eq:HGF_w2}.
\begin{figure}[h]
\vspace{-0.3cm}
\begin{align}
\vec{w}_{\mathfrak{p}} & = \bm{X}^T_{\mathfrak{p}} (\lambda \bm{E} + \bm{X}_{\mathfrak{p}} \bm{X}^T_{\mathfrak{p}} )^{-1} \vec{c}_{n+1, \mathfrak{p}} \nonumber \\
& = [\vec{c}_{0, \mathfrak{p}}^T, \cdots, \vec{c}_{n, \mathfrak{p}}^T]^T (\lambda \bm{E} + \sum_{i=0}^{n} \vec{c}_{i, \mathfrak{p}} \vec{c}_{i,\mathfrak{p}}^T )^{-1} \vec{c}_{n+1, \mathfrak{p}} \label{eq:HGF_w2}
\end{align}
\vspace{-0.5cm}
\end{figure}
This is because $(\lambda \bm{E} + \sum_{i=0}^{n} \vec{c}_{i, \mathfrak{p}} \vec{c}_{i,\mathfrak{p}}^T )^{-1}$ can be interpreted as a linear combination of outer products $\vec{c}_{i, \mathfrak{p}} \vec{c}_{i,\mathfrak{p}}^T$~\eqref{eq:HGF_inverse} according to following Proposition~\ref{prop:inverse}.
\begin{prop} If $\lambda \bm{E} + \sum_{i=0}^{n} \vec{c}_{i, \mathfrak{p}} \vec{c}_{i,\mathfrak{p}}^T $ is invertible, then
%
\begin{equation}
(\lambda \bm{E} + \sum_{i=0}^{n} \vec{c}_{i, \mathfrak{p}} \vec{c}_{i,\mathfrak{p}}^T)^{-1} = \lambda^{-1} \bm{E} + \sum_{i,j=0}^{n} \alpha_{ij, \mathfrak{p}} \vec{c}_{i, \mathfrak{p}} \vec{c}_{j,\mathfrak{p}}^T
\label{eq:HGF_inverse}
\end{equation}
%
where $\alpha_{ij, \mathfrak{p}} = \alpha^{n}_{ij, \mathfrak{p}}$ which can be iteratively computed by
\begin{align}\hspace{-2mm}
\alpha_{ij,\mathfrak{p}}^{\kappa} = & \begin{cases}
\gamma_{\mathfrak{p}}^\kappa F_{ij,\mathfrak{p}}^{\kappa} + \alpha_{ij,\mathfrak{p}}^{\kappa-1} & i < \kappa, j < \kappa \\
\lambda^{-1} \gamma_{\mathfrak{p}}^\kappa (\sum_{n=0}^{\kappa-1} \alpha^{\kappa-1}_{in, \mathfrak{p}} G_{n j, \mathfrak{p}}) & i < \kappa, j = \kappa \\
\lambda^{-1} \gamma_{\mathfrak{p}}^\kappa (\sum_{m=0}^{\kappa-1} \alpha^{\kappa-1}_{mj, \mathfrak{p}} G_{i m, \mathfrak{p}} ) & i = \kappa, j < \kappa \\
\lambda^{-2} \gamma_{\mathfrak{p}}^\kappa & i = j = \kappa
\end{cases}
\end{align}
from $\kappa = 1$ to $\kappa = n$ with $\alpha_{00,\mathfrak{p}}^{0} = - (\lambda + G_{00,\mathfrak{p}})^{-1}$, $G_{ij, \mathfrak{p}} = \vec{c}_{i,\mathfrak{p}}^T \vec{c}_{j, \mathfrak{p}}$, $F_{ij,\mathfrak{p}}^{\kappa} = \sum_{m,n=0}^{\kappa-1} \alpha^{\kappa-1}_{im,\mathfrak{p}} \alpha^{\kappa-1}_{nj,\mathfrak{p}} G_{m\kappa,\mathfrak{p}} G_{\kappa n,\mathfrak{p}}$ and $\gamma_{\mathfrak{p}}^\kappa = - ( 1 + \lambda^{-1} G_{\kappa \kappa,\mathfrak{p}} + \sum_{m,n=0}^{\kappa-1} \alpha^{\kappa-1}_{mn, \mathfrak{p}} G_{\kappa m, \mathfrak{p}} G_{n\kappa, \mathfrak{p}} )^{-1} $.
\label{prop:inverse}
\end{prop}
\begin{proof}
The recursive formula is derived from the Sherman-Morrison formula~\cite{Sherman_AMS_1950}. Constrained by maximal 8 pages constraint, we leave derivation details to supplementary materials.
\end{proof}
\begin{table}[t]
\begin{tabular}{|c|p{5.3cm}|}
\hline
\multirow{2}{*}{$\mathcal{F}$} & Calligraphic means that $\mathcal{F}$ is a function. \tabularnewline
\hline
\multirow{2}{*}{$i$} & Italics emphasizes that the variable $i$ is a scalar.\tabularnewline
\hline
$\mathfrak{p}$ & Fraktur denotes $\mathfrak{p}$ is an image pixel.\tabularnewline
\hline
$\vec{v}$ & Arrow $\vec{\quad}$ imlies $v$ is a vector.\tabularnewline
\hline
\multirow{2}{*}{$\bm{X}$} & Bold (disregarding case) indicates $\bm{X}$ is a matrix.\tabularnewline
\hline
\multirow{2}{*}{$i_\mathfrak{p} \backslash \vec{v}_{\mathfrak{p}}\backslash\bm{X}_{\mathfrak{p}}$} & The subscript $_{\mathfrak{p}}$ suggests $i_\mathfrak{p}\backslash \vec{v}_{\mathfrak{p}}\backslash\bm{X}_{\mathfrak{p}}$
is the scalar$\backslash$vector$\backslash$matrix located at $\mathfrak{p}$. \tabularnewline
\hline
\multirow{2}{*}{$\vec{v}_{i,\mathfrak{p}}\backslash$ $\bm{X}_{i,\mathfrak{p}}$} & The subscript $_{i,\mathfrak{p}}$ suggests $\vec{v}_{i,\mathfrak{p}}\backslash$
$\bm{X}_{i,\mathfrak{p}}$ is the $i$th vector$\backslash$matrix of $\mathfrak{p}$. \tabularnewline
\hline
\multirow{2}{*}{$\vec{v}(j)\backslash\vec{v}_{\mathfrak{p}}(j)\backslash\vec{v}_{i,\mathfrak{p}}(j)$} & $\vec{v}(j)\backslash\vec{v}_{\mathfrak{p}}(j)\backslash\vec{v}_{i,\mathfrak{p}}(j)$ is the $j$th element of $\vec{v}$ $\backslash$ $\vec{v}_{\mathfrak{p}}$$\backslash$$\vec{v}_{i,\mathfrak{p}}$
.\tabularnewline
\hline
\multirow{2}{*}{$\bm{X}(\mathfrak{p})\backslash\bm{X}_{i}(\mathfrak{p})$} & $\bm{X}(\mathfrak{p})\backslash\bm{X}_{i}(\mathfrak{p})$ is the element of $\bm{X}\backslash\bm{X}_{i}$
located at $\mathfrak{p}$. \tabularnewline
\hline
\end{tabular}
\caption{Symbol Conventions}
\label{tab:symbol_conventions}
\end{table}
Further, putting Eq~\eqref{eq:HGF_inverse} into Eq~\eqref{eq:HGF_w2},
we are able to transform the $k$th element $\vec{w}_{\mathfrak{p}}(k)$ of $\vec{w}_{\mathfrak{p}}$ to a linear combination of $G_{ij, \mathfrak{p}}$ as illustrated in Eq~\eqref{eq:HGF_w3}.
According to Proposition~\ref{prop:box},
\begin{figure}[h]
\vspace{-0.5cm}
\begin{align}
\vec{w}_{\mathfrak{p}}(k) = & \vec{c}_{k, \mathfrak{p}}^T (\lambda \bm{E} + \sum_{i=0}^{n} \vec{c}_{i, \mathfrak{p}} \vec{c}_{i,\mathfrak{p}}^T )^{-1} \vec{c}_{n+1, \mathfrak{p}} \nonumber \\
= & \vec{c}_{k, \mathfrak{p}}^T ( \lambda^{-1} \bm{E} + \sum_{i,j=0}^{n} \alpha_{ij, \mathfrak{p}} \vec{c}_{i, \mathfrak{p}} \vec{c}_{j,\mathfrak{p}}^T ) \vec{c}_{n+1, \mathfrak{p}} \nonumber \\
= & \lambda^{-1} I_{k\, n+1, \mathfrak{p}} + \sum_{i,j=0}^{n} \alpha_{ij, \mathfrak{p}} I_{ki, \mathfrak{p} } I_{j\, n+1, \mathfrak{p} }
\label{eq:HGF_w3}
\end{align}
\vspace{-0.7cm}
\end{figure}
$G_{ij,\mathfrak{p}}$ equals to the box filtering result $\bm{G}_{ij}(\mathfrak{p})$ of the element-wise production image $\bm{G}_i\bm{G}_j$. Then $\vec{w}_{\mathfrak{p}}(k)$ can be synthesized by composing a set of box filtering results.
\begin{prop}
if the neighborhood $\Omega_{\mathfrak{p}}$ of $\mathfrak{p}$ is a box window, we have $G_{ij,\mathfrak{p}} = \bm{G}_{ij}(\mathfrak{p})$ which is the box filtering result of the element-wise production image $\bm{G}_i\bm{G}_j$ in $\Omega_{\mathfrak{p}}$.
\label{prop:box}
\end{prop}
\begin{proof}
We have the dot production $G_{ij,\mathfrak{p}} = \vec{c}_{i,\mathfrak{p}}^T \vec{c}_{j, \mathfrak{p}} = \sum_{k=1}^{|\Omega_\mathfrak{p}|} \bm{G}_{i}(\mathfrak{q}_k) \bm{G}_{j}(\mathfrak{q}_k) = \sum_{\mathfrak{q} \in \Omega_{\mathfrak{p}}} \bm{G}_{i}(\mathfrak{q}) \bm{G}_{j}(\mathfrak{q}) $ and
the box filtering result $\bm{G}_{ij}(\mathfrak{p}) = \sum_{\mathfrak{q} \in \Omega_{\mathfrak{p}}} \bm{G}_i\bm{G}_j(\mathfrak{q}) = \sum_{\mathfrak{q} \in \Omega_{\mathfrak{p}}} \bm{G}_i(\mathfrak{q})\bm{G}_j(\mathfrak{q}) $. So we conclude $G_{ij,\mathfrak{p}} = \bm{G}_{ij}(\mathfrak{p})$.
\end{proof}
\begin{figure*}[t]
\vspace{-0.2cm}
\begin{subfigure}[b]{\linewidth}
\includegraphics[width=\textwidth, height=3.7cm]{framework}
\end{subfigure}
\caption{\textbf{Filtering Flowchart of HGF with the Input from a Multi-Label System}. At first, we exploit the input guidance to synthesize a polynomial guidance. Then the input cost slice together with the polynomial guidance are used to produce box filtering images $\bm{G}_{ij}$~\eqref{eq:HGF_Iij}. After that we compute $\bm{\alpha}_{ij}$ and $\bm{W}_i$ from $\bm{G}_{ij}$ according to Eq~\eqref{eq:alpha}~\eqref{eq:HGF_w4}. At last, the filtering result is yielded by Eq~\eqref{eq:HGF_z2}. Note that each step only involves element-wise arithmetic computation or box filtering. }
\label{fig:flowchart}
\end{figure*}
\noindent Above all, the $k$th element $\vec{w}_{\mathfrak{p}}(k)$ of $\vec{w}_{\mathfrak{p}}$ can be figured out in two steps:
\begin{enumerate}
\item applying box filter to element-wise production image $\bm{G}_i\bm{G}_j$ for $0 \leq i, j \leq n+1$ to produce $\bm{G}_{ij}$;
\item computing $\vec{w}_{\mathfrak{p}}(k)$ according to the linear combination~\eqref{eq:HGF_w3} of $\bm{G}_{ij}$.
\end{enumerate}
Then applying the procedure to each $\vec{w}_{\mathfrak{p}}(k)$, we will compose the vector $\vec{w}_{\mathfrak{p}}$. At last, we note that above two steps computing procedure is only composed by arithmetic calculation and box filtering. The matrix inverse operation is completely eliminated in the computation procedure.
\section{Hardware-Efficient Guided Filter}
\label{sec:HGF}
In this section, we define HGF and present its hardware-efficient implementation in detail. Fig~\ref{fig:flowchart} plots the overall computing procedure to give a general idea for our HGF.
\subsection{Defintion}
The key assumption of HGF is the generalized linear model~\eqref{eq:HGF_linear_output_model} between the synthesized $n$-channel guidance $\bm{G}$ and the output $\bm{Z}$, where $\vec{w}_{\mathfrak{p}}$ is constant in the window $\Omega_{\mathfrak{p}}$.
\begin{equation}
\bm{Z}(\mathfrak{q}) = \sum_{i=1}^{n} \vec{w}_{ \mathfrak{p}}(i) \bm{G}_{i}(\mathfrak{q}) + \vec{w}_{\mathfrak{p}}(0), \; \forall \mathfrak{q} \in \Omega_{\mathfrak{p}}
\label{eq:HGF_linear_output_model}
\end{equation}
According to the local multipoint filtering framework~\cite{Katkovnik_IJCV_2010}, HGF comprises two major steps: 1) \emph{multipoint estimation:} calculating the estimates for a set of points within a local support, and 2) \emph{aggregation:} fusing multipoint estimates available for each point. Specifically, in the first step, HGF estimates the coefficients $\vec{w}_{\mathfrak{p}}$ of model \eqref{eq:HGF_linear_output_model} by minimizing the linear ridge regression~\eqref{eq:HGF_linear_regression}, where $\bm{Y}$ denotes an input image and the closed-form solution of the minimizer $\vec{w}_{\mathfrak{p}}$ is Eq~\eqref{eq:HGF_w1}.
\begin{figure}[h]
\vspace{-0.3cm}
\begin{equation}\hspace{-0.2cm}
\min_{\vec{w}_{\mathfrak{p}}} \lambda \| \vec{w}_{\mathfrak{p}} \|_2^2 + \sum_{\mathfrak{q} \in \Omega_{\mathfrak{p}}} ( \bm{Y}(\mathfrak{q}) - \sum_{i=1}^{n} \vec{w}_{\mathfrak{p}}(i) \bm{G}_{i}(\mathfrak{q}) - \vec{w}_{\mathfrak{p}}(0) )^2
\label{eq:HGF_linear_regression}
\end{equation}
\vspace{-0.5cm}
\end{figure}
In the second step, HGF puts the minimizer $\vec{w}_{\mathfrak{p}}$ of optimization~\eqref{eq:HGF_linear_regression} into Eq~\eqref{eq:HGF_linear_output_model} and obtains a set of values $\bm{Z}'_{\mathfrak{p}}(\mathfrak{q}) = \sum_{i=1}^{n} \vec{w}_{i, \mathfrak{p}} \bm{G}_{i}(\mathfrak{q}) + \vec{w}_{0, \mathfrak{p}}, \mathfrak{q} \in \Omega_{\mathfrak{p}}$for a given window $\Omega_{\mathfrak{p}}$. So each pixel $\mathfrak{q}$ has $| \Omega_{\mathfrak{p}} |$ values. HGF aggregates these values together and considers their mean $ \frac{1}{|\Omega_{\mathfrak{q}}|} \sum_{\mathfrak{p} \in \Omega_{\mathfrak{q}}} \bm{Z}'_{\mathfrak{p}}(\mathfrak{q})$ as final filtering result $\bm{Z}(\mathfrak{q})$. So we have
\begin{align}
\bm{Z}(\mathfrak{q})
= & \frac{1}{|\Omega_{\mathfrak{q}}|} \sum_{\mathfrak{p} \in \Omega_{\mathfrak{q}}} \sum_{i=1}^{n} \vec{w}_{ \mathfrak{p}}(i) \bm{G}_{i}(\mathfrak{q}) + \vec{w}_{\mathfrak{p}}(0) \nonumber \\
= & \sum_{i=1}^{n} \vec{w}^a_{\mathfrak{q}}(i) \bm{G}_{i}(\mathfrak{q}) + \vec{w}^a_{\mathfrak{q}}(0)
\label{eq:HGF_z1}
\end{align}
where $\vec{w}^a_{\mathfrak{q}} = \frac{1}{|\Omega_{\mathfrak{q}}|} \sum_{\mathfrak{p} \in \Omega_{\mathfrak{q}}} \vec{w}_{ \mathfrak{p}} $ is the average of $\vec{w}_{ \mathfrak{p}}$ in $\Omega_{\mathfrak{q}}$.
\subsection{Polynomial Guidance}
GF exploits the linear model~\eqref{eq:GF_linear_model} to estimate filtering results from an input guidance. However, it is unreasonable to expect that the linear model works well under all circumstances as the linear models~\eqref{eq:GF_linear_model} of GF are apt to underfits data due to its simplicity and thus produces over-smoothing filtering results. We address the problem by synthesizing a polynomial guidance from a raw image.
The polynomial guidance is designed to introduce nonlinearity to the generalized linear model~\eqref{eq:HGF_linear_output_model}. For example, Eq~\eqref{eq:HGF_input_output_polynomial_model} shows
\begin{figure}[h]
\vspace{-0.3cm}
\begin{equation}
\bm{Z}(\mathfrak{q}) = \sum_{i=1}^{d} \vec{w}_{ \mathfrak{p}}(i) \bm{I}^{i}(\mathfrak{q}) + \vec{w}_{\mathfrak{p}}(0), \; \forall \mathfrak{q} \in \Omega_{\mathfrak{p}}
\label{eq:HGF_input_output_polynomial_model}
\end{equation}
\vspace{-0.3cm}
\end{figure}
the polynomial model with a gray input guidance $\bm{I}$,
where $d$ is the degree of the polynomial function. Compared with the linear model~\eqref{eq:HGF_linear_output_model}, we can find the equivalence between the linear model~\eqref{eq:HGF_linear_output_model} and the polynomial model~\eqref{eq:HGF_input_output_polynomial_model} if we assume $\bm{G}_i = \bm{I}^i$. This inspires us to
introduce nonlinearity to HGF by synthesizing a polynomial guidance, where each channel of the synthesized polynomial guidance is produced by a polynomial function operated on a channel of the input guidance.
This method can be easily extended to the multichannel guidance. In the case when the input guidance is multichannel, it is straightforward to apply the map procedure $\bm{G}_{(i-1)d+j} = \bm{I}_i^{j}$ to each channel independently, where $\bm{I}_i$ denotes the $i$th channel of the multichannel guidance $\bm{I}$ and $n$ is the channel number of $\bm{I}$. After that we stack produced results of each channel of the input multichannel guidance $\bm{I}$ to synthesize our polynomial guidance. Mathematically, the linear model~\eqref{eq:HGF_linear_output_model} in this situation is equivalent to following nonlinear polynomial model~\eqref{eq:HGF_input_output_polynomial_model_color}. So we successfully endow the nonliearity to the generalized linear model~\eqref{eq:HGF_linear_output_model} of HGF.
\begin{figure}[h]
\vspace{-0.5cm}
\begin{equation}
\bm{Z}(\mathfrak{q}) = \sum_{i=1}^{n}\sum_{j=1}^{d} \vec{w}_{ \mathfrak{p}}((i-1)d+j) \bm{I}^{j}_i(\mathfrak{q}) + \vec{w}_{\mathfrak{p}}(0)
\label{eq:HGF_input_output_polynomial_model_color}
\end{equation}
\vspace{-0.5cm}
\end{figure}
\subsection{Hardware-Efficient Implementation}
Here we present the matrix inverse algorithm tailored to $(\lambda \bm{E} + \bm{X}^T_{\mathfrak{p}} \bm{X}_{\mathfrak{p}} )^{-1}$ to make full use of the parallel computing ability of hardwares.
HGF in the first step calculates the minimizer~\eqref{eq:HGF_w1} of the linear ridge regression~\eqref{eq:HGF_linear_regression}. However traditional matrix inverse algorithms cannot fully take advantages of the parallel computing hardwares. Fortunately, Eq~\eqref{eq:HGF_w3} sheds light on a hardware-efficient way to compute $\vec{w}_{\mathfrak{p}}$ because it guarantees the $k$th element $\vec{w}_{\mathfrak{p}}(k)$ of $\vec{w}_{\mathfrak{p}}$ is the linear combination of the box filtering result $\bm{G}_{ij}(\mathfrak{p})$. Specifically, putting $\mathcal{B}(\bm{X})$ denote the box filtering result of an image $\bm{X}$, $\bm{W}_i$ and $\bm{\alpha}_{ij}$ record all values of $\vec{w}_{\mathfrak{p}}(i)$ and $\alpha_{ij,\mathfrak{p}}$ for arbitrary $\mathfrak{p}$ in the image domain (\ie $\bm{W}_i(\mathfrak{p}) = \vec{w}_{\mathfrak{p}}(i)$, $\bm{\alpha}_{ij} (\mathfrak{p}) = \alpha_{ij,\mathfrak{p}}$), we can generalize Eq~\eqref{eq:HGF_w3} to following element-wise arithmetic calculations~\eqref{eq:HGF_w4} of box filtering results $\bm{G}_{ij}$~\eqref{eq:HGF_Iij}. Here $\bm{G}_0$ denotes matrix of ones, $\bm{G}_{i} (1\leq i \leq n)$ stand for the $i$th channel of the synthesized polynomial $n$-channel guidance $\bm{G}$, $\bm{G}_{n+1}$ be the alias of the input image $\bm{Y}$.
\begin{figure}[h]
\vspace{-0.6cm}
\begin{align}
\bm{G}_{ij} &= \mathcal{B}(\bm{G}_{i} \bm{G}_{j}) \label{eq:HGF_Iij} \\
\bm{W}_i &= \lambda^{-1} \bm{G}_{\kappa n+1} + \sum_{i,j=0}^{n} \bm{\alpha}_{ij} \bm{G}_{\kappa i} \bm{G}_{j n+1}
\label{eq:HGF_w4}
\end{align}
\vspace{-0.6cm}
\end{figure}
Similarly, the updating formulate of $\alpha_{ij,\mathfrak{p}}^{\kappa}$ can also be modified to
the element-wise arithmetic calculation of matrices~\eqref{eq:alpha},
\begin{figure}[h]
\vspace{-0.5cm}
\begin{equation}
\bm{\alpha}_{ij}^{\kappa} = \begin{cases}
\bm{F}_{\mathfrak{p}}^{\kappa} + \bm{\alpha}_{ij}^{\kappa-1} & i < \kappa, j < \kappa \\
\lambda^{-1} \bm{\gamma}^\kappa \sum_{n=0}^{\kappa-1} \bm{\alpha}_{in}^{\kappa-1} \bm{G}_{n\kappa} & i < \kappa, j = \kappa \\
\lambda^{-1} \bm{\gamma}^\kappa \sum_{m=0}^{\kappa-1} \bm{\alpha}_{mj}^{\kappa-1} \bm{G}_{\kappa m} & i = \kappa, j < \kappa \\
\lambda^{-2} \bm{\gamma}^\kappa & i = j = \kappa
\end{cases}
\label{eq:alpha}
\end{equation}
\vspace{-0.5cm}
\end{figure}
where
$\bm{\alpha}_{00}^{0} = - (\lambda + \bm{G}_{00})^{-1}$,
$\bm{F}^{\kappa} = \sum_{m,n=0}^{\kappa-1} \bm{\alpha}^{\kappa-1}_{im} \bm{\alpha}^{\kappa-1}_{nj} \bm{G}_{m \kappa} \bm{G}_{\kappa n}$ and $\bm{\gamma}^\kappa = - (1 + \lambda^{-1} \bm{G}_{\kappa\kappa} + \sum \nolimits_{m,n=0}^{\kappa-1} \bm{\alpha}^{\kappa-1}_{mn} \bm{G}_{\kappa m} \bm{G}_{n \kappa} )^{-1}$.
HGF in the second step computes filtering results $\bm{Z}(\mathfrak{p})$ according to the average of coefficients $\vec{w}_{\mathfrak{p}}$. Define the average operator $\mathcal{A}(\bm{X}) = \mathcal{B}(\bm{X}) / \mathcal{B}(\bm{G}_0)$, we can formulate the element-wise arithmetic calculation form of Eq~\eqref{eq:HGF_z1} as
\vspace{-0.2cm}
\begin{equation}
\bm{Z} = \sum_{i=1}^{n} \mathcal{A}(\bm{W}_i) \bm{G}_i + \mathcal{A}(\bm{W}_0)
\label{eq:HGF_z2}
\end{equation}
Taking a closer look at Eq~\eqref{eq:HGF_Iij}~\eqref{eq:HGF_w4}~\eqref{eq:alpha}~\eqref{eq:HGF_z2}, we find that all equations only involve two computation types (Fig~\ref{fig:flowchart} sums up computation types in each step and overall computation flowchart): one is element-wise arithmetic calculations of matrices, the other is box filtering for images. Both computations can easily exert the parallelism power of current hardware. More importantly, there are highly optimized libraries for CPU and GPU. In the next, we present how to implement them in a hardware-efficient way.
\vspace{1mm}
\emph{\textbf{Element-wise arithmetic calculations}} is a typical data parallel task because it distributes the operation over elements of a matrix. In parallel computing literatures, it belongs to the map pattern~\cite{McCool_BOOK_2012} which applies an elemental function to an actual collection of input data. Current CPU and GPU do well in these calculations as the SIMD instructions of CPU and GPU can benefit from same computations done on different pieces of data in the data parallel task. Although inverting matrices simultaneously belongs to the map pattern too, it cannot be as efficient as our method because inverting operation is not directly supported by hardware and thus can not benefit from SIMD instructions. In contrast the arithmetic computations can be directly allocated to a core of CPU or thread of GPU for parallel computing. Finally, we note that element-wise arithmetic calculations are supported by many softwares or libraries such as
such as Matlab, ViennaCL~\cite{Rupp:ViennaCL} and Arrayfire~\cite{Yalamanchili_CODE_2015}.
\vspace{1mm}
\emph{\textbf{Box filtering}} produces a smoothing image of which has a value equal to the sum of its neighboring pixels in the input image and can be computed in linear time from the Summed Area Table~\cite{Crow_SGF_1984}. Different from element-wise calculation, box filtering belongs to the stencil pattern~\cite{McCool_BOOK_2012} that is a generalization of the map pattern in which an elemental function can access not only a single element in an input collection but also a set of neighbors. A detailed description on how to implement the stencil pattern efficiently on parallel devices can be found in the book~\cite{McCool_BOOK_2012}. Fortunately, we do not need to implement the box filtering manually since two libraries OpenCV of Intel and NPP of Nvidia already have offered.
\section{More Discussion for HGF}
\label{sec:discussion}
In this section, we clarity the connection and differences between HGF and GF. Moreover, the performance and implementation concerns of HGF will also be discussed.
\subsection{Connection with GF}
Our matrix inverse algorithm can also be used to speed up GF. Specifically, GF minimizes optimization~\eqref{eq:GF_linear_regression} to determine the coefficient $\vec{w}_{\mathfrak{p}}$, where $\vec{w}_{\mathfrak{p}}$ is a $4$ elements vector.
\begin{figure}[h]
\vspace{-0.6cm}
\begin{equation}
\min_{\vec{w}_{\mathfrak{p}} } \lambda \sum_{i=1}^{3}
\vec{w}_{\mathfrak{p}}^2(i) + \sum_{\mathfrak{q} \in \Omega_{\mathfrak{p}}} ( \bm{Y}(\mathfrak{q}) - \sum_{i=1}^{3} \vec{w}_{\mathfrak{p}}(i) \bm{I}_{i}(\mathfrak{p}) - \vec{w}_{\mathfrak{p}}(0) )^2
\label{eq:GF_linear_regression}
\end{equation}
\vspace{-0.8cm}
\end{figure}
Let $\vec{c}_{i, \mathfrak{p}}$ be a $n$ element vector extracted from $\bm{I}_i$ in $\Omega_{\mathfrak{p}}$, $\bm{X}_{\mathfrak{p}} = [\vec{c}_{1, \mathfrak{p}}, \vec{c}_{2, \mathfrak{p}}, \vec{c}_{3, \mathfrak{p}}] $, $\vec{\bm{1}}$ denote the identity vector, $\vec{x}_{\mathfrak{p}} = \frac{1}{n} \bm{X}^T \vec{\bm{1}}$, $c_{n+1, \mathfrak{p}} = \frac{1}{n} \vec{c}_{n+1, \mathfrak{p}}^T \vec{\bm{1}} $, $\bm{X}'^T_{\mathfrak{p}} = \bm{X}^T_{\mathfrak{p}} - \vec{1} \vec{x}^T_{\mathfrak{p}} $ and $\vec{c}'_{n+1, \mathfrak{p}} = \vec{c}_{n+1, \mathfrak{p}} - c_{n+1, \mathfrak{p}} \vec{\bm{1}}$,
then $
\vec{w}_{\mathfrak{p}}(0) = c_{n+1, \mathfrak{p}} - \vec{w}^T_{\mathfrak{p}} \vec{x}_{\mathfrak{p}} $.
\begin{figure}[h]\vspace{-0.5cm}
\begin{equation}
[\vec{w}_{\mathfrak{p}}(1), \vec{w}_{\mathfrak{p}}(2), \vec{w}_{\mathfrak{p}}(3)]^T = (\lambda \bm{E} + \bm{X}'^T_{\mathfrak{p}} \bm{X}'_{\mathfrak{p}} )^{-1}\bm{X}'^T_{\mathfrak{p}} \vec{c}'_{n+1, \mathfrak{p}}
\label{eq:GF_w}
\end{equation}
\vspace{-0.6cm}
\end{figure}
and the last three terms of $\vec{w}_{\mathfrak{p}}$ can be computed by Eq~\eqref{eq:GF_w}.
The form of Eq~\eqref{eq:GF_w} is same to Eq~\eqref{eq:HGF_w1}. Hence we can apply the same technique to invert the matrix.
\subsection{Differences From GF}
HGF is similar to GF but not same to it. Simply put, there are three major differences between the two filters:
\emph{\textbf{The guidance is different}}. GF directly takes a gray/color image as its guidance $\bm{I}$. Contrarily, HGF synthesizes a multi-channels polynomial guidance $\bm{G}$ from a gray or color input image. With increasing channel number, the guidance carries more and more information.
\emph{\textbf{The cost function is different}}. The regularization term of GF does not punish $\vec{w}_{\mathfrak{p}}(0)$. In contrast, HGF treats all elements of $\vec{w}_{\mathfrak{p}}$ equally in the cost function~\eqref{eq:HGF_linear_regression} as the minimizer~\eqref{eq:HGF_w2} can be computed in a hardware-efficient way and the final result of HGF in the multi-label system is much better according to our experiments.
\emph{\textbf{The matrix inverse algorithm is different}}. GF does not take any special measure to accelerate the speed of inverting matrices. On the contrary, HGF designs an effective matrix inverse algorithm to fully utilize the parallel ability of current hardwares. As a result, the computational procedure of HGF only comprises two hardware-efficient operations: element-wise arithmetic calculations and box filtering.
\subsection{Performance Evaluation}
\begin{table}[b]
\vspace{-0.2cm}
\centering
\begin{tabular}{|c|c|c|c|c|}
\hline
Algorithms & $3$ & $5$ & $7$ & $9$ \\
\hline \hline
$\text{GF}_1$ & $0.85s$ & $1.36s$ & $2.01s$ & $2.83s$ \\
$\text{GF}_2$ & $0.17s$ & $0.35s$ & $\diagup$ & $\diagup$ \\
HGF & $0.08s$ & $0.16s$ & $0.25s$ & $0.43s$ \\
\hline
\end{tabular}
\caption{Execution time to filter $10^3 \times 10^3$ gray images with different guidances on CPU, where the channel number of guidance varies from $3$ to $10$. }
\label{tab:time_matlab}
\end{table}
Our experiments are conducted on a Laptop with an Intel i7 CPU and GTX 960 GPU.
In order to compare the running performance fairly and comprehensively, we exploit two C++ libraries (\ie OpenCV and Arrayfire~\cite{Yalamanchili_CODE_2015}) to implement GF and HGF, where the Summed Area Table~\cite{Crow_SGF_1984} accelerated box filtering and the three matrix inverse algorithms are incorporated into the two filters. Here the three matrix inverse algorithms are:
\begin{itemize} \vspace{-0.5mm}
\item \textbf{Built-in LU matrix inverse algorithm:} We use the built-in matrix inverse function ``inv'' of OpenCV to compute final filtering results of GF. The built-in function takes a highly optimized LU matrix inverse algorithm and the input matrix can be arbitrary size.
\item \textbf{Analytic solution of matrix inverse algorithm:} The closed-form solution of each invertible matrix can be expressed by adjugate matrices. It is an efficient way to calculate the inverse of small matrices but is inefficient for large matrices. The built-in function ``GuidedFilter'' of OpenCV takes it to compute color-guidance results of GF. We only extend it to inverse $5 \times 5$ matrices because the matrix inverse code becomes much complex when the matrix size is large than $5$ and thus it is nearly impossible to write the code of inverting $7 \times 7$ and $9 \times 9$ matrices by hand (the analytic solutions of $7 \times 7$ and $9 \times 9$ matrix inverse are listed in the supplemental material for demonstration).
\item \textbf{Our hardware-efficient matrix inverse algorithm:} We incorporate it with our HGF to produce final results. Note that unlike the first algorithm that can invert arbitrary matrices and the second algorithm that only suits to a small matrix, our method can invert a arbitrary size matrix only if the matrix is invertible and can be presented by $\lambda \bm{E} + \sum_{i=0}^{n} \vec{c}_{i, \mathfrak{p}} \vec{c}_{i,\mathfrak{p}}^T $.
\end{itemize}
OpenCV is taken to reimplement GF according to its public Matlab code, where the C++ code is basically a line-by-line translation of the Matlab code and the matrix inverse algorithm is provided by the built-in ``inv'' function of OpenCV and our implementation according to the analytic solution of matrix inverse. We denote GF adopting the two implementations as $\text{GF}_1$ and $\text{GF}_2$. Since both the algorithm of GF and its Matlab code published by He \etal~\cite{He_PAMI_2013} do not consider parallelism or SIMD instructions, we compile the C++ code of GF with default complier option. Similarly, we do not take tricks to speed up HGF: the code of HGF is also compiled by default compiler option and all parallel computing infrastructure is provided by Arrayfire.
\begin{figure}[t]
\centering
\begin{subfigure}[b]{0.48\linewidth}
\includegraphics[width=\textwidth]{GF}
\caption{GF}
\end{subfigure}
\begin{subfigure}[b]{0.48\linewidth}
\includegraphics[width=\textwidth]{HGF}
\caption{HGF}
\end{subfigure}
\caption{\textbf{Execution Time Anatomy:} (a) (b) illustrate run times of the box filtering in preparing $\lambda \bm{E} + \bm{X}^T_{\mathfrak{p}} \bm{X}_{\mathfrak{p}} $, inverting this matrix and remainder computation of GF and HGF, where the green, orange and blue regions denote the run time of box filtering, matrix inverse and the remainder computation. }
\label{fig:contribution}
\end{figure}
\begin{figure*}[t]
\centering
\begin{subfigure}[b]{0.16\linewidth}
\includegraphics[width=\textwidth]{stereo_Cone_input}
\end{subfigure}
\begin{subfigure}[b]{0.16\linewidth}
\includegraphics[width=\textwidth]{stereo_Cone_BF}
\end{subfigure}
\begin{subfigure}[b]{0.16\linewidth}
\includegraphics[width=\textwidth]{stereo_Cone_GF}
\end{subfigure}
\begin{subfigure}[b]{0.16\linewidth}
\includegraphics[width=\textwidth]{stereo_Cone_CLMF}
\end{subfigure}
\begin{subfigure}[b]{0.16\linewidth}
\includegraphics[width=\textwidth]{stereo_Cone_MLPA}
\end{subfigure}
\begin{subfigure}[b]{0.16\linewidth}
\includegraphics[width=\textwidth]{stereo_Cone_HGF}
\end{subfigure}
\begin{subfigure}[b]{0.16\linewidth}
\includegraphics[width=\textwidth]{stereo_Teddy}
\caption{Input}
\end{subfigure}
\begin{subfigure}[b]{0.16\linewidth}
\includegraphics[width=\textwidth]{stereo_Teddy_BF}
\caption{BF}
\end{subfigure}
\begin{subfigure}[b]{0.16\linewidth}
\includegraphics[width=\textwidth]{stereo_Teddy_GF}
\caption{GF}
\end{subfigure}
\begin{subfigure}[b]{0.16\linewidth}
\includegraphics[width=\textwidth]{stereo_Teddy_CLMF}
\caption{CLMF}
\end{subfigure}
\begin{subfigure}[b]{0.16\linewidth}
\includegraphics[width=\textwidth]{stereo_Teddy_MLPA}
\caption{MLPA}
\end{subfigure}
\begin{subfigure}[b]{0.16\linewidth}
\includegraphics[width=\textwidth]{stereo_Teddy_HGF}
\caption{HGF}
\end{subfigure}
\setcounter{figure}{5}
\caption{\textbf{Stereo Matching Results:} (a) is input color image. (b) (c) (d) (e) and (f) illustrate the stereo matching results of BF, GF, CLMF, MLPA and HGF, respectively. In the left upper corners of (b) (c) (d) (e) and (f), we show comparisons with the respective groundtruth (error larger than one pixel in nonoccluded are denoted by black and in occlude regions are denoted by gray) and the Percentage of Bad Pixel (PBP) scores are listed in the bottom of each image. }
\label{fig:stereo}
\end{figure*}
The $\text{GF}_1$ and HGF rows of Table~\ref{tab:time_matlab} report execution times of GF and HGF for a $10^3 \times 10^3$ guidance with increasing channel number on CPU. According to our experiments, HGF is much faster than GF. Due to the smaller running cost of our matrix inverse algorithm, it is more efficient even if channel number of guidance is large. We also test the GF code using analytic solution of matrix inverse. The experimental data for $3/5$-channel guidances are reported in the $\text{GF}_2$ row. We can observe the speed of the analytic solution is faster than generalized matrix inverse function ``inv'' function of OpenCV, but is still slower than our matrix inverse algorithm. In short, the analytic solution achieves a relative fast speed by paying an extremely heavy cost to translate it into element-wise calculation.
\begin{table}[t]
\hspace{-0.2cm}
\begin{tabular}{|c|c|c|c|c|}
\hline
Size/$n$ & 3 & 5 & 7 & 9 \\ \hline
$250 \times 250$ & $3.9ms$ & $10.7ms$ & $39.9ms$ & $110.2ms$ \\ \hline
$500 \times 500$ & $3.7ms$ & $11.1ms$ & $40.1ms$ & $112.4ms$ \\ \hline
$1000 \times 1000$ & $4.1ms$ & $10.9ms$ & $41.3ms$ & $115.9ms$ \\ \hline
$2000 \times 2000$ & $4.3ms$ & $11.2ms$ & $42.7ms$ & $121.8ms$ \\ \hline
\end{tabular}
\caption{Execution time of HGF on Nvidia GPU with increasing guidances channel number $n$, where the input is a gray image with increasing sizes, the channel number of guidance varies from $3$ to $9$. }
\label{tab:time_arrayfire
\end{table}
Box filtering takes up most of the run time of HGF. The area graph in Fig~\ref{fig:contribution} displays the execution time of box filtering in preparing matrices $\lambda \bm{E} + \bm{X}^T_{\mathfrak{p}} \bm{X}_{\mathfrak{p}} $~\eqref{eq:HGF_w1}, inverting these matrices and remainder computation in GF and HGF, where the green denotes the box filtering time, the orange presents matrix inverse time and the horizontal axis is the channel number of guidance. We can observe that box filtering in HGF consumes more than half of the time. This inspires us to precompute the box filtering results $\bm{G}_{ij} = \mathcal{B}(\bm{G}_{i} \bm{G}_{j})$ of all pair-wise production image $\bm{G}_{i} \bm{G}_{j}$ in Eq~\eqref{eq:HGF_w4}~\eqref{eq:alpha} \eqref{eq:HGF_z2} to accelerate the computational speed of HGF further. Unlike HGF, matrix inverse operation in GF spends most of the time. So GF cannot take the same strategy to reduce its run time. At last, we note that an unignorable part of the overall execution time of HGF is spent by the ``remainder'' part denoted by the blue in Fig~\eqref{fig:contribution} and most time of this part is payed for box filtering as Eq~\eqref{eq:HGF_z2} involves $n$ box filters. Here $n$ is the channel number of the guidance.
To demonstrate the actual power of our algorithm, we accelerate HGF by precomputing all-pair box filtering results $\bm{G}_{ij} = \mathcal{B}(\bm{G}_{i} \bm{G}_{j})$. Table~\ref{tab:time_arrayfire} reports the execution time tested on GPU with increasing guidance channel number.
For guidance images of which the channel number is smaller than $7$, the performance is realtime. It is also worth noting that the performance of HGF scales well with the size of input image (\ie the execution time does not change with the data size). We contributes this ability to the parallel computing ability of HGF.
\begin{figure}[t]
\centering
\begin{subfigure}[b]{0.48\linewidth}
\includegraphics[width=\textwidth]{fitting_linear}
\caption{Linear model}
\end{subfigure}
\begin{subfigure}[b]{0.48\linewidth}
\includegraphics[width=\textwidth]{fitting_cubic}
\caption{Polynomial model}
\end{subfigure}
\setcounter{figure}{4}
\caption{\textbf{Fitting curves of linear model and nonlinear polynomial model on noisy data.} According to the fitting curves, the polynomial model is more flexible than the linear model. }
\label{fig:curves}
\end{figure}
\begin{figure*}[t]
\centering
\begin{subfigure}[b]{0.16\linewidth}
\includegraphics[width=\textwidth]{optical_Army}
\end{subfigure}
\begin{subfigure}[b]{0.16\linewidth}
\includegraphics[width=\textwidth]{optical_Army_BF}
\end{subfigure}
\begin{subfigure}[b]{0.16\linewidth}
\includegraphics[width=\textwidth]{optical_Army_GF}
\end{subfigure}
\begin{subfigure}[b]{0.16\linewidth}
\includegraphics[width=\textwidth]{optical_Army_CLMF}
\end{subfigure}
\begin{subfigure}[b]{0.16\linewidth}
\includegraphics[width=\textwidth]{optical_Army_MLPA}
\end{subfigure}
\begin{subfigure}[b]{0.16\linewidth}
\includegraphics[width=\textwidth]{optical_Army_HGF}
\end{subfigure}
\begin{subfigure}[b]{0.16\linewidth}
\includegraphics[width=\textwidth]{optical_Backyard}
\caption{Input}
\end{subfigure}
\begin{subfigure}[b]{0.16\linewidth}
\includegraphics[width=\textwidth]{optical_Backyard_BF}
\caption{BF}
\end{subfigure}
\begin{subfigure}[b]{0.16\linewidth}
\includegraphics[width=\textwidth]{optical_Backyard_GF}
\caption{GF}
\end{subfigure}
\begin{subfigure}[b]{0.16\linewidth}
\includegraphics[width=\textwidth]{optical_Backyard_CLMF}
\caption{CLMF}
\end{subfigure}
\begin{subfigure}[b]{0.16\linewidth}
\includegraphics[width=\textwidth]{optical_Backyard_MLPA}
\caption{MLPA}
\end{subfigure}
\begin{subfigure}[b]{0.16\linewidth}
\includegraphics[width=\textwidth]{optical_Backyard_HGF}
\caption{HGF}
\end{subfigure}
\setcounter{figure}{6}
\caption{\textbf{Optical Flow Estimation:} (a) is input color image. (b) (c) (d) (e) and (f) demonstrate the stereo matching results of BF, GF, CLMF, MLPA and HGF, respectively, where the white box denotes the close-up region for visual comparison. }
\label{fig:flow}
\end{figure*}
\section{Experiments and Applications}
\label{sec:exp}
To demonstrate the ability of our HGF, we apply it to three classic multi-label problems: stereo matching, optical flow and image segmentation. To show the robustness of our method, we use following, the same constant parameter setting to generate our results: $(\lambda = 0.05, r = 7)$, where $r$ indicates the radius of box window and $\lambda$ balances the two terms in Eq~\eqref{eq:HGF_linear_regression}. In the following experiments, each channel $\bm{G}_i$ of the polynomial guidance $\bm{G}$ is synthesized by the mapping $\bm{G}_{(i-1)d + j} = \bm{I}_i^{j}$ $(1 \leq j \leq 2)$ with a color input guidance $\bm{I}$ and total five edge-aware filters including BF~\cite{Tomasi_ICCV_1998}, GF~\cite{He_PAMI_2013}, CLMF~\cite{Lu_CVPR_2012}, MLPA~\cite{Tan_CVPR_2014} and our HGF are taken to perform comparison. For each application, we incorporate above five filters into the same framework to procedure final results. Experiments disclose our filter achieves the best result in terms of accuracy.
\vspace{0.1cm} \noindent \textbf{Nonlinearity \;} We own the achievement of HGF to the synthesized polynomial guidance which introduces nonlinearity to our HGF. Fig~\ref{fig:curves} compares the polynomial model and linear model on an artificial dataset, which consists of a curve extracting from a nature image and strong noise added to every fifth datapoints. From the plotted fitting curves of linear model, we can observe that the linear model fails in the dataset. We thus believe that linear model will fail too while
smoothing highly corrupted cost slice in the following experiments
\vspace{0.1cm} \noindent \textbf{Stereo Matching \;}
We conduct experiments based on the cost volume filtering framework~\cite{Hosni_PAMI_2013}. This framework comprises cost volume computation, cost aggregation, disparity computation and post processing. Above five filters are employed for cost aggregation. According to the results reported in Fig~\ref{fig:stereo}, our method outperforms other aggregation filters and the run time is less than $800ms$.
\vspace{0.1cm} \noindent \textbf{Optical Flow \;}
Xiao \etal~\cite{Xiao_ECCV_2006} separate the traditional one-step variational updating model into a two-step filtering-based updating model for optical flow estimation, where BF is proposed to substitute the original anisotropic diffusion process. In this framework, we substitute original BF with GF, CLMF, MLPA and HGF to test the performance of these filters. According to Fig~\ref{fig:flow}, our method can detect tiny structure in the optical flow images within $900ms$.
\vspace{0.2cm} \noindent \textbf{Image Segmentation \;}
We also take the cost volume filtering framework~\cite{Hosni_PAMI_2013} to show that HGF performs well for image segmentation, where the labels encode whether a pixel belongs to the foreground or background and cost computation is same to Hosni \etal~\cite{Hosni_PAMI_2013}. Fig~\ref{fig:segment} proves that our HGF is able to distinguish foreground from background much better and the run time is $120ms$.
\begin{figure}
\setlength{\tabcolsep}{0cm}
\begin{tabular}{cccc}
\multirow{2}{*}{ \parbox[c]{0.3\linewidth}{ \vspace{-0.8cm}
\begin{subfigure}[b]{\linewidth}
\includegraphics[width=\textwidth]{segment_teddy}
\caption{Input}
\end{subfigure} } }
&
\parbox[c]{0.2\linewidth}{
\begin{subfigure}[b]{0.98\linewidth}
\includegraphics[width=\textwidth]{segment_teddy_close_up_70_150_60_50}
\caption{Close-up}
\end{subfigure} }
&
\parbox[c]{0.2\linewidth}{
\begin{subfigure}[b]{0.98\linewidth}
\includegraphics[width=\textwidth]{segment_teddy_BF_close_up_70_150_60_50}
\caption{BF}
\end{subfigure} }
&
\parbox[c]{0.2\linewidth}{
\begin{subfigure}[b]{0.98\linewidth}
\includegraphics[width=\textwidth]{segment_teddy_GF_close_up_70_150_60_50}
\caption{GF}
\end{subfigure} } \\
&
\parbox[c]{0.2\linewidth}{ \vspace{0.15cm}
\begin{subfigure}[b]{0.98\linewidth}
\includegraphics[width=\textwidth]{segment_teddy_CLMF_close_up_70_150_60_50}
\caption{CLMF}
\end{subfigure} }
&
\parbox[c]{0.2\linewidth}{ \vspace{0.15cm}
\begin{subfigure}[b]{0.98\linewidth}
\includegraphics[width=\textwidth]{segment_teddy_MLPA_close_up_70_150_60_50}
\caption{MLPA}
\end{subfigure} }
&
\parbox[c]{0.2\linewidth}{ \vspace{0.15cm}
\begin{subfigure}[b]{0.98\linewidth}
\includegraphics[width=\textwidth]{segment_teddy_HGF_close_up_70_150_60_50}
\caption{HGF}
\end{subfigure} }
\end{tabular}
\caption{\textbf{Segmentation results:} (a) is input image, where black box denotes bounding box and white box presents the close-up region. (b) is the close-up of (a). (c) (d) (e) (f) (g) are the segmentation results of BF, GF, CLMF, MLPA and HGF, respectively. }
\label{fig:segment}
\end{figure}
\section{Conclusion}
This paper presented an effective guided image filter for multi-label problem. We own the power to the nonlinearity introduced by the synthesized polynomial guidance. A side effect of the nonlinearity model is that it inevitably increases the running cost as we have to invert a bulk of large matrices. Fortunately, our new designed hardware-efficient matrix inverse algorithm can reduce the run time significantly by the help of our effective matrix inverse technique. We believe our filter will greatly profit building efficient computer vision systems in other multi-label problems.
\section{Acknowledgments}
This work was supported in part by the National Key Research and Development Program of China (Grant No. 2016YFB1001001) and the National Natural Science Foundation of China (Grant No. 61620106003, 61522203, 61571046).
\newpage
{\small
\bibliographystyle{ieee}
| {'timestamp': '2018-03-02T02:00:17', 'yymm': '1803', 'arxiv_id': '1803.00005', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00005'} | arxiv |
\section{Proofs of Sec.~\ref{sec:analysis}}
\section{Concluding Remarks}
\label{sec:conclude}
In this paper, we study the problem of inferring the fine-grained spatial distribution of certain density data in a region based on the aggregate observations recorded for each of its subregions.
We propose the Constrained Spatial Smoothing (CSS) approach that exploits both the intrinsic smooth property of underlying factors and the additional features from external social or domestic statics. We further propose a training algorithm which combines the Spatial Spline Regression (SSR) technique and ADMM technique to learn our model parameters efficiently. To evaluate our algorithm and compare it with various other approaches, we run extensive evaluation based on the Milan Call Detail Records dataset provided by Telecom Italia Mobile. The simulation results on the dataset show that our algorithm significantly outperforms other baseline approaches by a great percentage.
\section{Problem Formulation}
\label{sec:formulation}
In this section, we formally introduce the problem of recovering a spatial field from coarse aggregations observed at sparse points in the field.
Suppose the entire region of interest is modelled by an irregularly bounded domain $\Omega \subset\mathbb R^2$ that excludes the uninhabited areas such as rivers, ocean coasts, hills and so on.
Let $f(\mathbf p)$ be a real-valued function or a spatial field that models certain densities (e.g., cell phone activities) over different geographical positions $\mathbf p = (x,y)\in\Omega$.
Suppose there is a set of $m$ observation points (e.g., base stations) $B = \{B_1,\ldots, B_m\}$ sparsely distributed in $\Omega$,
where each observation point $B_i$ has a position $\mathbf p_{B_i}$ and has observed an \emph{aggregated volume} $z_i$ in the subregion $\Omega_{B_i}$ it is in charge of.
For example, in the case of cell phone activity recovery, a mobile phone user will always connect to the closest base station (cell tower). Therefore, we have
$
z_i = \int_{\Omega_{B_i}}f(\mathbf p)\mathrm{d} \mathbf p,
$
where the subregion $\Omega_{B_i}$ that $B_i$ represnts is given by
\[
\Omega_{B_i} = \{\mathbf p\in \Omega: \|\mathbf p-\mathbf p_{B_i}\|< \|\mathbf p-\mathbf p_{B_{i'}}\|, \forall B_{i'}\in B, \ i'\ne i\}.
\]
Our goal is to recover the entire spatial field $f$ of cell phone activity densities in the domain $\Omega$, based on the aggregated activities $z_1,\ldots, z_m$ observed on $m$ sparsely distributed base stations. In this case, we may call the aggregate observations $z_1,\ldots, z_m$ \emph{base station volumes}. However, such a problem is almost computationally infeasible as the continuous nature of $\Omega_{B_i}$ can hardly be handled by a personal computer.
To fix notations, suppose $\Omega$ is discretized into $n$ small grid squares $\mathbf p_1,\ldots, \mathbf p_n$, where $\mathbf p_j = (x_j,y_j)\in \Omega$, $j=1,\ldots,n$ also represents the position of square $j$'s center in $\Omega$. Without loss of generality, assume each grid square has an area of $\Delta=1$. And we have $m \ll n$, i.e, the number of aggregate observations (e.g., base station volumes) is way smaller than the number of squares to be recovered.
With the discretization of the domain, the observed volume on base station $B_i$ is given by
\begin{equation}\label{eq:BSvolumes}
z_i = \sum_{\mathbf p_j \in \Omega_{B_i}}f(\mathbf p_j)\cdot \Delta,\quad i = 1,\ldots,m,
\end{equation}
where the subregion that $B_i$ represents is given by
\begin{equation}\label{eq:omegaBi}
\Omega_{B_i} = \{\mathbf p_j: 1\le j\le n, \|\mathbf p_j-\mathbf p_{B_i}\|< \|\mathbf p_j-\mathbf p_{B_{i'}}\|, \ \forall i'\ne i\}.
\end{equation}
Therefore, our objective is to recover the unknown spatial field $f$, and especially the activity densities
\[\mathbf f := (f(\mathbf p_1),\ldots, f(\mathbf p_n))^{\sf T}\] in all $n$ grid squares if the desired granularity is on a per-square level, based on the aggregated observations $z_i$ in \eqref{eq:BSvolumes}.
Note that the above problem description is not only applicable to cell phone activity density recovery, but also applies to a wide range of applications.
The nonessential difference is that each application has its own way to define each subregion $\Omega_{B_i}$, from which volume $z_i$ is aggregated.
\subsection{Constrained Spatial Smoothing Problem}
Let $\mathbf z = (z_1,\ldots,z_m)^{\sf T}$.
Since all $z_i$ are known and $\Omega_{B_i}$ can be predetermined, e.g., from \eqref{eq:omegaBi} for the cell phone activity density recovery problem, reconstructing $\mathbf f$ from \eqref{eq:BSvolumes} is essentially solving a linear equation
$
\mathbf z = \mathbf A \mathbf f,
$
where the elements of matrix $\mathbf A\in \mathbb R^{m\times n}$ are given by
$
A_{ij} = \left\{
\begin{array}{ll}
1 & \quad\text{if $\mathbf p_j \in \Omega_{B_i}$,}\\
0 & \quad\text{otherwise.}\\
\end{array}
\right.
$
To recover $f(\mathbf p_1),\ldots, f(\mathbf p_n)$ from $z_1,\ldots, z_m$ is apparently a sparse recovery problem, since $m\ll n$. Such a task seems infeasible, since the linear system of equations \eqref{eq:BSvolumes} is an underdetermined system which has an infinite many solutions.
However, we may further utilize some spatial property of $f$ to make the sparse recovery problem feasible. That is, we can leverage the fact that spatial data often exhibit local correlation or local continuity within $\Omega$. For example, the cell phone activity density at a certain place critically depends on the underlying overall human population and activity at that point, e.g., downtown is more crowded than suburb residential areas, and business areas such as office buildings feature different cell phone activity patterns than leisure areas such as night clubs and restaurants. And the underlying spatial distributions of human activity density and area functionality are often slowly changing over the domain $\Omega$.
Therefore, taking into account the local spatial continuity and non-negative property of $f$, we formulate our constrained spatial sparse recovery problem as
\begin{equation}
\label{eq:prob0}
\begin{split}
\underset{f}{\mbox{minimize}}\quad & \int_\Omega(\nabla^2 f)^2\mathrm{d}\mathbf p \\
\mbox{subject to}\quad & \mathbf z = \mathbf A \mathbf f,\\
&\mathbf f\ge 0,
\end{split}
\end{equation}
where $\nabla^2 f= \frac{\partial^2 f}{\partial x^2}+\frac{\partial^2 f}{\partial y^2}$ denotes the Laplacian of the functional $f$ to penalize the roughness of the spatial field $f$ and encourage local similarity.
Furthermore, we can also use additional external social or demographical features at each place to enhance the recovery capability.
Specifically, for each grid square $j$, let $\mathbf w_j = (w_{j1},\ldots,w_{jq})^\mathsf{T}$ be a vector of $q$ external attribute values associated with square $j$. With the additional input of external attributes, we assume that the spatial density data to be recovered in each square $j$ is given by
\begin{equation}\label{eq:f_lr}
f(\mathbf p_j) = f'(\mathbf p_j) + \mathbf w_j^{\sf T}\boldsymbol{\beta},
\end{equation}
where $f'(\mathbf p)$ is an underlying spatial field functional that preserves local spatial continuity, while $\mathbf w_j^{\sf T}\boldsymbol{\beta}$ is a linear regression part based on the attributes of square $\mathbf p_j$ that allows position-specific variation or jumps.
In the presence of attributes, the constrained spatial sparse recovery problem can be formulated as
\begin{equation}
\label{eq:prob1}
\begin{split}
\underset{f', \boldsymbol{\beta}}{\mbox{minimize}}\quad & \int_\Omega(\nabla^2 f')^2\mathrm{d}\mathbf p \\
\mbox{subject to}
\quad & f(\mathbf p_j) = f'(\mathbf p_j) + \mathbf w_j^{\sf T}\boldsymbol{\beta},\quad j = 1,\ldots,n,\\
& \mathbf z = \mathbf A \mathbf f,\\
&\mathbf f\ge 0.
\end{split}
\end{equation}
Once the spatial field $f'$ and $\boldsymbol{\beta}$ are found, we can recover $f(\mathbf p_j)$ for all the squares using \eqref{eq:f_lr}. For example, with external attributes, the cell phone activity $f(\mathbf p_j)$ at a certain point $\mathbf p_j$ is modeled as the summation of a spatial field functional $f'(\mathbf p_j)$ and the linear regression from the attributes that permit jumps if neighboring subregions have distinct attributes and functionalities.
\section{Introduction}
\label{sec:intro}
In this paper, we consider a new type of \emph{spatial sparse recovery} problem, that is to infer the fine-grained spatial distribution of certain density data in a region based on the aggregate observations recorded for each of its subregions. Such a spatial sparse recovery problem is of particular interests to many big data applications, where acquiring fine-grained spatial data involves either additional technical overhead or privacy issues. For example, a telecommunication service provider may only be able to monitor the aggregate mobile traffic on each cell tower (base station), but want to infer the fine-grained spatial distribution of cell phone activities for capacity planning, device installation, urban ecology~\cite{bcici_mobihoc15}, and the study of population density estimation~\cite{douglass2015high}. Another example is to infer the spatial distribution of population densities (e.g., voter population for a certain party) based on the aggregate population observed at sparsely scattered polling stations. A further example is for an Internet media provider or retailer, e.g., Google, Amazon, etc., to reconstruct a fine-grained geographical distribution of its users only from aggregated user counts observed at certain datacenters or points of presence (PoPs). The ability of spatial recovery from coarse aggregation will be critical in all these cases, as tracking the position of each individual may incur either technical overhead or privacy concerns.
However, the above-mentioned problem is very challenging.
A straightforward solution is to have a patched piece-wise constant estimation by assuming the density is uniformly distributed within each subregion in which there is an aggregate observation. However, this approach gives a non-smooth piece-wise constant spatial field, which offers little value in terms of discovering hot spots.
Moreover, the densities estimated in this way will jumps between neighboring subregions, ignoring the local continuity of the spatial densities across subregions. Such local continuity, however, is present in many spatial data, e.g., cell phone/Internet activities, which are highly dependent on underlying factors such as urban geography, area functionality, and population density, all of which are usually smoothly changing.
Alternatively, we may use spatial smoothing techniques \cite{Sanga13} developed in statistics in the past decade to smoothen the patched estimation.
However, nearly all existing spatial smoothing techniques \cite{Wood08, Sanga13, guillas2010bivariate} aim to reconstruct a spatial field of densities based on \emph{sampled} observations, e.g., recovering a spatial field of temperatures according to temperature readings at a few sample points, instead of based on coarse-grained \emph{aggregate observations}. As a result, applying existing spatial smoothing techniques to our new problem may violate the necessary constraint that the estimated spatial data in each subregion must sum up to its corresponding aggregate observation in the first place, leading to systematic errors.
In this paper, we propose a new approach called \emph{Constrained Spatial Smoothing} (CSS) to overcome the difficulties mentioned above. Specifically, we aim to reconstruct a spatial field $f$ of densities over a region $\Omega$ by penalizing the ``roughness'' of $f$ (especially across subregions), subject to the constraint that the aggregation of discretized values of $f$ in each patched subregion $\Omega_{B_i}$ equals to the aggregate value $z_i$ observed in $\Omega_{B_i}$. Our new approach is different from traditional spatial smoothing due to the presence of the additional constraint.
We propose an Alternating Direction Method of Multipliers (ADMM) \cite{boyd2011distributed} algorithm to decouple the problem into the alternated minimizations of two subproblems: a quadratic program (QP) and a spatial smoothing subproblem, where we use the QP to iteratively enforce the aggregation constraints, while solving the spatial smoothing subproblem with a recently proposed finite element technique called Spatial Spline Regression (SSR) \cite{Sanga13}.
Moreover, our proposed algorithm not only leverages the local continuity to perform spatial sparse recovery, but is also able to take into account additional external information
in the underlying geographical region
to further enhance recovery performance.
We conducted extensive evaluation of the proposed algorithm in a case study of reconstructing mobile phone activity distributions of Milan, Italy from aggregated observations on base stations.
Results suggest that our algorithm achieves significant improvement, as compared to various other methods including the state-of-the-art Spatial Spline Regression (SSR) \cite{Sanga13} approach.
Our algorithm can recover the fine-grained spatial distribution of cell phone activities in Milan only from observations on $200$ base stations, with a mean absolute percentage error of $0.309$, representing a $26.3\%$ improvement from SSR.
\section{An ADMM Algorithm for\\ Constrained Spatial Smoothing}
\label{sec:model}
The spatial sparse recovery problem \eqref{eq:prob0} is different from \eqref{eq:minSSR} from two aspects: the loss function and the additional constraints. As a consequence, previous SSR based on the finite element analysis can not be directly applied. More advanced algorithm needs to be developed to cope with our new loss function with constraints.
In this section, we propose to utilize the Alternating Direction Method of Multipliers (ADMM), originated in classical paper \cite{douglas1956numerical}, to decompose our constrained optimization problem into two sub-problems that can be solved effectively by SSR and Quadratic Programming (QP) respectively.
By introducing the following indicator function $\mathds{1}_{\mathbf{f}}$,
\begin{equation}
\mathds{1}_{\mathbf{f}} = \left\{
\begin{array}{ll}
0 & \quad\text{if $\mathbf{f} \geq 0$ and $\mathbf{z} = \mathbf{Af}$,}\\
\infty & \quad\text{otherwise.}\\
\end{array}
\right.
\end{equation}
the original problem \eqref{eq:prob0} is equivalent to
\begin{equation}
\label{eq:add-auxiliary}
\begin{split}
\underset{f}{\mbox{minimize}} \quad
& \lambda \int_\Omega(\nabla^2 f)^2\mathrm{d}\mathbf p + \mathds{1}_{\mathbf{f}}
\end{split}
\end{equation}
where $\lambda$ is a parameter that controls the smoothness of $f$.
In order to split the convex optimization problem into two sub-convex problems we introduce an auxiliary variable $\mathbf g$ defined as
\begin{equation}
\mathbf g := (g(\mathbf{p}_1), \dots, g(\mathbf{p}_n))^{\sf T}
\end{equation}
The problem is transformed into the standard ADMM format,
\begin{equation}
\label{eq:add-auxiliary}
\begin{split}
\underset{f}{\mbox{minimize}} \quad
& \lambda \int_\Omega(\nabla^2 f)^2\mathrm{d}\mathbf p + \mathds{1}_{\mathbf{g}}\\
\mbox{subject to} \quad
& \mathbf f = \mathbf g,
\end{split}
\end{equation}
The \textit{augmented Lagrangian} for \eqref{eq:add-auxiliary} is
\begin{equation}
\label{eq:aug-Lagrangian}
\begin{split}
{\mbox{minimize}} \quad
\mathcal L_{\rho}(\mathbf f, \mathbf g, \boldsymbol{\alpha}) =
& \lambda\int_\Omega(\nabla^2 f)^2\mathrm{d}\mathbf p + \mathds{1}_{\mathbf{g}} \\
& + \boldsymbol{\alpha}^{\sf T} ( \mathbf{g} - \mathbf{f}) + \frac{\rho}{2} \| \mathbf{g} - \mathbf{f} \|_{2}^{2},
\end{split}
\end{equation}
where
$\boldsymbol{\alpha} = (\alpha_1, ..., \alpha_n)^{\sf T}$ is the dual variable, and $\rho > 0$ is the penalty parameter in ADMM. Then the ADMM consists of the following iterations
\begin{align}
\mathbf{f}^{k + 1} := &\ \underset{\mathbf f} {\mbox{argmin}} \ \mathcal L_{\rho} (\mathbf f, \mathbf g^{k+1}, \boldsymbol{\alpha}^k ) \label{eq:ADMM-g-1}\\
\mathbf{g}^{k + 1} := &\ \underset{\mathbf g} {\mbox{argmin}} \ \mathcal L_{\rho} (\mathbf f^k, \mathbf g, \boldsymbol{\alpha}^k ) \label{eq:ADMM-g-2}\\
\boldsymbol{\alpha}^{k + 1} := &\ \boldsymbol{\alpha}^{k} + \rho (\mathbf f - \mathbf g). \label{eq:ADMM-g-3}
\end{align}
For the $\mathbf f$-update step in each iteration, \eqref{eq:ADMM-g-2} is equivalent to
\begin{equation}\label{eq:admm-f}
\underset{f}{\text{minimize}}\quad \big\| \left(\boldsymbol{\alpha}^{\sf T} + \rho \mathbf g^{\sf T}\right)/2 - \mathbf f \big\|_2^2 + \lambda\int_\Omega(\nabla^2 f)^2\mathrm{d}\mathbf p,
\end{equation}
which is exactly the form of \eqref{eq:minSSR} with $h_j = \left(\alpha_j + \rho g(\mathbf p_j)\right)/2$ and $\mathbf w_j = 0$, thus can be solved efficiently by SSR.
The penalty parameter $\lambda$ controls the smoothness of $f$ by putting little emphasis on the smoothness if it is small, and the estimated surface $f$ will be over fitted. If it is too big, the surface will be too smooth, which can cause underfitting.
For the $\mathbf g$-update step in each iteration, \eqref{eq:ADMM-g-1} is equivalent to
\begin{equation}
\label{eq:g-QR}
\begin{split}
\underset{\mathbf g}{\mbox{minimize}} \quad
& \frac{\rho}{2}\|\mathbf g\|_2^2 + (\boldsymbol{\alpha}^{\sf T} - \rho \mathbf f^{\sf T}) \mathbf g\\
\mbox{subject to} \quad
& \mathbf g \geq 0,\\
& \mathbf z= \mathbf{Ag},
\end{split}
\end{equation}
which is a convex problem that can be solve by Quadratic Programming (QP).
For the case with attributes, the algorithm does not require major changes. We just need to replace $\mathbf f$ by $\mathbf f + \mathbf W \boldsymbol{\beta}$ in \eqref{eq:admm-f}, where $\mathbf W := (\mathbf w_1, ..., \mathbf w_n)^{\sf T}$ represents the attributes and $\boldsymbol{\beta}$ is the corresponding contributions.
Our proposed ADMM training algorithm is able to efficiently fit the spatial field and covariates for our constrained spatial sparse recovery problem. In $\mathbf g$-update step, we enforce the constraints by solving a constrained QP with no need to worry about smoothing; in $\mathbf f$-update step, we approximate the obtained $\mathbf g$ with a smooth $f$ using the SSR-based smoothing technique. In
this way, we decouple the handling of smoothing and constraints which was not possible in pure SSR previously.
\section{Related Work}
\label{sec:related}
The Telecom Italia Big Data Challenge dataset is a multi-source dataset that contains a variety of informations, including aggregation of telecommunication activities, news, social networks, weather, and electricity data from the city of Milan. With the important information about human activities contained in the dataset, especially the cellphone activity records, researchers utilized the data to study different problems, such as modeling human mobility patterns~\cite{gonzalez2008understanding}, population density estimation~\cite{douglass2015high}, models the spread of diseases~\cite{blondel2015survey}, modeling city ecology~\cite{bcici_mobihoc15}, etc. However, few research work has been done to estimate the spatial distribution of cellphone activity itself, despite the great value of this problem.
There are various tasks where the key problem is estimating a spatial field over a region based on observations of sampled points, such as house price estimation and population density estimation. \cite{chopra2007discovering} models the underlying surface of land desirability using kernel-based interpolation. However, it is hard to choose the form of kernel functions and tune a large number of hyper-parameters.
Spatial Spline Regression technique is applied to the problem of population density estimation in~\cite{Sanga13}. However, in our problem, we only get the accumulated activity density in base stations, rather than real densities in each base station location. Besides, BS locations distribution is highly sparse in our case.
The fine-grained data for the distribution of the volume of calls and SMS is not usually available. A common type of data is the data collected by cell phone base stations.
Some researchers interpolate the data to obtain fine grained distributions as in \cite{ratti2006mobile}. However in \cite{ratti2006mobile} authors do not evaluate the performance of the interpolated distribution. To the best of our knowledge
there is no extensive work done in trying to obtain optimal reconstructions of fine grained cell phone data distribution.
We are the first to apply latest spatial functional analysis techniques to cellphone activity distribution modeling, assuming the activity densities consists of a regression part based on social or demographical statistic features and a spatial field that captures the underlying smoothness property of cellphone activities.
\section{Performance Evaluation}
\label{sec:simu}
\begin{figure*}[!htb]
\centering
\subfigure[November, $n_{\text{BS}} = 200$]{
\includegraphics[width=1.7in]{figures/CDF_200_Nov}
\label{fig:CDF200Nov}
}
\hspace{-3mm}
\subfigure[December, $n_{\text{BS}} = 200$]{
\includegraphics[width=1.7in]{figures/CDF_200_Dec}
\label{fig:CDF200Dec}
}
\hspace{-3mm}
\subfigure[November, $n_{\text{BS}} = 100$]{
\includegraphics[width=1.7in]{figures/CDF_100_Nov}
\label{fig:CDF100Nov}
}
\hspace{-3mm}
\subfigure[December, $n_{\text{BS}} = 100$]{
\includegraphics[width=1.7in]{figures/CDF_100_Dec}
\label{fig:CDF100Dec}
}
\vspace{-3mm}
\caption{The comparison of the CDFs of relative errors given by different estimation methods when $n_{\text{BS}} = 200$ and $n_{\text{BS}} = 100$ for stress-testing. The legends follow the same order as the curves at relative error $= 0.5$.}
\label{fig:compareCDF100}
\vspace{-3mm}
\end{figure*}
\begin{figure*}[t]
\centering
\subfigure[November, $n_{\text{BS}} = 200$]{
\includegraphics[width=1.7in]{figures/barplot_200_Nov}
\label{fig:barplot200Nov}
}
\hspace{-3mm}
\subfigure[December, $n_{\text{BS}} = 200$]{
\includegraphics[width=1.7in]{figures/barplot_200_Dec}
\label{fig:barplot200Dec}
}
\hspace{-3mm}
\subfigure[November, $n_{\text{BS}} = 100$]{
\includegraphics[width=1.7in]{figures/barplot_100_Nov}
\label{fig:barplot100Nov}
}
\hspace{-3mm}
\subfigure[December, $n_{\text{BS}} = 100$]{
\includegraphics[width=1.7in]{figures/barplot_100_Dec}
\label{fig:barplot100Dec}
}
\vspace{-3mm}
\caption{The comparison of the Mean Relative Error of different estimation methods when $n_{\text{BS}} = 200$ or $n_{\text{BS}} = 100$ for stress-testing. In each figure, the bars from left to right represent Patched Estimation, Patched Estimation + SSR 1, Patched Estimation + SSR 2, Constrained Spatial Smoothing, and Constrained Spatial Smoothing + Features, respectively.}
\label{fig:compareMRE}
\vspace{-6mm}
\end{figure*}
The model in \eqref{eq:add-auxiliary} is not attached to any particular empirical problem and does not contain many implicit assumptions, it is general. However, in order to measure its performance we evaluate the model using real-world cell phone data.
The Milan Call Description Records (CDR) dataset
contains the telecommunications activity records from November 1$st$, 2013 to December 31$th$, 2013 in the city of Milan~\cite{bigdatachallenge}. In the Milan CDR dataset, the city of Milan is divided into a $100\times 100$ square grid. Each square is size of about 235m $\times$ 235m. Each activity record consists of the following entries: square ID, time-stamp of 10-minute time slot, incoming SMS activity, outgoing SMS activity, incoming call activity and outgoing call activity. The values of the four types of activities are normalized to the same scale.
Another dataset we utilized is the Milan geographical attribute dataset available from the Municipality of Milan's Open Data website \cite{barlacchi2015multi}. This dataset consists of features of central 2726 squares among the whole $10,000$ squares. The features of each square include: population, green area percentage, number of sport centers, number of universities, number of businesses, and number of bus stops.
In our empirical study, we focus on these squares to compare the performance of different algorithms.
The general \textbf{\textit{problem of recovering a spatial field from coarse aggregations observed at sparse points in
the field}} in this particular case study is reformulated into \textbf{\textit{the problem of recovering the distribution of cell phone activities over the whole 2726 square regions given that only aggregated activity observations in base stations are known}}. To study this problem, we need to further process the Milan CDR dataset.
\textit{First}, we sum up the four types of activities during November and December respectively to come up with the activity volume of each square during the two months. These two datasets are served as the ground-truth datasets of Milan cell phone activity distributions.
\textit{Second}, after we aggregated the two months' activities for each square, we need to set the locations of base stations (BSs). According to \cite{ratti2006mobile}, there are roughly $200$ base stations in Milan. However, the exact locations are not available. Thus, we assume the $n_{\text{BS}}$ ($n_{\text{BS}} = 200$ or $100$ for stress-test) BSs are randomly distributed according to the probability distribution
$
\Pr (\text{Set square $i$ as BS}) = f(\mathbf p_i) / \sum_{j=1}^{N}f(\mathbf p_j),
$
where $f(\mathbf p_i)$ is the cell phone activity volume in square $i$, $i=\{1, \ldots, N\}$, $N=2726$ is the number of squares we are focusing on.
\textit{Third}, after the base station locations are sampled, the activity of each square will be assigned to its closest base station. If multiple base stations are equidistant from the square, then the activity of this square will be evenly distributed among these base stations. We then assume we only know the aggregated activities in base station squares, which is usually the true case in reality.
Fig.~\ref{fig:100BS} and Fig.~\ref{fig:100BSincharge} show the base station distributions and the region charged by each base station for $n_{\text{BS}} = 100$ respectively.
We test our proposed approach and compare it with 3 baseline methods.
\begin{itemize}
\item \textbf{Patched Estimation (PE)}:
assume cell phone activity density is distributed uniformly within each sub-region $\Omega_{B_i}$
and estimate each square's activity volume by \eqref{eq:patched}.
\item \textbf{Patched Estimation + SSR 1}: first estimate \textit{only base station} activity volumes by \eqref{eq:patched}. Use these sparse points to fit a smooth surface by running Spatial Spline Regression to obtain the estimated cell phone activity in all squares.
\item \textbf{Patched Estimation + SSR 2}: first estimate the activity volumes of \textit{all squares} by Patched Estimation. Then use all these points to fit a smooth surface by running Spatial Spline Regression to obtain the final estimated cell phone activity in all squares.
\item \textbf{Constrained Spatial Smoothing (CSS)}: first get the initial estimation of the activity volumes of all squares by Patched Estimation, then run Constrained Spatial Smoothing algorithm to get the final activity volumes estimation of all squares.
\item \textbf{Constrained Spatial Smoothing + Features}: in this case, we incorporate the geographical features into the Constrained Spatial Smoothing algorithm.
\end{itemize}
We set the penalty parameter $\lambda = 1$ when $n_{\text{BS}} = 200$ and $\lambda = 10$ when $n_{\text{BS}} = 100$, for all methods that utilize SSR. The geographical features of Milan are only incorporated in the last algorithm described above.
We evaluate the performance by the Mean Relative Error (MRE) of the produced activity estimates for the true activity values.
\subsection{Performance Evaluation}
\subsubsection{\bf Comparison of Different Algorithms}
We show the cumulative distribution function (CDF) of Relative Errors given by each approach in Fig.~\ref{fig:compareCDF100}. In addition, we compare the estimation's Mean Relative Errors of different approaches in Fig.~\ref{fig:compareMRE}. It is quite clear that our proposed algorithms outperform other three baseline approaches significantly in all the cases ($n_{\text{BS}} = 200$ and $n_{\text{BS}}=100$, data aggregated in November and in December).
By comparing Patched Estimation + SSR 1 with Patched Estimation approach, we can see that using spatial smoothing based on only base station squares' observations leads to worse performance than patched estimation. This can be explained by the smoothing property of SSR and the way we set the values of base station squares. As we described, we set the activity values of base stations by averaging the total activity amount of each base station on all the squares it covers. Thus, given the activity $\frac{z_i}{|\Omega_{B_i}|}$ ($|\Omega_{B_i}|$ denotes the number of squares within region $\Omega_{B_i}$) of a base station $B_i$, the true activities of itself and its surrounding squares within region $B_i$ are distributed with a mean of $\frac{z_i}{|\Omega_{B_i}|}$. Given two base stations $B_1$ and $B_2$ that are close to each other, with aggregated activities of $z_1$ and $z_2$ respectively, the Spatial Smoothing approach will fit a smooth surface between the two base stations. Suppose $z_1 > z_2$, in this case, in overall the activities of $B_1$'s neighbour squares will be under estimated, and that of $B_2$ will be over estimated. Therefore, Patched Estimation + SSR 1's performance is not as good as Patched Estimation.
By comparing Patched Estimation + SSR 2 with Patched Estimation and Patched Estimation + SSR 1, we can observe that applying spatial smoothing on the results of patched estimation improves the performance. This proves the rationality and effectiveness of introducing smoothness into the estimated cell phone activity distribution surface.
Our proposed approaches achieves much better performance compared with the three baseline methods. By using Constrained Spatial Smoothing instead of applying Spatial Spline Regression directly, we are able to fit a smooth activity distribution while forcing it to match the observations of base station squares (the aggregated activity volumes) at the same time. By comparing Constrained Spatial Smoothing that incorporates additional features of each square with the version without features, we can see that the performance is further improved. The reason is that the heterogeneity of different locations will influence the telecommunication activity distribution, therefore making the distribution not everywhere smooth. Incorporating additional features into our model can help to explain the residuals between estimated smooth distribution and the true activity distribution, therefore further increases estimation accuracy.
The performance of different methods on December dataset is worse than on November dataset. The reason is that, there are multiple holidays during December, therefore the cell phone activities will be much more irregular than usual.
\begin{figure}[t]
\centering
\subfigure[Distribution of BSs]{
\includegraphics[width=1.3in]{figures/heatmap_100BS}
\label{fig:100BS}
}
\hspace{-0mm}
\subfigure[Areas covered by each BS]{
\includegraphics[width=1.3in]{figures/incharge_100BS}
\label{fig:100BSincharge}
}
\vspace{-3mm}
\caption{(a) The geographical distribution of sampled base stations for $n_{\text{BS}} = 100$. (b) The areas that the individual base stations are responsible for, when $n_{\text{BS}} = 100$.}
\label{fig:BSLocations}
\vspace{-6mm}
\end{figure}
\section{Patched Estimation and\\ Spatial Spline Regression}
\label{sec:SSR}
In this section, we first explore some tentative solutions, and then point out their insufficiency and limitations in handling our constrained spatial sparse recovery problem.
\textbf{Patched Piece-wise Constant Estimation}.
In practice, we only know the locations of all $\mathbf p_{B_i}$'s and their corresponding aggregated volumes $z_i$'s. What is not known is the fine-grained distribution of each volume $z_i$ across $\Omega_{B_i}$, the subregion covers the observed point $B_i$.
As a first heuristic, we can assume that the density is distributed uniformly within each $\Omega_{B_i}$ and estimate $f(\mathbf p_j)$ as the volume $z_i$ divided by its area:
\begin{equation}\label{eq:patched}
\bar f(\mathbf p_j) = \frac{z_i}{|\Omega_{B_i}|}, \text{ for each }\mathbf p_j \in \Omega_{B_i},
\end{equation}
where $|\Omega_{B_i}|$ is the area of $\Omega_{B_i}$.
Hence we obtain patched piece-wise constant estimation. In this paper, we may use {\it patch} to refer to $\Omega_{B_i}$, the subregion covered $B_i$.
However, the patched estimation oversimplifies the solution, since the obtained estimates $\bar f(\mathbf p_j)$ are far from being smooth and in fact may have discontinuous jumps on the borders of patches, which will be illustrated in our evaluation.
In practice, however, the piece-wise uniformity assumption fails: $f(\mathbf p_j)$ is not constant within a certain patch $\Omega_{B_i}$. In fact, $f(\mathbf p_j)$ should slowly change across neighboring points, as the underlying geographical and demographical characteristics also change smoothly across regions.
\textbf{Spatial Spline Regression}.
The observations above naturally lead to the idea of using spatial smoothing techniques to smoothen the patched estimation $\bar f(\mathbf p_j)$ to remove the discontinuities and jumps. In the following, we briefly describe a recently proposed powerful smoothing technique called Spatial Spline Regression (SSR) \cite{Sanga13}. After demonstrating its usage for our particular problem, we point out the major limitations for the spatial sparse recovery problem.
Given a set of $l$ spatial data points in $\Omega$, which contains the following information: \emph{1)} the values of these $l$ points: $\{h_j\}_{j=1}^l$, \emph{2)} their positions $\{\mathbf p_j\}_{j=1}^l$, and \emph{3)} their attribute vectors $\{\mathbf w_j\}_{j=1}^l$, SSR fits a smooth spatial field $f$ by minimizing the following penalized sum of square errors \cite{Sanga13}, \cite{Ramsay02}, i.e.,
\begin{equation}\label{eq:minSSR}
\underset{\boldsymbol{\beta}, f}{\text{minimize}}\sum_{j=1}^{l}\big(h_j- {\mathbf w}_j^{\mathsf T} \boldsymbol{\beta} - f(\mathbf p_j) \big)^2 + \lambda\int_\Omega(\nabla^2 f)^2\mathrm{d}\mathbf p,
\end{equation}
where $f$ is assumed to be twice-differentiable over $\Omega$, and
$\nabla^2 f= \frac{\partial^2 f}{\partial x^2}+\frac{\partial^2 f}{\partial y^2}$ denotes the \emph{Laplacian} of $f$ to smoothen out the roughness of the spatial field $f$. The tuning parameter $\lambda$ is used to trade the smoothness of $f$ off for a better approximation to data value $h_j$.
We now briefly describe how spatial spline regression \cite{Sanga13} can solve problem \eqref{eq:minSSR} via \emph{finite element analysis} for any irregularly shaped domain $\Omega$.
In SSR, the domain $\Omega$ is divided into small disjoint triangles, which can be done for example by the means of Delaunay triangulation \cite{hje06}. Then a polynomial function is defined on each of these triangles, such that the summation of these polynomial functions defined on different pieces closely approximates the desired spatial field $f$. It is shown in \cite{Sanga13} that the best approximation is achieved by simply solving a set of linear equations (see \cite{Sanga13} for more details).
Now we can see that if $l=n$ and we plug $h_j = \bar f(\mathbf p_j)$, $j=1,\ldots,n$ into problem \eqref{eq:minSSR}, we will get a new density surface $\hat f$ as a solution to the SSR problem \eqref{eq:minSSR} that is a smoothened approximation of the patched estimates $\bar f(\mathbf p_j)$.
However, SSR given by \eqref{eq:minSSR}
can not accommodate any constraints, and especially, does not enforce the aggregated volume constraint \eqref{eq:BSvolumes}, or equivalently, the constraint $\mathbf z = \mathbf A\mathbf f$ in \eqref{eq:prob0}. Therefore, if we smoothen the patched estimates $\bar f(\mathbf p_j)$ out to get a smooth surface estimate $\hat f$, there is no guarantee that the estimated densities in each patch $\Omega_{B_i}$ will sum up to the observed volume $z_i$ on the point $B_i$. Violating this constraint would likely cause large density estimation errors. | {'timestamp': '2018-03-02T02:06:03', 'yymm': '1803', 'arxiv_id': '1803.00192', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00192'} | arxiv |
\section{Introduction}
While deep learning has become state of the art in many application domains such as computer vision and
natural language processing and speech recognition, the theoretical understanding of this success is steadily
growing but there are still plenty of questions where there is little or no understanding. In particular, for the question
how one should construct the network e.g. choice of activation function, number of layers, number of hidden units per layer etc.,
there is little guidance and only limited understanding on the implications of the choice e.g. ``The design of hidden units is an extremely active area of research and does not
yet have many definitive guiding theoretical principles.'' is a quote from the recent book on deep learning \citep[p. 191]{Goodfellow-et-al-2016}.
Nevertheless there is recently progress in the understanding of these choices.
The first important results are the universal approximation theorems \citep{Cybenko1989,Hornik1989}
which show that even a single hidden layer network with standard non-polynomial activation function \cite{Leshno1993}, like the sigmoid,
can approximate arbitrarily well every continuous function over a compact domain of $\mathbb{R}^d$.
In order to explain the success of deep learning, much of the recent effort has been spent on analyzing the representation power of neural networks from the
perspective of depth
\citep{Delalleau2011,Telgarsky2016,Telgarsky2015,Eldan2016,Safran2017,Yarotsky2016,Poggio2016,Liang2017,Mhaskar2016}.
Basically, they show that there exist functions that can be computed efficiently
by deep networks of linear or polynomial size but require exponential size for shallow networks.
To further highlight the power of depth, \cite{Montufar2014, Pascanu2014} show that
the number of linear regions that a ReLU network can form in the input space grows exponentially with depth.
Tighter bounds on the number of linear regions are later on developed by \cite{AroraEtal2018, SerraEtal2018, ChaMar2018}.
Another measure of expressivity so-called trajectory length is proposed by \cite{Raghu2017}.
They show that the complexity of functions computed by the network
along a one-dimensional curve in the input space also grows exponentially with depth.
While most of previous work
can only show the existence of depth efficiency (\textit{i.e. } there exist certain functions that can be efficiently represented by
deep networks but not effectively represented or even approximated by shallow networks)
but cannot show how often this holds for all functions of interest,
\cite{CohenCOLT2016} have taken the first step to address this problem.
In particular, by studying a special type of networks called convolutional arithmetic circuits
-- also known as Sum-Product networks \citep{Poon2011},
the authors show that besides a set of measure zero,
all functions that can be realized by a deep network of polynomial size
require exponential size in order to be realized, or even approximated by a shallow network.
Later, \cite{CohenICML2016} show that this property however no longer holds for convolutional rectifier networks,
which represents so far the empirically most successful deep learning architecture in practice.
Unlike most of previous work which focuses on the power of depth,
\citep{Lu2017,Hanin2017} have recently shown that neural networks with ReLU activation function
have to be wide enough in order to have the universal approximation property as depth increases.
In particular, the authors show that the class of continuous functions on a compact set cannot be arbitrarily well approximated by
an arbitrarily deep network if the maximum width of the network is not larger than the input dimension $d$.
Moreover, it has been shown recently, that the loss surface of fully connected networks \citep{Quynh2017}
and for convolutional neural networks \citep{Quynh2017_conv} is well behaved, in the sense that almost all
local minima are global minima, if there exists a layer which has more hidden units than the number of training points.
In this paper we study the question under which conditions on the network the decision regions of a neural network are
connected respectively can potentially be disconnected. The decision region of a class is the subset of $\mathbb{R}^d$,
where the network predicts this class.
A similar study has been in \cite{Makhoul1989,Makhoul1990} for feedforward
networks with threshold activation functions, where they show that the initial layer has to have width $d+1$ in order that one can
get disconnected decision regions. On an empirical level it has recently been argued \cite{Fawzi2017} that the decision regions of
the Caffe Network \cite{JiaEtAl2014} on ImageNet are connected. In this paper we analyze feedforward networks with
continuous activation functions as currently used in practice. We show in line with previous work that almost all networks which
have a pyramidal structure up to the last hidden layer, that is the width of all hidden layers is smaller than the input dimension $d$,
can only produce connected decision regions.
We show that the result is tight by providing explicit counterexamples for the case $d+1$.
We conclude that a guiding principle
for the construction of neural networks should be that there is a layer which is wider than the input dimension
as it would be a strong assumption that the Bayes optimal classifier must have connected decision regions.
Interestingly, our result holds for leaky ReLU, that is $\sigma(t)=\mathop{\rm max}\nolimits\{t,\alpha t\}$ for $0<\alpha<1$,
whereas the result of \cite{Hanin2017} is for ReLU, that is $\sigma(t)=\mathop{\rm max}\nolimits\{t,0\}$,
but ``the generalization is not straightforward, even for activations of the form $\sigma(t)=\mathop{\rm max}\nolimits\{l_1(t),l_2(t)\}$,
where $l_1,l_2$ are affine functions with different slopes.''
We discuss also the implications of connected decision regions regarding the generation of adversarial samples,
which will provide another argument in favor of larger width for neural network architectures.
\section{Feedforward Neural Networks}\label{sec:fnn}
We consider in this paper feedforward neural networks for multi-class classification.
Let $d$ be the input dimension and $m$ the number of classes.
Let $L$ be the number of layers where the layers are indexed from $k=0,1,\ldots,L$
which respectively corresponds to the input layer, 1st hidden layer, $\ldots$, and the output layer $L$.
Let $n_k$ be the width of layer $k$.
For consistency, we assume that $n_0=d$ and $n_L=m$.
Let $\sigma_k:\mathbb{R}\to\mathbb{R}$ be the activation function of every hidden layer $1\leq k\leq L-1$.
In the following, all functions are applied componentwise.
We define $f_k:\mathbb{R}^d\to\mathbb{R}^{n_k}$ as the feature map of layer $k$, which computes for every input $x\in\mathbb{R}^d$
a feature vector at layer $k$ defined as
\begin{align*}
f_k(x) =
\begin{cases}
x & k=0\\
\sigma_k\big( W_k^T f_{k-1}(x) + b_k \big) & 1\leq k\leq L-1\\
W_L^T f_{L-1}(x) + b_L & k=L
\end{cases}
\end{align*}
where $W_k\in\mathbb{R}^{n_{k-1}\times n_k}$ is the weight matrix at layer $k$.
Please note that the output layer is linear as it is usually done in practice. We consider in the following
activation functions $\sigma: \mathbb{R} \rightarrow \mathbb{R}$ which are continuous and strictly monotonically increasing.
This is true for most of proposed activation functions, but does not hold for ReLU, $\sigma(t)=\mathop{\rm max}\nolimits\{t,0\}$. On the
other hand, it has been argued in the recent literature, that the following variants are to be preferred over ReLU
as they deal better with the vanishing gradient problem and outperform ReLU in prediction performance \cite{HeEtAl2015,Clevert2016}. This is leaky ReLU \cite{Maas2013}:
\[ \sigma(t)=\mathop{\rm max}\nolimits\{t,\alpha t\} \quad \textrm{ for } \quad 0<\alpha<1,\]
where typically $\alpha$ is fixed but it has also been optimized
together with the network weights \cite{HeEtAl2015} and ELU (exponential linear unit) \citep{Clevert2016}:
\[ \sigma(t) = \begin{cases}
e^t-1 & t < 0\\
t & t\geq 0 .
\end{cases}.\]
Note that image of the activation function $\sigma$, $\sigma(\mathbb{R})=\{ \sigma(t)\,|\, t \in \mathbb{R}\}$, is equal to $\mathbb{R}$ for leaky ReLU and $(-1,\infty)$ for the
exponential linear unit.
\section{Connectivity of Decision Regions}\label{sec:topology}
In this section, we prove two results on the connectivity of the decision
regions of a classifier. Both require that the activation function is continuous and strictly monotonically increasing.
Our main Theorem \ref{theo:class_region}
holds for feedforward networks of arbitrary depth and requires additionally $\sigma(\mathbb{R})=\mathbb{R}$,
the second Theorem \ref{theo:class_region_one} holds just for one hidden layer networks but has no further requirements on the activation function.
Both show that in general pyramidal feedforward neural networks
where the width of all the hidden layers is smaller than or equal to the input dimension
can only produce connected decision regions.
\subsection{Preliminary technical results}
We first introduce the definitions and terminologies used in the following, before we prove
or recall some simple results about continuous mappings from $\mathbb{R}^m$ to $\mathbb{R}^n$.
For a function $f:U\to V$, where $\mathop{\rm dom}\nolimits(f)=U\subseteq\mathbb{R}^m$ and $V\subseteq\mathbb{R}^n$, we denote
for every subset $A\subseteq U$, the image $f(A)$ as $f(A)\mathrel{\mathop:}=\Setbar{f(x)}{x\in A}=\bigcup_{x\in A}f(x).$
Let $\mathop{\rm range}\nolimits(f)\mathrel{\mathop:}= f(U).$
\begin{definition}[Decision region]\label{def:class_region}
The decision region of a given class $1\leq j\leq m$, denoted by $C_j$, is defined as
\begin{align*}
C_j = \Setbar{x\in\mathbb{R}^d}{(f_L)_j(x) > (f_L)_k(x),\; \forall k\neq j} .
\end{align*}
\end{definition}
\begin{definition}[Connected set]\label{def:connected_set}
A subset $S\subseteq\mathbb{R}^d$ is called connected if for every $x,y\in S$,
there exists a continuous curve $r: [0,1]\to S$ such that $r(0)=x$ and $r(1)=y.$
\end{definition}
To prove our key Lemma \ref{lem:inverse_layer},
the following properties of connected sets and continuous functions are useful.
All proofs are moved to the appendix due to limited space.
\begin{proposition}\label{prop:connected_continuous_map}
Let $f:U\to V$ be a continuous function.
If $A\subseteq U$ is a connected set then $f(A)\subseteq V$ is also a connected set.
\end{proposition}
\begin{proposition}\label{prop:minkowski}
The Minkowski sum of two connected subsets $U,V\subseteq\mathbb{R}^n$,
defined as $U+V=\Setbar{u+v}{u\in U,v\in V}$, is a connected set.
\end{proposition}
As our main idea is to transfer the connectedness of a set from the output layer
back to the input layer, we require the notion of pre-image and inverse mapping.
\begin{definition}[Pre-Image]
The pre-image of a function $f:U\to V$ is the set-valued function $f^{-1}:V\to U$ defined
for every $y\in V$ as
\[ f^{-1}(y) = \Setbar{x\in U}{f(x)=y}.\]
Similarly, for every subset $A\subseteq V$, let
\[ f^{-1}(A)=\bigcup_{y\in A}f^{-1}(y)=\Setbar{x\in U}{f(x)\in A}.\]
\end{definition}
By definition, it holds for every subset $A\subseteq V$ that $f(x)\in A$ if and only if $x\in f^{-1}(A).$
Moreover, for every $A\subseteq V$
\begin{align*}
f^{-1}(A)
&=f^{-1}(A\cap\mathop{\rm range}\nolimits(f))\;\cup\;f^{-1}(A\setminus\mathop{\rm range}\nolimits(f)) \\
&=f^{-1}(A\cap\mathop{\rm range}\nolimits(f))\;\cup\;\emptyset \\
&=f^{-1}(A\cap\mathop{\rm range}\nolimits(f)) .
\end{align*}
As a deep feedforward network is a composition of the individual layer functions, we need the following property.
\begin{proposition}\label{prop:inverse_compo}
Let $f:U\to V$ and $g:V\to Q$ be two functions.
Then it holds that $(g\circ f)^{-1} = f^{-1}\circ g^{-1}.$
\end{proposition}
\begin{figure*}[ht!]
\centering
\begin{tikzpicture}[scale=1.8]
\begin{scope}
\draw[thick,->] (-1.5,0) -- (1.5,0) node[anchor=north west] {x};
\draw[thick,->] (0,-1.5) -- (0,1.5) node[anchor=south east] {y};
\draw (0.125cm,1pt) -- (0.125 cm,-1pt) node[anchor=north] {$\frac{1}{8}$};
\draw (1pt,0.125 cm) -- (-1pt,0.125 cm) node[anchor=east] {$\frac{1}{8}$};
\draw (1pt,1 cm) -- (-1pt,1 cm) node[anchor=east] {$1$};
\draw (1pt,-1 cm) -- (-1pt,-1 cm) node[anchor=east] {$-1$};
\draw (-1 cm,-1pt) -- (-1 cm,1pt) node[anchor=north] {$-1$};
\draw (1 cm,-1pt) -- (1 cm,1pt) node[anchor=north] {$1$};
\node at (0.5,0.5) {$S$};
\coordinate (a) at (1.35,0.5);
\draw[dashed] (-1.3,1.3)node[anchor=south west] {$f(\mathbb{R})$} -- (1.3,-1.3);
\draw[thick,-,blue] (-1,1) -- (-0.125,0.125);
\draw[thick,-,red] (0.125,-0.125) -- (1,-1);
\fill[pattern=north east lines, pattern color=gray] (-1,0.125) -- (0.125,0.125) -- (0.125,-1) -- (1,-1) -- (1,1) -- (-1,1) -- cycle;
\end{scope}
\begin{scope}[xshift=3.5cm]
\draw[thick,->] (-1.5,0) -- (1.5,0) node[anchor=north west] {};
\draw (-1 cm,-1pt) -- (-1 cm,1pt) node[anchor=north] {$-1$};
\draw (1 cm,-1pt) -- (1 cm,1pt) node[anchor=north] {$1$};
\draw (0 cm,-1pt) -- (0 cm,1pt) node[anchor=north] {$0$};
\draw (-0.5 cm,-1pt) -- (-0.5 cm,1pt) node[anchor=north] {$-\frac{1}{2}$};
\draw (0.5 cm,-1pt) -- (0.5 cm,1pt) node[anchor=north] {$\frac{1}{2}$};
\coordinate (b) at (-1.35,0.5);
\fill[pattern=north east lines, pattern color=red] (-1,-0.05) -- (-0.5,-0.05) -- (-0.5,0.05) -- (-1,0.05) -- cycle;
\fill[pattern=north east lines, pattern color=blue] (1,-0.05) -- (0.5,-0.05) -- (0.5,0.05) -- (1,0.05) -- cycle;
\end{scope}
\draw[->] (a) -- node [midway,above]{$f^{-1}(S)$} (b);
\end{tikzpicture}
\caption{Left: illustration of the image of $\mathbb{R}$ under the mapping $f$, denoted as $f(\mathbb{R}) \subset \mathbb{R}^2$
for the toy example from \eqref{eq:toyex} which maps into a lower-dimensional subspace (the diagonal line).
Right: The pre-image $f^{-1}(S) \subset \mathbb{R}$ of the connected $S$ becomes disconnected.}
\label{fig:disc}
\end{figure*}
Apart from the property of connectivity, we can also show the openness of a set when considering the pre-image
of a given network.
We recall the following standard result from topology (see \textit{e.g. } \citealp{Apostol1974}, Theorem 4.23, p. 82).
\begin{proposition}\label{prop:inverse_open}
Let $f:\mathbb{R}^m\to\mathbb{R}^n$ be a continuous function.
If $U\subseteq\mathbb{R}^n$ is an open set then $f^{-1}(U)$ is also open.
\end{proposition}
We now recall a standard result from calculus showing that under certain, restricted conditions the inverse
of a continuous mapping exists and is as well continuous.
\begin{proposition}\label{lem:inverseContFct}
Let $f:\mathbb{R} \rightarrow f(\mathbb{R})$ be continuous and strictly monotonically increasing.
Then the inverse mapping $f^{-1}: f(\mathbb{R}) \rightarrow \mathbb{R}$ exists and is continuous.
\end{proposition}
The following lemma is a key ingredient in the following proofs. It allows us to show that the pre-image
of an open and connected set by a one hidden layer network is again open and connected. Using the fact
that deep networks can be seen as a composition of such individual layers, this will later on allow us to transfer
the result to deep networks.
\begin{lemma}\label{lem:inverse_layer}
Let $m\geq n$ and $f:\mathbb{R}^m\to\mathbb{R}^n$ be a function defined as
$f=\hat{\sigma} \circ h$ where $\hat{\sigma}:\mathbb{R}^n \to\mathbb{R}^n$ is defined as
\begin{equation}
\hat{\sigma}(x)=\begin{pmatrix} \sigma(x_1)\\ \vdots \\ \sigma(x_n)\end{pmatrix} \label{eq:hatsigma},
\end{equation}
and $\sigma:\mathbb{R} \rightarrow \mathbb{R}$ is bijective, continuous and strictly monotonically increasing,
$h:\mathbb{R}^m\to\mathbb{R}^n$ is a linear map defined as
$h(x)=W^Tx+b$ where $W\in\mathbb{R}^{m\times n}$ has full rank and $b\in\mathbb{R}^n.$
If $V\subseteq\mathbb{R}^n$ is an open connected set then
$f^{-1}(V)\subseteq\mathbb{R}^m$ is also an open connected set.
\end{lemma}
\begin{proof}
By Proposition \ref{prop:inverse_compo}, it holds that $f^{-1}(V)=h^{-1}(\hat{\sigma}^{-1}(V)).$
As $\hat{\sigma}$ is a componentwise function, the inverse mapping $\hat{\sigma}^{-1}$ is given by the inverse mappings of the components
\[ \hat{\sigma}^{-1}:\mathbb{R}^n \rightarrow \mathbb{R}^n, \; \hat{\sigma}^{-1}(x)=\begin{pmatrix} \sigma^{-1}(x_1)\\ \vdots \\ \sigma^{-1}(x_n)\end{pmatrix},\]
where under the stated assumptions the inverse mapping $\sigma^{-1}:\mathbb{R} \rightarrow \mathbb{R}$ exists by Lemma \ref{lem:inverseContFct} and is continuous.
Since $V\subseteq \mathbb{R}^n=\mathop{\rm dom}\nolimits(\hat{\sigma}^{-1})$, $\hat{\sigma}^{-1}(V)$
is the image of the connected set $V$ under the continuous map $\hat{\sigma}^{-1}$.
Thus by Proposition \ref{prop:connected_continuous_map}, $\hat{\sigma}^{-1}(V)$ is connected.
Moreover, $\hat{\sigma}^{-1}(V)$ is an open set by Proposition \ref{prop:inverse_open}.
It holds for every $y\in\mathbb{R}^n$ that
\begin{align*}
&h^{-1}(y) \\
&= \begin{cases}
\emptyset & y\notin \mathop{\rm range}\nolimits(h)\\
W(W^TW)^{-1} (y-b) + \mathop{\rm ker}\nolimits(W^T) & y\in\mathop{\rm range}\nolimits(h) ,
\end{cases}
\end{align*}
where the inverse of $W^TW$ exists as $W$ has full rank $n$ (note that we assume $n\leq m$).
As $W$ has full rank and $m\geq n$, it holds that $\mathop{\rm range}\nolimits(h)=\mathbb{R}^n$ and thus
\begin{align*}
h^{-1}(y) = W(W^TW)^{-1} (y-b) + \mathop{\rm ker}\nolimits(W^T), \quad \forall\,y\in\mathbb{R}^n.
\end{align*}
Therefore it holds for $\hat{\sigma}^{-1}(V)\subseteq\mathbb{R}^n$ that
\begin{align*}
h^{-1}\big(\hat{\sigma}^{-1}(V)\big)
= W(W^TW)^{-1} \big(\hat{\sigma}^{-1}(V)-b\big) + \mathop{\rm ker}\nolimits(W^T) ,
\end{align*}
where the first term is the image of the connected set $\hat{\sigma}^{-1}(V)$
under an affine mapping and thus is again connected by Proposition \ref{prop:connected_continuous_map},
the second term $\mathop{\rm ker}\nolimits(W^T)$ is a linear subspace which is also connected.
By Proposition \ref{prop:minkowski}, the Minkowski sum of two connected sets is connected.
Thus $f^{-1}(V)=h^{-1}(\hat{\sigma}^{-1}(V))$ is a connected set.
Moreover, as $f^{-1}(V)$ is the pre-image of the open set $V$ under the continuous function $f$,
it must be also an open set by Proposition \ref{prop:inverse_open}.
Thus $f^{-1}(V)$ is an open and connected set.
\end{proof}
Note that in Lemma \ref{lem:inverse_layer}, if $m<n$ and $W$ has full rank then $\mathop{\rm range}\nolimits(h)\subsetneq\mathbb{R}^n$ and the linear equation $h(x)=y$
has a unique solution $x=(WW^T)^{-1}W(y-b)$ for every $y\in\mathop{\rm range}\nolimits(h)$ and thus
\begin{align*}
f^{-1}(V)
&=h^{-1}\big(\sigma^{-1}(V)\big) \\
&=h^{-1}\big(\sigma^{-1}(V)\cap\mathop{\rm range}\nolimits(h)\big) \\
&= (WW^T)^{-1}W \big((\sigma^{-1}(V)\cap\mathop{\rm range}\nolimits(h))-b\big) .
\end{align*}
In this case, even though $\sigma^{-1}(V)$ is a connected set,
the intersection $\sigma^{-1}(V)\cap\mathop{\rm range}\nolimits(h)$ can be disconnected
which can imply that $f^{-1}(V)$ is disconnected and thus the decision region becomes disconnected.
We illustrate this with a simple example, where $m=1$ and $n=2$ with $\sigma(x)=x^3$ and $W^T=\begin{pmatrix} -1 \\ 1\end{pmatrix}$ and $b=\begin{pmatrix} 0\\0\end{pmatrix}$.
In this case it holds that
\begin{equation}\label{eq:toyex}
f(x) = \hat{\sigma}(W^Tx+b)= \begin{pmatrix} \sigma(-x)\\ \sigma(x)\end{pmatrix} = \begin{pmatrix} -x^3\\ x^3 \end{pmatrix}.
\end{equation}
Figure \ref{fig:disc} shows that $f(\mathbb{R})$ is a one-dimensional submanifold (in this case subspace) of $\mathbb{R}^2$
and provides an example of a set $S \subset \mathbb{R}^2$ where the pre-image $f^{-1}(S)$ is disconnected.
\subsection{Main results}
We show in the following that the decisions regions of feedforward networks which are pyramidal
and have maximal width at most the input dimension $d$ can only produce connected decision regions.
We assume for the activation functions that $\sigma(\mathbb{R})=\mathbb{R}$, which is fulfilled by leaky ReLU.
\begin{theorem}\label{theo:class_region}
Let the width of the layers of the feedforward network network satisfy $d=n_0\geq n_1\geq\ldots\geq n_{L-1}$
and let $\sigma_l:\mathbb{R}\to\mathbb{R}$ be a continuous, strictly monotonically increasing function with $\sigma_l(\mathbb{R})=\mathbb{R}$ for every layer $1\leq l\leq L-1$
and all the weight matrices $(W_l)_{l=1}^{L-1}$ have full rank.
Then every decision region $C_j$ is an open connected subset of $\mathbb{R}^d$
for every $1\leq j\leq m.$
\end{theorem}
\begin{proof}
From Definition \ref{def:class_region}, it holds for every $1\leq j\leq m$
\begin{align*}
C_j \hspace{-1mm}&=\hspace{-1mm} \Setbar{x\in\mathbb{R}^d}{f_{Lj}(x) - f_{Lk}(x) > 0,\forall k\neq j}
\end{align*}
where
\begin{align*}
&f_{Lj}(x)-f_{Lk}(x)\\
&=\inner{(W_L)_{:j}-(W_L)_{:k}, f_{L-1}(x)} + {(b_L)}_j-{(b_L)}_k.
\end{align*}
Let us define the set
$$V_j\!\!=\!\!\Setbar{y}{\inner{(W_L)_{:j}-(W_L)_{:k},y}\!>\!{(b_L)}_k-{(b_L)}_j,\forall k\neq j}$$
then it holds
$ C_j
= \Setbar{x\in\mathbb{R}^d}{f_{L-1}(x)\in V_j}
= f_{L-1}^{-1} (V_j).
$
If $V_j$ is an empty set then we are done,
otherwise one observes that $V_j$ is the intersection of a finite number of open half-spaces (or the whole space),
which is thus an open and connected set.
Moreover, it holds $V_j \cap \hat{\sigma}_{L-1}(\mathbb{R})=V_j$, where $\hat{\sigma}_{L-1}$ is defined as in \eqref{eq:hatsigma}.
It follows from Proposition \ref{prop:inverse_open} that $C_j$ must be an open set
as it is the pre-image of the open set $V_j$ under the continuous mapping $f_{L-1}.$
To show that $C_j$ is a connected set, one first observes that
\begin{align*}
f_{L-1} = \hat{\sigma}_{L-1} \circ h_{L-1} \circ \hat{\sigma}_{L-2} \circ h_{L-2} \ldots \circ \hat{\sigma}_1 \circ h_1
\end{align*}
where $h_k:\mathbb{R}^{n_{k-1}}\times\mathbb{R}^{n_k}$
is an affine mapping between layer $k-1$ and layer $k$ defined as $h_k(x)=W_k^T x + b_k$ for every $1\leq k\leq L-1, x\in\mathbb{R}^{n_{k-1}}$,
and $\hat{\sigma}_k:\mathbb{R}^{n_k}\to\mathbb{R}^{n_k}$ is the activation mapping of layer $k$ defined as in \eqref{eq:hatsigma}.
By Proposition \ref{prop:inverse_compo} it holds that
\begin{align*}
f_{L-1}^{-1}(V_j) = (h_1^{-1} \circ \hat{\sigma}_1^{-1} \circ \ldots \circ h_{L-1}^{-1} \circ \hat{\sigma}_{L-1}^{-1})(V_j)
\end{align*}
Since $\sigma_k:\mathbb{R}\to\mathbb{R}$ is a continuous bijection by our assumption,
it follows that $\hat{\sigma}_k:\mathbb{R}^{n_k}\to\mathbb{R}^{n_k}$ is also a continuous bijection.
Moreover, it holds that $W_k$ has full rank and $n_{k-1}\geq n_k$ for every $1\leq k\leq L-1$ and $V_j$ is a connected set.
Thus one can apply Lemma \ref{lem:inverse_layer} subsequently for the composed functions $(\hat{\sigma}_k\circ h_k)$
for every $k=L-1,L-2,\ldots,1$ and obtains that $C_j=f_{L-1}^{-1}(V_j)$ is a connected set.
Thus $C_j$ is an open and connected set for every $1\leq j\leq m.$
\end{proof}
The next theorem holds just for networks with one hidden layer but allows general activation functions which are continuous
and strictly monotonically increasing, that is leaky ReLU, ELU, softplus or sigmoid activation functions. Again the decision
regions are connected if the hidden layer has maximal width smaller than $d+1$.
\begin{theorem}\label{theo:class_region_one}
Let the one hidden layer network satisfy $d=n_0 \geq n_1$
and let $\sigma_1:\mathbb{R}\to\mathbb{R}$ be a continuous, strictly monotonically increasing function
and the hidden layer's weight matrix $W_1$ has full rank.
Then every decision region $C_j$ is an open connected subset of $\mathbb{R}^d$ for every $1\leq j\leq m.$
\end{theorem}
\begin{proof}
We note that in the proof of Theorem \ref{theo:class_region} the $V_j$ is a finite intersection of open half-spaces and thus a convex set.
Moreover, $\hat{\sigma}_1(\mathbb{R}^{n_1})$ is an open convex set (it is just an axis-aligned open box), as $\sigma_1$ is strictly
monotonically increasing. Thus
\begin{align*}
C_j
&= \Setbar{x\in\mathbb{R}^d}{f_{1}(x)\in V_j \cap \hat{\sigma}_1(\mathbb{R}^{n_1})} \\
&= f_{1}^{-1} \big(V_j \cap \hat{\sigma}_1(\mathbb{R}^{n_1})\big).
\end{align*}
As both sets are open convex sets, the intersection $V_j \cap \hat{\sigma}_1(\mathbb{R}^{n_1})$ is again convex and open as well.
Thus $V_j \cap \hat{\sigma}_1(\mathbb{R}^{n_1})$ is a connected set. The rest of the argument follows then by using Lemma \ref{lem:inverse_layer},
noting that by Proposition \ref{lem:inverseContFct} ${\hat{\sigma}_1}^{-1}: \hat{\sigma}_1(\mathbb{R}^{n_1}) \rightarrow \mathbb{R}^{n_1}$ is a continuous mapping.
\end{proof}
Note that Theorem \ref{theo:class_region} and Theorem \ref{theo:class_region_one} make no assumption on the structure of all layers in the network.
Thus they can be applied to neural networks with both fully connected layers and convolutional layers.
Moreover, the results hold regardless of how the parameters of the network $(W_l,b_l)_{l=1}^L$ have been attained,
trained or otherwise, as long as all the weight matrices of hidden layers have full rank.
This is a quite weak condition in practice as the set of low rank matrices has just Lebesgue measure zero. Even if the optimal weight parameters
for the data generating distribution would be low rank (we discuss such an example below), then it is very unlikely that the trained weight parameters are low rank, as one has
statistical noise by the training sample, ``optimization noise'' from the usage of stochastic gradient descent (SGD)
and its variants and finally
in practice one often uses early stopping and thus even if the optimal solution for the training set is low rank,
one will not find it.
Theorem \ref{theo:class_region} covers activation functions like leaky ReLU but not sigmoid, ELU or softplus. At the moment it is unclear
for us if the result might hold also for the more general class of activation functions treated in Theorem \ref{theo:class_region_one}.
The problem is that then in Lemma \ref{lem:inverse_layer} one has to compute the pre-image of $V \cap \hat{\sigma}(\mathbb{R}^n)$. Even
though both sets are connected, the intersection of connected sets need not be connected. This is avoided in Theorem \ref{theo:class_region_one}
by using that the initial set $V_j$ and $\hat{\sigma}(\mathbb{R}^{n_{L-1}})$
are both convex and the intersection of convex sets is convex and thus connected.
We show below that the result is tight in the sense that we give an empirical example of a neural network with a single hidden layer of $d+1$ hidden units
which produces disconnected regions.
Note that our result complements the result of \cite{Hanin2017},
where they show the universal approximation property (for ReLU) only if
one considers networks of width at least $d+1$ for arbitrary depth.
Theorem \ref{theo:class_region} and Theorem \ref{theo:class_region_one} indicate that this result could also hold for leaky ReLU as
approximation of arbitrary functions implies approximation of arbitrary decisions regions, which clearly requires that one is able to get disconnected decision regions.
Taking both results together, it seems rather obvious that as a general guiding principle for the construction of hidden layers in neural networks
one should use, at least for the first hidden layer, more units than the input dimension,
as it is rather unlikely that the Bayes optimal decision regions are connected.
Indeed, if the true decision regions are disconnected
then using a network of smaller width than $d+1$ might still perfectly fit the finite training data
but since the learned decision regions are connected there exists a path between the
true decision regions which then can be used for potential adversarial manipulation.
This is discussed in the next section where we show empirical evidence for the existence of such adversarial examples.
\section{Illustration and Discussion}
In this section we discuss with analytical examples as well as trained networks that the result is tight
and the conditions of the theorem cannot be further relaxed. Moreover, we argue that connected decision regions
can be problematic as they open up the possibility to generate adversarial examples.
\subsection{Why pyramidal structure of the network is necessary to get connected decision regions?}\label{sec:non_pyramidal}
\begin{figure}[ht]
\vspace{-5pt}
\centering
\includegraphics[width=0.4\linewidth]{non_pyramidal-eps-converted-to.pdf}
\hspace{5pt}
\includegraphics[width=0.42\linewidth]{relu.png}
\caption{Decision region of the network in \eqref{eq:non_pyramidal}(left) and \eqref{eq:net_relu}(right).}
\label{fig:relu}
\vspace{-5pt}
\end{figure}
In Theorem \ref{theo:class_region}, if the network does not have pyramidal structure up to the last hidden layer,
\textit{i.e. } the condition $d_1\geq \ldots\geq d_{L-1}$ is not fulfilled, then the statement of the theorem
might not hold as the decision regions can be disconnected.
We illustrate this via a counter-example below.
Let us consider a non-pyramidal network 2-1-2-2 defined as
\begin{align}\label{eq:non_pyramidal}
W_3^T\hat{\sigma}_2(W_2^T\hat{\sigma}_1(W_1^Tx+b_1)+b_2)+b_3
\end{align}
where $\sigma_1(t)=\sigma_2(t)=\mathop{\rm max}\nolimits\Set{0.5\,t, t}$,
and
$
W_1=\begin{bmatrix}1\\1\end{bmatrix}, b_1=0,
W_2=\begin{bmatrix}1&-1\end{bmatrix}, b_2=\begin{bmatrix}0\\0\end{bmatrix},
W_3=\begin{bmatrix}2&1\\3&2\end{bmatrix}, b_3=\begin{bmatrix}0\\1\end{bmatrix} .
$
Then one can check that this network has (see appendix for the full derivation)
$C_1 = \Setbar{x\in\mathbb{R}^2}{x_1+x_2-2>0 \textrm{ and } x_1+x_2+4<0}$,
which is a disconnected set as illustrated in Figure \ref{fig:relu}.
\subsection{Why full rank of the weight matrices is necessary to get connected decision regions?}
Similar to Section \ref{sec:non_pyramidal}, we show that if the weight matrices of hidden layers are not full rank while the other conditions
are still satisfied, then the decision regions can be disconnected.
The reason is simply that low rank matrices, in particular in the first layer, reduce the effective
dimension of the input. We illustrate this effect with a small analytical example and then argue that nevertheless in
practice it is extremely difficult to get low rank weight matrices.
\begin{figure}[ht]
\centering
\includegraphics[width=0.4\linewidth]{toy_input.png}
\quad
\includegraphics[width=0.4\linewidth]{toy_decisionregion.png}
\vspace{-5pt}
\caption{Left: the training set corresponding to the distribution in \eqref{onedproblem}. Right: the decision regions
of a trained classifier, which are connected as the learned weight matrix $W_1$ has full rank.}
\label{fig:illu1}
\vspace{-5pt}
\end{figure}
\vspace{-5pt}
\begin{figure*}[ht]
\begin{center}
\subfigure[Training data]{
\includegraphics[width=0.15\linewidth]{09_165221_input_blue=286_red=286.png}
}
\subfigure[$n_1=2 (122)$]{
\includegraphics[width=0.15\textwidth]{09_165221_nUnits=2_test_cropped.png}
}
\subfigure[$n_1=3 (72)$]{
\includegraphics[width=0.15\textwidth]{09_165221_nUnits=3_test_cropped.png}
}
\subfigure[$n_1=4 (45)$]{
\includegraphics[width=0.14\textwidth]{09_165221_nUnits=4_test_cropped.png}
}
\subfigure[$n_1=7 (12)$]{
\includegraphics[width=0.15\textwidth]{09_165221_nUnits=7_test_cropped.png}
}
\subfigure[$n_1=50 (0)$]{
\includegraphics[width=0.15\textwidth]{09_165221_nUnits=50_test_cropped.png}
}
\end{center}
\vspace{-7pt}
\caption{Decision region of a one hidden layer network trained with SGD for varying number of hidden units
for the toy example given in (a). As shown by Theorem \ref{theo:class_region} the decision
region for $n_1=d=2$ is connected, however already for $n_1>d=2$ one gets disconnected decision regions which shows
that Theorem \ref{theo:class_region} is tight. The numbers in bracket show the number of misclassified training points.
}
\label{fig:toy2d}
\vspace{-5pt}
\end{figure*}
Suppose one has a two-class classification problem on $\mathbb{R}^2$ (see Figure \ref{fig:illu1}) with equal class probabilities $P(\textrm{red})=P(\textrm{blue})$,
and the conditional distribution is given as
\begin{align}\label{onedproblem}
p(x_1,x_2|\mathrm{blue})\hspace{-1mm} &=\hspace{-1mm} \frac{1}{2}, \,\forall \, x_1 \in [-2,-1] \cup [1,2], x_2 \in [-\frac{1}{2},\frac{1}{2}] \nonumber\\
p(x_1,x_2|\mathrm{red}) \hspace{-1mm}&=\hspace{-1mm} 1, \,\forall\, x_1 \in [-1,1], x_2 \in [-\frac{1}{2},\frac{1}{2}].
\end{align}
Note that the Bayes optimal decision region for class blue is disconnected. Moreover, it is easy to verify that a one
hidden layer network with leaky ReLU $\sigma(t)=\mathop{\rm max}\nolimits\{t,\alpha t\}$ for $0<\alpha<1$ can perfectly fit the data with
\[ W^T_1 \hspace{-1mm}=\hspace{-1mm} \begin{pmatrix} 1 & 0\\-1 & 0 \end{pmatrix},
b_1\hspace{-1mm}=\hspace{-1mm}\begin{pmatrix}-1\\-1\end{pmatrix},
W^T_2 \hspace{-1mm}=\hspace{-1mm}\begin{pmatrix} 1 & 1 \\ 0 & 0\end{pmatrix},
b_2\hspace{-1mm}=\hspace{-1mm}\begin{pmatrix}0\\-2\alpha\end{pmatrix}\]
Note that $W_1$ has low rank.
Suppose that the first output unit corresponds to the blue class and second output unit corresponds to the red class.
Then it holds $(f_2)_{\mathrm{red}}(x_1,x_2) =-2\alpha$,
$(f_2)_{\mathrm{blue}}(x_1,x_2) = \mathop{\rm max}\nolimits\{x_1-1,\alpha (x_1-1)\} + \mathop{\rm max}\nolimits\{-(x_1+1), -\alpha (x_1+1)\}$
and thus
\begin{align*}
(f_2)_{\mathrm{blue}}(x_1,x_2)\hspace{-1mm}=\hspace{-1mm}
\begin{cases} (1-\alpha)x_1 - (1+\alpha) & x_1\geq 1\\
-2\alpha & -1\leq x_1\leq 1\\
-(1-\alpha)x_1-(1+\alpha) & x_1\leq -1
\end{cases}
\end{align*}
which implies that $(f_2)_{\mathrm{blue}}(x_1,x_2)>(f_2)_{\mathrm{red}}(x_1,x_2)$ for every $x_1\in(-\infty,-1)\cup(1,+\infty)$
and thus the decision region for class blue has two disconnected decision regions.
This implies that Theorems \ref{theo:class_region} and \ref{theo:class_region_one} do indeed not hold
if the weight matrices do not have full rank.
Nevertheless in practice, it is unlikely that one will get such low rank weight matrices,
which we illustrate in Figure \ref{fig:illu1} that the decision regions of the trained classifier has indeed connected decision regions.
This is due to statistical noise in the training set as
well as through the noise in the optimization procedure (SGD) and the common practice of early stopping in training of neural networks.
\subsection{Does the result hold for ReLU activation function?}
As the conditions of Theorem \ref{theo:class_region} are not fulfilled for ReLU,
one might ask whether the decision regions of a ReLU network with pyramidal structure and full rank weight matrices
can be potentially disconnected.
We show that this is indeed possible via the following example.
Let a two hidden layer network (2-2-2-2) be defined as
\begin{align}\label{eq:net_relu}
W_3^T\hat{\sigma}_2(W_2^T\hat{\sigma}_1(W_1^Tx+b_1)+b_2)+b_3
\end{align}
where $\sigma_1(t)=\sigma_2(t)=\mathop{\rm max}\nolimits\Set{t, 0}$ and
\begin{align*}
W_1^T=\begin{bmatrix}1&0\\0&1\end{bmatrix},
W_2^T=\frac{\sqrt{2}}{2}\begin{bmatrix}1&1\\-1&1\end{bmatrix},
W_3^T=\begin{bmatrix}-1&0\\ 0&-3\end{bmatrix},
\end{align*}
and $b_1=[0,0]^T, b_2=\frac{1}{\sqrt{2}}[\sqrt{2}-1, -3]^T, b_3=[1,0]^T.$
Then one can derive the decision region for the first class as (see appendix for the full derivation)
\begin{align*}
C_1
&= \Setbar{x\in\mathbb{R}^2} {x_1<1,\;x_2<1,\;x_1+x_2<1}
\\
&\;\cup \Setbar{x\in\mathbb{R}^2}{x_2>4,\;2x_1-x_2+4<0}
\end{align*}
which is a disconnected set as illustrated in Figure \ref{fig:relu}.
Finally, one notes in this example that except for the activation function,
all the other conditions of Theorem \ref{theo:class_region} are still satisfied, that is,
the network has pyramidal structure (2-2-2-2) and all the weight matrices $(W_l)_{l=1}^{2}$ have full rank by our construction.
Thus the statement of Theorem \ref{theo:class_region}, at least under current form, does not hold for ReLU.
\subsection{The theorems are tight: disconnected decision regions for width $d+1$}
We consider a binary classification task in $\mathbb{R}^2$ where the data points are generated
so that the blue class has disconnected components on the square $[-4,4]\times [-4,4]$, see Figure \ref{fig:toy2d} (a) for an illustration.
We use a one hidden layer network with varying number of hidden units,
two output units, leaky ReLU activation function and cross-entropy loss.
We then train this network by using SGD with momentum for $1000$ epochs and learning rate $0.1$ and reduce the it
by a factor of $2$ after every $50$ epochs.
For all the attempts with different starting points that we have done in our experiment,
the resulting weight matrices always have full rank.
We show the training error and the decision regions of trained network in Figure \ref{fig:toy2d}.
The grid size in each case of Figure \ref{fig:toy2d}
has been manually chosen so that one can see clearly the connected/disconnected components in the decision regions.
First, we observe that for two hidden units ($n_1=2$), the network satisfies the condition of Theorem \ref{theo:class_region}
and thus can only learn connected regions, which one can also clearly see in the figure, where one basically gets a linear separator.
However, for three hidden units ($n_1=3$), one can see that the network can produce disconnected decision regions,
which shows that both our Theorems \ref{theo:class_region} and \ref{theo:class_region_one} are tight, in the sense that width $d+1$
is already sufficient to produce disconnected components, whereas the results say that for width less than $d+1$ the decision regions
have to be connected.
As the number of hidden units increases, we observe that the network produces more easily disconnected decision regions as expected.
\subsection{Relation to adversarial manipulation}\label{sec:adversarial}
We use a single image of digit $1$ from the MNIST dataset to create a new artificial dataset where the underlying data generation probability measure has a similar one-dimensional structure as in \eqref{onedproblem} but now embedded in the pixel space $\mathbb{R}^{28 \times 28}$.
This is achieved by using rotation as the one-dimensional degree of freedom.
We generate $2000$ training images for each red/blue class by rotating the chosen digit $1$ with angles ranging from $[-5^{\circ},5^{\circ}]$
for the read class, and $[-20^{\circ},-15^{\circ}]\,\cup\,[15^{\circ},20^{\circ}]$ for the blue class, see Figure \ref{fig:fig_classifications}.
\begin{figure}[h]
\vspace{-3pt}
\centering
\scriptsize
\stackunder{\label{fig:origin}\includegraphics[width=0.085\textwidth]{digit1_dataset_0.png}}{\textcolor{blue}{$[-20^{\circ},-15^{\circ}]$}}
\hspace{10pt}
\stackunder{\label{fig:main}\includegraphics[width=0.085\textwidth]{digit1_dataset_original.png}}{\textcolor{red}{$[-5^{\circ},5^{\circ}]$}}
\hspace{10pt}
\stackunder{\label{fig:target}\includegraphics[width=0.085\textwidth]{digit1_dataset_10000.png}}{\textcolor{blue}{$[15^{\circ},20^{\circ}]$}}
\vspace{-3pt}
\caption{Training examples for our binary digit-$1$ dataset.
The color (red/blue) denotes the class of corresponding example.
}
\label{fig:fig_classifications}
\vspace{-5pt}
\end{figure}
\begin{figure*}[t]
\centering
\scriptsize
\stackunder{\includegraphics[width=0.085\textwidth]{digit1_path_via_adversarial_source_to_adversarail_0.0.png}}{\textcolor{blue}{$0.99$ (source)}}
\stackunder{\includegraphics[width=0.085\textwidth]{digit1_path_via_adversarial_source_to_adversarail_0.1.png}}{\textcolor{blue}{$0.99 (0.1)$}}
\stackunder{\includegraphics[width=0.085\textwidth]{digit1_path_via_adversarial_source_to_adversarail_0.2.png}}{\textcolor{blue}{$0.99 (0.2)$}}
\stackunder{\includegraphics[width=0.085\textwidth]{digit1_path_via_adversarial_source_to_adversarail_0.3.png}}{\textcolor{blue}{$0.99 (0.3)$}}
\stackunder{\includegraphics[width=0.085\textwidth]{digit1_path_via_adversarial_source_to_adversarail_0.4.png}}{\textcolor{blue}{$0.99 (0.4)$}}
\stackunder{\includegraphics[width=0.085\textwidth]{digit1_path_via_adversarial_source_to_adversarail_0.5.png}}{\textcolor{blue}{$0.99 (0.5)$ }}
\stackunder{\includegraphics[width=0.085\textwidth]{digit1_path_via_adversarial_source_to_adversarail_0.6.png}}{\textcolor{blue}{$0.99 (0.6)$ }}
\stackunder{\includegraphics[width=0.085\textwidth]{digit1_path_via_adversarial_source_to_adversarail_0.7.png}}{\textcolor{blue}{$0.99 (0.7)$}}
\stackunder{\includegraphics[width=0.085\textwidth]{digit1_path_via_adversarial_source_to_adversarail_0.8.png}}{\textcolor{blue}{$0.99 (0.8)$}}
\stackunder{\includegraphics[width=0.085\textwidth]{digit1_path_via_adversarial_source_to_adversarail_0.9.png}}{\textcolor{blue}{$0.99 (0.9)$}}
\stackunder{\includegraphics[width=0.085\textwidth]{digit1_path_via_adversarial_source_to_adversarail_1.0.png}}{\textcolor{blue}{$0.99$ (\red{adversarial})}}
\vspace{5pt}
\stackunder{\includegraphics[width=0.085\textwidth]{digit1_path_via_adversarial_from_adversarail_to_target_0.0.png}}{\textcolor{blue}{$0.99$ (\red{adversarial})}}
\stackunder{\includegraphics[width=0.085\textwidth]{digit1_path_via_adversarial_from_adversarail_to_target_0.1.png}}{\textcolor{blue}{$0.99 (0.1)$}}
\stackunder{\includegraphics[width=0.085\textwidth]{digit1_path_via_adversarial_from_adversarail_to_target_0.2.png}}{\textcolor{blue}{$0.99 (0.2)$}}
\stackunder{\includegraphics[width=0.085\textwidth]{digit1_path_via_adversarial_from_adversarail_to_target_0.3.png}}{\textcolor{blue}{$0.99 (0.3)$}}
\stackunder{\includegraphics[width=0.085\textwidth]{digit1_path_via_adversarial_from_adversarail_to_target_0.4.png}}{\textcolor{blue}{$0.99 (0.4)$}}
\stackunder{\includegraphics[width=0.085\textwidth]{digit1_path_via_adversarial_from_adversarail_to_target_0.5.png}}{\textcolor{blue}{$0.99 (0.5)$ }}
\stackunder{\includegraphics[width=0.085\textwidth]{digit1_path_via_adversarial_from_adversarail_to_target_0.6.png}}{\textcolor{blue}{$0.99 (0.6)$ }}
\stackunder{\includegraphics[width=0.085\textwidth]{digit1_path_via_adversarial_from_adversarail_to_target_0.7.png}}{\textcolor{blue}{$0.99 (0.7)$}}
\stackunder{\includegraphics[width=0.085\textwidth]{digit1_path_via_adversarial_from_adversarail_to_target_0.8.png}}{\textcolor{blue}{$0.99 (0.8)$}}
\stackunder{\includegraphics[width=0.085\textwidth]{digit1_path_via_adversarial_from_adversarail_to_target_0.9.png}}{\textcolor{blue}{$0.99 (0.9)$}}
\stackunder{\includegraphics[width=0.085\textwidth]{digit1_path_via_adversarial_from_adversarail_to_target_1.0.png}}{\textcolor{blue}{$0.99$ (target)}}
\vspace{-7pt}
\caption{
Digit-1 dataset ($2$ output classes): The trajectory from source image to adversarial image (top row) parameterized by $\lambda$ (numbers inside brackets),
and from adversarial image to target image (second row).
Each number outside bracket shows the confidence that the corresponding image was predicted to be in blue class.
The image with red caption can be seen as an adversarial image of the red class.
}
\label{fig:digit_1_trajectory_1}
\vspace{-5pt}
\end{figure*}
\begin{figure*}[t]
\centering
\scriptsize
\stackunder{\includegraphics[width=0.085\textwidth]{mnist_trajectory_via_adversarail_source_to_adversarail_0.0.png}}{\textcolor{blue}{$0.99$ (source)}}
\stackunder{\includegraphics[width=0.085\textwidth]{mnist_trajectory_via_adversarail_source_to_adversarail_0.1.png}}{\textcolor{blue}{$0.99 (0.1)$}}
\stackunder{\includegraphics[width=0.085\textwidth]{mnist_trajectory_via_adversarail_source_to_adversarail_0.2.png}}{\textcolor{blue}{$0.98 (0.2)$}}
\stackunder{\includegraphics[width=0.085\textwidth]{mnist_trajectory_via_adversarail_source_to_adversarail_0.3.png}}{\textcolor{blue}{$0.98 (0.3)$}}
\stackunder{\includegraphics[width=0.085\textwidth]{mnist_trajectory_via_adversarail_source_to_adversarail_0.4.png}}{\textcolor{blue}{$0.97 (0.4)$}}
\stackunder{\includegraphics[width=0.085\textwidth]{mnist_trajectory_via_adversarail_source_to_adversarail_0.5.png}}{\textcolor{blue}{$0.96 (0.5)$ }}
\stackunder{\includegraphics[width=0.085\textwidth]{mnist_trajectory_via_adversarail_source_to_adversarail_0.6.png}}{\textcolor{blue}{$0.94 (0.6)$ }}
\stackunder{\includegraphics[width=0.085\textwidth]{mnist_trajectory_via_adversarail_source_to_adversarail_0.7.png}}{\textcolor{blue}{$0.93 (0.7)$}}
\stackunder{\includegraphics[width=0.085\textwidth]{mnist_trajectory_via_adversarail_source_to_adversarail_0.8.png}}{\textcolor{blue}{$0.92 (0.8)$}}
\stackunder{\includegraphics[width=0.085\textwidth]{mnist_trajectory_via_adversarail_source_to_adversarail_0.9.png}}{\textcolor{blue}{$0.89 (0.9)$}}
\stackunder{\includegraphics[width=0.085\textwidth]{mnist_trajectory_via_adversarail_source_to_adversarail_1.0.png}}{\textcolor{blue}{$0.82$ (\red{adversarial})}}
\vspace{5pt}
\stackunder{\includegraphics[width=0.085\textwidth]{mnist_trajectory_via_adversarail_adverserail_to_target_0.0.png}}{\textcolor{blue}{$0.82$ (\red{adversarial})}}
\stackunder{\includegraphics[width=0.085\textwidth]{mnist_trajectory_via_adversarail_adverserail_to_target_0.1.png}}{\textcolor{blue}{$0.55 (0.1)$}}
\stackunder{\includegraphics[width=0.085\textwidth]{mnist_trajectory_via_adversarail_adverserail_to_target_0.2.png}}{\textcolor{blue}{$0.45 (0.2)$}}
\stackunder{\includegraphics[width=0.085\textwidth]{mnist_trajectory_via_adversarail_adverserail_to_target_0.3.png}}{\textcolor{blue}{$0.54 (0.3)$}}
\stackunder{\includegraphics[width=0.085\textwidth]{mnist_trajectory_via_adversarail_adverserail_to_target_0.4.png}}{\textcolor{blue}{$0.68 (0.4)$}}
\stackunder{\includegraphics[width=0.085\textwidth]{mnist_trajectory_via_adversarail_adverserail_to_target_0.5.png}}{\textcolor{blue}{$0.83 (0.5)$ }}
\stackunder{\includegraphics[width=0.085\textwidth]{mnist_trajectory_via_adversarail_adverserail_to_target_0.6.png}}{\textcolor{blue}{$0.91 (0.6)$ }}
\stackunder{\includegraphics[width=0.085\textwidth]{mnist_trajectory_via_adversarail_adverserail_to_target_0.7.png}}{\textcolor{blue}{$0.96 (0.7)$}}
\stackunder{\includegraphics[width=0.085\textwidth]{mnist_trajectory_via_adversarail_adverserail_to_target_0.8.png}}{\textcolor{blue}{$0.98 (0.8)$}}
\stackunder{\includegraphics[width=0.085\textwidth]{mnist_trajectory_via_adversarail_adverserail_to_target_0.9.png}}{\textcolor{blue}{$0.99 (0.9)$}}
\stackunder{\includegraphics[width=0.085\textwidth]{mnist_trajectory_via_adversarail_adverserail_to_target_1.1.png}}{\textcolor{blue}{$0.99$ (target)}}
\vspace{-7pt}
\caption{
MNIST dataset ($10$ output classes): The trajectory from source image to adversarial image (top row) parameterized by $\lambda$ (numbers inside brackets),
and from adversarial image to target image (second row).
Each number outside bracket shows the confidence that the corresponding image was predicted to be in blue class (digit $5$)
out of $10$ classes.
}
\label{fig:mnist_trajectory_1}
\end{figure*}
Note that this is a binary classification task where the dataset has just one effective degree of freedom
and the Bayes optimal decision regions are disconnected.
We train a one hidden layer network with $784$ hidden units
which is equal to the input dimension and leaky ReLU as activation function with $\alpha=0.1$.
The training error is zero and the resulting weight matrices have full rank,
thus the conditions of Theorem \ref{theo:class_region} are satisfied and the decision region of class blue should
be connected even though the Bayes optimal decision region is disconnected.
This can only happen by establishing a connection around the other red class.
We test this by sampling a source image from the $[-20^{\circ},-15^{\circ}]$ part of the blue class
and a target image from the other part $[15^{\circ},20^{\circ}]$.
Next, we generate an adversarial image
\footnote{This is essentially a small perturbation of an image from the red class which is classified as blue class}
from the red class using the one step target class method \cite{KurakinEtal2016, KurakinEtal2017}
and consider the path between the source image to the adversarial image and subsequently from the adversarial image to the target one.
For each path, we simply consider the line segment $\lambda s + (1-\lambda)t$ for $\lambda \in [0,1]$ between
the two endpoint images $s$ and $t$ and sample it very densely by dividing $[0,1]$ into $10^4$ equidistant parts.
Figure \ref{fig:digit_1_trajectory_1} shows the complete path from the source image to the target image
where the color indicates that all the intermediate images are classified as blue with high confidence
(note that we turned the output of the network into probabilities by using the softmax function).
Moreover, the intermediate images from Figure \ref{fig:digit_1_trajectory_1} look very much like images from the red class
thus could be seen as adversarial samples for the red class.
The point we want to make here is that one might think that in order to
avoid adversarial manipulation the solution is to use a simple classifier of low capacity.
We think that rather the opposite is true in the sense that only if the classifier is rich enough to model the true underlying data generating distribution it will be able to model the true decision
boundaries. In particular, the classifier should be able to realize disconnected decision regions in order to avoid paths through the input space which connect different disconnected regions of the Bayes optimal classifier. Now one could argue that the problem of our synthetic example
is that the corresponding digits obviously do not fill the whole image space, nevertheless the classifier has to do a prediction for all possible images. This could be handled by introducing a background class, but then it would be even more important that the classifier can produce
disconnected decision regions which naturally requires a minimal width of $d+1$ of the network.
In Figure \ref{fig:mnist_trajectory_1}, we show another similar experiment on MNIST dataset, but now for all the $10$ image classes.
We train a network with $200$ hidden units, leaky ReLU and softmax cross-entropy loss to zero training error.
Once again, one can see that there exists a continuous path that connects two different-looking images of digit $5$ (blue class)
where every image along this path is classified as blue class with high confidence.
Moreover this path goes through a pre-constructed adversarial image of the red class (digit $4$).
\section{Conclusion}
We have shown that deep neural networks (with a certain class of activation functions) need to have in general
width larger than the input dimension in order to learn disconnected decision regions. It remains an open
problem if our current requirement $\sigma(\mathbb{R})=\mathbb{R}$ can be removed.
While our result does not resolve
the question how to choose the network architecture in practice, it provides at least a guideline how to choose the width
of the network. Moreover, our result and experiments show that too narrow networks produce high confidence predictions
on a path connecting the true disconnected decision regions which could be used to attack these networks using adversarial
manipulation.
\section*{Acknowledgements}
The authors would like to thank the reviewers for their helpful comments on the paper
and Francesco Croce for bringing up a counter-example for the ReLU activation function.
| {'timestamp': '2018-06-11T02:09:34', 'yymm': '1803', 'arxiv_id': '1803.00094', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00094'} | arxiv |
\section{Introduction}
Deep learning has demonstrated impressive performance on a variety of tasks. Arguably the most important task, that of supervised classification, has led to many advancements. Notably, the use of deeper structures \cite{simonyan2014very, szegedy2015going, he2016deep} and more powerful loss functions \cite{hadsell2006dimensionality, schroff2015facenet, wen2016discriminative, tadmor2016learning, liu2016large} have resulted in far more robust feature representations. There has also been more attention on obtaining better-behaved gradients through normalization of batches or weights \cite{ioffe2015batch, ba2016layer, salimans2016weight}.
One of the most important practical applications of deep networks with supervised classification is face recognition. Robust face recognition poses a huge challenge in the form of very large number of classes with relatively few samples per class for training with significant nuisance transformations. A good understanding of the challenges in this task results in a better understanding of the core problems in supervised classification, and in general representation learning. However, despite the impressive attention on face recognition tasks over the past few years, there are still many gaps towards such an understanding. Notably, the need and practice of feature normalization. Normalization of features has recently been discovered to provide significant improvement in performance which implicitly results in a cosine embedding \cite{ranjan2017l2, Wang2017NormFace}. However, direct normalization in deep networks explored in these works results in a non-convex formulation resulting in local minima generated by the loss function itself. It is important to preserve convexity in loss functions for more effective minimization of the loss given that the network optimization itself is non-convex. In a separate thrust of work, cosine similarity has also been very recently explored for supervised classification \cite{liu2017learning, chunjie2017cosine}. Nonetheless, a concrete justification and principled motivation for the \textit{need} for normalizing the features itself is also lacking.
\begin{figure
\begin{center}
\subfigure[Features trained using Softmax]{%
\centering
\includegraphics[width=0.45\columnwidth,height=0.4\columnwidth,valign=m]{Softmax.pdf}\label{fig_softmax}
}%
\subfigure[Features trained using Ring loss]{%
\centering
\includegraphics[width=0.5\columnwidth,height=0.4\columnwidth,valign=m]{RingLoss.pdf}\label{fig_ring_loss}
}
\end{center}
\vspace{-0.5cm}
\caption{Sample MNIST features trained using (a) Softmax and (b) Ring loss on top of Softmax. Ring loss uses a convex norm constraint to gradually enforce normalization of features to a learned norm value $R$. This results in features of equal length while mitigating classification margin imbalance between classes. Softmax achieves 98.97 \% accuracy on MNIST, whereas Ring loss achieves 99.34 \% demonstrating the superior performance of the network learned normalized features. }
\label{fig_sample_visualization}
\vspace{-0.5cm}
\end{figure}
\begin{figure*
\begin{center}
\subfigure[A 2-class 2-sample case]{%
\centering
\includegraphics[width=0.7\columnwidth,valign=m]{RingLoss_sample_case.pdf}\label{fig_class_margin_setting}
}%
\subfigure[Classification margin]{%
\centering
\includegraphics[width=0.9\columnwidth,valign=m]{class_margin.eps}\label{fig_class_margin}
}
\end{center}
\vspace{-0.7cm}
\caption{ (a) A simple case of binary classification. The shaded regions (yellow, green) denote the classification margin (for class 1 and 2). (b) Angular classification margin for $\theta_1$ for different $\delta=\cos \theta_2$. }
\label{fig_class_margin_visualization}
\vspace{-0.5cm}
\end{figure*}
\textbf{Contributions.} In this work, we propose Ring loss, a simple and elegant approach to normalize all sample features through a convex augmentation of the primary loss function (such as Softmax). The value of the target norm is also learnt during training. Thus, the only hyperparameter in Ring loss is the loss weight w.r.t to the primary loss function. We provide an analytical justification illustrating the benefits of feature normalization and thereby cosine feature embeddings. Feature matching during testing in face recognition is typically done through cosine distance creating a gap between testing and training protocols which do not utilize normalization. The incorporation of Ring loss during training eliminates this gap. Ring loss is differentiable that allows for seamless and simple integration into deep architectures trained using gradient based methods. We find that Ring loss provides consistent improvements over a large range of its hyperparameter when compared to other baselines in normalization and indeed other losses proposed for face recognition in general. Interestingly, we also find that Ring loss helps in being robust to lower resolutions through the norm constraint.
\section{Ring loss: Convex Feature Normalization}
\subsection{Intuition and Motivation. }
\begin{figure*}[t]
\centering
\begin{tabular}{ccc}
\subfigure[$\lambda=0$ (Pure Softmax) ]{\includegraphics[scale=.3]{visual_00.pdf}} &
\subfigure[$\lambda=1$ ]{\includegraphics[scale=.3]{visual_01.pdf}} &
\subfigure[$\lambda=10$ ]{\includegraphics[scale=.3]{visual_10.pdf}
\end{tabular}
\vspace{-0.5cm}
\caption{\textbf{Ring loss Visualizations:} (a), (b) and (c) show the final convergence of the samples (for varying $\lambda$). The blue-green dots are the samples before the gradient update and the red dots are the same samples after the update. The dotted blue vector is the target class direction. $\lambda=0$ fails to converge and does not constrain the norm whereas $\lambda=10$ takes very small steps towards Softmax gradients. A good balance is achieved at $\lambda=1$. In our large scale experiments, a large range of $\lambda$ achieves this balance. }
\label{fig_ring_loss_visual}
\vspace{-0.5cm}
\end{figure*}
There have been recent studies on the use of norm constraints right before the Softmax loss \cite{Wang2017NormFace, ranjan2017l2}. However, the formulations investigated are non-convex in the feature representations leading to difficulties in optimization. Further, there is a need for better understanding of the benefits of normalization itself. Wang \emph{et.al.} \cite{Wang2017NormFace} argue that the `radial' nature of the Softmax features is not a useful property, thereby cosine similarity should be preferred leading to normalized features. A concrete reason was, however, not provided. Ranjan \emph{et.al.} \cite{ranjan2017l2} show that the Softmax loss encodes the quality of the data (images) into the norm thereby deviating from the ultimate objective of learning a good representation purely for classification.\footnote{We in fact, find in our pilot study that the Softmax features also encode the `difficulty' of the class.} Therefore for better classification, normalization forces the network to be invariant to such details. This is certainly not the entire story and in fact overlooks some key properties of feature normalization. We now motivate Ring loss with three arguments. 1) We show that the norm constraint is beneficial to maintain a balance between the angular classification margins of multiple classes. 2) It removes the disconnect between training and testing metrics. 3) It minimizes test errors due to angular variation due to low norm features.
\textbf{The Angular Classification Margin Imbalance. } Consider a binary classification task with two feature vectors $x_1$ and $x_2$ from class 1 and 2 respectively, extracted using some model (possibly a deep network). Let the classification weight vector for class 1 and 2 be $w_1, w_2$ respectively (potentially Softmax). An example arrangement is shown in Fig.~\ref{fig_class_margin_setting}. Then in general, in order for the class 1 vector $w_1$ to pick $x_1$ \textit{and not} $x_2$ for correct classification, we require $w_1^T x_1 > w_1^Tx_2 \Rightarrow \|x_1\|_2 \cos \theta_1 > \|x_2\|_2\cos \theta_2$\footnote{Although, it is more common to in turn investigate competition between two weight vectors to classify a single sample, we find that this alternate perspective provide some novel and interesting insights.}. Here, $\theta_1$ and $\theta_2$ are the angles between the weight vector $w_1$ (class 1 vector only) and $x_1$, $x_2$ respectively\footnote{Note that this reasoning is applicable to any loss function trying to enforce this inequality in some form.}. We call the feasible set (range for $\theta_1$) for this inequality to hold as the \textit{angular classification margin}. Note that it is also a function of $\theta_2$. Setting $\frac{\|x_2\|_2}{\|x_1\|_2} = r$, we observe $r>0$ and that for correct classification, we need $\cos \theta_1 > r \cos \theta_2 \Rightarrow \theta_1 < \cos ^{-1}( r \cos \theta_2)$ since $\cos \theta$ is a decreasing function between $[-1, 1]$ for $\theta \in [0, \pi]$. This inequality needs to hold true for any $\theta_2$. Fixing $\cos \theta_2 = \delta$, we have $\theta_1 < \cos ^{-1} (r\delta)$. From the domain constraints of $\cos^{-1}$, we have $-1 \leq r\delta \leq 1 \Rightarrow \frac{-1}{\delta} \leq r \leq \frac{1}{\delta }$. Combining this inequality with $r>0$, we have $ 0 < r \leq \frac{1}{|\delta|} \Rightarrow \|x_2\|_2 \leq \frac{1}{\delta } \|x_1\|_2 ~~\forall \delta \in (0 ~1]$. For our purposes it suffices to only look at the case $\delta > 0$ since the $\delta<0$ doesn't change the inequality $-1 \leq r\delta \leq 1 $ and is more interesting.
\textbf{Discussion on the angular classification margin. } We plot the upper bound on $\theta_1$ (\emph{i.e.} $\cos ^{-1}( r \cos \theta_2)$) for a range of $\delta$ ([0.1, 1]) and the corresponding range of $r$. Fig.~\ref{fig_class_margin} showcases the plot. Consider $\delta=0.1$ which implies that the sample $x_2$ has a large angular distance from $w_1$ (about $85^\circ$). This case is favorable in general since one would expect a lower probability of $x_2$ being classified to class 1. However, we see that as $r$ increases (difference in norm of $x_1, x_2$), the classification margin for $x_1$ decreases from $90^\circ$ to eventually $0^\circ$. In other terms, as the norm of $x_2$ increases w.r.t $x_1$, the angular margin for $x_1$ to be classified correctly while rejecting $x_2$ by $w_1$, decreases. The difference in norm ($r>1$) therefore will have an adverse effect during training by effectively enforcing smaller angular classification margins for classes with smaller norm samples. This also leads to lop-sided classification margins for multiple classes due to the difference in class norms as can be seen in Fig.~\ref{fig_softmax}. This effect is only magnified as $\delta$ increases (or the sample $x_2$ comes closer to $w_1$). Fig.~\ref{fig_class_margin} shows that the angular classification margin decreases much more rapidly as $\delta$ increases. However, $r<1$ leads to a larger margin and seems to be beneficial for classifying class 1 (as compared to $r>1$). One might argue that this suggests that the $r<1$ should be enforced for better performance. However, note that the same reasoning applies correspondingly to class 2, where we want to classify $x_2$ to $w_2$ while rejecting $x_1$. This creates a trade off between performance on class 1 versus class 2 based on $r$ which also directly scales to multi-class problems. In typical recognition applications such as face recognition, this is not desirable. Ideally, we would want to represent all classes equally well. Setting $r=1$ or constraining the norms of the samples from both classes to be the same ensures this.
\textbf{Effects of Softmax on the norm of MNIST features.} We qualitatively observe the effects of vanilla Softmax on the norm of the features (and thereby classification margin) on MNIST in Fig.~\ref{fig_softmax}. We see that digits 3, 6 and 8 have large norm features which are typically the classes that are harder to distinguish between. Therefore, we observe $r<1$ for these three `difficult' classes (w.r.t to the other `easier' classes) thereby providing a larger angular classification margin to the three classes. On the other hand, digits 1, 9 and 7 have lower norm corresponding to $r>1$ w.r.t to the other classes, since the model can afford to decrease the margin for these `easy' classes as a trade off. We also observe that arguably most easily distinguishable class, digit 1, has the lowest norm thereby the highest $r$. On the other hand, Fig.~\ref{fig_ring_loss} showcases the features learned using Softmax augmented with our proposed Ring loss, which forces the network to learn feature normalization through a convex formulation thereby mitigating this imbalance in angular classification margins.
\textbf{ Regularizing Softmax loss with the norm constraint.}
The ideal training scenario for a system testing under the cosine metric would be where all features pointing in the same \textit{direction} have the same loss. However, this is not true for the most commonly used loss function, Softmax and its variants (FC layer combined with the softmax function and the cross-entropy loss). Assuming that the weights are normalized, i.e. $\|w_k\|=1$, the Softmax loss for feature vector $\mathcal{F}(\mathbf{x}_i)$ can be expressed as (for the correct class $y_i$):
\begin{align}
L_{SM} &= -\log{
\frac{
\exp{w_k \mathcal{F}(\mathbf{x}_i)}}
{
\sum_{{k'}=1}^K
{\exp{w_{k'} \mathcal{F}(\mathbf{x}_i)}}
}F
}\\
&= -\log{
\frac{
\exp{\|\mathcal{F}(\mathbf{x}_i)\|\cos{\theta_{ki}}}}
{
\sum_{{k'}=1}^K
{\exp{\|\mathcal{F}(\mathbf{x}_i)\|\cos{\theta_{k'i}}}}
}
}
\end{align}
Clearly, despite having the same direction, two features with different norms have different losses. From this perspective, the straightforward solution to regularize the loss and remove the influence of the norm is to normalize the features before Softmax as explored in $l_2$-constrained Softmax \cite{ranjan2017l2}. However, this approach is effectively a projection method, i.e. it calculates the loss as if the features are normalized to the same scale, while the actual \textit{network} does not \textit{learn} to normalize features.
\textbf{ The need for features normalization in feature space.} As an illustration, consider the training and testing set features trained by vanilla Softmax, of the digit 8 from MNIST in Fig.~\ref{fig_train_test}. Fig.~\ref{fig_softmax_train} shows that at the end of training, the features are well behaved with a large variation in the norm of the features with a few samples with low norm. However, Fig.~\ref{fig_softmax_test} shows that that the features for the test samples are much more erratic. There is a similar variation in norm but now most of the low norm features have huge variation in \textit{angle}. Indeed, variation in samples for lower norm features translates to a larger variation in angle than the same for higher norm samples features. This translates to higher errors in classification under the cosine metric (as is common in face recognition). This is yet another motivation to normalize features during training. Forcing the network to \textit{learn} to normalize the features helps to mitigate this problem during test wherein the network learns to work in the normalized feature space. A related motivation to feature normalization was proposed by Ranjan \emph{et.al.} \cite{ranjan2017l2} wherein it was argued that low resolution of an image results in a low norm feature leading to test errors. Their solution to project (not implicitly learn) the feature to the scaled unit hypersphere was also aimed at handling low resolution. We find in our large scale experiment with low resolution images (see Exp. 6 Fig.~\ref{fig_scale2}) that soft normalization by Ring loss achieves better results. In fact hard projection method by $l_2$-constrained Softmax \cite{ranjan2017l2} performs worse than Softmax for a downsampling factor of 64.
\begin{figure
\begin{center}
\subfigure[Features for training set]{%
\centering
\includegraphics[width=0.49\columnwidth,height=0.4\columnwidth,valign=m]{deviation_train_1.pdf}\label{fig_softmax_train}
}%
\subfigure[Features for testing set]{%
\centering
\includegraphics[width=0.49\columnwidth,height=0.4\columnwidth,valign=m]{deviation_test_1.pdf}\label{fig_softmax_test}
}
\end{center}
\vspace{-0.5cm}
\caption{MNIST features for digit 8 trained using vanilla Softmax loss. }
\label{fig_train_test}
\vspace{-0.7cm}
\end{figure}
\textbf{ Incorporating the norm constraint as a convex problem.} Identifying the need to normalize the sample features from the network, we now formulate the problem. We define $L_S$ as the primary loss function (for instance Softmax loss). Assuming that $\mathcal{F}$ provides deep features for a sample $x$ as $\mathcal{F}(x)$, we would like to minimize the loss subject to the normalization constraint as follows,
\begin{align}
\min L_S(\mathcal{F}(x)) ~~s.t. ~~ \|\mathcal{F}(x)\|_2=R \label{eq_1}
\end{align}
Here, $R$ is the scale constant that we would like the features to be normalized to. This is the exact formulation recently studied and implemented by \cite{ranjan2017l2, Wang2017NormFace}. Note that this problem is non-convex in $\mathcal{F}(x)$ since the set of feasible solutions is itself non-convex due to the norm equality constraint. Approaches which use standard SGD while ignoring this critical point would not be providing feasible solutions to this problem thereby, the network $\mathcal{F}$ would not learn to output normalized features. Indeed, the features obtained using this straightforward approach are not normalized as was found in Fig. 3b in \cite{ranjan2017l2} compared to our approach (Fig.~\ref{fig_ring_loss}). One naive approach to get around this problem would be to relax the norm equality constraint to an inequality. This objective will now be convex, however it does not necessarily enforce equal norm features. In order to incorporate the formulation as a convex constraint, the following form is directly useful as we find below.
\subsection{Ring loss}
\textbf{Ring loss Definition. } Ring loss $L_R$ is defined as
\begin{align}
L_R = \frac{\lambda}{2m} \sum_{i=1}^m (\|\mathcal{F}(\mathbf{x}_i)\|_2 - R)^2
\end{align}
where $\mathcal{F}(\mathbf{x}_i)$ is the deep network feature for the sample $\mathbf{x}_i$. Here, $R$ is the target norm value which is also learned and $\lambda$ is the loss weight enforcing a trade-off between the primary loss function. $m$ is the batch-size. The square on the norm difference helps the network to take larger steps when the norm of a sample is too far off from $R$ leading to faster convergence. The corresponding gradients are as follows.
\begin{align}
\frac{\partial L_R}{\partial R } &= -\frac{\lambda}{m}\sum_{i=1}^m (\|\mathcal{F}(\mathbf{x}_i)\|_2 - R) \\ \frac{\partial L_R}{\partial \mathcal{F}(\mathbf{x}_i) }&= \frac{\lambda}{m} \left(1 - \frac{R}{\|\mathcal{F}(\mathbf{x}_i)\|_2} \right) \mathcal{F}(\mathbf{x}_i)
\end{align}
Ring loss ($L_R$) can be used along with any other loss function such as Softmax or large-margin Softmax \cite{liu2017sphereface}. The loss encourages norm of samples being value $R$ (a learned parameter) rather than explicit enforcing through a hard normalization operation. This approach provides informed gradients towards a better minimum which helps the network to satisfy the normalization constraint. The network therefore, learns to normalize the features using \textit{model weights themselves} (rather than needing an explicit non-convex normalization operation as in \cite{ranjan2017l2}, or batch normalization \cite{ioffe2015batch}). In contrast and in connection, batch normalization \cite{ioffe2015batch} enforces the scaled normal distribution for each element in the feature independently. This does not constrain the overall norm of the feature to be equal across all samples and neither addresses the class imbalance problem. As shown in Fig. \ref{fig_accuracy}, Ring loss stabilizes the feature norm across all classes, and, in turn, rectifies the classification imbalance for Softmax to perform better overall.
\begin{figure
\begin{center}
\subfigure{%
\centering
\includegraphics[width=0.8\columnwidth,height=0.35\columnwidth,valign=m]{Accuracy.pdf}
}
\hspace{-0.85cm}
\subfigure{%
\centering
\includegraphics[width=0.15\columnwidth,height=0.30\columnwidth,valign=m]{Legend.pdf}
}
\end{center}
\vspace{-0.5cm}
\caption{Ring loss improves MNIST testing accuracy across all classes by reducing inter-class norm variance. Norm Ratio is the ratio between average class norm and average norm of all features.}
\label{fig_accuracy}
\vspace{-0.7cm}
\end{figure}
\textbf{Ring loss Convergence Visualizations.} To illustrate the effect of the Softmax loss augmented with the enforced soft-normalization, we conduct some analytical simulations. We generate a 2D mesh of points from $( -1.5, 1.5 )$ in x,y-axis. We then compute the gradients of Ring loss ($R=1$) assuming the dottef blue vertical line (see Fig.~\ref{fig_ring_loss_visual}) as the target class and update each point with a fixed step size for 20 steps. We run the simulation for $\lambda = \{ 0, 1, 10 \}$. Note that $\lambda=0$ represents pure Softmax. Fig.~\ref{fig_ring_loss_visual} depicts the results of these simulations. Sub-figures (a), (b) and (c) in Fig.~\ref{fig_ring_loss_visual} show the initial points on the mesh grid (light green) and the final updated points (red). For pure Softmax ($\lambda=0$), we see that the updates increases norm of the samples and moreover they do not converge. For a reasonable loss weight of $\lambda=1$, Ring loss gradients can help the updated points converge much faster in the same number of iterations. For heavily weighted Ring loss with $\lambda=10$, we see that the gradients force the samples to a unit norm since $R$ was set to 1 while overpowering Softmax gradients. These figures suggest that there exists a trade off enforced by $\lambda$ between the Softmax loss $L_S$ and the normalization loss. We observe similar trade-offs in our experiments.\\
\section{Experimental Validation}
We benchmark Ring loss on large scale face recognition tasks while augmenting two loss functions. The first one is the ubiquitous Softmax, and the second being a successful variant of Large-margin Softmax \cite{liu2016large} called SphereFace \cite{liu2017sphereface}. We present results on five large-scale benchmarks of LFW \cite{LFWTech}, IARPA Janus Benchmark IJB-A \cite{klare2015pushing}, Janus Challenge Set 3 (CS3) dataset (which is a super set of the IJB-A Janus dataset), Celebrities Frontal-Profile (CFP) \cite{sengupta2016frontal} and finally the MegaFace dataset \cite{kemelmacher2016megaface}. We also present results of Ring loss augmented Softmax features on low resolution images from Janus CS3 to showcase resolution robust face matching.
\begin{figure
\centering
\includegraphics[width=0.9\columnwidth,valign=m]{CFP.eps}
\vspace{-0.2cm}
\caption{ ROC curves on the CFP Frontal vs. Profile verification protocol. For all Figures and Tables, SM denotes Softmax, SF denotes SphereFace \cite{liu2017sphereface},l2-Cons SM denotes \cite{ranjan2017l2}, + CL denotes Center Loss augmentation \cite{wen2016discriminative} and finally + R denotes Ring loss augmentation. Numbers in bracket denote value of hyperparameter (loss weight), \emph{i.e.} $\alpha$ for \cite{ranjan2017l2}, $\lambda$ for Center loss and Ring loss.}
\label{fig_cfp}
\vspace{-0.5cm}
\end{figure}
\textbf{Implementation Details.}
For all the experiments in this paper, we usethe ResNet 64 (Res64) layer architecture from Liu \emph{et. al.} \cite{liu2017sphereface}. For Center loss, we utilized the code repository online and used the best hyperparameter setting reported\footnote{see \url{https://github.com/ydwen/caffe-face.git}}. The $l_2$-constrained Softmax loss was implemented follwing \cite{ranjan2017l2} by integrating a normalization and scaling layer\footnote{see \url{https://github.com/craftGBD/caffe-GBD}. In our experiments, for $\alpha=50$ the gradients exploded due the relatively deep Res64 architecture and learning $\alpha$ initialized at 30 did not converge.} before the last fully-connected layer. For experiments with L-softmax \cite{liu2016large} and SphereFace \cite{liu2017sphereface}, we used the publicly available Caffe implementation. The Resnet 64 layer (Res64) architecture results in a feature dimension of 512 (at the fc5 layer), which is used for matching using the cosine distance. Ring loss and Center loss are both applied on this feature \emph{i.e.} to the output of the fc5 layer. All models were trained on the MS-Celeb 1M dataset \cite{guo2016ms}. The dataset was cleaned to remove potential outliers within each class and also noisy classes before training. To clean the dataset we used a pretrained model to extract features from the MS-Celeb 1M dataset. Then, classes that had variance in the MSE, between the sample features and the mean feature of that class, above a certain threshold were discarded. Following this, from the filtered classes, images that have their MSE error between their feature vector and the class mean feature vector higher than a threshold are discarded. After this procedure, we are left with about 31,000 identities and about 3.5 million images. The learning rate was initialized to 0.1 and then decreased by a factor of 10 at 80K and 150K iterations for a total of 165K iterations. All models evaluated were the 165K iteration model\footnote{For all Tables, results reported after double horizontal lines are from models trained during our study. The results above the lines reported directly from the paper as cited.}.
\textbf{Preprocessing.} All faces were detected and aligned using \cite{zhang2016joint} which provided landmarks for the two eye centers, nose and mouth corners (5 points). Since MS-Celeb1M, IJB-A Janus and Janus CS3 have harder faces we use a robust detector \emph{i.e.} CMS-RCNN \cite{zhu2017cms} to detect faces and a fast landmarker that is robust to pose \cite{bhagavatula2017faster}. The faces were then aligned using a similarity transformation and were cropped to $112\times 96$ in the RGB format. The pixel level activations were normalized by subtracting 127.5 and then dividing by 128. For failed detections, the training set images are ignored. In the case of testing, ground truth landmarks were used from the corresponding dataset.
\begin{figure*
\begin{center}
\subfigure[IJB-A Janus 1:1 Verification]{%
\centering
\includegraphics[width=0.9\columnwidth,valign=m]{janus_curves.eps}\label{fig_janus}
}%
\subfigure[Janus CS3 1:1 Verification]{%
\centering
\includegraphics[width=0.9\columnwidth,valign=m]{cs3_ringloss_cuvres.eps}\label{fig_cs3}
}
\end{center}
\vspace{-0.5cm}
\caption{ ROC curves on the (a) IJB-A Janus 1:1 verification protocol and the (b) Janus CS3 1:1 verification protocol. For all Figures and Tables, SM denotes Softmax, SF denotes SphereFace \cite{liu2017sphereface},l2-Cons SM denotes \cite{ranjan2017l2}, + CL denotes Center Loss augmentation \cite{wen2016discriminative} and finally + R denotes Ring loss augmentation. Numbers in bracket denote value of hyperparameter (loss weight), \emph{i.e.} $\alpha$ for \cite{ranjan2017l2}, $\lambda$ for Center loss and Ring loss.}
\vspace{-0.5cm}
\end{figure*}
\textbf{Exp 1. Testing Benchmark: LFW.} The LFW \cite{LFWTech} database contains about 13,000 images for about 1680 subjects with a total of 6,000 defined matches. The primary nuisance transformations are illumination, pose, color jittering and age. As the field has progressed, LFW has been considered to be saturated and prone to spurious minor variances in performance (in the last \% of accuracy) owing to the small size of the protocol. Small differences in accuracy on this protocol do not accurately reflect the generalizing capabilities of a high performing model. Nonetheless, as a benchmark, we report performance on this dataset.
\textbf{Results: LFW.} Table~\ref{tab_lfw} showcases the results on the LFW protocol. We find that for Softmax (SM + R), Ring loss normalization seems to significantly improve performance (up from 98.47\% to \textbf{99.52\%} using Ring loss with $\lambda=0.01$). We find similar trends while using Ring loss with SphereFace. The LFW accuracy of SphereFace improves from 99.47\% to \textbf{99.50\%}. We note that since even our baselines are high performing, there is a lot of variance in the results owing to the small size of the LFW protocol (just 6000 matches compared to about 8 million matches in the Janus CS3 protocol which shows clearer trends). Indeed we find clearer trends with MegaFace, IJB-A and CS3 all of which are orders of magnitude larger protocols.
\textbf{Exp 2. Testing Benchmark: IJB-A Janus.} IJB-A \cite{klare2015pushing} is a challenging dataset which consists of 500 subjects with extreme pose, expression and illumination with a total of 25,813 images. Each subject is described by a template instead of a single image. This allows for score fusion techniques to be developed. The setting is suited for applications which have multiple sources of images/video frames. We report results on the 1:1 template matching protocol containing 10 splits with about 12,000 pair-wise template matches each resulting in a total of 117,420 template matches. The template matching score for two templates $T_i, T_j$ is determined by using the following formula, $S(T_i, T_j) = \sum_{\gamma=1}^K \frac{\sum_{t_a\in T_i, t_b\in T_j} s(t_a, t_b) \exp{ \gamma s(t_a, t_b) } }{ \sum_{t_a\in T_i, t_b\in T_j} \exp{ \gamma s(t_a, t_b) } } $ where $s(t_a. t_b)$ is the cosine similarity score between images $t_a, t_b$ and $K=8$.
\textbf{Results: IJB-A Janus.} Table.~\ref{tab_janus} and Fig.~\ref{fig_janus} present these results. We see that Softmax + Ring loss (0.001) outperforms Softmax by a large margin, particularly 60.52\% verification rate compared to \textbf{78.41\%} verification at $10^{-5}$ FAR. Further, it outperforms Center loss \cite{wen2016discriminative} (46.01\%) and $l_2$-constrained Softmax (73.29\%) \cite{ranjan2017l2}. Although SphereFace performs better than Softmax + Ring loss, an augmentation by Ring loss boosts SphereFace's performance from 78.52\% to \textbf{82.41\%} verification rate for $\lambda=0.01$. This matches the state-of-the-art reported in \cite{ranjan2017l2} which uses a 101-layer ResNext architecture despite our system using a much shallower 64-layer ResNet architecture. The effect of high $\lambda$ akin to the effects simulated in Fig.~\ref{fig_ring_loss_visual} show in this setting for $\lambda=0.03$ for SphereFace augmentation. We observe this trade-off in Janus CS3, CFP and MegaFace results as well. Nonetheless, we notice that Ring loss augmentation provides consistent improvements over a large range of $\lambda$ for both Softmax and Sphereface. This is in sharp contrast with $l_2$-constrained Softmax whose performance varies significantly with $\alpha$ rendering it difficult to optimize. In fact for $\alpha=10$, it performs worse than Softmax.
\textbf{Exp 3. Testing Benchmark: Janus CS3.} The Janus CS3 dataset is a super set of the IARPA IJB-A dataset. It contains about 11,876 still images and 55,372 video frames from 7,094 videos. For the CS3 1:1 template verification protocol there are a total of 1,871 subjects and 12,590 templates. The CS3 template verification protocol has over 8 million template matches which amounts to an extremely large number of template verifications. There are about 1,870 templates in the gallery and about 10,700 templates in the probe. The CS3 protocol being a super set of IJB-A, has a large number of extremely challenging images and faces. The challenging conditions range from extreme illumination, extreme pose to significant occlusion. For sample images, please refer to Fig. 4 and Fig. 10 in \cite{lin2017proximity}, Fig. 1 and Fig. 6 in \cite{bodla2017deep}. Since the protocol is template matching, we utilize the same template score fusion technique we utilize in the IJB-A results with $K=2$.
\begin{figure*
\begin{center}
\subfigure[Downsampling 4x]{%
\centering
\includegraphics[width=0.4\columnwidth,valign=m]{scale2.eps}
}%
\subfigure[Downsampling 16x]{%
\centering
\includegraphics[width=0.4\columnwidth,valign=m]{scale4.eps}
}
\subfigure[Downsampling 25x]{%
\centering
\includegraphics[width=0.4\columnwidth,valign=m]{scale5.eps}
}
\subfigure[Downsampling 36x]{%
\centering
\includegraphics[width=0.4\columnwidth,valign=m]{scale6.eps}
}
\subfigure[Downsampling 64x]{%
\centering
\includegraphics[width=0.4\columnwidth,valign=m]{scale8.eps}
}
\end{center}
\vspace{-0.5cm}
\caption{ ROC curves for the downsampling experiment on Janus CS3. Ring loss (SM + R $\lambda=0.01$) learns the most robust features, whereas $l_2$-constrained Softmax (l2-Cons SM $\alpha=30$) \cite{ranjan2017l2} performs poorly (worse than the baseline Softmax) at very high downsampling factor of 64x. }
\label{fig_scale2}
\vspace{-0.5cm}
\end{figure*}
\textbf{Results: Janus CS3.} Table.~\ref{tab_cs3} and Fig.~\ref{fig_cs3} showcases our results on the CS3 dataset. We report verification rates (VR) at $10^{-3}$ through $10^{-6}$ FAR. We find that our Ring loss augmented Softmax model outperforms the previous best reported results on the CS3 dataset. Recall that the Softmax + Ring loss model (SM + R) was trained only on a subset of the MS-Celeb dataset and achieves a VR of 74.56\% at $10^{-4}$ FAR. This is in contrast to Lin \emph{et. al.} who train on MS-Celeb plus CASIA-WebFace (an additional 0.5 million images) and achieve 72.52 \%. Further, we find that even though our baseline Sphereface Res64 model outperforms the previous state-of-the-art, our Ring loss augmented Sphereface model outperforms all other models to achieve high a VR of \textbf{82.74 \%} at $10^{-4}$ FAR. At very low FAR of $10^{-6}$ our SF + R model achieves VR \textbf{35.18 \%} which to the best of our knowledge is the state-of-the-art on the challenging Janus CS3. In accordance with the results on IJB-A Janus, Ring loss provides consistent improvements over large ranges of $\lambda$ whereas $l_2$-constrained Softmax exhibits significant variation w.r.t. to its hyperparameter.
\textbf{Exp 4. Testing Benchmark: MegaFace. } The recently released MegaFace benchmark is extremely challenging which defines matching with a gallery of about 1 million distractors \cite{kemelmacher2016megaface}. The aspect of face recognition that this database test is discrimination in the presence of very large number of distractors. The testing database contains two sets of face images. The distractor set contains 1 million distractor subjects (images). The target set contain 100K images from 530 celebrities.
\textbf{Result: MegaFace.} Table.~\ref{tab_megaface} showcases our results. Even at this extremely large scale evaluation (evaluating FaceScrub against 1 million), the addition of Ring loss provides significant improvement to the baseline approaches. The identification rate ($\%$) for Softmax upon the addition of Ring loss ($\lambda = 0.001$) improves from 56.36\% to a high \textbf{71.67\%} and for SphereFace it improves from 74.95\% to \textbf{75.22\%} for a \textit{single} patch model. This is higher than the single patch model reported in the orginal Sphereface paper (72.72\% \cite{liu2017sphereface}). We outperform Center loss \cite{wen2016discriminative} augmenting both Softmax (67.24\%) and Sphereface (71.15\%). We find that though for MegaFace, $l_2$-constrained Softmax \cite{ranjan2017l2} for $\alpha=30$ achieves 72.22\%, there is yet again significant variation in performance that occurs due to a change in the hyper parameter $\alpha$ (66.20\% for $\alpha=10$ to 72.22\% for $\alpha=30$). Ring loss hyper parameter ($\lambda$), as we find again, is more easily tunable and manageable. This results in a smaller variance in performance for both Softmax and SphereFace augmentations.
\begin{table
\small
\caption{Accuracy (\%) on LFW. }
\centering
\begin{tabular}{l c c }
\hline\hline
Method & Training Data & Accuracy (\%) \\
\hline
FaceNet \cite{schroff2015facenet} & 200M private & 99.65 \\
Deep-ID2+ \cite{sun2014deep} & CelebFace+ & 99.15 \\
Range loss \cite{ZhangFWL016} & WebFace & 99.52 \\
& +Celeb1M(1.5M) & \\
Baidu \cite{liu2015targeting} & 1.3M & 99.77 \\
Norm Face \cite{Wang2017NormFace} & WebFace & 99.19 \\
\hline
\hline
SM & MS-Celeb & 98.47 \\
$l2$-Cons SM (30) \cite{ranjan2017l2} & MS-Celeb & 99.55 \\
$l2$-Cons SM (20) \cite{ranjan2017l2} & MS-Celeb & 99.47 \\
$l2$-Cons SM (10) \cite{ranjan2017l2} & MS-Celeb & 99.45 \\
SM + CL \cite{wen2016discriminative} & MS-Celeb & 99.17 \\
SF \cite{liu2017sphereface} & MS-Celeb & 99.47 \\
SF + CL \cite{wen2016discriminative, liu2017sphereface} & MS-Celeb & 99.52 \\
\hline
SM + R ($0.01$) & MS-Celeb & 99.52 \\
SM + R ($0.001$) & MS-Celeb & 99.50 \\
SM + R ($0.0001$) & MS-Celeb & 99.28 \\
\hline
SF + R ($0.03$) & MS-Celeb & 99.48 \\
SF + R ($0.01$) & MS-Celeb & 99.43 \\
SF + R ($0.001$) & MS-Celeb & 99.42 \\
SF + R ($0.0001$) & MS-Celeb & 99.50 \\
\hline
\end{tabular}
\label{tab_lfw}
\end{table}
\begin{table}
\centering
\begin{tabular}{l c c }
\hline\hline
Method & Acc \% (MegaFace) & $10^{-3}$ (CFP) \\
\hline
\hline
SM & 56.36 & 55.86 \\
$l2$-Cons SM (30) \cite{ranjan2017l2} & 72.22 & 82.14 \\
$l2$-Cons SM (20) \cite{ranjan2017l2} & 70.29 & 83.69 \\
$l2$-Cons SM (10) \cite{ranjan2017l2} & 66.20 & 76.77 \\
SM + CL \cite{wen2016discriminative} & 67.24 & 78.94 \\
SF \cite{liu2017sphereface} & 74.95 & 89.94 \\
SF + CL \cite{wen2016discriminative, liu2017sphereface} & 71.15 & 82.97 \\
\hline
SM + R ($0.01$) & 71.10 & 87.43 \\
SM + R ($0.001$) & 71.67 & 81.29 \\
SM + R ($0.0001$) & 69.41 & 76.30 \\
\hline
SF + R ($0.03$) & 73.05 & 86.23 \\
SF + R ($0.01$) & 74.93 & \textbf{ 90.94} \\
SF + R ($0.001$) & \textbf{ 75.22 } & 87.69 \\
SF + R ($0.0001$) & 74.45 & 88.17 \\
\hline
\end{tabular}
\caption{Identification rates on MegaFace with 1 million distractors (Accuracy \%) and Verification rates at $10^{-3}$ FAR for the CFP Frontal vs. Profile protocol. }
\label{tab_megaface}
\end{table}
\begin{table}
\hfill
\centering
\begin{tabular}{l c c c}
\hline\hline
Method & $10^{-5}$ & $10^{-4}$ & $10^{-3}$ \\
\hline
$l2$-Cons SM* (101) \cite{ranjan2017l2} &- & 87.9 & 93.7 \\
$l2$-Cons SM* (101x) \cite{ranjan2017l2} & -& 88.3 & 93.8 \\
\hline
\hline
SM & 60.52 & 69.69 & 83.10 \\
$l2$-Cons SM (30) \cite{ranjan2017l2}& 73.29 & 80.65 & 90.72 \\
$l2$-Cons SM (20) \cite{ranjan2017l2}& 67.63 & 76.88 & 89.89 \\
$l2$-Cons SM (10) \cite{ranjan2017l2}& 53.74 & 68.58 & 83.42 \\
SM + CL \cite{wen2016discriminative} & 46.01 & 74.10 & 88.32 \\
SF \cite{liu2017sphereface}& 78.52 & 88.0 & \textbf{93.24} \\
SF + CL \cite{wen2016discriminative, liu2017sphereface} & 72.35 & 81.11 & 89.26 \\
\hline
SM + R ($0.01$) & 72.53 & 79.1 & 90.8 \\
SM + R ($0.001$) & 78.41 & 85.0 & 91.5 \\
SM + R ($0.0001$) & 69.23 & 82.30 & 89.20 \\
\hline
SF + R ($0.03$) & 79.54 & 85.37 & 91.64 \\
SF + R ($0.01$) & \textbf{82.41} & \textbf{ 88.5} & \textbf{93.22} \\
SF + R ($0.001$) & 79.74 & 87.71 & 92.62 \\
SF + R ($0.0001$) & 80.13 & 86.34 & 92.57 \\
\hline
\end{tabular}
\caption{Verification \% on the IJB-A Janus 1:1 verification protocol. $l2$-Cons SM* indicates the result reported in \cite{ranjan2017l2} which uses a 101 layer ResNet/ResNext architecture.}
\label{tab_janus}
\end{table}
\begin{table}
\hfill
\centering
\begin{tabular}{l c c c c}
\hline\hline
Method & $10^{-6}$ & $10^{-5}$ & $10^{-4} $ & $10^{-3}$ \\
\hline
Bodla \emph{et. al.} Final1 \cite{bodla2017deep} & - & - & 69.81 & 82.89 \\
Bodla \emph{et. al.} Final2 \cite{bodla2017deep} & - & - & 68.45 & 82.97 \\
Lin \emph{et. al.} \cite{lin2017proximity} & - & - & 72.52 & 83.55 \\
\hline
\hline
SM & 6.16 & 42.03 & 64.52 & 80.86 \\
$l2$-Cons SM (30) \cite{ranjan2017l2}& 24.47 & 52.32 & 73.36 & 87.46 \\
$l2$-Cons SM (20) \cite{ranjan2017l2}& 21.14 & 48.82 & 68.84 & 85.34 \\
$l2$-Cons SM (10) \cite{ranjan2017l2}& 13.28 & 36.08 & 57.80 & 78.36 \\
SM + CL \cite{wen2016discriminative} & 2.88 & 20.87 & 65.71 & 84.55 \\
SF \cite{liu2017sphereface} & 28.51 & 63.92 & 82.29 & 90.58 \\
SF + CL \cite{wen2016discriminative, liu2017sphereface} & 28.99 & 53.36 & 72.91 & 86.14 \\
\hline
SM + R ($0.01$) & 25.17 & 52.60 & 73.56 & 87.50 \\
SM + R ($0.001$) & 26.62 & 54.13 & 74.56 & 87.93 \\
SM + R ($0.0001$) & 17.35 & 50.65 & 71.06 & 85.48 \\
\hline
SF + R ($0.03$) & 27.27 & 56.84 & 76.97 & 88.75 \\
SF + R ($0.01$) & \textbf{ 35.18 } & \textbf{65.02} &\textbf{ 82.74 } & \textbf{90.99 } \\
SF + R ($0.001$) & 32.19 & 63.13 & 81.62 & 90.17 \\
SF + R ($0.0001$) & 32.01 & 63.12 & 81.57 & 90.24 \\
\hline
\end{tabular}
\caption{Verification \% on the Janus CS3 1:1 verification protocol. }
\label{tab_cs3}
\end{table}
\textbf{Exp 5. Testing Benchmark: CFP Frontal vs. Profile. } Recently the CFP (Celebrities Frontal-Profile) dataset was released to evaluate algorithms exclusively on frontal versus profile matches \cite{sengupta2016frontal}. This small dataset has about 7,000 pairs of matches defined with 3,500 same pairs and 3,500 not-same pairs for about 500 different subjects. For sample images please refer to Fig. 1 of \cite{sengupta2016frontal}. The dataset presents a challenge since each of the probe images is almost entirely profile thereby presenting extreme pose along with illumination and expression challenges.
\textbf{Result: CFP Frontal vs. Profile.} Fig.~\ref{fig_cfp} showcases the ROC curves for this experiment whereas Table.~\ref{tab_megaface} shows the verification rates at $10^{-3}$ FAR. Ring loss (\textbf{87.43\%}) provides consistent and significant boost in performance over Softmax (55.86\%). We find however, SphereFace required more careful tuning of $\lambda$ with $\lambda=0.01$ (\textbf{90.94\%}) outperforming the baseline. Further, Softmax and Ring loss with $\lambda=0.01$ significantly outperforms all runs for $l_2$-constrained Softmax \cite{ranjan2017l2} (83.69). Thus, Ring loss helps in providing higher verification rates while dealing with frontal to highly off-angle matches thereby explicitly demonstrating robustness to pose variation.
\textbf{Exp 6. Low Resolution Experiments on Janus CS3. } One of the main motivations for $l_2$-constrained Softmax was to handle images with varying resolution. Low resolution images were found to result in low norm features and vice versa. Ranjan \emph{et.al.} \cite{ranjan2017l2} argued normalization (through $l_2$-constrained Softmax) would help deal with this issue. In order to test the efficacy of our alternate convex normalization formulation towards handling low resolution faces, we synthetically downsample Janus CS3 from an original size of ($112\times 96$) by a factor of 4x, 16x, 25x, 36x and 64x respectively (images were downsampled and resized back up using bicubic interpolation in order to fit the model). We run the Janus CS3 protocol and plot the ROC curves in Fig.~\ref{fig_scale2}. We find that the Ring loss helps Softmax features be more robust to resolution. Though $l_2$-constrained Softmax provides improvement over Softmax, it's performance is lower than Ring loss. Further, at extremely high downsampling of 64x, $l_2$-constrained Softmax in fact performs worse than Softmax, whereas Ring loss provides a clear improvement. Center loss fails early on at 16x. We therefore find that our simple convex soft normalization approach is more effective at arresting performance drop due to resolution in accordance with the motivation for as normalization presented in \cite{ranjan2017l2}.
\textbf{Conclusion.} We motivate feature normalization in a principled manner and develop an elegant, simple and straight forward to implement convex approach towards that goal. We find that Ring loss consistently provides significant improvements over a large range of the hyperparameter $\lambda$. Further, it helps the network itself to learn normalization thereby being robust to a large range of degradations.
{\small
\bibliographystyle{ieee}
| {'timestamp': '2018-03-02T02:04:09', 'yymm': '1803', 'arxiv_id': '1803.00130', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00130'} | arxiv |
\section{Introduction}
With advancements in sensor technology, heterogeneous sets of data
containing scalars, waveform signals, images, etc. are more and more
available. For example, in semiconductor manufacturing, machine/process
settings (scalar variables), sensor readings in chambers (waveform
signals), and wafer shape measurements (images) may be collected to
model and monitor the process. In this article, we refer to non-scalar
variables as high-dimensional (HD) variables. Analysis and evaluation
of such heterogeneous data sets can benefit many applications, including
manufacturing processes \citep{szatvanyi2006multivariate,wojcik2009combustion},
food industries \citep{yu2003multivariate}, medical decision-making
\citep{bellon1995experimental}, and structural health monitoring
\citep{balageas2010structural}. Specifically, analysis of such data
may lead to the construction of a statistical model that estimates
a variable (including HD) based on several other variables (regression
model). Unfortunately, most works in regression modeling only consider
scalars and waveform signals \citep{liang2003relationship,Ramsay2005,fan2014functional,luo2017function},
without including images or structured point clouds. However, in several
applications, images or structured point clouds are available. For
example, materials scientists are interested in constructing a link
between process variables, e.g., the temperature and pressure under
which a material is operating, and the microstructure of the material
\citep{khosravani2017development}, which is often represented by
an image or a variation of the microstructure image obtained by two-point
statistics. Generating such a linkage model requires regression analysis
between scalar and waveform process variables as inputs and an image.
For more detailed information and a case study, please refer to \citep{Gorgannejad2018}.
As another example, in semiconductor manufacturing, overlay errors
(defined as the difference between in-plane displacements of two layers
of a wafer) are directly influenced by the shape of the wafer before
the lithographic process. In this process, both the wafer shape and
the overlay error (in the \textit{x} and \textit{y} directions) can
be represented as images as shown in Figure \ref{fig:Examples-of-wafer-shape-overlay-1}.
Prediction of the overlay error across a wafer based on the wafer
shape can be fed forward to exposure tools for specific corrections
\citep{turner2013role}. In order to predict the overlay error based
on the wafer shape deformation, an image-on-image statistical model
is required to capture the correlation between the wafer overlay and
shape.
\begin{figure}
\begin{centering}
\subfloat[\label{fig:waferShape-1}]{\includegraphics[width=0.4\columnwidth]{Figures/waferShape2}}\subfloat[\label{fig:overlayError-1}]{\includegraphics[width=0.4\columnwidth]{Figures/ovl_err_example2}
}
\par\end{centering}
\caption{Examples of the (a) wafer shape and (b) x coordinate overlay error.
All measurements are in millimeters (mm). The wafer in (a) has an
overall bow shape, with several high-order wave-form patterns that
cannot be seen. Figure (b) represents the misalignment of two layers
in the x coordinate. The dark blue represents a large error in the
negative direction of the x coordinate, and light yellow represents
a large error in the positive direction of the x coordinate. \label{fig:Examples-of-wafer-shape-overlay-1}}
\end{figure}
In addition to the space and computational issues caused by the large
size of the HD variables, the challenge of developing an accurate
model for a process with a heterogeneous group of variables is twofold:
Integrating variables of different forms (e.g., scalars, images, curves)
while capturing their ``within'' correlation structure. Mishandling
this challenge can lead to an overfitted, inaccurate model. The regular
regression approach that considers each observation within an HD variable
as an independent predictor excessively increases the number of covariates
in comparison to the sample size ($p\gg n$) and ignores the correlation
between the observations. Consequently, this method may cause severe
overfitting and produce inaccurate predictions. Principle component
regression (PCR) alleviates the problem by first reducing the dimension
of both the input variables and the output. Nevertheless, PCR fails
to exploit the structure of images or point clouds\textbf{.} Furthermore,
PCR determines the principle components (PCs) of the inputs and the
outputs separately from each other without considering the interrelationship
between them. Functional data analysis, specifically the functional
regression model (FRM), has become popular in recent years due to
its built-in data reduction functionality and its ability to capture
nonlinear correlation structures \citep{liang2003relationship,Ramsay2005,yao2005functional,fan2014functional,ivanescu2015penalized,luo2017function}.
However, FRM requires a set of basis functions that is usually specified
based on domain knowledge rather than a data-driven approach. Recently,
\citet{luo2017function} proposed an approach that can combine several
profiles and scalars to predict a curve, while learning the bases
that span the input and output spaces. Nevertheless, it is not clear
how to extend this approach to other forms of data effectively.
In the past few years, multilinear algebra (and, in particular, tensor
analysis) has shown promising results in many applications from network
analysis to process monitoring \citep{sun2006window,sapienza2015detecting,yan2015image}.
Nevertheless, only a few works in the literature use tensor analysis
for regression modeling. \citet{zhou2013tensor} has successfully
employed tensor regression using PARAFAC/CANDECOMP\textbf{ }(CP) decomposition
to estimate a scalar variable based on an image input. The CP decomposition
approximates a tensor as a sum of several rank-1 tensors \citep{kiers2000towards}.
\citet{zhou2013tensor} further extended their approach to a generalized
linear model for tensor regression in which the scalar output follows
any exponential family distribution. \citet{li2013tucker} performed
tensor regression with scalar output using Tucker decomposition. Tucker
decomposition is a form of higher order PCA that decomposes a tensor
into a core tensor multiplied by a matrix along each mode \citep{tucker1963implications}.
CP decomposition is a special case of Tucker decomposition that assumes
the same rank for all the basis matrices. \citet{yan20173DPoint}
performed the opposite regression and estimated point cloud data using
a set of scalar process variables. Recently, \citet{lock2017tensor}
developed a tensor-on-tensor regression (TOT) approach that can estimate
a tensor using a tensor input while learning the decomposition bases.
However, several limitations in TOT should be addressed. First, TOT
uses CP decomposition, which restricts both the input and output bases
to have exactly the same rank (say, $R$). This restriction may cause
over- or under-estimation when the input and the output have different
ranks. For example, when estimating an image based on few scalar inputs,
the rank of the output can be far larger than the input matrix. Second
and more importantly, this approach can only take into account a single
tensor input and cannot be used effectively when multiple sources
of input data with different dimensions and forms (e.g., a combination
of scalar, curve, and image data) are available. The extension of
TOT to multiple tensor inputs generates a significant challenge due
to the first limitation previously mentioned. Because the output and
the inputs should have the same rank, extending the TOT approach to
multiple tensor inputs as well requires all the inputs to have the
same rank (which is equal to the rank of the output). However, this
means that in certain situations, such as when scalar and image inputs
exist, one of the inputs should take the rank of the other, causing
a severe underfitting or overfitting problem. One approach to allow
multiple forms of data in TOT is to combine all the data into one
single input tensor, e.g., an image and scalar input being merged
by transforming each scalar value into a constant image. However,
this approach generates a few issues: First, it significantly increases
the size of the data, and second, it masks the separate effect of
each input on the output due to the fusion of inputs. Furthermore,
in situations in which the dimension of modes does not match (for
example, a curve input with 60 observed points and an image of size
50x50), merging data into one tensor requires a method for dimension
matching. Finally, the TOT approach fails to work on tensors of moderate
size (e.g., on the image data of size 20000 pixels used in our case
study) due to its high space complexity.
The overarching goal of this paper is to overcome the limitations
of the previous methods, such as PCR, FRMs, and TOT, by constructing
a unified regression framework that estimates a scalar, curve, image,
or structured point cloud based on a heterogeneous set of (HD) input
variables. This will be achieved by representing the output and each
group of input variables as separate tensors and by developing a multiple
tensor-on-tensor regression (MTOT). To avoid overfitting and estimating
a large number of parameters, we perform Tucker decomposition on each
group of inputs' parameters using one set of bases to expand each
of the input spaces and another set of bases to span the output space.
We obtain the input bases by performing Tucker decomposition on the
input tensors, then define a least square loss function to estimate
the decomposition coefficients and output bases. To ensure uniqueness,
we impose an orthonormality constraint over the output bases when
minimizing the loss function and show a closed-form solution for both
the bases and the decomposition coefficient in each iteration of our
algorithm. This approach not only performs dimension reduction similar
to PCR, but it also learns the output bases in accordance with the
input space. Furthermore, the use of tensors to represent the data
preserves the structure of an image or structured point cloud.
The rest of the article is organized as follows: In Section \ref{sec:Tensor-Notation},
we introduce notations and the multilinear algebra concepts used in
the paper. In Section \ref{sec:Tensor-on-Tensor}, we formulate the
multiple tensor-on-tensor regression model and illustrate the closed-form
solution for estimating the parameters. In Section \ref{sec:Performance-Evaluation-Simulation},
we describe four simulation studies. The first simulation study combines
a profile and scalar data to estimate a profile output. This simulation
study is particularly considered to compare MTOT to the available
methods in functional regression. The second and third simulation
studies contain images or point clouds either as the input or output.
The fourth simulation considers estimating a nonsmooth profile using
a set of scalar inputs. In each simulation study, we compare the performance
of the proposed method with benchmarks in terms of (standardized)
mean square prediction errors (MSPE). A case study on predicting the
overlay errors based on the wafer shape is conducted in Section \ref{sec:Case-Study}.
Finally, we summarize the paper in Section \ref{sec:Conclusion}.
\section{Tensor Notation and Multilinear Algebra \label{sec:Tensor-Notation}}
In this section, we introduce the notations and basic tensor algebra
used in this paper. Throughout the paper, we denote a scalar by a
lower or upper case letter, e.g., $a$ or $A$; a vector by a boldface
lowercase letter and a matrix by a boldface uppercase letter, e.g.,
$\boldsymbol{a}$ and $\mathbf{A}$; and a tensor by a calligraphic
letter, e.g., $\mathcal{A}$. For example, we denote an order-$n$
tensor by $\mathcal{R\in\mathbb{R}}^{I_{1}\times I_{2}\times\cdots\times I_{n}}$,
where $I_{i}$ is the dimension of the $i^{th}$ mode of tensor $\mathcal{R}$.
We also denote a mode-$j$ matricization of tensor $\mathcal{R}$
as $\boldsymbol{R}_{\left(j\right)}\in\mathcal{\mathbb{R}}^{I_{j}\times I_{-j}}$,
whose columns are the mode-$j$ fibers of the corresponding tensor
$\mathcal{R}$, and $I_{-j}=I_{1}\times I_{2}\times\cdots\times I_{j-1}\times I_{j+1}\times\cdots\times I_{n}$.
We also define a more general matricization of a tensor $\mathcal{T}\in\mathbb{R}^{P_{1}\times\cdots\times P_{l}\times Q_{1}\times\cdots\times Q_{d}}$
as follows: Let $\mathbb{I}=\left\{ I_{1},I_{2},\cdots,I_{l}\right\} $
and $\mathbb{Q}=\left\{ Q_{1},Q_{2},\cdots,Q_{d}\right\} $ be two
sets that partition the set $\left\{ I_{1},I_{2},\cdots,I_{l},Q_{1},Q_{2},\cdots,Q_{d}\right\} $,
which contains the dimensions of the modes of the tensor $\mathcal{\mathcal{T}}$.
Then, the matricized tensor is specified by $\boldsymbol{T}_{\left(\mathbb{I}\times\mathbb{Q}\right)}\in\mathbb{R}^{P\times Q}$,
where $P=\prod_{i=1}^{l}P_{i}$ and $Q=\prod_{i=1}^{d}Q_{i}$, and
\[
\left(\boldsymbol{T}_{\left(\mathbb{I}\times\mathbb{Q}\right)}\right)_{ij}=\mathcal{T}_{p_{1}\cdots p_{l}q_{1}\cdots q_{d}},
\]
where $i=1+\sum_{r=1}^{l}\prod_{n=1}^{r}P_{n}\left(p_{n}-1\right)$
and $j=1+\sum_{r=1}^{d}\prod_{n=1}^{r}Q_{n}\left(q_{n}-1\right)$.
For simplicity of notation, we will denote $\boldsymbol{T}_{\left(\mathbb{I}\times\mathbb{Q}\right)}$
as \textbf{$\boldsymbol{T}$}.
The Frobenius norm of a tensor $\mathcal{R}$ can be defined as the
Frobenius norm of any matricized tensor, e.g., $||\mathcal{R}||_{F}^{2}=||\boldsymbol{R}_{(1)}||_{F}^{2}$.
The mode-$j$ product of a tensor $\mathcal{R}$ by a matrix $\boldsymbol{A}\in\mathbb{R}^{L\times I_{j}}$
is a tensor in $\mathcal{\mathbb{R}}^{I_{1}\times I_{2}\times\cdots\times I_{j-1}\times L\times I_{j+1}\times\cdots\times I_{n}}$
and is defined as
\[
\left(\mathcal{R}\times_{j}\boldsymbol{A}\right)_{i_{1},i_{2},\cdots,i_{j-1},l,i_{j+1},\cdots,i_{K}}=\sum_{i_{j}=1}^{I_{j}}\mathcal{R}_{i_{1},\cdots,i_{j},\cdots,i_{K}}\boldsymbol{A}_{l,i_{j}}.
\]
The Tucker decomposition of a tensor $\mathcal{R}$ decomposes the
tensor into a core tensor $\mathcal{C}\in\mathbb{R}^{P_{1}\times P_{2}\times\cdots\times P_{n}}$
and $n$ orthogonal matrices $\boldsymbol{U}_{i}\in\mathbb{R}^{I_{i}\times P_{i}}\,\left(i=1,2,\cdots,n\right)$
so that $\mathcal{R}=\mathcal{C}\times_{1}\boldsymbol{U}_{1}\times_{2}\boldsymbol{U}_{2}\times_{3}\cdots\times_{n}\boldsymbol{U}_{n}$.
The dimensions of the core tensor $\mathcal{C}$ is smaller than $\mathcal{A}$,
i.e., $P_{j}\leq I_{j}\,\left(j=1,2,\cdots,n\right)$. Furthermore,
the Kronecker product of two matrices $\boldsymbol{A}\in\mathbb{R}^{m\times n}$
and $\boldsymbol{B}\in\mathbb{R}^{r\times s}$ is denoted as $\boldsymbol{A}\otimes\boldsymbol{B}\in\mathbb{R}^{mr\times ns}$
and is obtained by multiplying each element of matrix $\boldsymbol{A}$
to the entire matrix $\boldsymbol{B}$:
\[
\boldsymbol{A}\otimes\boldsymbol{B}=\left[\begin{array}{ccc}
a_{11}\boldsymbol{B} & ... & a_{1n}\boldsymbol{B}\\
\vdots & \ddots & \vdots\\
a_{m1}\boldsymbol{B} & ... & a_{mn}\boldsymbol{B}
\end{array}\right].
\]
We link the tensor multiplication with the Kronecker product using
the Proposition \ref{prop:proposition1}.
\begin{prop}
\label{prop:proposition1}Let $\boldsymbol{U}_{i}\in\mathbb{R}^{P_{i}\times\tilde{P_{i}}}\left(i=1,\cdots,l\right)$
and $\boldsymbol{V}_{i}\in\mathbb{R}^{Q_{i}\times\tilde{Qi}}\,\left(i=1,\cdots,d\right)$,
and let $\mathcal{T}\in\mathbb{R}^{P_{1}\times\cdots\times P_{l}\times Q_{1}\times\cdots\times Q_{d}}$
and $\mathcal{C}\mathbb{\in R}^{\tilde{P_{1}}\times\cdots\times\tilde{P_{l}}\times\tilde{Q_{1}}\times\cdots\times\tilde{Q}_{d}}$,
then
\begin{align*}
& \mathcal{T}=\mathcal{C}\times_{1}\boldsymbol{U}_{1}\times\boldsymbol{U}_{2}\times_{3}\cdots\times_{l}\boldsymbol{U}_{l}\times_{l+1}\boldsymbol{V}_{1}\times_{l+2}\cdots\times_{l+d}\boldsymbol{V}_{d}\iff\\
& \boldsymbol{T}=\left(\boldsymbol{U}_{l}\otimes\boldsymbol{U}_{l-1}\otimes\cdots\otimes\boldsymbol{U}_{1}\right)\boldsymbol{C}\left(\boldsymbol{V}_{d}\otimes\boldsymbol{V}_{d-1}\otimes\cdots\otimes\boldsymbol{V}_{1}\right)^{\mathtt{T}},
\end{align*}
where $\boldsymbol{C}\in\mathbb{R}^{\tilde{P}\times\tilde{Q}}$ is
an unfold of the core tensor $\mathcal{C}$ with $\tilde{P}=\prod_{j=1}^{l}\tilde{P_{j}}$
and $\tilde{Q}=\prod_{j=1}^{d}\tilde{Q}_{j}$.
\end{prop}
The proof of this proposition can be found in \citep{kolda2006multilinear}.
Finally, the contraction product of two tensors $\mathcal{B}\in\mathbb{R}^{P_{1}\times\cdots\times P_{l}\times Q_{1}\times\cdots\times Q_{d}}$
and $\mathcal{X}\in\mathbb{R}^{P_{1}\times\cdots\times P_{l}}$ is
denoted as $\mathcal{X}*\mathcal{B}\in\mathbb{R}^{Q_{1}\times\cdots\times Q_{d}}$
and is defined as
\[
\left(\mathcal{X}*\mathcal{B}\right)_{q_{1}\cdots q_{d}}=\sum_{p_{1},\cdots,p_{l}}\mathcal{X}_{p_{1},\cdots,p_{l}}\mathcal{B}_{p_{1},\cdots,p_{l},q_{1},\cdots,q_{d}}.
\]
\section{Multiple Tensor-on-Tensor Regression Framework \label{sec:Tensor-on-Tensor}}
In this section, we introduce the multiple tensor-on-tensor (MTOT)
framework as an approach for integrating multiple sources of data
with different dimensions and forms to model a process. Assume a set
of training data of size $M$ is available and includes response tensors
$\mathcal{Y}_{i}\in\mathbb{R}^{Q_{1}\times\cdots\times Q_{d}}\,\left(i=1,\cdots,M\right)$
and input tensors $\mathcal{X}_{ji}\in\mathbb{R}^{P_{j1}\times\cdots\times P_{jl_{j}}}\,\left(i=1,\cdots,M;\,j=1,\cdots,p\right)$,
where $p$ is the number of inputs. The goal of MTOT is to model the
relationship between the input tensors and the response using the
linear form
\begin{equation}
\mathcal{Y}_{i}=\sum_{j=1}^{p}\mathcal{X}_{ji}*\mathcal{B}_{j}+\mathcal{E}_{i},\,i=1,\cdots M,\label{eq:simple regression-1}
\end{equation}
where $\mathcal{B}_{j}\in\mathbb{R}^{P_{j1}\times\cdots\times P_{jl_{j}}\times Q_{1}\times\cdots\times Q_{d}}$
is the model parameter to be estimated and $\mathcal{E}_{i}$ is an
error tensor whose elements are from a random process. To achieve
a more compact representation of the model (\ref{eq:simple regression-1}),
we can combine tensors $\mathcal{Y}_{i}$, $\mathcal{X}_{ji}$, and
$\mathcal{E}_{i}$ $\left(i=1,\cdots,M\right)$ into one-mode larger
tensors $\mathcal{Y}\in\mathbb{R}^{M\times Q_{1}\times\cdots\times Q_{d}}$,
$\mathcal{X}_{j}\in\mathbb{R}^{M\times P_{j1}\times P_{j2}\times\cdots\times P_{jl_{j}}}\,\left(j=1,2,\cdots,p\right)$,
and $\mathcal{E}\in\mathbb{R}^{M\times Q_{1}\times\cdots\times Q_{d}}$
and write
\begin{equation}
\mathcal{Y}=\sum_{j=1}^{p}\mathcal{X}_{j}*\mathcal{B}_{j}+\mathcal{E}.\label{eq:multipleTensorRegressionFormula}
\end{equation}
The matricization of (\ref{eq:multipleTensorRegressionFormula}) gives
\begin{equation}
\boldsymbol{Y}_{\left(1\right)}=\sum_{j=1}^{p}\boldsymbol{X}_{j\left(1\right)}\boldsymbol{B}_{j}+\boldsymbol{E}_{\left(1\right)},\label{eq:multiple regression matricization}
\end{equation}
where $\boldsymbol{Y}_{\left(1\right)}$ and $\boldsymbol{X}_{j\left(1\right)}$
are mode-1 unfolding of tensors $\mathcal{Y}$ and $\mathcal{X}_{j}$,
respectively, and the first mode corresponds to the sample mode. $\boldsymbol{B}_{j}\in\mathbb{R}^{P_{j}\times Q}$
is an unfold of tensor $\mathcal{B}_{j}$ with $P_{j}=\prod_{k=1}^{l_{j}}P_{jk}$
and $Q=\prod_{k=1}^{d}Q_{k}$. It is intuitive that the parameters
of (\ref{eq:multiple regression matricization}) can be estimated
by minimizing the mean squared loss function $L=||\boldsymbol{Y}_{\left(1\right)}-\sum_{j=1}^{p}\boldsymbol{X}_{j\left(1\right)}\boldsymbol{B}_{j}||_{F}^{2}$.
However, this requires estimating $\sum_{j=1}^{p}\prod_{i=1}^{l_{j}}P_{ji}\prod_{k=1}^{d}Q_{k}$
parameters. For example, in the situation in which\textbf{ }$p=1$,
minimizing the loss function gives a closed-form solution $\hat{\boldsymbol{B}}=\left(\boldsymbol{X}_{\left(1\right)}^{\mathtt{T}}\boldsymbol{X}_{\left(1\right)}\right)^{-1}\boldsymbol{X}_{\left(1\right)}^{\mathtt{T}}\boldsymbol{Y}_{\left(1\right)}$
that requires estimating $\prod_{i=1}^{l}P_{i}\prod_{j=1}^{d}Q_{j}$
parameters. Estimating such a large number of parameters is prone
to severe overfitting and is often intractable. In reality, due to
the structured correlation between $\mathcal{X}_{j}$ and $\mathcal{Y}$,
we can assume that the parameter $\mathcal{B}_{j}$ lies in a much
lower dimensional space and can be expanded using a set of basis matrices
via a tensor product. That is, for each $\mathcal{B}_{j}\,\left(j=1,\cdots,p\right)$,
we can write
\begin{equation}
\mathcal{B}_{j}=\mathcal{C}_{j}\times_{1}\boldsymbol{U}_{j1}\times_{2}\boldsymbol{U}_{j2}\times_{3}\cdots\times_{l_{j}}\boldsymbol{U}_{jl_{j}}\times_{l_{j}+1}\boldsymbol{V}_{1}\times_{l_{j}+2}\cdots\times_{l_{j}+d}\boldsymbol{V}_{d},\label{eq:MR-parameter expansion}
\end{equation}
where $\mathcal{C}_{j}\mathbb{\in R}^{\tilde{P_{j1}}\times\cdots\times\tilde{P_{jl_{j}}}\times\tilde{Qi}\times\cdots\times\tilde{Q}_{d}}$
is a core tensor with $\tilde{P_{ji}}\ll P_{ji}\,\left(j=1,\cdots,p;\,i=1,\cdots l_{j}\right)$
and $\tilde{Q}_{i}\ll Q_{i}\,\left(i=1,\cdots,d\right)$; $\left\{ \boldsymbol{U}_{ji}:j=1,\cdots p;\,i=1,\cdots,l_{j}\right\} $
is a set of bases that spans the $j^{th}$ input space; and $\left\{ \boldsymbol{V}_{i}:\,i=1,\cdots,d\right\} $
is a set of bases that spans the output space. With this low-dimensional
representation, the estimation of $\mathcal{B}_{j}$ reduces to learning
the core tensor $\mathcal{C}_{j}$ and the basis matrices $\boldsymbol{U}_{ji}$
and $\boldsymbol{V}_{i}$. In this paper, we allow $\boldsymbol{U}_{ji}$
to be learned directly from the input spaces. Two important choices
of $U_{ji}$ are truncated identity matrices (i.e., no transformation
on the inputs) or the bases obtained from Tucker decomposition of
the input tensor $\mathcal{X}_{j}$, i.e.,
\[
\left\{ \mathcal{D}_{j},\boldsymbol{U}_{j1},\cdots,\boldsymbol{U}_{jl_{j}}\right\} =\arg\min_{\mathcal{D}_{j},\left\{ \boldsymbol{U}_{ji}\right\} }\left|\left|\mathcal{X}_{j}-\mathcal{D}_{j}\times_{1}\boldsymbol{U}_{j1}\times\cdots\times_{l_{j}}\boldsymbol{U}_{jl}\right|\right|_{F}^{2}.
\]
In a special case that an input tensor is a matrix, the bases are
the principle components (PCs) of that input if one uses Tucker decomposition.
Allowing $\boldsymbol{U}_{ji}\,\left(j=1,\cdots,p;\,i=1,\cdots l_{j}\right)$
to be selected is reasonable because $\mathcal{X}_{j}$ is an independent
variable, and its basis matrices can be obtained separately from the
output space. Furthermore, learning the core tensors $\mathcal{C}_{j}\,\left(j=1,\cdots,p\right)$
and the bases $\boldsymbol{V}_{i}\,\left(i=1,\cdots,d\right)$ provides
a sufficient degree of freedom to learn $\mathcal{B}_{j}$. Next,
we iteratively estimate the core tensors $\mathcal{C}_{j}$ and the
basis matrices $\boldsymbol{V}_{i}$ by solving the following optimization
problem:
\begin{align}
& \left\{ \mathcal{C}_{j},\boldsymbol{V}_{1},\cdots,\boldsymbol{V}_{d}\right\} =\arg\min\left|\left|\boldsymbol{Y}_{\left(1\right)}-\sum_{j=1}^{p}\boldsymbol{X}_{j\left(1\right)}\boldsymbol{B}_{j}\right|\right|_{F}^{2},\,s.t.\nonumber \\
& \mathcal{B}_{j}=\mathcal{C}_{j}\times_{1}\boldsymbol{U}_{j1}\times_{2}\boldsymbol{U}_{j2}\times_{3}\cdots\times_{l_{j}}\boldsymbol{U}_{jl_{j}}\times_{l_{j}+1}\boldsymbol{V}_{1}\times_{l_{j}+2}\cdots\times_{l_{j}+d}\boldsymbol{V}_{d},\nonumber \\
& \boldsymbol{V}_{i}^{\mathtt{T}}\boldsymbol{V}_{i}=I_{\tilde{Qi}}\,\left(i=1,\cdots,d\right),\label{eq:multipleTOT-objectiveFunction}
\end{align}
where $\boldsymbol{I}_{\tilde{Qi}}$ is a $\tilde{Qi}\times\tilde{Qi}$
identity matrix. The first constraint ensures that the tensor of parameters
is low-rank, and the orthogonality constraint $\boldsymbol{V}_{i}^{\mathtt{T}}\boldsymbol{V}_{i}=\boldsymbol{I}_{\tilde{Qi}}$
ensures the uniqueness of both the bases and the core tensors when
the problem is identifiable. In general, the problem of estimating
functional data through a set of functions may not be identifiable
under some conditions. That is, assuming $p=1$, one can find $\boldsymbol{B}\neq\overline{\boldsymbol{B}}$,
such that $\boldsymbol{B}X=\overline{\boldsymbol{B}}X$, i.e., $\boldsymbol{B}$
and $\overline{\boldsymbol{B}}$ both estimate same mean value for
the output. \citet{he2000extending,chiou2004functional,lock2017tensor}
discuss the identifiability problem in functional and tensor regression.
Because the main purpose of this paper is to estimate and predict
the output, we do not discuss the identifiability issue here, as learning
any correct set of parameters $\left\{ \boldsymbol{B}_{k}:\,k=1,\cdots,p\right\} $
will eventually lead to the same estimation of the output.
In order to solve (\ref{eq:multipleTOT-objectiveFunction}), we combine
the alternating least square (ALS) approach with the block coordinate
decent (BCD) method (designated by ALS-BCD). The advantages of ALS
algorithms that lead to their widespread use are conceptual simplicity,
noise robustness, and computational efficiency \citep{sharan2017orthogonalized}.
In tensor decomposition and regression, due to the non-convex nature
of the problem, finding the global optimum is often intractable, and
it is well-known that the ALS algorithm also has no global convergence
guarantee and may be trapped in a local optima \citep{kolda2006multilinear,sharan2017orthogonalized}.
However, ALS has shown great promise in the literature for solving
tensor decomposition and regression applications with satisfying results.
To be able to employ ALS-BCD, we first demonstrate Proposition \ref{prop:MR-core tensor estimate}:
\begin{prop}
\label{prop:MR-core tensor estimate}When $\boldsymbol{U}_{ki}\,\left(k=1,\cdots,p;\,i=1,2,\cdots,l_{j}\right)$
,$\boldsymbol{V}_{i}\,\left(i=1,2,\cdots,d\right)$, and $\text{\ensuremath{\mathcal{C}}}_{k}\,\left(k\neq j\right)$
are known, a reshaped form of the core tensor $\text{\ensuremath{\mathcal{C}}}_{j}$
can be estimated as
\begin{equation}
\text{\ensuremath{\mathcal{\tilde{C}}}}_{j}=\mathcal{R}_{j}\times_{1}\left(\boldsymbol{Z}_{j}^{\mathtt{T}}\boldsymbol{Z}_{j}\right)^{-1}\boldsymbol{Z}_{j}^{\mathtt{T}}\times_{2}\left(\boldsymbol{V}_{1}^{\mathtt{T}}\boldsymbol{V}_{1}\right)^{-1}\boldsymbol{V}_{1}^{\mathtt{T}}\times_{3}\left(\boldsymbol{V}_{2}^{\mathtt{T}}\boldsymbol{V}_{2}\right)^{-1}\boldsymbol{V}_{2}^{\mathtt{T}}\cdots\times_{d+1}\left(\boldsymbol{V}_{d}^{\mathtt{T}}\boldsymbol{V}_{d}\right)^{-1}\boldsymbol{V}_{d}^{\mathtt{T}},\label{eq:SolutionToRegression-1}
\end{equation}
where $\boldsymbol{Z}_{j}=\boldsymbol{X}_{j\left(1\right)}(\boldsymbol{U}_{jl}\otimes\boldsymbol{U}_{jl-1}\otimes\cdots\otimes\boldsymbol{U}_{j1})$
and $\mathcal{R}_{j}=\mathcal{Y}-\sum_{i\neq j}^{p}\mathcal{B}_{j}*\mathcal{X}_{j}$.
Note that $\text{\ensuremath{\mathcal{\tilde{C}}}}_{j}$ has fewer
modes ($d+1$) than the original core tensor $\mathcal{C}_{j}$ in
(\ref{eq:MR-parameter expansion}), but it can be transformed into
$\mathcal{C}$ by a simple reshape operation.
\end{prop}
The simplified proof of this proposition is given in Appendix A. Furthermore,
if $\boldsymbol{V}_{i}$s are orthogonal, the core tensor can be obtained
efficiently by the tensor product as
\[
\text{\ensuremath{\mathcal{\tilde{C}}}}_{j}=\mathcal{R}_{j}\times_{1}\left(\boldsymbol{Z}_{j}^{\mathtt{T}}\boldsymbol{Z}_{j}\right)^{-1}\boldsymbol{Z}_{j}^{\mathtt{T}}\times_{2}\boldsymbol{V}_{1}^{\mathtt{T}}\times_{3}\boldsymbol{V}_{2}^{\mathtt{T}}\cdots\times_{d+1}\boldsymbol{V}_{d}^{\mathtt{T}}.
\]
Note that in the situations in which sparsity of the core tensor is
of interest, one can include a lasso penalty over the core tensor,
and use numerical algorithms (e.g., Iterative Shrinkage-Thresholding
Algorithm \citep{beck2009fast}) to solve the problem. Furthermore,
one can estimate the basis matrices $V_{i}$ as follows:
\begin{prop}
\label{prop:MR-basis estimate}With known $\mathcal{C}_{j}$, $\boldsymbol{U}_{ji}$,
and $\boldsymbol{V}_{k}\,\left(k\neq i\right)$, we can solve $\boldsymbol{V}_{i}$
by
\[
\boldsymbol{V}_{i}=\boldsymbol{R}\boldsymbol{W}^{\mathtt{T}},
\]
where $\boldsymbol{R}$ and $\boldsymbol{W}$ are obtained from the
singular value decomposition of $\boldsymbol{Y}_{\left(i\right)}\boldsymbol{S}^{\mathtt{T}}$,
where $\boldsymbol{S}=\sum_{j=1}^{p}\boldsymbol{S}_{j}$ and $\boldsymbol{S}_{j}=\tilde{\boldsymbol{C}}_{j\left(i\right)}\left(\boldsymbol{V}_{d}\otimes\cdots\otimes\boldsymbol{V}_{i+1}\otimes\boldsymbol{V}_{i-1}\cdots\otimes\boldsymbol{V}_{1}\otimes\boldsymbol{Z}_{j}\right)^{T}$;
and $\tilde{\boldsymbol{C}}_{j\left(i\right)}$ is the mode-i matricization
of tensor $\text{\ensuremath{\mathcal{\tilde{C}}}}_{j}$. Note that
$\boldsymbol{R}$ is truncated.
\end{prop}
The simplified proof of this proposition is shown in Appendix B. First
note that we do not require calculation of the Kronecker product $\boldsymbol{V}_{d}\otimes\cdots\boldsymbol{V}_{i+1}\otimes\boldsymbol{V}_{i-1}\otimes\boldsymbol{V}_{1}\otimes\boldsymbol{Z}$
explicitly to find $\boldsymbol{Y}_{\left(i\right)}\boldsymbol{S}^{\mathtt{T}}$.
In real implementation, we can use Proposition \ref{prop:proposition1}
to calculate the complete matrix using tensor products efficiently.
Second, unlike the principle component regression (PCR) in which the
principle components of the output are learned independent of the
inputs, the estimated basis matrices $\boldsymbol{V}_{i}\,\left(i=1,\cdots,d\right)$
directly depend on the input tensors, ensuring correlation between
the bases and inputs. By combining Propositions \ref{prop:MR-core tensor estimate}
and \ref{prop:MR-basis estimate}, Algorithm \ref{alg:MR-Estimation-procedure algorithm}
summarizes the estimation procedure for multiple tensor-on-tensor
regression. This algorithm, in fact, combines the block coordinate
decent (BCD) algorithm with the ALS algorithm.
\begin{algorithm}
\begin{algorithmic}[1]
\algdef{SE}[DOWHILE]{Do}{doWhile}{\algorithmicdo}[1]{\algorithmicwhile\ #1
\State{Initilize $\mathcal{C}_j$ for all $j$}
\State{Estimate $U_{ji}$ using Tucker decomposition of $\mathcal{X}_j$ for all $i$ and $j$}
\State{Initilize $V_i$ for all $i$}
\State{Compute $B_{j}$ for all $j$ and set $w_{0} =\left|\left|Y_{\left(1\right)}-\sum_{j=1}^{p}X_{j\left(1\right)}B_{j}\right|\right|_{F}^{2}$}
\Do
\State{Estimate $\mathcal{C}_j$ for all $j = 1: p$ using Proposition \ref{prop:MR-core tensor estimate}}
\State{Estimate $V_i$ for all $i = 1: d$ using Proposition \ref{prop:MR-basis estimate}}
\State{Compute $B_{j}$ for all $j$ and set $w_{k} =\left|\left|Y_{\left(1\right)}-\sum_{j=1}^{p}X_{j\left(1\right)}B_{j}\right|\right|_{F}^{2}$}
\doWhile{$|w_{k+1}-w_{k}| > \epsilon $}
\end{algorithmic}
\caption{Estimation procedure for multiple tensor-on-tensor regression \label{alg:MR-Estimation-procedure algorithm}}
\end{algorithm}
\subsection{Selection of tuning parameters}
The proposed approach requires the selection of the values $\tilde{P}_{ji}$~$\left(j=1,2,\cdots,p;i=1,2,\cdots,l_{j}\right)$
and $\tilde{Q}_{k}\,\left(k=1,\cdots,d\right)$. For simplicity and
practicality, we assume that for each predictor $\mathcal{X}_{j}$
and the response $\mathcal{Y}$, the rank is fixed, i.e., $\tilde{P}_{j1}=\tilde{P}_{j2}=\cdots=\tilde{P}_{jl_{j}}=\tilde{P}_{j}$
and $\tilde{Q}_{k}=\tilde{Q}$. As a result, we only need to select
$p+1$ parameters. For this purpose, we use the k-fold cross-validation
method on a $\left(p+1\right)$-D grid of parameters $\left(\tilde{P}_{1},\tilde{P}_{2},\cdots,\tilde{P}_{p},\tilde{Q}\right)$
and find the tuple of parameters that minimizes the mean squared error.
As a result, we should define a grid over the rank values. This is
achieved as following: First, we unfold each tensor $\mathcal{X}_{j}\,\left(j=1,2,\cdots,p\right)$
and $\mathcal{Y}$ along their first mode. Next, we find the rank
of each unfolded matrix, denoted as $R_{x_{1}},R_{x_{2}},\cdots,R_{x_{p}}$
and $R_{y}$. Then, for each $\mathcal{X}_{j}\,\left(j=1,2,\cdots,p\right)$
and $\mathcal{Y}$, we select the tuning parameters from $\mathcal{P}_{j}=\left\{ 1,\left\lceil \frac{R_{x_{j}}}{2^{log_{2}R_{x_{j}}-1}}\right\rceil ,\cdots\left\lceil \frac{R_{x_{j}}}{2^{2}}\right\rceil ,\left\lceil \frac{R_{x_{j}}}{2}\right\rceil ,R_{x_{j}}\right\} $
and $\mathcal{Q}=\left\{ 1,\left\lceil \frac{R_{y}}{2^{log_{2}R_{y}-1}}\right\rceil ,\cdots\left\lceil \frac{R_{y}}{2^{2}}\right\rceil ,\left\lceil \frac{R_{y}}{2}\right\rceil ,R_{y}\right\} $.
Next, for each tuple $\left(\tilde{P}_{1},\tilde{P}_{2},\cdots,\tilde{P}_{p},\tilde{Q}\right)\in\mathcal{P}_{1}\times\mathcal{P}_{2}\times\cdots\times\mathcal{P}_{p}\times\mathcal{Q}$,
we calculate the average sum square error (RSS) and take the one that
minimizes the RSS. For all studies in the next sections, we perform
five-fold CV.
\section{Performance Evaluation Using Simulation \label{sec:Performance-Evaluation-Simulation}}
This section contains two parts. In the first part, we only consider
curve-on-curve regression and compare our proposed method to the function-on-function
regression approach proposed by \citet{luo2017function}, designated
as \textit{sigComp}. The reason we compare our approach to sigComp
is that sigComp can handle multiple functional inputs (curves) and
learn the basis functions similar to our approach. In the second part,
we conduct a set of simulation studies to evaluate the performance
of the proposed method when the inputs or outputs are in the form
of images, structured point clouds, or curves with jumps. In this
part, we compare the proposed method with two benchmarks: 1) The first
benchmark is the TOT approach proposed by \citet{lock2017tensor},
which can roughly be viewed as a general form of sigComp. Because
this approach can only handle a single input tensor, when multiple
inputs exist we perform a transformation to merge the inputs into
one single tensor. 2) The second benchmark is based on principle component
regression (PCR) similar to a benchmark considered in \citep{fan2014functional}.
In this approach, we first matricize all the input and output tensors,
then perform principle component analysis to reduce the dimension
of the problem by computing the PCA scores of the first few principle
components that explain at least $v$ percent of the variation in
the data. Next, we perform linear regression between the low-dimensional
PC score of both inputs and output. More formally, let $\boldsymbol{X}_{j\left(1\right)}\in\mathbb{R}^{M\times P_{j}}$
and $\boldsymbol{Y}_{\left(1\right)}\in\mathbb{R}^{M\times Q}$ denote
the mode-1 matricization of the inputs and output, and $\boldsymbol{X}=\left[\boldsymbol{X}_{1\left(1\right)},\boldsymbol{X}_{2\left(1\right)},\cdots,\boldsymbol{X}_{p\left(1\right)}\right]$
be a concatenation of all the input matrices. We first compute the
first $G_{x}$ and $G_{y}$ principle components of $X$ and the response
$\boldsymbol{Y}_{\left(1\right)}$. Next, the PC scores of the input
$\boldsymbol{X}$ are calculated (a matrix in $\mathbb{R}^{M\times G_{x}}$)
and are used to predict the matrix of the scores of the response function
(a matrix in $\mathbb{R}^{M\times G_{y}}$). Then, given the PC scores
of the new inputs, we use the fitted regression model to predict the
response scores. Finally, we multiply the predicted response scores
by the $G_{y}$ principle components to obtain the original responses.
The number of principle components $G_{x}$ and $G_{y}$ can be identified
through a cross-validation procedure. In this paper, instead of cross-validating
over $G_{x}$ and $G_{y}$ directly, we perform CV over the percentage
of variation the PCs explain, i.e., $v$. For this purpose, we take
the value of $v$ from $\{85\%,\,90\%,\,95\%,\,99\%,\,99.5\%\}$ and
take the $v$ that minimizes the CV error. The standardized mean square
prediction error (SMSPE) is used as a performance measure to compare
the proposed method with the benchmarks. The SMSPE is defined as $SMSPE=\frac{||\mathcal{Y}-\hat{\mathcal{Y}}||_{F}^{2}}{||\mathcal{Y}||_{F}^{2}}.$
\subsection{Simulation studies for curve-on-curve regression}
In this simulation, we consider multiple functional (curve) predictors
and multiple scalar predictors similar to the simulation study in
\citep{luo2017function}. We first randomly generate $\left(\boldsymbol{B}_{1},\boldsymbol{B}_{2},\cdots,\boldsymbol{B}_{p}\right)$
as follows:
\[
\boldsymbol{B}_{i}\left(s,t\right)=\frac{1}{p^{2}}\left[\gamma_{1i}\left(t\right)\psi_{1i}\left(s\right)+\gamma_{2i}\left(t\right)\psi_{2i}\left(s\right)+\gamma_{3i}\left(t\right)\psi_{3i}\left(s\right)\right],
\]
where $\gamma_{ki}\left(t\right)$ and $\psi_{ki}\left(s\right)\,\left(k=1,\,2,\,3;\,i=1,\cdots,p\right)$
are Gaussian processes with covariance function $\Sigma_{1}\left(z,z'\right)=\left(1+20\left|z-z'\right|+\frac{1}{3}\left(20\left|z-z'\right|\right)^{2}\right)e^{-20\left|z-z'\right|}$.
Next, we generate $p=1,\,3,\,6,$ functional predictors using the
following procedure: Let $S$ be a $p\times p$ matrix with the $\left(i,j\right)^{th}$
element equal to $\rho_{c}=0,\,0.5$ for $i\neq j$ and equal to one
for diagonal elements. Next, we decompose $\boldsymbol{S}=\boldsymbol{\Delta}\boldsymbol{\Delta}^{\mathtt{T}}$,
where $\boldsymbol{\Delta}$ is a $p\times p$ matrix and generate
a set of curves $w_{1},\,w_{2},\cdots,\,w_{p}$ using a Gaussian process
with covariance function $\Sigma_{2}\left(z,z'\right)=e^{-\left(2\left|z-z'\right|\right)^{2}}$.
Finally, we generate the predictors at any given point $s$ as
\[
\left(x_{1}\left(s\right),\cdots,x_{p}\left(s\right)\right)=\left(w_{1}\left(s\right),w_{2}\left(s\right),\cdots,w_{p}\left(s\right)\right)\boldsymbol{\Delta}^{\mathtt{T}}.
\]
With this formulation, each curve of $x_{1}\left(s\right),\cdots,x_{p}\left(s\right)$
is a Gaussian process with covariance function $\Sigma_{2}\left(s,s'\right)$,
and for each $s$, the vector $\left(x_{1}\left(s\right),\cdots,x_{p}\left(s\right)\right)$
is a multivariate normal distribution with covariance \textbf{$\boldsymbol{S}$}.
When $\rho_{c}=0$, this vector becomes an independent vector of normally
distributed variables. Figure \ref{fig:Example-of-the_predictors_sim0}
illustrates examples of the predictors when $p=3$ for $\rho_{c}=0,\,0.5$.
We also generate the scalar predictors $\left(u_{1},\cdots,u_{5}\right)$
from a multivariate normal distribution with mean vector zero and
the covariance matrix with diagonal elements equal to $1$ and off-diagonal
elements equal to $0.5$. The coefficients of the scalar variables
denoted by $\alpha_{i}\left(t\right)\,\left(i=1,\cdots,5\right)$
are generated from a Gaussian process with covariance function $\Sigma\left(t,t'\right)=e^{\left\{ -5\left|t-t'\right|\right\} ^{2}}.$
Finally, we generate the response curves as
\[
y\left(t\right)=\sum_{i=1}^{5}\alpha_{i}\left(t\right)u_{i}+\sum_{i=1}^{p}\intop\boldsymbol{B}_{i}\left(s,t\right)x_{i}\left(s\right)ds+\epsilon\left(t\right),
\]
where $\epsilon\left(t\right)$ is generated from a normal distribution
with zero mean and $\sigma^{2}=0.1$. We generate all of the input
and output curves over $0<s<2$ and $0<t<1$ and take the samples
over an equidistant grid of size $100$.
\begin{figure}
\begin{centering}
\subfloat[]{\includegraphics[width=0.35\columnwidth]{Figures/example_GP_data_rho_0_new}
}\subfloat[]{\includegraphics[width=0.35\columnwidth]{Figures/example_GP_data_rho_5_new}}
\par\end{centering}
\caption{Example of the predictors when (a) $p=3$, $\rho_{c}=0$ and (b) $p=3$,$\rho_{c}=0.5$.\label{fig:Example-of-the_predictors_sim0}}
\end{figure}
For each combination of $\left(p,\rho_{c}\right)$, we compare the
performance of the proposed method with the methods in \citep{luo2017function}
based on the mean square prediction error (MSPE) and the mean square
estimation error (MSEE). We do not compare our approach to PCR in
this simulation because sigComp has already demonstrated superiority
over PCR in simulation studies in \citep{luo2017function}. We implement
the sigComp benchmark method using the R package \textit{FRegSigCom}
in which we use 50 spline bases for both the inputs and output and
default convergence tolerance. To calculate the MSPE and MSEE, we
first generate a sample data of size $M_{train}=400$ that is used
to learn the model parameters. Next, we generate a testing sample
of size $M_{test}=100$ and calculate MSPE as
\[
MSPE=\frac{1}{M_{test}}\sum_{j=1}^{M_{test}}\left(\frac{1}{100}\sum_{i=1}^{100}\left(y_{j}^{test}\left(t_{i}\right)-\hat{y}_{j}^{test}\left(t_{i}\right)\right)^{2}\right)
\]
and
\[
MSEE=\frac{1}{M_{test}}\sum_{j=1}^{M_{test}}\frac{1}{100}\sum_{i=1}^{100}\left(y_{j}^{test}\left(t_{i}\right)-\epsilon\left(t_{i}\right)-\hat{y}_{j}\left(t_{i}\right)\right)^{2}.
\]
We repeat this procedure 50 times to find the means and standard deviations
of the MSPE and MSEE for each method. Table \ref{tab:Comparison-between-Luo method and proposed}
reports the results at different values of $\rho_{c}$ and different
numbers of predictors, $p$. As reported, our proposed approach is
superior to the sigComp method in terms of MSPE and MSEE for $p=1,\,3$.
For example, when $p=3$ and $\rho_{c}=0.5$, the average MSPE and
MSEE of the sigComp are $0.2052$ and $0.1048$, which are much larger
than the corresponding values ($0.1282$ and $0.0286$) achieved by
MTOT. However, the performance of sigComp is comparable or even slightly
better than MTOT for $p=6$. For example, when $p=6$ and $\rho_{c}=0.5$,
the average MSPE is $0.1104$ for sigComp and $0.1121$ for MTOT.
The reason that sigComp performs slightly better for a larger $p$
is that it imposes sparsity when estimating the parameters, thus reducing
the chance of overfitting. Figure \ref{fig:Prediction-examples_GPsim}
illustrates prediction examples obtained by each method, along with
the true curve for different $p$. As illustrated both of the approaches
produce accurate predictions for $p=6$.
\begin{table}
\caption{Comparison between the proposed method and the sigComp method proposed
by \citet{luo2017function}.\label{tab:Comparison-between-Luo method and proposed}}
\centering{}{\small{}
\begin{tabular}{|c|c|c|c|c|c|}
\hline
& & \multicolumn{2}{c|}{\textit{\small{}sigComp}} & \multicolumn{2}{c|}{\textit{\small{}MTOT}}\tabularnewline
\hline
{\small{}$p$} & {\small{}$\rho_{c}$} & {\small{}MSPE} & {\small{}MSEE} & {\small{}MSPE} & {\small{}MSEE}\tabularnewline
\hline
\hline
{\small{}$1$} & {\small{}0} & {\small{}0.7155 (}0.041{\small{}3)} & 0.6139 (0.0414) & \textbf{\small{}0.1039}{\small{} (0.00130)} & \textbf{\small{}0.0025}{\small{} (0.0001)}\tabularnewline
\hline
\multirow{2}{*}{{\small{}$3$}} & {\small{}0} & 0.2052{\small{} (0.0089)} & 0.1048 (0.0087) & \textbf{\small{}0.1282}{\small{} (0.0064)} & \textbf{\small{}0.0286}{\small{} (0.0061)}\tabularnewline
\cline{2-6}
& {\small{}0.5} & {\small{}0.2086 (0.0105)} & 0.0934 (0.0106) & \textbf{\small{}0.1159}{\small{} (0.0034)} & \textbf{\small{}0.0140}{\small{} (0.0029)}\tabularnewline
\hline
\multirow{2}{*}{{\small{}$6$}} & {\small{}0} & {\small{}0.1052 (0.0011)} & 0.0055 (0.0011) & \textbf{\small{}0.1051}{\small{} (0.0010)} & \textbf{\small{}0.0053}{\small{} (0.0003)}\tabularnewline
\cline{2-6}
& {\small{}0.5} & \textbf{0.1104} (0.0018) & \textbf{0.0106} (0.008) & {\small{}0.1121 (0.0035)} & {\small{}0.0141 (0.0043)}\tabularnewline
\hline
\end{tabular}{\small \par}
\end{table}
\begin{figure}
\begin{centering}
\includegraphics[bb=20bp 0bp 320bp 255bp,clip,width=0.6\columnwidth]{Figures/GPsim_exampleOFPredictions}
\par\end{centering}
\caption{Prediction examples of sigComp and MTOT for different $p$ and $\rho_{c}$.\label{fig:Prediction-examples_GPsim}}
\end{figure}
\subsection{Simulation studies for image/ structured point-cloud or non-smooth
output}
\paragraph*{Case I\textendash Waveform surface simulation: \textmd{We simulate
waveform surfaces $\mathcal{Y}_{i}$ based on two input tensors, $\mathcal{X}_{1i}\in\mathbb{R}^{P_{11}\times P_{12}\times\cdots\times P_{1l_{1}}}$
and $\mathcal{X}_{2i}\in\mathbb{R}^{P_{21}\times P_{22}\times\cdots\times P_{2l_{2}}}\,$$\left(i=1,\cdots M\right)$,
where $M$ is the number of samples.}}
\paragraph*{\textmd{To generate the input tensors, we define $x_{kmj}=\frac{j}{P_{km}}\,\left(k=1,2;\,m=1,\cdots l_{k};\,j=1,\cdots P_{km}\right)$.
Then, we set $\boldsymbol{U}_{km}=\left[\boldsymbol{u}_{km1},\boldsymbol{u}_{km2},\cdots\boldsymbol{u}_{kmR_{k}}\right]\,\left(k=1,2;\,m=1,\cdots l_{k}\right)$,
where
\[
\boldsymbol{u}_{kmt}=\protect\begin{cases}
\left[\cos\left(2\pi tx_{km1}\right),\cdots,\cos\left(2\pi tx_{kmP_{km}}\right)\right]^{\mathtt{T}} & \textrm{if \ensuremath{t} is odd}\protect\\
\left[\sin\left(2\pi tx_{km1}\right),\cdots,\sin\left(2\pi tx_{kmP_{km}}\right)\right]^{\mathtt{T}} & \textrm{if \ensuremath{t} is even}.
\protect\end{cases}
\]
Next, we randomly simulate elements of a core tensor $\mathcal{D}_{ki}$
from a standard normal distribution. Then, we generate an input sample
using the following model:
\[
\mathcal{X}_{ki}=\mathcal{D}_{ki}\times_{1}\boldsymbol{U}_{k1}\times_{2}\cdots\times_{l_{k}}\boldsymbol{U}_{kl_{k}}\,\left(k=1,2;\,i=1,\cdots,M\right).
\]
To generate a response tensor, we first simulate the elements of a
core tensor $\mathcal{C}_{k}$ from a standard normal distribution.
Moreover, we set $\boldsymbol{V}_{m}=\left[\boldsymbol{v}_{m1},\boldsymbol{v}_{m2},\cdots\boldsymbol{v}_{mR}\right]\,\left(m=1,\cdots,d\right)$,
where
\[
\boldsymbol{v}_{mt}=\protect\begin{cases}
\left[\cos\left(2\pi ty_{m1}\right),\cdots,\cos\left(2\pi ty_{mQ_{m}}\right)\right]^{\mathtt{T}} & \textrm{if \ensuremath{t} is odd}\protect\\
\left[\sin\left(2\pi ty_{m1}\right),\cdots,\sin\left(2\pi ty_{mQ_{m}}\right)\right]^{\mathtt{T}} & \textrm{if \ensuremath{t} is even}
\protect\end{cases}
\]
and $y_{mj}=\frac{j}{Q_{m}}$. Next, we define the parameter tensors
$\mathcal{B}_{k}$ using the following expansion:
\[
\mathcal{B}_{k}=\mathcal{C}_{k}\times_{1}\boldsymbol{U}_{k1}\times_{2}\cdots\times_{l_{k}}\boldsymbol{U}_{kl_{k}}\times_{l_{k}+1}\boldsymbol{V}_{1}\times\cdots\times_{l_{k}+d}\boldsymbol{V}_{d}.
\]
Finally, we simulate a response tensor as
\[
\mathcal{Y}_{i}=\sum_{k=1}^{2}\mathcal{X}_{ki}*\mathcal{B}_{k}+\mathcal{E}_{i},
\]
where $\mathcal{E}_{i}$ is the error tensor whose elements are sampled
from a normal distribution $\mathcal{N}\left(0,\sigma^{2}\right)$.
For simulation purposes, we assume $\mathcal{X}_{1i}\in\mathbb{R}^{60}$,
$\mathcal{X}_{2i}\in\mathbb{R}^{50\times50}$, and $\mathcal{Y}_{i}=\mathbb{R}^{60\times40}$.
That is, we generate a response based on a profile and an image signal.
Furthermore, we set $R_{1}=2$, $R_{2}=3$, and $R=3$. This implies
that $\mathcal{C}_{1}\in\mathbb{R}^{2\times3\times3}$ and $\mathcal{C}_{2}\in\mathbb{R}^{3\times3\times3}$.
Figure \ref{fig:example of case 1} illustrates examples of generated
response surfaces. For this simulation study, we first generate a
set of $M=200$ data points. Then, we randomly divide the data into
a set of size $160$ for training and a set of size $40$ for testing.
We perform CV and train the model using the training set, then calculate
the SMSPE for the proposed method and benchmarks based on the testing
data. We repeat this procedure 50 times to capture the variance of
the SMSPE. In order to prepare data for the TOT approach, three steps
are performed: First, because the dimension of the curve inputs $\left(1\times60\right)$
and the image inputs $\left(50\times50\right)$ do not match, we randomly
select $50$ points out of 60 to reduce the curve dimension to 50.
Second, we replicate each curve 50 times to generate $50\times50$
images. Third, for each sample, we merge the image constructed from
the curve and the image input to construct a tensor of size $50\times50\times2$.
Combining all of the samples, we obtain an input tensor of size $M\times50\times50\times2$,
where $M$ is the sample size. }}
\paragraph*{Case II\textendash Truncated cone simulation: \textmd{We simulate
a truncated cone based on a set of scalars and simple profile data
in a 3D cylindrical coordinate system $\left(r,\phi,z\right)$, where
$\phi\in\left[0,2\pi\right]$ and $z\in\left[0,1\right]$. We first
generate an equidistant grid of $I_{1}\times I_{2}$ over the $\left(\phi,z\right)$
space by setting $\phi_{i}=\frac{2\pi i}{I_{1}}\,\left(i=1,\cdots,I_{1}\right)$
and $z_{j}=\frac{j}{I_{2}}\,\left(j=1,\cdots,I_{2}\right)$. Specifically,
we set $I_{1}=I_{2}=200$. Next, we simulate the truncated cone over
the grid by
\begin{equation}
r\left(\phi,z\right)=\frac{r_{0}+z\tan\theta}{\sqrt{1-e^{2}\cos^{2}\phi}}+c\left(z^{2}-z\right)+\epsilon\left(\phi,z\right),\label{eq:truncated cone}
\end{equation}
where $r_{0}$ is the radii of the upper circle of the truncated cone,
$\theta$ is the angle of the cone, $e$ is the eccentricity of the
top and bottom surfaces, $c$ is the side curvatures of the truncated
cone, and $\epsilon\left(\phi,z\right)$ is process noise simulated
from $\mathcal{N}\left(0,\sigma^{2}\right)$. Figure \ref{fig:examplesOfCase2}
illustrates examples of generated truncated cones. We assume that
the parameters of the truncated cone are specific features obtained
from a scalar and three simple profile data. In particular, we assume
that the scalar predictor is $x_{1i}=r_{0i}$ and the profile predictors
are $x_{2i}\left(z\right)=z\tan\theta$, $x_{3i}\left(\phi\right)=e^{2}\cos^{2}\phi$,
and $x_{4i}\left(z\right)=c\left(z^{2}-z\right)$; $i=1,\cdots,M$.
That is, the inputs are one scalar and three profiles. We simulate
these profiles for training purposes by setting the parameters as
follows: We set $r_{0}\in\left\{ 1.1,1.3,1.5\right\} $, $\theta\in\left\{ 0,\frac{\pi}{8},\frac{\pi}{4}\right\} $,
$e\in\left\{ 0,0.3,0.5\right\} $, $c\in\left\{ -1,0,1\right\} $,
and consider a full factorial design to generate $81$ samples. That
is, for each combination of parameters (e.g., $\left\{ 1.1,\,0,\,0.3,\,-1\right\} $),
we generate a sample containing one scalar value and three profiles.
We represent each of the inputs by a matrix (a tensor of order 2)
to obtain four input matrices $X_{1}$, $X_{2}$, $X_{3}$, and $X_{4}$,
where $X_{1}\in\mathbb{R}^{81\times1}$ and $X_{i}\in\mathbb{R}^{81\times200}\,\left(i=2,3,4\right)$.
Finally, we generate the testing data by sampling the truncated cone
parameters as follows: We assume $r\sim U\left(1.1,1.5\right)$, $\theta\sim U\left(0,\frac{\pi}{4}\right)$,
$e\sim U\left(0,0.5\right)$, and $c\sim U\left(-1,1\right)$, where
$U\left(a,b\right)$ denotes a uniform distribution over the interval
$\left[a,b\right]$, and sample each parameter from its corresponding
distribution. In this simulation, we first train the model using the
generated training data. Next, we generate a set of 1000 testing data.
We predict the truncated cone based on the input values in the testing
data and calculate the SMSPE for each predicted cone. In order to
prepare the data for TOT, we first replicate the column of $X_{1}$
to generate a matrix of size $81\times200$, then merge this matrix
with the other three matrices to construct an input tensor of size
$81\times4\times200$. This tensor is used as an input in the TOT.}}
\paragraph*{Case III\textendash Curve response with jump simulation: \textmd{We
simulate a response function with jump using a group of B-spline bases.
Let $t_{i}=\frac{i}{I}$ with $i=0,1,\cdots,I$ and $I=200$ and let
$B_{1}\in\mathbb{R}^{I\times5}$ and $B_{2}\in\mathbb{R}^{I\times51}$
be two matrices of fourth-order B-spline bases obtained by one and
47 knots over $\left[0,1\right]$. We generate a response profile
by combining these two bases as follows:
\[
y_{j}\left(t_{i}\right)=B_{1}\left(t_{i}\right)x_{1j}+B_{2}\left(t_{i}\right)x_{2j}+e\left(t_{i}\right),
\]
where $B_{1}\left(t_{i}\right)$ and $B_{2}\left(t_{i}\right)$ are
basis evaluations at the point $t_{i}$, and $e\left(t_{i}\right)$
is a random error simulated from $\mathcal{N}\left(0,\sigma^{2}\right)$.
The input vector $x_{1j}$ is dense, and its elements are generated
from a uniform distribution over $\left[0,1\right]$. $x_{2j}$ is
a sparse vector with five consecutive elements equal to one and the
rest equal to zero. The location of five consecutive elements is selected
at random. Figure \ref{fig:examplesOfCase3} illustrates examples
of response functions. For this simulation study, we first generate
a set of $M=500$ data points, i.e., $\left\{ \left(y_{j},x_{1j},x_{2j}\right)\right\} _{j=1}^{M}$.
Then, we randomly divide the data into a set of size $400$ for training
and a set of size $100$ for testing. We perform CV and train the
model using the training data set. Next, we calculate the SMSPE for
the proposed method and the benchmark based on the testing data. We
repeat this procedure 50 times to capture the variance of the SMSPE.
}\protect \\
\textmd{\smallskip{}
}}
In each case, we compare the proposed method with benchmarks based
on the SMSPE calculated at different levels of noise $\sigma$. Tables
\ref{tab:Comparison-sim1-wavefrom-surface}, \ref{tab:Comparison-caseII-cone},
and \ref{tab:Comparision-CaseIII-jumpcurve} report the average and
standard deviation of SMSPE (or its logarithm), along with the average
running time of each algorithm for the simulation cases I, II, and
III, respectively. In Table \ref{tab:Comparison-caseII-cone}, we
report the average and standard deviation of the logarithm of the
SMSPE for better comparison of the values. Please notice that the
SMSPE is a standardized error and should not directly be compared
to the variance. In all cases, the MTOT has the smallest prediction
errors, reflecting the advantage of our method in terms of prediction.
Furthermore, with the increase in $\sigma$, all methods illustrate
a larger SMSPE in all cases. In the first case, the TOT illustrates
a prediction performance comparable to our method at a cost of a much
longer running time. For example, when $\sigma=0.2$, TOT requires
about 147.33 seconds to reach the SMSPE of 0.0170, obtained in 1.05
seconds by MTOT. The performance of both PCR and TOT are significantly
worse than MTOT in the second case. The inferior performance of TOT
is due to both its restriction on selecting the same rank for both
the input and output and the fact that the CP decomposition it uses
does not consider the correlation between multiple modes.
In the third case, the prediction performances of all three methods
are comparable, indicating that all three are capable of predicting
a functional output with discontinuity. However, our approach shows
slightly smaller prediction errors. Although the running time of the
PCR is significantly lower than the other two approaches, MTOT running
time is reasonable and within two-tenths of a second. The TOT shows
slightly larger prediction error in all cases with much longer running
time, making this approach less appealing. Recall that in this simulation,
we used B-spline bases as the coefficients of the input to generate
the output curve. Figure \ref{fig:example of cas3 params1} illustrates
the plot of the columns of the learned coefficient matrix that corresponds
to $B_{1}$. As can be seen, the learned bases are very similar to
B-spline bases used originally as the coefficients. Figure \ref{fig:examplesOfCase3 param2}
illustrates some of the columns of the learned parameters that correspond
to $B_{2}$. Unlike the first set of parameters, these parameters
are slightly different from the B-spline bases that are originally
used for data generation purposes. This is due to the identifiability
issue. Our approach imposes an orthogonality restriction that may
generate a set of parameters (when the identifiability issue exists)
different from the parameters from which\textbf{ }the data is originally
generated, but that can still produce accurate predictions in terms
of the mean value.
\begin{figure}
\begin{centering}
\subfloat[\label{fig:example of case 1}]{\includegraphics[bb=25bp 20bp 210bp 160bp,clip,width=0.45\columnwidth]{Figures/exampleOfWaveSurf}}\,~~~\subfloat[\label{fig:examplesOfCase2}]{\begin{centering}
\includegraphics[bb=30bp 30bp 200bp 150bp,clip,width=0.45\columnwidth]{Figures/exampleOfCones}
\par\end{centering}
}
\par\end{centering}
\centering{}\subfloat[\label{fig:examplesOfCase3}]{\begin{centering}
\includegraphics[bb=15bp 0bp 210bp 170bp,clip,width=0.45\columnwidth]{Figures/exampleOfjumpresponse}
\par\end{centering}
}\caption{Examples of generated output for the simulation study (a) case I-waveform
surface, (b) case II\textendash truncated cone, and (c) response function
with jump.}
\end{figure}
\begin{table}
\caption{Comparison between the proposed method (MTOT) and the benchmarks in
case I with the waveform response. The TOT requires a much larger
running time to achieve the same level of prediction error as the
MTOT. \label{tab:Comparison-sim1-wavefrom-surface}}
\centering{
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline
& \multicolumn{2}{c|}{\textit{\footnotesize{}PCR}} & \multicolumn{2}{c|}{\textit{\footnotesize{}TOT}} & \multicolumn{2}{c|}{\textit{\footnotesize{}MTOT}}\tabularnewline
\hline
{\footnotesize{}$\sigma$} & {\footnotesize{}SMSPE} & {\footnotesize{}Time (sec)} & {\footnotesize{}SMSPE} & {\footnotesize{}Time (sec)} & {\footnotesize{}SMSPE} & {\footnotesize{}Time (sec)}\tabularnewline
\hline
\hline
{\footnotesize{}0.1} & {\footnotesize{}0.0057 (0.0015)} & {\footnotesize{}0.03 (0.00)} & {\footnotesize{}0.0046 (0.0011)} & {\footnotesize{}154.98 (17.94)} & \textbf{\footnotesize{}0.0044}{\footnotesize{} (0.0011)} & {\footnotesize{}1.05 (0.03)}\tabularnewline
\hline
{\footnotesize{}0.2} & {\footnotesize{}0.0199 (0.0045)} & {\footnotesize{}0.04 (0.00)} & \textbf{\footnotesize{}0.0170}{\footnotesize{} (0.0039)} & {\footnotesize{}147.33 (2.47)} & \textbf{\footnotesize{}0.0170}{\footnotesize{} (0.0040)} & {\footnotesize{}1.05 (0.01)}\tabularnewline
\hline
{\footnotesize{}0.3} & {\footnotesize{}0.0455 (0.0097)} & {\footnotesize{}0.04 (0.00)} & {\footnotesize{}0.0399 (0.0086)} & {\footnotesize{}149.03 (1.36)} & \textbf{\footnotesize{}0.0395}{\footnotesize{} (0.0086)} & {\footnotesize{}1.05 (0.02)}\tabularnewline
\hline
{\footnotesize{}0.4} & {\footnotesize{}0.0773 (0.0233)} & {\footnotesize{}0.04 (0.00)} & {\footnotesize{}0.0678 (0.0135)} & {\footnotesize{}149.13 (0.96)} & \textbf{\footnotesize{}0.0673}{\footnotesize{} (0.0212)} & {\footnotesize{}1.05 (0.03)}\tabularnewline
\hline
{\footnotesize{}0.5} & {\footnotesize{}0.1186 (0.0222)} & {\footnotesize{}0.04 (0.00)} & {\footnotesize{}0.1036 (0.0231)} & {\footnotesize{}146.17 (0.95)} & \textbf{\footnotesize{}0.1032}{\footnotesize{} (0.0203)} & {\footnotesize{}1.04 (0.01)}\tabularnewline
\hline
{\footnotesize{}0.6} & {\footnotesize{}0.1670 (0.0327)} & {\footnotesize{}0.04 (0.00)} & {\footnotesize{}0.1456 (0.0309)} & {\footnotesize{}147.75 (1.81)} & \textbf{\footnotesize{}0.1454}{\footnotesize{} (0.0299)} & {\footnotesize{}1.03 (0.01)}\tabularnewline
\hline
\end{tabular}
\end{table}
\begin{table}
\caption{Comparison between the proposed method and the benchmarks in case
II with truncated cone. Due to the difference between the input and
the output rank, the performance of the TOT is significantly worse
than the MTOT. The PCR is very fast in estimation, but the prediction
accuracy is not as appealing as the MTOT. \label{tab:Comparison-caseII-cone}}
\centering{
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline
& \multicolumn{2}{c|}{\textit{\footnotesize{}PCR}} & \multicolumn{2}{c|}{\textit{\footnotesize{}TOT}} & \multicolumn{2}{c|}{\textit{\footnotesize{}MTOT}}\tabularnewline
\hline
{\footnotesize{}$\sigma$} & {\footnotesize{}log(SMSPE)} & {\footnotesize{}Time (sec)} & {\footnotesize{}log(SMSPE)} & {\footnotesize{}Time (sec)} & {\footnotesize{}log(SMSPE)} & {\footnotesize{}Time (sec)}\tabularnewline
\hline
\hline
{\footnotesize{}0.01} & {\footnotesize{}-5.555 (0.986)} & {\footnotesize{}0.05 (0.00)} & {\footnotesize{}-5.249 (1.326)} & {\footnotesize{}23.58 (5.93)} & \textbf{\footnotesize{}-8.095}{\footnotesize{} (1.196)} & {\footnotesize{}3.82 (0.09)}\tabularnewline
\hline
{\footnotesize{}0.02} & {\footnotesize{}-5.509 (0.937)} & {\footnotesize{}0.07 (0.00)} & {\footnotesize{}-5.197 (1.254)} & {\footnotesize{}27.94 (6.11)} & \textbf{\footnotesize{}-7.629}{\footnotesize{} (0.869)} & {\footnotesize{}3.92 (0.10)}\tabularnewline
\hline
{\footnotesize{}0.03} & {\footnotesize{}-5.441 (0.879)} & {\footnotesize{}0.08 (0.00)} & {\footnotesize{}-5.127 (1.175)} & {\footnotesize{}29.11 (8.46)} & \textbf{\footnotesize{}-7.215}{\footnotesize{} (0.666)} & {\footnotesize{}3.93 (0.12)}\tabularnewline
\hline
{\footnotesize{}0.04} & {\footnotesize{}-5.360 (0.819)} & {\footnotesize{}0.06 (0.00)} & {\footnotesize{}-5.048 (1.097)} & {\footnotesize{}33.61 (9.02)} & \textbf{\footnotesize{}-6.856}{\footnotesize{} (0.537)} & {\footnotesize{}3.95 (0.14)}\tabularnewline
\hline
{\footnotesize{}0.05} & {\footnotesize{}-5.269 (0.762)} & {\footnotesize{}0.07 (0.00)} & {\footnotesize{}-4.963 (1.023)} & {\footnotesize{}34.29 (14.55)} & \textbf{\footnotesize{}-6.543}{\footnotesize{} (0.454)} & {\footnotesize{}3.99 (0.13)}\tabularnewline
\hline
{\footnotesize{}0.06} & {\footnotesize{}-5.173 (0.710)} & {\footnotesize{}0.07 (0.00)} & {\footnotesize{}-4.875 (0.956)} & {\footnotesize{}37.43 (15.19)} & \textbf{\footnotesize{}-6.266}{\footnotesize{} (0.402)} & {\footnotesize{}3.95 (0.14)}\tabularnewline
\hline
\end{tabular}
\end{table}
\begin{table}
\caption{Comparison between the proposed method and the benchmarks in case
III with a non-smooth response. All three methods produce reasonable
predictions. However, the MTOT performs slightly better than the benchmarks
within a reasonable running time. \label{tab:Comparision-CaseIII-jumpcurve}}
\centering{
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline
& \multicolumn{2}{c|}{\textit{\footnotesize{}PCR}} & \multicolumn{2}{c|}{\textit{\footnotesize{}TOT}} & \multicolumn{2}{c|}{\textit{\footnotesize{}MTOT}}\tabularnewline
\hline
{\footnotesize{}$\sigma$} & {\footnotesize{}SMSPE} & {\footnotesize{}Time (sec)} & {\footnotesize{}SMSPE} & {\footnotesize{}Time (sec)} & {\footnotesize{}SMSPE} & {\footnotesize{}Time (sec)}\tabularnewline
\hline
\hline
{\footnotesize{}0.1} & {\footnotesize{}0.0255 (0.0010)} & {\footnotesize{}0.02 (0.00)} & {\footnotesize{}0.0250 (0.0008)} & {\footnotesize{}17.67 (0.58)} & \textbf{\footnotesize{}0.0230}{\footnotesize{} (0.0007)} & {\footnotesize{}0.26 (0.01)}\tabularnewline
\hline
{\footnotesize{}0.15} & {\footnotesize{}0.0503 (0.0018)} & {\footnotesize{}0.03 (0.00)} & {\footnotesize{}0.0510 (0.0018)} & {\footnotesize{}17.27 (0.20)} & \textbf{\footnotesize{}0.0496}{\footnotesize{} (0.0017)} & {\footnotesize{}0.25 (0.01)}\tabularnewline
\hline
{\footnotesize{}0.2} & {\footnotesize{}0.0851 (0.0027)} & {\footnotesize{}0.04 (0.00)} & {\footnotesize{}0.0862 (0.0026)} & {\footnotesize{}17.25 (0.22)} & \textbf{\footnotesize{}0.0848}{\footnotesize{} (0.0028)} & {\footnotesize{}0.25 (0.01)}\tabularnewline
\hline
{\footnotesize{}0.25} & {\footnotesize{}0.1260 (0.0043)} & {\footnotesize{}0.05 (0.00)} & {\footnotesize{}0.1271 (0.0042)} & {\footnotesize{}16.01 (2.32)} & \textbf{\footnotesize{}0.1255}{\footnotesize{} (0.0042)} & {\footnotesize{}0.27 (0.00)}\tabularnewline
\hline
{\footnotesize{}0.3} & {\footnotesize{}0.1730 (0.0046)} & {\footnotesize{}0.05 (0.00)} & {\footnotesize{}0.1734 (0.0041)} & {\footnotesize{}16.33 (2.67)} & \textbf{\footnotesize{}0.1725}{\footnotesize{} (0.0046)} & {\footnotesize{}0.27 (0.01)}\tabularnewline
\hline
{\footnotesize{}0.35} & {\footnotesize{}0.2305 (0.0051)} & {\footnotesize{}0.05 (0.00)} & {\footnotesize{}0.2333 (0.0066)} & {\footnotesize{}16.69 (0.83)} & \textbf{\footnotesize{}0.2230}{\footnotesize{} (0.0052)} & {\footnotesize{}0.27 (0.00)}\tabularnewline
\hline
\end{tabular}
\end{table}
\begin{figure}
\centering{}\subfloat[\label{fig:example of cas3 params1}]{\includegraphics[width=0.5\columnwidth]{Figures/sim3-param1-plot}}\subfloat[\label{fig:examplesOfCase3 param2}]{\begin{centering}
\includegraphics[width=0.5\columnwidth]{Figures/sim3-param2-plot}
\par\end{centering}
}\caption{Examples of the learned parameters in simulation case III when $\sigma=0$.}
\end{figure}
\section{Case Study \label{sec:Case-Study}}
In semiconductor manufacturing, patterns are printed layer by layer
over a wafer in a sequence of deposition, etching, and lithographic
processes to manufacture transistors \citep{nishi2000handbook}. Many
of these processes induce stress variations across the wafer, distorting/changing
the wafer shape \citep{brunner2013characterization,turner2013role}.\textbf{
}Figure \ref{fig:Process-of-a-wafer-and overlayerror} illustrates
a simplified sequence of processes, causing the overlay error in the
patterned wafers. In the first step, a layer is deposited over the
wafer and exposed to rapid thermal annealing, causing a curvature
in the free-state wafer. The wafer is then chucked flat and patterned
in a lithographic process. Next, to generate a second layer pattern,
a new layer is deposited, changing the wafer shape. Finally, in the
lithography step, the flattened wafer is patterned. Because the wafer
is flattened, the first pattern distance increases, but the new pattern
is printed with the same distance $L$, generating a misalignment
between patterns. The overlay error caused by lower order distortions
can be corrected by most of the exposure tools. For this purpose,
the alignment positions of several targets are measured and used to
fit a linear overlay error model \citep{brunner2013characterization}:
\begin{equation}
\begin{cases}
\Delta x=T_{x}-\theta_{x}y+M_{x}x & \text{error in x coordinate}\\
\Delta y=T_{y}+\theta_{y}x+M_{y}y & \text{error in y coordinate,}
\end{cases}\label{eq:OverlayErrorModel}
\end{equation}
where $x$ and $y$ identify the position of the target point over
the wafer, $T_{x}$ and $T_{y}$ are transition errors, $\theta_{x}$
and $\theta_{y}$ relate to rotation error, and $M_{x}$ and $M_{y}$
are isotropic magnification errors pertaining to the wafer size change
or wafer expansion due to processing. The fitted model is then used
to correct the overlay errors. This model, however, can only correct
the overlay error induced by a uniform stress field and fails to compensate
for overlay errors caused by high-order distortions \citep{brunner2013characterization}.
Therefore, developing a model that can relate the overlay error to
higher order patterns in the wafer shape is essential for better overlay
correction.
\begin{figure}
\begin{centering}
\includegraphics[bb=100bp 70bp 650bp 480bp,clip,width=0.6\columnwidth]{Figures/illustration_of_overlay_error}
\par\end{centering}
\caption{Process of a wafer, which causes shape variation and consequently
overlay error.\label{fig:Process-of-a-wafer-and overlayerror}}
\end{figure}
In this case study, we use our proposed method to predict the overlay
error based on the wafer shape data. Such predictions can be fed forward
to the exposure tools to result in a better correction strategy. In
practice, the wafer shape is measured using a patterned wafer geometry
(PWG) tool, and the overlay error is measured using standard optical
methods \citep{brunner2013characterization}. Both the wafer shapes
and the overlay errors (in each coordinate, x or y) can be presented
as image data. In this case study, we follow the procedure and results
suggested and verified (through both experiments and finite element
{[}FE{]} analysis) by \citet{brunner2013characterization} to generate
surrogate data of overlay errors $\left(PIR\left(x,y\right)\right)$
based on the wafer shape prior to two lithography steps ($w_{1}\left(x,y\right)$,
$w_{2}\left(x,y\right)$). The data generation procedure is elaborated
in Appendix C.
Based on the described procedure in Appendix C, we generate a set
of 500 training observations, i.e., wafer shapes and overlay errors,
$\left\{ \left(w_{1i}\left(x,y\right),w_{2i}\left(x,y\right),PIR_{i}\right)\right\} _{i=1}^{M=500}$,
and employ our proposed method to estimate the $PIR_{i}$ based on
$\left(w_{1i}\left(x,y\right),w_{2i}\left(x,y\right)\right)$. Because
in our simulated data $w_{1i}\left(x,y\right)$ remains fixed, we
consider $w_{i}\left(x,y\right)=w_{2i}\left(x,y\right)-w_{1i}\left(x,y\right)$
as the predictor. We also generate 100 observations as the test dataset.
The mean square prediction error obtained from the testing data is
used as the performance criterion. We repeat the simulations 50 times
and record the MSPE values. Because our proposed methodology assumes
that the shapes are observed over a grid, we transform the data to
the polar coordinate prior to modeling. In the polar space, each shape
is observed over a grid of $100\times200$ ($100$ in the radial direction
and $200$ in the angular direction, with overall 20,000 pixels).
Unfortunately, the TOT approach proposed by \citet{lock2017tensor}
failed to run with this size of images due to its high space complexity.
Therefore, we only compared our approach with PCR. Figure \ref{fig:Example-of-PIRandPIR_est}
illustrates an example of the original and predicted corrected overlay
error image, along with the prediction error. As illustrated, the
proposed method predicted the original surface more accurately, with
smaller errors across the wafer. Figure \ref{fig:logarithm-of-prediction_error}
illustrates the boxplots of the logarithm of the prediction mean square
error calculated over the 50 replications in contrast with the benchmark.
The results show that the proposed method is superior to the benchmark
in prediction of the image. As an example, the average of log(SMSE)
over the replications is -8.33 for the proposed method and -7.56 for
the PCR approach.
\begin{figure}[H]
\begin{centering}
\subfloat[\label{fig:PIR}]{\includegraphics[width=0.35\columnwidth]{Figures/CS_TestData}
}
\par\end{centering}
\begin{centering}
\subfloat[\label{fig:PIR_est}]{\includegraphics[width=0.35\columnwidth]{Figures/CS_TOT_Estimate}
}\subfloat[\label{fig:PIR-PIR_est}]{\begin{centering}
\includegraphics[width=0.35\columnwidth]{Figures/CS_TOT_ERROR}
\par\end{centering}
}
\par\end{centering}
\begin{centering}
\subfloat[\label{fig:PIR_est-1}]{\includegraphics[width=0.35\columnwidth]{Figures/CS_PCA_Estimate}
}\subfloat[\label{fig:PIR-PIR_est-1}]{\begin{centering}
\includegraphics[width=0.35\columnwidth]{Figures/CS_PCA_ERROR}
\par\end{centering}
}
\par\end{centering}
\caption{Example of (a) the x coordinate overlay error, (b) prediction of MTOT,
(c) MTOT prediction error, (d) prediction of PCR, and (e) PCR prediction
error. \label{fig:Example-of-PIRandPIR_est} }
\end{figure}
\begin{figure}[H]
\begin{centering}
\includegraphics[bb=0bp 0bp 265bp 213bp,clip,width=0.7\columnwidth]{Figures/CS_SMSE_hist}
\par\end{centering}
\caption{Logarithm of the prediction mean square error calculated for the test
data over 50 replications. The proposed method illustrates significantly
lower standard prediction error than the PCR approach. \label{fig:logarithm-of-prediction_error}}
\end{figure}
\section{Conclusion\label{sec:Conclusion}}
This paper proposed a multiple tensor-on-tensor approach for modeling
processes with a heterogeneous set of input variables and an output
that can be measured by a scalar, curve, image, or point-cloud, etc.
The proposed method represents each of the inputs as well as the output
by tensors, and formulates a multiple linear regression model over
these tensors. In order to estimate the parameters, a least square
loss function is defined. In order to avoid overfitting, the proposed
method decomposes the regression parameters through a set of basis
matrices that spans the input and output spaces. Next, the basis matrices,
along with their expansion coefficients, are learned by minimizing
the loss function. The orthogonality condition is imposed over the
output bases to assure identifiability and interpretability. To solve
the minimization problem, first, a closed-form solution is derived
for both the bases and their coefficients. Second, the block coordinate
decent (BCD) approach combined with the ALS algorithm is applied.
The proposed approach is capable of combining different forms of inputs
(e.g., an image, a curve, and a scalar) to estimate an output (e.g.,
a scalar, a curve, or an image, etc.) as demonstrated in first three
simulation studies. For example, in the first and third simulation
studies, we combined the scalar and profile inputs to estimate a profile
and a point cloud, respectively; and in the second simulation study,
a profile and an image are integrated to predict an image.
In order to evaluate the performance of the proposed method, we conducted
four simulation studies and a case study. In our first simulation
study, we compared our proposed method with the function-on-function
approach proposed by \citet{luo2017function}. This simulation considered
scalar and curve inputs since the benchmark can only handle those
form of data. Next, we performed three other simulations to evaluate
the performance of the proposed method when the inputs or outputs
are images or point clouds. In these simulation studies, the proposed
approach was compared with principle component regression (PCR) and
tensor-on-tensor (TOT) regression, and showed superior performance
in terms of mean squared prediction error. We also evaluated our proposed
method using a set of surrogate data generated according to the manufacturing
process of semiconductors. We simulated the shape and overlay errors
for several wafers and applied the proposed method to estimate the
overlay errors based on the wafer shapes measured prior to the lithography
steps. Results showed that the proposed method performed significantly
better than the PCR in predicting the overlay errors.
As a future work, including penalties such as lasso for sparsity and
group lasso for variable selection and imposing roughness penalties
over the basis matrices may improve the prediction results and can
be further studied.
\section*{Appendix A: Proof of Proposition \ref{prop:MR-core tensor estimate}}
For simplicity, we assume only one input tensor exists. Then, we can
solve $\mathcal{C}$ by
\begin{align*}
\textrm{argmin}_{\mathcal{C}}\|Y_{\left(1\right)}-X_{\left(1\right)}B\|_{F}^{2} & =\|Y_{\left(1\right)}-X_{\left(1\right)}(U_{l}\otimes U_{l-1}\otimes\cdots\otimes U_{1})C(V_{d}\otimes\cdots\otimes V_{1})^{T}\|_{F}^{2}\\
& =\|vec(Y_{\left(1\right)})-vec(X_{\left(1\right)}(U_{l}\otimes U_{l-1}\otimes\cdots\otimes U_{1})C(V_{d}\otimes\cdots\otimes V_{1})^{T})\|_{2}^{2}\\
& =\|vec(Y_{\left(1\right)})-vec(ZC(V_{d}\otimes\cdots\otimes V_{1})^{T})\|_{2}^{2}\\
& =\|vec(Y_{\left(1\right)})-(V_{d}\otimes\cdots\otimes V_{1}\otimes Z)vec(C)\|_{2}^{2},
\end{align*}
where $vec\left(X\right)$ stacks the columns of matrix $X$ on top
of each other. This is a simple least square regression that gives
a closed-form solution as in (\ref{eq:SolutionToRegression-1}) after
applying Proposition \ref{prop:proposition1} to convert Kronecker
products to tensor products.
\section*{Appendix B: Proof of Proposition \ref{prop:MR-basis estimate}}
Again assuming a single input tensor, let us define $\tilde{Y}=(V_{d}\otimes\cdots\otimes V_{1}\otimes Z)vec(C)$
in the tensor format as $\tilde{\mathcal{Y}}=\tilde{C}\times_{1}Z\times_{2}V_{1}\times\cdots\times_{d+1}V_{d}$,
which can be written as $\tilde{Y}_{(i)}=V_{i}\tilde{C}_{(i)}(V_{d}\otimes\cdots V_{i+1}\otimes V_{i-1}\otimes V_{1}\otimes Z)^{\mathtt{T}}$.
First note that
\begin{align*}
\textrm{argmin}_{V_{i}}\|Y_{\left(1\right)}-X_{\left(1\right)}B\|_{F}^{2} & =\textrm{argmin}_{V_{i}}\|vec(Y_{\left(1\right)})-(V_{d}\otimes\cdots\otimes V_{1}\otimes Z)vec(\tilde{C})\|_{F}^{2}\\
& =\textrm{argmin}_{V_{i}}\|Y_{(i)}-\tilde{Y}_{(i)}\|_{F}^{2}\\
& =\textrm{argmin}_{V_{i}}\|Y_{(i)}-V_{i}\tilde{C}_{(i)}(V_{d}\otimes\cdots V_{i+1}\otimes V_{i-1}\otimes V_{1}\otimes Z)^{\mathtt{T}}\|_{F}^{2},
\end{align*}
with $A:=\tilde{C}_{(i)}(V_{d}\otimes\cdots V_{i+1}\otimes V_{i-1}\otimes V_{1}\otimes Z)^{\mathtt{T}}$.
Then, we want to solve
\[
\textrm{argmin}_{V_{i}}\|Y_{(i)}-V_{i}A\|_{F}^{2}\,s.t.\,V_{i}^{\mathtt{T}}V_{i}=I.
\]
This is an orthogonal procrustes problem and is known to have solution
as is stated in Proposition \ref{prop:MR-basis estimate}.
\section*{Appendix C: Simulating the Overlay Error }
\citet{brunner2013characterization} introduced a measure based on
in-plane distortion (IPD) called predicted in-plane distortion residual
(PIR) to estimate and predict nonuniform-stress-induced overlay errors
based on wafer shape. For this purpose, they first illustrate that
the IPD is proportional to gradient of wafer shape $w\left(x,y\right)$,
i.e.,
\[
IPD\varpropto-\nabla w.
\]
Then, for two layers, say $i$ and $k$, to be patterned, they calculate
the IPD and subtract them to find the shape-slope difference, i.e.,
$SSD=IPD_{i}-IPD_{k}$. The shape-slope is then corrected based on
model (\ref{eq:OverlayErrorModel}) to find the shape-slope residual
(SSR). Finally, \citet{brunner2013characterization} calculated the
PIR as a factor of SSR. That is,
\[
PIR=c\times SSR,
\]
where $c$ is a constant that depends on the wafer thickness. In their
study, they showed through four differently patterned engineer stress
monitor (ESM) wafers that the PIR is linearly correlated by the overlay
errors with high $R^{2}$ values (e.g., 92\%). To perform the experiment,
they first deposit a layer of silicon nitride film over a 300mm wafer
as a source of stress. This process changes the wafer shape and causes
the wafer to curve. The shape of the wafer is measured by a patterned
wafer geometry (PWG) tool designed for the metrology of 300mm wafers.
After the wafer is exposed by a designed pattern (four different patterns
considered in this study), it goes through an etching process that
relieves some part of the stress depending on the pattern density.
At this stage, and prior to next lithography step, the wafer shape
is again measured. After the second lithography step, the overlay
error is measured using standard optical methods. Using the measured
wafer shapes, they calculated the PIR and showed a high correlation
between the PIR and overlay error.
In our study, we first simulate the wafer shapes and then estimate
the overlay errors using the following procedure introduced by \citet{brunner2013characterization}.
Simulating a wafer shape requires knowledge of the different components
in wafer geometry. \citet{brunner2013characterization} and \citet{turner2013role}
consider several wafer shape features that span different ranges of
spatial wavelength $\left(\lambda\right)$. At the highest level is
the overall shape of the wafer represented by a bow (or warp) in the
range of tens of micrometers. Other shape variations are those that
are spanned by spatial wavelengths in the range of several meters
and waveheight in the micrometer range. Another component is the nanotopography
(NT) of the wafer, with $\lambda$ ranging from few millimeters to
20mm and the wave-height in nanometers. Finally, the roughness of
the wafer is defined as variations with $\lambda<0.2$mm. In this
study, we only consider the bow shape and the NT components when simulating
a wafer shape. The wafer shapes are simulated as follows: We first
assume that a thin layer is deposited over a wafer, which causes only
a bow shape geometry in the wafer (that is, we assume no wave patterns).
We simulate the bowed wafer geometry using $w_{1}\left(x,y\right)=\frac{b_{1}\left(0.5x^{2}+y^{2}\right)}{R^{2}}$,
where $b_{1}$ is the warp or bow size and is assumed to be $100\text{\ensuremath{\mu}m}$,
and $R$ is the wafer radius, which is assumed to be $150$mm. We
then assume that a lithography/etching process is performed and the
wafer shape changes in both bow and wavy patterns as follows:
\[
w_{2}\left(x,y\right)=\frac{b_{2}\left(0.5x^{2}+y^{2}\right)}{R^{2}}+\sum_{i=1}^{p}\frac{h_{i}}{2}\left(1+sin\left(\frac{2\pi x}{\lambda_{i}}\right)\right)+\sum_{i=1}^{p}\frac{h_{i}}{2}\left(1+cos\left(\frac{2\pi y}{\lambda_{i}}\right)\right),
\]
where $b_{2}$ is the bow size uniformly sampled from $30$ to $100\mu m$,
and $h_{i}$ and $\lambda_{i}$ are the waveheight and wavelength,
respectively. Moreover, $p$ is the number of waveforms assumed. For
each wafer (i.e. sample), we first randomly select $p$ from $U\left(2,10\right)$
and then select $p$ wavelength from $U\left(2,20\right)$ for NT
wavelength. Finally, we sample waveheight $h_{i}$ from $U\left(\frac{\lambda_{i}}{10^{7}},\frac{\lambda_{i}}{10^{6}}\right)$
to ensure that the large wavelength has large a waveheight and vice
versa. After simulating a wafer shape prior to two lithography steps,
we calculate the IPD and PIR according to the procedure described
previously. Note that we only calculate the values proportional to
the original values. Figure \ref{fig:Illustration-of-wafer_shapes_IPD_IPR}
illustrates an example of generated shapes, their associated IPDs
in the x coordinates, i.e., $-\frac{\partial w}{\partial x}$, and
the difference between the x coordinate IPDs prior to and after correction.
In order to correct the IPD values, we consider a second order model:
\[
\begin{cases}
\Delta IPD_{x}=k_{0}+k_{1}x+k_{2}y+k_{3}x^{2}+k_{4}y^{2}+k_{5}xy & \text{error in x coordinate}\\
\Delta IPD_{y}=k_{6}+k_{7}x+k_{8}y+k_{9}x^{2}+k_{10}y^{2}+k_{11}xy & \text{error in y coordinate},
\end{cases}
\]
which is fitted to the calculated values of $\Delta IPD_{x}=IPD_{x2}-IPD_{x1}$
and $\Delta IPD_{y}$. Then the fitted model is subtracted from the
$\Delta IPD_{x}$ and $\Delta IPD_{y}$ to find the corrected values.
The corrected values are associated with the PIR and the overlay error.
\begin{figure}[H]
\centering{}\includegraphics[bb=80bp 90bp 770bp 470bp,clip,width=0.7\columnwidth]{Figures/waferShape_IPD_PIR_example}\caption{Illustration of wafer (a) shape prior to first step lithography, (b)
shape prior to second step lithography, (c) $IPD_{x}$ for the first
shape, (d) $IPD_{x}$ for the second shape, (e) PIR prior to correction,
and (f) PIR after correction for second order shapes.\label{fig:Illustration-of-wafer_shapes_IPD_IPR}}
\end{figure}
\section*{}
\bibliographystyle{authordate4}
| {'timestamp': '2018-04-23T02:04:57', 'yymm': '1803', 'arxiv_id': '1803.00138', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00138'} | arxiv |
\section{Introduction}
There is a wide variety of data in HIV/AIDS research. In clinical studies, common variables include CD4 cell count, HIV-1 RNA (viral load), demographics, WHO or CDC disease stage, and time-to-event variables such as time from ART initiation to an AIDS defining event, viral failure, or death. Biomarker data are common in both clinical and basic studies of HIV; these may include markers of inflammation, pharmacokinetics, drug use, or metabolism, and may be biomarkers commonly used in other disease settings (e.g., diabetes or hepatitis). Genomic data, both human and viral, are also important.
Of course, the characteristics of these and other variables used in HIV research are extremely diverse. The distribution of some are fairly symmetric (e.g., age at ART initiation), somewhat skewed (e.g., CD4 count), or highly skewed (e.g., viral load). Many variables are left censored at detection limits (e.g., viral load and other biomarkers) or right censored due to finite follow-up (e.g., time to death). Many are ordered categorical (e.g., stage of disease and single nucleotide polymorphisms). Much of the statistical work in the analysis of HIV data involves finding proper models for these variables to assess associations, to predict outcomes, and hopefully in the end to improve patient and public health. Given the diversity of variables, a wide variety of statistical models are used.
There are benefits to having statistical methods that are robust and efficient across a wide variety of data types. Such methods can be quickly applied with confidence in many different situations and may be useful as a first pass in big data settings (e.g., datasets with many variables of interest). Such methods may also be useful in smaller analyses because they provide nice, simple summaries. Spearman's rank correlation is one such example: its simplicity, validity, and utility across a wide variety of orderable variables makes it popular in practice.
We have developed a new type of residual, the probability-scale residual (PSR), which is remarkably useful and well defined across a wide variety of variable types and models \citep{li2010test,li2012new,shepherd2016psr}. As a residual it can be used for model diagnostics and for inference. We have proposed to use the correlation of PSRs to adjust Spearman's rank correlation for covariates \citep{liu2016}. The goal of this chapter is to introduce the PSR to HIV researchers, to describe a few of its important properties, and to demonstrate its utility across a diverse set of analyses with HIV data. We first introduce the PSR and describe some of its properties (section 2). We then illustrate its use for model diagnostics (section 3) and inference (section 4). Several datasets that we have encountered in our collaborative HIV/AIDS research will be used to illustrate the methods. The final section discusses a few points and proposes directions for future research. Analysis code for all of the data examples is available at our website, biostat.mc.vanderbilt.edu/ArchivedAnalyses.
\section{Probability-scale Residual}
In linear regression, a residual is defined as $y-\hat y$, where $y$ is an observed
value and $\hat y$ is a fitted value, typically the estimated expectation of the outcome conditional on covariates. This observed-minus-expected residual (OMER) is simple and has many desirable properties, but is not easily extendable to outcomes where conditional expectations are difficult to calculate or are not meaningful. For example, for ordinal outcomes there is no natural definition of difference or conditional expectation unless scores are assigned to the ordered categories; for right censored outcomes with partially defined fitted distributions one may not be able to calculate the conditional expectation. Furthermore, the OMER may be misleading with models where one is fitting a non-symmetric distribution to data.
The OMER can be thought of as the expectation of the difference between the observed value, $y$, and a random variable, $Y^*$,
from the fitted distribution with cdf $F^*$: $E(y-Y^*) = y-\hat y$. Instead of using the difference to contrast $y$ and $Y^*$, one could use the sign function, specifically, $\text{sign}(y,Y^*)$, where sign$(a,b)$ is $-1, 0,$ and 1 for $a<b, a=b,$ and $a>b,$ respectively. The PSR is simply the expectation of this contrast,
$r(y,F^*)=E\left\{\text{sign}(y,Y^*)\right\}$, which can be written in terms of probabilities as $P(Y^*<y)-P(Y^*>y)$ or equivalently $F^*(y-)+F^*(y)-1.$
A few benefits of the PSR are immediately apparent. First, the sign function is more generally applicable than the difference, so by contrasting variables with the sign function we are able to define a residual for more types of outcomes. Second, the PSR does not require estimation of conditional expectation but rather estimation of the conditional distribution itself. Note that it is not necessary to estimate the entire distribution, but the distribution only needs to be estimated at the observed value, $y$. Hence, the residual is flexible for a wide range of outcome variables (including ordered categorical) and models (including semiparametric), while still providing information on model fit.
We originally introduced the PSR for use with ordered categorical variables \citep{li2010test,li2012new}. In that setting, the residual has several nice properties including the following:
\begin{enumerate}
\item The PSR captures order information without assigning arbitrary numbers to the ordinal categories.
\item The PSR yields only one value per observation regardless of the number of categories of the ordinal variable.
\item The PSR has expectation zero with a correctly specified model; i.e., for a random variable $Y$ with distribution $F$, $E\{r(Y,F^*)\}=0$ if $F^*=F$.
\end{enumerate}
In addition to the above, the PSR is the only residual that satisfies several natural properties for ordinal outcomes such as the branching property \citep{brockett1977characterization}, reversability, and monotonicity with respect to the observed value. Details are in \cite{li2012new}. For proportional odds models, the PSR sums to 0.
The PSR is also well defined for other types of orderable data, including binary, count, continuous, and censored outcomes \citep{shepherd2016psr}. In all cases, the PSR has expectation zero under correctly specified models. With continuous data, the PSR equals zero at the median of the fitted distribution. In addition, with continuous data the random variable $r(Y,F^*)$ is uniformly distributed between $-1$ and 1 if the fitted distribution is correctly specified, suggesting that with sufficiently large sample sizes, one can approximately assess model fit by comparing the distribution of PSRs with a uniform($-1,1)$ distribution. With binary data, the PSR is simply the OMER, or the unscaled Pearson residual. With right censored data, the PSR is a function of the observed minimum of the censoring and event times, $y$, and the indicator that an event occurred, $\delta$: $r(y,F^*,\delta)=F^*(y)- \delta \left\{1-F^*(y-)\right\}$. Given $\delta$, the PSR with time-to-event data is a one-to-one function of the martingale, deviance, and Cox-Snell residuals. The PSR can also be written for current status data. Details are in \cite{shepherd2016psr}, where we also demonstrated the calculation and the utility of the PSR in a variety of settings including normal linear models, least squared regression, exponential regression models, median/quantile regression, semi-parametric transformation models, Poisson and negative binomial regression, Cox regression, and the analysis of current status data.
Although novel, the PSR is related to other methods proposed in the statistical literature. The PSR was part of a test statistic in genetic analysis of ordinal traits \citep{zhang2006detection}. The PSR is closely related to ridits \citep{bross1958use} and can be thought of as a linear transformation of an observed value's adjusted rank (see Section 4). With continuous data, the PSR is simply a re-scaling of the probability integral transformation, which has been previously proposed for assessing goodness of fit \citep{pearson1938, davidjohnson1948} and as a component of a residual \citep{coxsnell1968, davisontsai1992, dunnsmyth1996}. One of the strengths of the PSR is its unification of several of these concepts into a single residual.
\section{Model Diagnostics}
As a residual, the PSR can be useful for model diagnostics. In this section, we introduce a few HIV datasets and demonstrate the residual's use in these settings.
\subsection{Stage of Cervical Lesions: Proportional Odds Models}
Cervical specimens from 145 HIV-infected women in Zambia were examined using cytology and categorized into five ordered stages; 10 specimens were normal, 26 atypical squamous cells of undetermined significance (ASCUS), 35 low grade intraepithelial lesions, 49 high grade intraepithelial lesions, and 30 suspicious for cancer \citep{parham2006}. Other data were collected from the women including age, CD4 count, education, and frequency of condom use (never, rarely, almost always, always). There is interest in modeling the association between these variables and stage of cervical lesions. To this end, we fit proportional odds models with stage of cervical lesions as the outcome and various combinations of the other variables as predictors. The left panel of Figure 1 shows a residual-by-predictor plot with the x-axis showing age and the y-axis showing PSRs from a proportional odds model with age and CD4 included as linear predictors; a lowess curve demonstrating the smoothed relationship between the residuals and age is also included. When age is included in the proportional odds model as a linear variable, there appears to be a quadratic relationship between the PSRs and age: the model tends to over-predict severity of lesions at low and high ages. For example, a 23-year old woman in the dataset with a CD4 count of 309 cells/mm$^3$ had predicted probabilities of 0.10, 0.25, 0.27, 0.27, and 0.11 for cytology being normal, ASCUS, low, high, and cancerous, respectively. This suggests that her observed cytology of ASCUS was less severe than predicted by the model -- resulting in a residual of $0.10-(0.27+0.27+0.11)=-0.55$ (left-most residual in the left panel). If both linear and quadratic terms of age are included in the proportional odds model, the quadratic relationship between the residuals and age is no longer seen (right panel), suggesting a better model fit. The observed ASCUS cytology for the 23-year old woman is now more consistent to what the model predicts (probability of normal, ASCUS, low, high, and cancerous estimated as 0.26, 0.38, 0.21, 0.12, and 0.03, respectively), resulting in a PSR closer to zero: $0.26-(0.21+0.12+0.03)=-0.11$.
\begin{figure}
\begin{center}
\includegraphics[height=5.8in,width=3.2in,angle=-90]{residual-by-predictor-plots.eps}
\end{center}
\caption{Probability-scale residual-by-predictor plots with age included in a proportional odds model as a linear term (left panel) and with a linear and quadratic term (right panel). These plots are reproduced with permission from {\it Biometrika} \citep{li2012new}.}
\label{fig1}
\end{figure}
\subsection{Biomarker Study of Metabolomics: Semiparametric Transformation Models}
HIV-positive individuals who have been on long term antiretroviral therapy (ART) appear to be at an increased risk of cardiometabolic diseases, including diabetes, compared to HIV-negative individuals. Plasma levels of amino acids and other small molecules reflective of impaired energy metabolism, such as acylcarnitines and organic acids, were measured with mass spectrometry to provide a detailed metabolic profile for 70 non-diabetic, HIV-infected persons who were on efavirenz, tenofovir, and emtricitabine with an undetectable viral load for over 2 years \citep{koethe2016}. There is interest in assessing associations between these biomarkers and demographic/clinical variables. In this section, we will focus on modeling a specific biomarker, 2-hydroxybutyric acid, which is thought to be an early indicator of insulin resistance in non-diabetic persons; elevated serum 2-hydroxybutyric acid has been seen to predict worsening glucose tolerance. 2-hydroxybutyric acid is fairly skewed, ranging from 13 to 151 $\mu$M, median 34 $\mu$M in our dataset. Even after a log-transformation, the distribution remains slightly right-skewed with some outlier levels. Predictor variables for our model include age, sex, race, body mass index (BMI), CD4 cell count, smoking status, and ART duration (log transformed).
Because of the skewness of the biomarker outcome, we favor fitting a semiparametric transformation model, specifically $Y=T(\beta Z + \epsilon)$, where $T(\cdot)$ is an unspecified monotonic increasing transformation and $\epsilon$ is a random error with a specified parametric distribution $F_{\epsilon}$ \citep{zeng2007}. The conditional distribution of $Y$ given $Z$ is therefore
\begin{align*}
F_{Y|Z}(y)&=P(T(\beta Z + \epsilon) \leq y) \\
&= P( \epsilon \leq T^{-1}(y) - \beta Z) \\
&=F_{\epsilon}(T^{-1}(y) - \beta Z).
\end{align*}
Hence, the semiparametric transformation model can be written in a manner similar to that of the ordinal cumulative probability model, $g[F_{Y|Z}(y)]=\alpha(y)-\beta Z$, with the link function $g(\cdot)=F^{-1}_{\epsilon}(\cdot)$ and the intercept $\alpha(y)=T^{-1}(y)$. \cite{harrell2015} has proposed using this fact to estimate parameters from the semiparametric transformation model with continuous data by maximizing an approximated multinomial likelihood, and he has implemented this procedure, denoted as orm, in R statistical software as part of his popular \lq rms' package.
In our biomarker analysis, we fit three models of 2-hydroxybutyric acid (denoted as $Y$) on covariates: (1) a multivariable linear regression model with $Y$ untransformed; (2) a multivariable linear model with $Y$ log-transformed; and (3) a semiparametric transformation model fitted using orm with the link function $g(\cdot)$=log($-$log($\cdot))$, which corresponds to assuming $F_{\epsilon}$ follows an extreme value distribution.
Figure 2 shows quantile-quantile (QQ) plots of PSRs from each of these models compared to quantiles from a Uniform($-1,1$) distribution. If the model is correctly specified, the residuals should be approximately uniformly distributed. Clearly PSRs from the normal linear model are far from uniform, and although PSRs from the linear model after log-transforming the biomarker are closer to being uniform, PSRs from the flexible, semiparametric transformation model are more uniform.
In this analysis, we could also have used OMERs to uncover lack of fit for the linear models. However, the OMER is difficult to calculate for the semiparametric transformation model because it requires computation of the conditional expectation, and even if we went through the process of estimating the conditional expectation for all observed covariate combinations, OMERs would still be skewed and not very good for model diagnostics because the semiparametric transformation model makes no assumptions of symmetry of the OMERs, equal variance, etc. In contrast, the PSR is easily and naturally calculated from the fitted semiparametric transformation model and makes no additional assumptions beyond that of the original model.
Hence, the PSR is useful for comparing fit across the three different models because it is on the same scale for each; with the PSR, one is comparing apples with apples, so to speak.
\begin{figure}
\begin{center}
\includegraphics[height=6in,width=2.1in,angle=-90]{quantile-plot.eps}
\end{center}
\caption{QQ plots of PSRs from linear (left), linear after log-transformation (center), and semiparametric transformation models (right) of 2-hydroxybutyric acid compared to a Uniform($-1$,1) distribution.}
\label{fig2}
\end{figure}
Figure 3 shows residual-by-predictor plots for continuous covariates from the semiparametric transformation model using PSRs. There is some evidence of non-linear relationships (top panel). The model was re-fit expanding age, BMI, and log-transformed ART duration using restricted cubic splines with 3 knots. Residual-by-predictor plots from these models are given in the bottom panel of Figure 3. There is no longer evidence of non-linear residual relationships. A likelihood ratio test confirms that the second model with the non-linear terms is a better fit (p=0.010); despite the added model complexity, the AIC for the model with the non-linear terms is lower than that without them (599 vs. 605).
\begin{figure}
\begin{center}
\includegraphics[height=6in,width=3in,angle=-90]{biomarker-resid-plot.eps}
\end{center}
\caption{Residual by predictor plots. The smoothed relationship is shown using lowess curves. The top panels show PSRs versus continuous predictors from an initial model fit without splines. The bottom panels show PSRs versus continuous predictors after expanding age, BMI, and log-transformed ART duration using restricted cubic splines with 3 knots.}
\label{fig3}
\end{figure}
\section{Inference}
Because the PSR is applicable to and has a common scale across a wide variety of outcome types, it can be used to test for conditional associations using residual correlation. We describe these tests for residual correlation using PSRs in Section 4.1 and show their connection with Spearman's rank correlation in Section 4.2.
\subsection{Tests of Residual Correlation}
We initially developed the PSR as a component of an approach for testing the association between two ordinal variables, $X$ and $Y$ while controlling for covariates $Z$ \citep{li2010test}. Our approach was to fit separate multinomial models (e.g., proportional odds models) of $X$ on $Z$ and $Y$ on $Z$, obtain residuals from these models, and then test the association between residuals from these models.
This is analogous to linear regression where the association between $Y$ and $X$ conditional on $Z$ is captured by the correlation between OMERS from linear models of $X$ on $Z$ and of $Y$ on $Z$. We could not find a good residual for ordinal outcomes that resulted in a single value per observation and captured the necessary residual information without imposing assumptions additional to those imposed by the original model -- hence, we created the PSR. In \cite{li2010test}, we proposed three test statistics for testing the conditional association between $X$ and $Y$, one of which was simply the sample correlation between PSRs from the two models. We showed that our test statistics equal zero under the null hypothesis of independence between $Y$ and $X$ conditional on $Z$, and we derived their large sample distributions. Collectively, we referred to our test statistics as COBOT (conditional ordinal by ordinal tests).
We found that these test statistics performed well in simulations, finding a nice balance between power and robustness. For example, if data were simulated from a proportional odds model with a linear relationship between the log-odds of $Y$ and the labels of the ordinal predictor $X$ conditional on $Z$, then our COBOT methods resulted in minimal loss of power compared to the gold standard analysis of simply fitting a proportional odds model with $X$ included as a continuous variable. Under this scenario, the power of COBOT was much higher than models treating ordinal $X$ as a categorical variable that ignored the order information. And when data were generated such that the log-odds of $Y$ and the labels of the ordinal predictor $X$ was non-linear conditional on $Z$, then the power of COBOT was higher than that of approaches that included $X$ in the proportional odds model as a continuous variable or a categorical variable. Details are in \cite{li2010test}.
It would be disingenuous to claim that COBOT always outperforms other approaches. For example, COBOT has poor power to reject the null of conditional independence when the relationship between $X$ and $Y$ conditional on $Z$ is not monotonic. Also, subsequent simulations have suggested that the advantages of COBOT depend on the number of categories of the ordinal variable and the probability distribution of those categories. For example, if an ordinal variable, $X$, has few categories (i.e., 2-3) then there appears to be little advantage to using COBOT over simply treating $X$ as a categorical predictor variable in a proportional odds model, whereas when there are lots of categories (i.e., $>7$), treating the ordinal variables as continuous seems to perform reasonably well, even with non-linear relationships. These caveats noted, we believe that COBOT fills an important gap in the statistical literature regarding methods to test the conditional association between two ordinal variables while accounting for their ordinal nature.
Because of its applicability and common scale with a wide variety of outcomes, the correlation of PSRs can also be used to test for conditional associations in more general settings. For example, using the correlation of PSRs, one could test for association between continuous, count, or ordinal $X$ and continuous, count, or ordinal $Y$ conditional on $Z$.
\subsection{Spearman's Partial and Conditional Rank Correlations}
Consider a model of an ordinal outcome $Y$ with a constant predictor for all subjects (i.e., a model with only an intercept). With such a model, the predicted probability for each category is simply its empirical distribution ($n_j/n$), and the PSR is therefore a linear transformation of the ranks of $Y$. As such, when there are no covariates, the correlation coefficient between PSRs from models for $X$ and $Y$ is equivalent to Spearman's rank correlation. When covariates are present, the PSR can be thought of as a linear transformation of the adjusted ranks of subjects and our test statistic can be thought of as an adjusted rank correlation. This also holds for continuous outcomes and other types of ordered discrete variables (e.g., count data), and suggests an approach for extending Spearman's rank correlation to account for covariates.
More formally, the population parameter of Spearman's rank correlation, denoted as $\gamma_{XY}$, is the scaled difference between the probability of concordance and the probability of discordance between $(X,Y)$ and $(X_0,Y_0)$, where $X_0$ and $Y_0$ have the same marginal distributions as $X$ and $Y$, denoted $F$ and $G$, respectively, but $X_0 \perp Y_0$ and $(X_0,Y_0) \perp (X,Y)$ \citep{kruskal1958}. With continuous $X$ and $Y$ the scaling factor is 3, which ensures that $-1 \leq \gamma_{XY} \leq 1$; for non-continuous $X$ and/or $Y$, the scaling factor is a function of the marginal distributions of the non-continuous variables \citep{neslehova2007}. It can be shown that this difference between concordance and discordance probabilities is equal to the covariance of PSRs (from unconditional models), and the scaling factor is simply the inverse of the square root of the product of the variances of the PSRs \citep{liu2016}. Specifically,
\begin{align*}
\gamma_{XY}&=c\{P[(X-X_0)(Y-Y_0)>0]-P[(X-X_0)(Y-Y_0)<0]\} \\
&=c{\text{Cov}[r(X, F), r(Y, G)]} \\
&={\text{corr}[r(X, F), r(Y, G)]}.
\end{align*}
Note, as highlighted in Section 2, that with continuous variables and correct model specification, the PSR is uniformly distributed from $-1$ to 1 and hence has variance 1/3, leading to a scaling factor of $c=3$; with discrete random variables, the variance of the PSR is $\text{Var}[r(X, F)]=(1-\sum f_x^3)/3, \text{where }f_x=P(X=x)$, which leads to the scaling factor for Spearman's correlation with discrete variables. Therefore, Spearman's rank correlation can be written as the correlation of PSRs.
Similarly, Spearman's rank correlation conditional on $Z$ can be defined as
\begin{align*}
\gamma_{XY|Z}&=c_Z \{P[(X-X_0)(Y-Y_0)>0|Z]-P[(X-X_0)(Y-Y_0)<0|Z]\} \\
&=\text{corr}[r(X, F_{X|Z}), r(Y,G_{Y|Z}) |Z],
\end{align*}
the conditional correlation between PSRs from models conditional on $Z$. This expression is equivalent to Spearman's conditional rank correlation for continuous variables recently proposed by \cite{gijbels2011}. Unlike \cite{gijbels2011}, however, our conditional rank correlation using PSRs can also be easily applied to discrete variables. Such a statistic describes how the rank correlation between $X$ and $Y$ varies as a function of $Z$.
Finally, we define Spearman's partial rank correlation as
\begin{align*}
\gamma_{XY\cdot Z}
&=c^* \{P[(X-X_0)(Y-Y_0)>0|Z]-P[(X-X_0)(Y-Y_0)<0|Z]\} \\
&= \text{corr}[r(X, F_{X|Z}), r(Y,G_{Y|Z})],
\end{align*}
which is a weighted average of $\gamma_{XY |Z}$. Partial correlations describe the association between $X$ and $Y$ after adjusting for $Z$, but not as a function of $Z$. Details are in \cite{liu2016}.
These observations fill another gap in the literature. Pearson's partial correlation is derived as the correlation between OMERs from models of $Y$ on $Z$ and $X$ on $Z$. When $Z$ is a single variable, this is equivalently written as ($\rho_{XY}-\rho_{XZ}\rho_{YZ})/\sqrt{(1-\rho^2_{XZ})(1-\rho_{YZ}^2)}$, where $\rho_{XY}$ denotes Pearson's correlation between $X$ and $Y$ and so forth. The traditional Spearman's partial correlation has been proposed by substituting $\rho_{AB}$ with the corresponding rank correlations, $\gamma_{AB}$. Although not a poor measure of association, this traditional Spearman's partial correlation is ad hoc and does not correspond with a sensible population parameter \citep{kendall1942, gripenberg1992}. In contrast, Spearman's partial rank correlation defined as the correlation of PSRs directly corresponds to the population parameter of Spearman's rank correlation and is elegantly analogous to the definition of Pearson's partial correlation -- instead of the correlation of OMERs it is the correlation of PSRs.
The above arguments are made at the population level. In practice, one must fit models of $Y$ on $Z$ and $X$ on $Z$ to compute the partial Spearman's rank correlation. Given the flexibility of the PSR to a wide variety of models, the choice of models for $Y$ on $Z$ and $X$ on $Z$ are almost unlimited. However, the choice of model is still important to ensure adequate fit for investigating residual correlation. For example, if a model of $Y$ on $Z$ poorly fits the data, then residual correlations from this model may be misleading. To be true to the robust nature of Spearman's rank correlation, yet to be efficient, we favor fitting semiparametric models that only use the order information of the outcomes for models of $Y$ on $Z$ and $X$ on $Z$. Specifically, we favor using the semiparametric transformation model described in Section 3.2 with $Y=T(\beta Z + \epsilon)$, where $T(\cdot)$ is an unspecified monotonic increasing transformation and $\epsilon$ is a random error with a specified parametric distribution $F_{\epsilon}$ \citep{zeng2007}. A similar model is fit for $X$ on $Z$. An advantage of the semiparametric transformation model is that it can be fit to binary, ordered categorical, and continuous variables. In practice, we have used orm, introduced in Section 3.2, to obtain maximum likelihood estimates based on the semiparametric transformation model. Extensive simulations have shown that Spearman's partial correlation using PSRs performs remarkably well with orm, even when models are misspecified (e.g., orm with a cloglog, instead of probit, link is fit to normal data) \citep{liu2016}.
Computation of conditional Spearman's rank correlations can also be computed using PSRs from semiparametric transformation models. If $Z$ is categorical, then this correlation can simply be calculated in each level of $Z$. With continuous $Z$, the conditional rank correlation can be computed either nonparametrically with, for example, kernal smoothers, or modeled with parametric functions \citep{liu2016}.
\subsection{Covariance of PSRs}
In COBOT, we proposed 3 test statistics. One of them, the correlation between PSRs, has been described above as an extension of Spearman's rank correlation to account for covariates. A second COBOT test statistic was to compare the observed values of $(X,Y)$ with the distribution of possible values under the null that $X$ and $Y$ are independent conditional on $Z$ using the difference of concordance-discordance probabilities.
It can be shown that this is equivalent to the expectation of the product of PSRs, $E[r(Y,F_{Y|Z}),r(X,G_{X|Z})]$, which with correctly specified models is simply the covariance of PSRs. Hence, not surprisingly, we could also use the covariance of PSRs as a test statistic. Although some interpretation is lost when using the covariance, it may have advantages over the correlation when modeling the rank association between $X$ and $Y$ as a function of $Z$ because it only requires modeling $E[r(X, F_{X|Z})r(Y, G_{Y|Z})|Z]$. In contrast, models of Spearman's conditional rank correlation with discrete data also require modeling $\text{Var}[r(X, F_{X|Z})]$ and $\text{Var}[r(Y, G_{Y|Z})|Z]$.
\subsection{Examples}
\subsubsection{Stage of Cervical Lesions}
Returning to the Zambia dataset of Section 3.1, there is interest in assessing the association between stage of cervical lesions and condom use, after controlling for other variables. Stage of cervical lesions and condom use are both ordered categorical variables. The unadjusted Spearman's rank correlation is $-0.057$ (p-value=0.50). Using the methods described above, Spearman's partial rank correlation was estimated to be $-0.037$ (95\% CI $-0.196, 0.123$; p-value=0.65), adjusted for age, age$^2$, CD4, education, and marital status.
\subsubsection{Biomarker Study of Metabolomics}
Returning to the biomarker study of Section 3.2, there is interest in assessing the correlation between plasma levels of various metabolites to better understand how these molecules interact among persons infected with HIV who have been on long term antiretroviral therapy. There were 21 primary biomarkers measured on 70 HIV-infected patients. Data were complete except for a single patient who was missing a measurement of OGIS 120. The distributions of the biomarkers are quite heterogenous (data not shown), many are right skewed (e.g., 2-hydroxybutyric acid highlighted in Section 3.2), some have several patients with values below assay detection limits, and pairwise associations are not expected to be linear. The biomarkers' scales vary and there is little interest in obtaining interpretable regression coefficients.
For these reasons, Spearman's rank correlations between biomarkers would be ideal because of their robustness and their single number summary of the strength of association on a common scale between $-1$ and 1. However, other variables could be associated with various biomarkers that we would like to control for, including age, sex, race, BMI, CD4 cell count, smoking status, and ART duration. Hence, we also computed Spearman's partial rank correlation using the correlation of PSRs from models that adjusted for those variables. This was done by fitting a model for each biomarker using a semiparametric transformation model with the covariates listed above (with ART duration log-transformed) and estimating via orm with a logit link. (Results were very similar when using a complementary log-log link, and are not shown.) As illustrated in Section 3.2, some of these models may have benefited from including non-linear relationships between covariates and biomarkers using splines; however, with only 70 patients, over-fitting could be an issue. Also, these estimates are meant to be a first pass that could lead to further investigation, perhaps fine-tuning model fit using diagnostics as done in Section 3.2.
\begin{figure}
\includegraphics[height=5.5in,width=7in,angle=0]{biomarker_heatmap_logit.eps}
\caption{Heatmap showing the pairwise Spearman's rank correlations between 21 biomarkers. The upper-left correlations are unadjusted, the lower-right correlations are partial correlations adjusted for age, sex, race, BMI, CD4, smoking status, and ART duration. Colors denote the correlation with those closer to $-1$ and 1 being more blue and red, respectively. Those correlations that are significantly different from 0 at the $\alpha=0.05$-level are boxed.}
\label{fig4}
\end{figure}
Figure 4 shows Spearman's rank correlation for all pairs of biomarkers; the quantities to the upper-left of the diagonal are unadjusted, the quantities to the lower-right of the diagonal are adjusted using the correlation of PSRs. Red and blue shading indicates positive and negative correlation, respectively, and black boxes are drawn around those correlations that are significantly different from 0 (i.e., p-values $<0.05$). The figure demonstrates that many of the correlations are reduced after adjusting for these additional variables. For example, HOMA 2 insulin sensitivity appears to be correlated (positively or negatively) with many of the other biomarkers, with 15 of the 20 unadjusted pairwise correlations significantly different from 0. However, after controlling for covariates the correlations generally weakened with point estimates closer to 0 and only 5 of 20 adjusted pairwise correlations significantly different from 0. A similar reduction in correlation is observed for the lactate biomarker. Although correlations generally weakened after controlling for other variables, this was not always the case. For example, the rank correlation between hemoglobin A1C and glutamic acid increased from 0.22 to 0.29 after controlling for covariates, and the rank correlation between alpha-ketogluterate and pyruvate increased from 0.22 to 0.31 in the presence of covariates.
\subsubsection{Genome-wide Association Study}
As an additional illustration of our methods, we use the correlation of PSRs to examine the potential association between single nucleotide polymorphism (SNPs) and tenofovir clearance among patients randomized to the tenofovir/emtricitabine arm in AIDS Clinical Trials Group Protocol A5202. Tenofovir causes kidney toxicity in some patients and there is interest in identifying SNPs that may be associated with plasma tenofovir clearance, as these SNPs may in turn be associated with risk of kidney toxicity. An earlier genome-wide association study (GWAS) looked at the association between approximately 890,000 SNPs and tenofovir clearance using standard methods \citep{wanga2015}. In these analyses, the association between SNPs and tenofovir clearance was modeled using linear regression adjusting for sex, age, BMI, other antiretrovirals (efavirenz or ritonavir boosted atazanavir), baseline creatinine clearance, self-reported race (white, black, Hispanic, or other), and the first two principal components for genetic ancestry. SNPs were included in those models assuming additive effects; i.e., for bi-allelic markers with alleles A and a, genotypes A/A, A/a, and a/a were coded as 0, 1, and 2.
Genotype can be thought of as an ordered categorical variable, and there may be benefits to treating it as such in a GWAS. In particular, genetic effects may be additive (as assumed by the analysis model given above), dominant, or recessive, and it would be desirable to have a single analysis that is robust for detecting monotone associations between SNPs and tenofovir clearance without specifically assuming effects are either additive, dominant, or recessive. To that end, we repeated the GWAS using the correlation of PSRs. Specifically, we regressed tenofovir clearance on the same covariates adjusted for in \cite{wanga2015} with the exception that SNPs were not included in the model, and we also fit proportional odds models of SNPs based on these same covariates. PSRs were then derived from all models; for the linear model we used an empirical estimate of the distribution of the residuals to compute PSRs (i.e., PSR$_i = \sum_{j=1}^n I(\hat \epsilon_j < \hat \epsilon_i)/n - \sum_{j=1}^nI(\hat \epsilon_j > \hat \epsilon_i)/n$, where $\hat \epsilon_i$ is the OMER for subject $i$). We then computed the correlation between PSRs from the tenofovir clearance model and PSRs from the SNP models (i.e., Spearman's partial rank correlation), and computed p-values under the null hypothesis of no residual correlation. Finally, for purpose of comparison, we repeated all analyses fitting linear models in a manner identical to that of \cite{wanga2015} except using dominant, recessive, and categorical specifications for the SNPs. Specifically, this amounts to coding (A/A, A/a, a/a) as (0, 1, 1) for dominant, (0, 0, 1) for recessive, and using two (dummy) variables coded as (0, 1, 0) and (0, 0, 1) for categorical which therefore ignores the order information.
\begin{table}[ht]
\renewcommand\thetable{1}
\resizebox{0.95\textwidth}{!}{\begin{minipage}{\textwidth}
\captionsetup{justification=centering}
\caption{TDF clearance: Correlation matrix of p-values in GWAS.}
\centering
\begin{tabular}{*6c}
\hline\hline
& \textbf{corr(PSRs)} & \textbf{Additive} & \textbf{Dominant} & \textbf{Recessive} & \textbf{Categorical} \\
\hline
\textbf{corr(PSRs)} & 1 & & & & \\
\textbf{Additive} & 0.801 & 1 & & & \\
\textbf{Dominant} & 0.709 & 0.734 & 1 & & \\
\textbf{Recessive} & 0.204 & 0.326 & 0.067 & 1 & \\
\textbf{Categorical} & 0.557 & 0.649 & 0.643 & 0.653 & 1 \\
\hline
\end{tabular}
\label{table:M.comb}
\end{minipage} }
\end{table}
Table 1 shows a pairwise Spearman's correlation matrix of the approximately 890,000 p-values using the five different analysis models. P-values between the residual correlation and additive models were strongly correlated ($\gamma=0.801$); results from the residual correlation model were also highly correlated with the dominant model ($\gamma=0.709$), less so with the categorical model ($\gamma=0.557$), and weakly correlated with the recessive model ($\gamma=0.204$). Table 2 shows the top 10 SNPs under each analysis model, and their respective p-values. SNP rs12387850 was ranked first in the correlation of PSRs analysis (p-value $= 2.80 \times 10^{-7})$, additive (p-value $= 1.26 \times 10^{-6})$ and dominant models (p-value $= 5.63 \times 10^{-7})$, but ranked the $75^{th}$ (p-value $= 1.07 \times 10^{-5})$ and $26^{th}$ (p-value $= 3.71 \times 10^{-6})$ in the recessive and categorical models respectively. Among the SNPs significantly associated with tenofovir clearance, SNP rs12082252 ranked $1^{st}$ (p-value $= 2.28 \times 10^{-10})$ and $2^{nd}$ (p-value $= 1.69 \times 10^{-9})$ in the recessive and categorical models respectively, but was ranked much lower in the other model specifications ($346688^{th}$ using the correlation of PSRs, $1924^{th}$ in additive, $90918^{th}$ in dominant).
\begin{table}[ht]
\begin{footnotesize}
\renewcommand\thetable{2}
\captionsetup{justification=centering}
\caption{TDF clearance: SNPs with the smallest p-values in combined group analysis}
\resizebox{0.70\textwidth}{!}{\begin{minipage}{\textwidth}
\centering
\begin{tabular}{ccc|ccc|ccc|ccc|ccc}
\hline\hline
\multicolumn{3}{c|}{\textbf{corr(PSRs)}} & \multicolumn{3}{c|}{\textbf{Additive}} & \multicolumn{3}{c|}{\textbf{Dominant}} & \multicolumn{3}{c|}{\textbf{Recessive}} & \multicolumn{3}{c}{\textbf{Categorical}} \\ [0.5ex]
CHR & SNP & P & CHR & SNP & P & CHR & SNP & P & CHR & SNP & P & CHR & SNP & P \\ [0.5ex]
\hline
2 & rs887829 & 7.08e-10 & 2 & rs887829 & 2.24e-11 & 2 & rs3755319 & 1.03e-07 & 2 & rs887829 & 4.49e-12 & 2 & rs887829 & 1.74e-12 \\
2 & rs4148325 & 2.54e-09 & 2 & rs4148325 & 7.30e-11 & 19 & rs4239638 & 3.74e-07 & 2 & rs4148325 & 8.81e-12 & 2 & rs4148325 & 4.60e-12 \\
2 & rs6742078 & 4.87e-09 & 2 & rs6742078 & 1.32e-10 & 19 & rs7257832 & 4.52e-07 & 2 & rs6742078 & 5.13e-11 & 2 & rs6742078 & 1.69e-11 \\
2 & rs4148324 & 1.04e-08 & 2 & rs4148324 & 3.11e-10 & 2 & rs4663333 & 4.68e-07 & 2 & rs929596 & 1.02e-10 & 2 & rs929596 & 2.48e-11 \\
2 & rs10179091 & 1.63e-08 & 2 & rs929596 & 3.39e-10 & 2 & rs4663967 & 5.17e-07 & 2 & rs4148324 & 1.05e-10 & 2 & rs4148324 & 4.39e-11 \\
2 & rs3771341 & 3.07e-08 & 2 & rs3771341 & 3.89e-10 & 2 & rs4399719 & 8.00e-07 & 2 & rs3771341 & 3.36e-10 & 2 & rs3771341 & 6.07e-11 \\
2 & rs929596 & 3.63e-08 & 2 & rs10179091 & 3.15e-09 & 2 & rs4124874 & 1.03e-06 & 2 & rs17862875 & 6.46e-09 & 2 & rs17862875 & 2.92e-09 \\
2 & rs3755319 & 4.34e-08 & 2 & rs17862875 & 1.56e-08 & 2 & rs4663965 & 1.48e-06 & 2 & rs10179091 & 2.48e-08 & 2 & rs10179091 & 1.01e-08 \\
2 & rs4148326 & 6.53e-08 & 2 & rs2221198 & 2.04e-08 & 2 & rs6431628 & 2.17e-06 & 2 & rs4148326 & 6.00e-08 & 2 & rs4148326 & 5.80e-08 \\
2 & rs2221198 & 1.34e-07 & 2 & rs4663969 & 2.24e-08 & 11 & rs1560994 & 2.50e-06 & 2 & rs2221198 & 1.86e-07 & 2 & rs2221198 & 6.47e-08 \\
2 & rs4663969 & 1.93e-07 & 2 & rs3755319 & 2.38e-08 & 2 & rs17862866 & 2.77e-06 & 2 & rs4663969 & 2.68e-07 & 2 & rs3755319 & 7.48e-08 \\
2 & rs4663967 & 2.43e-07 & 2 & rs4148326 & 2.73e-08 & 2 & rs3806597 & 2.96e-06 & 2 & rs16862202 & 2.69e-07 & 2 & rs7604115 & 7.53e-08 \\
2 & rs4663333 & 2.81e-07 & 2 & rs7604115 & 2.94e-08 & 2 & rs2008595 & 3.90e-06 & 2 & rs7556676 & 4.01e-07 & 2 & rs4663969 & 7.94e-08 \\
2 & rs7556676 & 2.84e-07 & 2 & rs7556676 & 3.05e-08 & 2 & rs4294999 & 3.91e-06 & 2 & rs7604115 & 4.46e-07 & 2 & rs7556676 & 1.15e-07 \\
2 & rs871514 & 4.07e-07 & 2 & rs871514 & 4.00e-08 & 10 & rs7915217 & 4.02e-06 & 19 & rs8111761 & 2.67e-06 & 2 & rs4663967 & 2.53e-07 \\
2 & rs4294999 & 4.80e-07 & 2 & rs4663967 & 5.55e-08 & 2 & rs871514 & 4.12e-06 & 7 & rs1395381 & 2.80e-06 & 2 & rs4663333 & 2.58e-07 \\
2 & rs4663965 & 5.48e-07 & 2 & rs4663333 & 5.97e-08 & 2 & rs4663963 & 4.63e-06 & 3 & rs9310867 & 4.57e-06 & 2 & rs871514 & 2.87e-07 \\
2 & rs4399719 & 5.65e-07 & 2 & rs4294999 & 6.26e-08 & 19 & rs8108083 & 4.68e-06 & 12 & rs7303705 & 4.87e-06 & 14 & rs2353726 & 3.55e-07 \\
2 & rs3806597 & 6.46e-07 & 2 & rs4663965 & 1.16e-07 & 6 & rs199634 & 5.13e-06 & 4 & rs3866838 & 5.14e-06 & 2 & rs4294999 & 4.28e-07 \\
2 & rs7604115 & 6.46e-07 & 2 & rs4663963 & 1.33e-07 & 19 & rs2377572 & 5.64e-06 & 9 & rs7847905 & 5.53e-06 & 2 & rs4663965 & 5.99e-07 \\
\hline
\end{tabular}
\label{table:combTable}
\end{minipage} }
\end{footnotesize}
\end{table}
These results are fairly consistent with extensive simulations in which we generated data under different scenarios (additive, dominant, recessive, and non-linear; and with different minor allele frequencies) and investigated the power of the correlation of PSRs to detect associations under the various scenarios \citep{wanga2014}. The correlation of PSRs had greater power to detect associations than the recessive and dominant models (except, of course, when the data were generated under these models). The correlation of PSRs did well when the true association was additive, resulting in only a slight loss of power when compared with models that were correctly specified as additive. However, the correlation of PSRs struggled to detect associations generated under the recessive model; categorical models were better at detecting these recessive associations and even additive models performed as well as the correlation of PSRs in the recessive case. Hence, although it is certainly reasonable to analyze GWAS data using the correlation of PSRs, the benefits of this approach are not as apparent in this setting as in some others. This is somewhat expected: with only three categories, the loss of power by treating ordinal SNP data as categorical is likely minimal.
\section{Discussion}
We have described a new residual, the probability-scale residual, and demonstrated its use for diagnostics and inference in several settings using actual HIV data. We believe the PSR should be the go-to residual for the analysis of ordered categorical data and semiparametric transformation models fit to continuous data. The PSR is also useful in many other settings that are illustrated elsewhere (see \cite{shepherd2016psr}), including time-to-event outcomes. In some of these settings, existing residuals are available that offer similar information to the PSR. However, as seen in Section 3.2, there are advantages to having a residual that is defined across multiple classes of models, as residuals on the same scale become easier to directly compare fit across model classes. Because it is bounded between $-1$ and 1, the PSR is poor at detecting outliers. (It should be noted that in some analyses [e.g., semiparametric transformation models and quantile regression] the analysis model down weights the influence of outliers, so residual plots that are dominated by \lq outliers' are actually inconsistent with the model that was fit and may not be desirable.) If outlier detection is desired, a simple transformation of the PSRs (e.g., $\Phi^{-1}\{(PSR+1)/2\}$ with $\Phi^{-1}(\cdot)$ denoting the inverse cdf of the standard normal distribution) allows their detection. There are certainly other diagnostics for which residuals more specialized than the PSR might be more appropriate.
The extension of Spearman's rank correlation to adjust for covariates using the correlation of PSRs is an important development. In many settings, researchers are not interested in regression coefficients, but would like a simple, single number summary of the strength of relationship between variables, after controlling for other variables, that is given in a constant scale regardless of the type of outcome. Our definition of Spearman's partial rank correlation provides such a summary measure, and it estimates a sensible population parameter.
The examples described in this chapter have focused on univariate outcomes. Of particular interest would be whether some of these approaches could be of value with multivariate data, for example in the analysis of repeated measures data. We are also interested in examining the utility of Spearman's partial rank correlation using PSRs where at least one of the outcomes is a time-to-event. These represent areas of future research.
\section{Acknowledgements}
We would like to thank Vikrant Sahasrabuddhe, John Koethe, and the AIDS Clinical Trials Group for giving us permission to use their data. This work was funded in part by the National Institutes of Health, grant numbers R01 AI93234 and P30 AI110527.
\bibliographystyle{apa}
| {'timestamp': '2018-03-02T02:06:20', 'yymm': '1803', 'arxiv_id': '1803.00200', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00200'} | arxiv |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.